@llm4ts/flow 2.31.1 → 2.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Approval.d.ts +1 -1
- package/dist/Approval.d.ts.map +1 -1
- package/dist/Artifacts.d.ts +2 -2
- package/dist/Artifacts.d.ts.map +1 -1
- package/dist/BenchReport.d.ts +2 -2
- package/dist/BenchReport.d.ts.map +1 -1
- package/dist/Chat.d.ts +5 -2
- package/dist/Chat.d.ts.map +1 -1
- package/dist/Chat.js +7 -4
- package/dist/Chat.js.map +1 -1
- package/dist/CostLedger.d.ts +2 -2
- package/dist/CostLedger.d.ts.map +1 -1
- package/dist/Equiv.d.ts +3 -3
- package/dist/Equiv.d.ts.map +1 -1
- package/dist/Flow.d.ts +16 -1
- package/dist/Flow.d.ts.map +1 -1
- package/dist/Flow.js +29 -3
- package/dist/Flow.js.map +1 -1
- package/dist/FlowError.d.ts +15 -2
- package/dist/FlowError.d.ts.map +1 -1
- package/dist/FlowError.js +15 -0
- package/dist/FlowError.js.map +1 -1
- package/dist/FlowEvents.d.ts +12 -1
- package/dist/FlowEvents.d.ts.map +1 -1
- package/dist/FlowEvents.js +11 -0
- package/dist/FlowEvents.js.map +1 -1
- package/dist/Gates.d.ts +1 -1
- package/dist/Gates.d.ts.map +1 -1
- package/dist/Judgment.d.ts +2 -2
- package/dist/Judgment.d.ts.map +1 -1
- package/dist/Landing.d.ts +1 -1
- package/dist/Landing.d.ts.map +1 -1
- package/dist/NodePreflight.d.ts +1 -1
- package/dist/NodePreflight.d.ts.map +1 -1
- package/dist/Pack.d.ts +9 -1
- package/dist/Pack.d.ts.map +1 -1
- package/dist/Pack.js +26 -2
- package/dist/Pack.js.map +1 -1
- package/dist/Persistence.d.ts +2 -2
- package/dist/Persistence.d.ts.map +1 -1
- package/dist/PlanExecution.d.ts +1 -1
- package/dist/PlanExecution.d.ts.map +1 -1
- package/dist/ProgramJudge.d.ts +1 -1
- package/dist/ProgramJudge.d.ts.map +1 -1
- package/dist/ProgramJudge.js +6 -3
- package/dist/ProgramJudge.js.map +1 -1
- package/dist/Replay.d.ts +2 -2
- package/dist/Replay.d.ts.map +1 -1
- package/dist/Retro.d.ts +51 -4
- package/dist/Retro.d.ts.map +1 -1
- package/dist/Retro.js +196 -11
- package/dist/Retro.js.map +1 -1
- package/dist/Review.d.ts +38 -6
- package/dist/Review.d.ts.map +1 -1
- package/dist/Review.js +147 -8
- package/dist/Review.js.map +1 -1
- package/dist/ReviewCache.d.ts +1 -1
- package/dist/ReviewCache.d.ts.map +1 -1
- package/dist/Reviewer.d.ts +2 -0
- package/dist/Reviewer.d.ts.map +1 -1
- package/dist/Reviewer.js +3 -1
- package/dist/Reviewer.js.map +1 -1
- package/dist/Roster.d.ts +1 -1
- package/dist/Roster.d.ts.map +1 -1
- package/dist/RosterSeats.d.ts +1 -1
- package/dist/RosterSeats.d.ts.map +1 -1
- package/dist/Stall.d.ts +29 -0
- package/dist/Stall.d.ts.map +1 -0
- package/dist/Stall.js +49 -0
- package/dist/Stall.js.map +1 -0
- package/dist/Stories.d.ts +8 -1
- package/dist/Stories.d.ts.map +1 -1
- package/dist/Stories.js +7 -1
- package/dist/Stories.js.map +1 -1
- package/package.json +3 -2
- package/src/Chat.ts +15 -7
- package/src/Flow.ts +48 -3
- package/src/FlowError.ts +16 -0
- package/src/FlowEvents.ts +14 -0
- package/src/Pack.ts +34 -1
- package/src/ProgramJudge.ts +3 -0
- package/src/Retro.ts +229 -4
- package/src/Review.ts +202 -8
- package/src/Reviewer.ts +3 -1
- package/src/Stall.ts +85 -0
- package/src/Stories.ts +14 -0
package/dist/ProgramJudge.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { reviewRulesPreamble } from "./Review.js";
|
|
1
2
|
import * as Effect from "effect/Effect";
|
|
2
3
|
import { Sample } from "@llm4ts/core/eval/Eval";
|
|
3
4
|
import { makeEvaluator } from "@llm4ts/core/eval/Evaluator";
|
|
@@ -70,9 +71,11 @@ export const withJudgment = (generative, dimensions, options, events) => {
|
|
|
70
71
|
}));
|
|
71
72
|
};
|
|
72
73
|
const join = (root, path) => `${root.replace(/[\\/]+$/, "")}/${path.replace(/^[\\/]+/, "")}`;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
/** The shared review rules (ADR 0027 decision 9) precede every rubric the judge scores with. */
|
|
75
|
+
const rubricText = (dimensions) => `${reviewRulesPreamble}\n\n` +
|
|
76
|
+
dimensions
|
|
77
|
+
.map((dimension) => `${dimension.name} (0..${dimension.maxScore}): ${dimension.rubric}`)
|
|
78
|
+
.join("\n");
|
|
76
79
|
/**
|
|
77
80
|
* Sub-bar dimensions as Critical review issues, titled with the program they
|
|
78
81
|
* belong to — the same shape the extract gate produces, so fix loops and
|
package/dist/ProgramJudge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgramJudge.js","sourceRoot":"","sources":["../src/ProgramJudge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,MAAM,EAAmC,MAAM,wBAAwB,CAAA;AAChF,OAAO,EAAE,aAAa,EAAkB,MAAM,6BAA6B,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAE3D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAA;AAC7D,OAAO,EACL,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,uBAAuB,EAExB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,EAAqB,MAAM,eAAe,CAAA;AAItE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAc/C;;;;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IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;IAClE,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QAC1E,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CACzE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CACtC,CAAA;QACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;IACxE,CAAC;IAED,OAAO,kBAAkB,CAAC,CAAC,GAAG,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;AACtE,CAAC,CAAC,CAAA"}
|
package/dist/Replay.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ export declare class ReplayFailure extends ReplayFailure_base {
|
|
|
22
22
|
export declare const ReplayTurn: Schema.Union<readonly [typeof ReplaySuccess, typeof ReplayFailure]>;
|
|
23
23
|
export type ReplayTurn = typeof ReplayTurn.Type;
|
|
24
24
|
export declare const segmentReplayTurns: (lines: ReadonlyArray<TraceLine>) => ReadonlyArray<ReplayTurn>;
|
|
25
|
-
export declare const readTrace: (files: PlainFileStoreShape, path: string) => Effect.Effect<readonly TraceLine[], import("./FlowError.ts").PersistenceError | PlanParseError | UnsupportedSchemaVersion | import("./FlowError.ts").WorkspacePathError | import("./FlowError.ts").WorkspaceLimitError | import("./FlowError.ts").WorkspaceIoError | import("./FlowError.ts").FlowAborted | import("./FlowError.ts").ProcessError | import("./FlowError.ts").FlowLlmError | import("./FlowError.ts").FlowCapabilityDenied | import("./FlowError.ts").ColumnNotFound | import("./FlowError.ts").BudgetExceeded | import("./FlowError.ts").StoryPlanInvalid | import("./FlowError.ts").PerimeterViolation | import("./FlowError.ts").MissingDependency | import("./FlowError.ts").MergeConflict | import("./FlowError.ts").EpicCheckoutDirty | import("./FlowError.ts").RosterInvalid | import("./FlowError.ts").EpicIncomplete | import("./FlowError.ts").LandingFailed | import("./FlowError.ts").RefineRefused | import("./FlowError.ts").RosterExhausted | import("./FlowError.ts").StoryFailed | import("./FlowError.ts").DecisionsInvalid | import("./FlowError.ts").OpenPointsPending | import("./FlowError.ts").ExtractPackMissing | import("./FlowError.ts").EpicBriefInvalid | import("./FlowError.ts").EpicBriefNotApproved | import("./FlowError.ts").ContractConflict, never>;
|
|
25
|
+
export declare const readTrace: (files: PlainFileStoreShape, path: string) => Effect.Effect<readonly TraceLine[], import("./FlowError.ts").PersistenceError | PlanParseError | UnsupportedSchemaVersion | import("./FlowError.ts").WorkspacePathError | import("./FlowError.ts").WorkspaceLimitError | import("./FlowError.ts").WorkspaceIoError | import("./FlowError.ts").FlowAborted | import("./FlowError.ts").ProcessError | import("./FlowError.ts").FlowLlmError | import("./FlowError.ts").FlowCapabilityDenied | import("./FlowError.ts").ColumnNotFound | import("./FlowError.ts").BudgetExceeded | import("./FlowError.ts").StoryPlanInvalid | import("./FlowError.ts").PerimeterViolation | import("./FlowError.ts").MissingDependency | import("./FlowError.ts").MergeConflict | import("./FlowError.ts").EpicCheckoutDirty | import("./FlowError.ts").RosterInvalid | import("./FlowError.ts").EpicIncomplete | import("./FlowError.ts").LandingFailed | import("./FlowError.ts").RefineRefused | import("./FlowError.ts").RosterExhausted | import("./FlowError.ts").Stalled | import("./FlowError.ts").StoryFailed | import("./FlowError.ts").DecisionsInvalid | import("./FlowError.ts").OpenPointsPending | import("./FlowError.ts").ExtractPackMissing | import("./FlowError.ts").EpicBriefInvalid | import("./FlowError.ts").EpicBriefNotApproved | import("./FlowError.ts").ContractConflict, never>;
|
|
26
26
|
export declare const makeReplayConnector: (turns: readonly (ReplaySuccess | ReplayFailure)[]) => Effect.Effect<LlmServiceShape, never, never>;
|
|
27
|
-
export declare const replayFromTrace: (files: PlainFileStoreShape, path: string) => Effect.Effect<LlmServiceShape, import("./FlowError.ts").PersistenceError | PlanParseError | UnsupportedSchemaVersion | import("./FlowError.ts").WorkspacePathError | import("./FlowError.ts").WorkspaceLimitError | import("./FlowError.ts").WorkspaceIoError | import("./FlowError.ts").FlowAborted | import("./FlowError.ts").ProcessError | import("./FlowError.ts").FlowLlmError | import("./FlowError.ts").FlowCapabilityDenied | import("./FlowError.ts").ColumnNotFound | import("./FlowError.ts").BudgetExceeded | import("./FlowError.ts").StoryPlanInvalid | import("./FlowError.ts").PerimeterViolation | import("./FlowError.ts").MissingDependency | import("./FlowError.ts").MergeConflict | import("./FlowError.ts").EpicCheckoutDirty | import("./FlowError.ts").RosterInvalid | import("./FlowError.ts").EpicIncomplete | import("./FlowError.ts").LandingFailed | import("./FlowError.ts").RefineRefused | import("./FlowError.ts").RosterExhausted | import("./FlowError.ts").StoryFailed | import("./FlowError.ts").DecisionsInvalid | import("./FlowError.ts").OpenPointsPending | import("./FlowError.ts").ExtractPackMissing | import("./FlowError.ts").EpicBriefInvalid | import("./FlowError.ts").EpicBriefNotApproved | import("./FlowError.ts").ContractConflict, never>;
|
|
27
|
+
export declare const replayFromTrace: (files: PlainFileStoreShape, path: string) => Effect.Effect<LlmServiceShape, import("./FlowError.ts").PersistenceError | PlanParseError | UnsupportedSchemaVersion | import("./FlowError.ts").WorkspacePathError | import("./FlowError.ts").WorkspaceLimitError | import("./FlowError.ts").WorkspaceIoError | import("./FlowError.ts").FlowAborted | import("./FlowError.ts").ProcessError | import("./FlowError.ts").FlowLlmError | import("./FlowError.ts").FlowCapabilityDenied | import("./FlowError.ts").ColumnNotFound | import("./FlowError.ts").BudgetExceeded | import("./FlowError.ts").StoryPlanInvalid | import("./FlowError.ts").PerimeterViolation | import("./FlowError.ts").MissingDependency | import("./FlowError.ts").MergeConflict | import("./FlowError.ts").EpicCheckoutDirty | import("./FlowError.ts").RosterInvalid | import("./FlowError.ts").EpicIncomplete | import("./FlowError.ts").LandingFailed | import("./FlowError.ts").RefineRefused | import("./FlowError.ts").RosterExhausted | import("./FlowError.ts").Stalled | import("./FlowError.ts").StoryFailed | import("./FlowError.ts").DecisionsInvalid | import("./FlowError.ts").OpenPointsPending | import("./FlowError.ts").ExtractPackMissing | import("./FlowError.ts").EpicBriefInvalid | import("./FlowError.ts").EpicBriefNotApproved | import("./FlowError.ts").ContractConflict, never>;
|
|
28
28
|
export {};
|
|
29
29
|
//# sourceMappingURL=Replay.d.ts.map
|
package/dist/Replay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Replay.d.ts","sourceRoot":"","sources":["../src/Replay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAIvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAY,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAkB,MAAM,gBAAgB,CAAA;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAE3D,eAAO,MAAM,kBAAkB,IAAI,CAAA;;;;;;AAEnC,qBAAa,aAAc,SAAQ,kBAIjC;CAAG;;;;;AAEL,qBAAa,aAAc,SAAQ,kBAGjC;CAAG;AAEL,eAAO,MAAM,UAAU,qEAA+C,CAAA;AACtE,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AA8C/C,eAAO,MAAM,kBAAkB,GAAI,OAAO,aAAa,CAAC,SAAS,CAAC,KAAG,aAAa,CAAC,UAAU,CAgE5F,CAAA;AAID,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"Replay.d.ts","sourceRoot":"","sources":["../src/Replay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAIvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAY,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAkB,MAAM,gBAAgB,CAAA;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAE3D,eAAO,MAAM,kBAAkB,IAAI,CAAA;;;;;;AAEnC,qBAAa,aAAc,SAAQ,kBAIjC;CAAG;;;;;AAEL,qBAAa,aAAc,SAAQ,kBAGjC;CAAG;AAEL,eAAO,MAAM,UAAU,qEAA+C,CAAA;AACtE,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AA8C/C,eAAO,MAAM,kBAAkB,GAAI,OAAO,aAAa,CAAC,SAAS,CAAC,KAAG,aAAa,CAAC,UAAU,CAgE5F,CAAA;AAID,eAAO,MAAM,SAAS,2zCAqCpB,CAAA;AAEF,eAAO,MAAM,mBAAmB,qGAkF9B,CAAA;AAEF,eAAO,MAAM,eAAe,szCAM1B,CAAA"}
|
package/dist/Retro.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as Schema from "effect/Schema";
|
|
|
3
3
|
import type { JsonSchema } from "@llm4ts/core/Models";
|
|
4
4
|
import { Board } from "./BoardSync.ts";
|
|
5
5
|
import { PersistenceError, type StoryPlanInvalid } from "./FlowError.ts";
|
|
6
|
-
import { type FlowEventsShape } from "./FlowEvents.ts";
|
|
6
|
+
import { FlowEvent, type FlowEventsShape } from "./FlowEvents.ts";
|
|
7
7
|
import type { TraceLine } from "./FlowRecorder.ts";
|
|
8
8
|
import { Plan } from "./Plan.ts";
|
|
9
9
|
import { type PlainFileStoreShape } from "./Persistence.ts";
|
|
@@ -49,7 +49,7 @@ export interface RetroInputs {
|
|
|
49
49
|
}
|
|
50
50
|
export declare const defaultRetroChars = 60000;
|
|
51
51
|
/** Reads the per-story files the executor keeps under `<state>/stories/`. */
|
|
52
|
-
export declare const loadStoryFiles: (files: PlainFileStoreShape, stateDir: string, story: Story) => Effect.Effect<StoryFiles, PersistenceError | import("./FlowError.ts").PlanParseError | import("./FlowError.ts").UnsupportedSchemaVersion | import("./FlowError.ts").WorkspacePathError | import("./FlowError.ts").WorkspaceLimitError | import("./FlowError.ts").WorkspaceIoError | import("./FlowError.ts").FlowAborted | import("./FlowError.ts").ProcessError | import("./FlowError.ts").FlowLlmError | import("./FlowError.ts").FlowCapabilityDenied | import("./FlowError.ts").ColumnNotFound | import("./FlowError.ts").BudgetExceeded | StoryPlanInvalid | import("./FlowError.ts").PerimeterViolation | import("./FlowError.ts").MissingDependency | import("./FlowError.ts").MergeConflict | import("./FlowError.ts").EpicCheckoutDirty | import("./FlowError.ts").RosterInvalid | import("./FlowError.ts").EpicIncomplete | import("./FlowError.ts").LandingFailed | import("./FlowError.ts").RefineRefused | import("./FlowError.ts").RosterExhausted | import("./FlowError.ts").StoryFailed | import("./FlowError.ts").DecisionsInvalid | import("./FlowError.ts").OpenPointsPending | import("./FlowError.ts").ExtractPackMissing | import("./FlowError.ts").EpicBriefInvalid | import("./FlowError.ts").EpicBriefNotApproved | import("./FlowError.ts").ContractConflict, never>;
|
|
52
|
+
export declare const loadStoryFiles: (files: PlainFileStoreShape, stateDir: string, story: Story) => Effect.Effect<StoryFiles, PersistenceError | import("./FlowError.ts").PlanParseError | import("./FlowError.ts").UnsupportedSchemaVersion | import("./FlowError.ts").WorkspacePathError | import("./FlowError.ts").WorkspaceLimitError | import("./FlowError.ts").WorkspaceIoError | import("./FlowError.ts").FlowAborted | import("./FlowError.ts").ProcessError | import("./FlowError.ts").FlowLlmError | import("./FlowError.ts").FlowCapabilityDenied | import("./FlowError.ts").ColumnNotFound | import("./FlowError.ts").BudgetExceeded | StoryPlanInvalid | import("./FlowError.ts").PerimeterViolation | import("./FlowError.ts").MissingDependency | import("./FlowError.ts").MergeConflict | import("./FlowError.ts").EpicCheckoutDirty | import("./FlowError.ts").RosterInvalid | import("./FlowError.ts").EpicIncomplete | import("./FlowError.ts").LandingFailed | import("./FlowError.ts").RefineRefused | import("./FlowError.ts").RosterExhausted | import("./FlowError.ts").Stalled | import("./FlowError.ts").StoryFailed | import("./FlowError.ts").DecisionsInvalid | import("./FlowError.ts").OpenPointsPending | import("./FlowError.ts").ExtractPackMissing | import("./FlowError.ts").EpicBriefInvalid | import("./FlowError.ts").EpicBriefNotApproved | import("./FlowError.ts").ContractConflict, never>;
|
|
53
53
|
/** The epic's report and board, when the run wrote them. */
|
|
54
54
|
export declare const loadEpicFiles: (files: PlainFileStoreShape, stateDir: string) => Effect.Effect<{
|
|
55
55
|
readonly report: EpicReport | undefined;
|
|
@@ -98,6 +98,26 @@ export declare const RetroStory: Schema.Struct<{
|
|
|
98
98
|
readonly feedback: Schema.optionalKey<Schema.String>;
|
|
99
99
|
}>;
|
|
100
100
|
export type RetroStory = typeof RetroStory.Type;
|
|
101
|
+
export declare const RuleEditOp: Schema.Literals<readonly ["append-rule", "replace-section"]>;
|
|
102
|
+
export type RuleEditOp = typeof RuleEditOp.Type;
|
|
103
|
+
/**
|
|
104
|
+
* An edit to the loop rather than to a story (ADR 0027 decision 12): a line
|
|
105
|
+
* appended to a rules file, or a section replaced. Structured, never a
|
|
106
|
+
* diff; the report renders it as one for the human.
|
|
107
|
+
*/
|
|
108
|
+
export declare const RuleEdit: Schema.Struct<{
|
|
109
|
+
/** Repo-relative: `.llm4ts/review-rules.md`, a pack's `reviewers/<name>.md`, `pack.md`, `lessons.md`, or a `patterns/pitfalls-*.md` card. */
|
|
110
|
+
readonly target: Schema.String;
|
|
111
|
+
readonly op: Schema.Literals<readonly ["append-rule", "replace-section"]>;
|
|
112
|
+
/** `append-rule`: the rule, one line, without a leading dash. */
|
|
113
|
+
readonly line: Schema.optionalKey<Schema.String>;
|
|
114
|
+
/** `replace-section`: the `## heading` (without the hashes) and its new body. */
|
|
115
|
+
readonly heading: Schema.optionalKey<Schema.String>;
|
|
116
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
117
|
+
/** The signature in the digest this answers. */
|
|
118
|
+
readonly why: Schema.String;
|
|
119
|
+
}>;
|
|
120
|
+
export type RuleEdit = typeof RuleEdit.Type;
|
|
101
121
|
declare const RetroProposal_base: Schema.Class<RetroProposal, Schema.Struct<{
|
|
102
122
|
readonly summary: Schema.String;
|
|
103
123
|
readonly stories: Schema.$Array<Schema.Struct<{
|
|
@@ -122,6 +142,19 @@ declare const RetroProposal_base: Schema.Class<RetroProposal, Schema.Struct<{
|
|
|
122
142
|
/** `refine`: the feedback a new round should take. */
|
|
123
143
|
readonly feedback: Schema.optionalKey<Schema.String>;
|
|
124
144
|
}>>;
|
|
145
|
+
/** Edits to the rules the next run reviews with; absent in proposals written before ADR 0027. */
|
|
146
|
+
readonly rules: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
147
|
+
/** Repo-relative: `.llm4ts/review-rules.md`, a pack's `reviewers/<name>.md`, `pack.md`, `lessons.md`, or a `patterns/pitfalls-*.md` card. */
|
|
148
|
+
readonly target: Schema.String;
|
|
149
|
+
readonly op: Schema.Literals<readonly ["append-rule", "replace-section"]>;
|
|
150
|
+
/** `append-rule`: the rule, one line, without a leading dash. */
|
|
151
|
+
readonly line: Schema.optionalKey<Schema.String>;
|
|
152
|
+
/** `replace-section`: the `## heading` (without the hashes) and its new body. */
|
|
153
|
+
readonly heading: Schema.optionalKey<Schema.String>;
|
|
154
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
155
|
+
/** The signature in the digest this answers. */
|
|
156
|
+
readonly why: Schema.String;
|
|
157
|
+
}>>>;
|
|
125
158
|
readonly runAdvice: Schema.$Array<Schema.Struct<{
|
|
126
159
|
readonly finding: Schema.String;
|
|
127
160
|
readonly evidence: Schema.String;
|
|
@@ -146,6 +179,14 @@ export interface ValidatedRetro {
|
|
|
146
179
|
export declare const storyWithChanges: (story: Story, changes: RetroStoryChanges) => Story | undefined;
|
|
147
180
|
/** Code checks the seat's answer before anything is written; bad items are dropped, not fatal. */
|
|
148
181
|
export declare const validateRetroProposal: (proposal: RetroProposal, plan: StoryPlan, storiesWithPlan: ReadonlySet<string>) => ValidatedRetro;
|
|
182
|
+
/** The files a retro may edit: the repository's review rules, a pack's lenses and rules, a pitfall card. */
|
|
183
|
+
export declare const allowedRuleTarget: (target: string) => boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Patterns across stories the digest flags for a rule (ADR 0027 decision 12):
|
|
186
|
+
* gaming (oracle-guard findings), the same reviewer finding in two or more
|
|
187
|
+
* stories, fabricated status in two or more stories.
|
|
188
|
+
*/
|
|
189
|
+
export declare const signaturesOf: (inputs: RetroInputs, events: ReadonlyArray<FlowEvent>) => ReadonlyArray<string>;
|
|
149
190
|
export declare const AppliedMarkerPrefix = "- [x] Applied";
|
|
150
191
|
export interface RetroApproval {
|
|
151
192
|
readonly approved: boolean;
|
|
@@ -167,7 +208,7 @@ export declare const renderLibraryAdvice: (runId: string, epicId: string, propos
|
|
|
167
208
|
export declare const writeRetro: (files: PlainFileStoreShape, stateDir: string, inputs: RetroReportInputs & {
|
|
168
209
|
readonly digest: string;
|
|
169
210
|
readonly at: number;
|
|
170
|
-
}) => Effect.Effect<RetroPaths, PersistenceError | import("./FlowError.ts").PlanParseError | import("./FlowError.ts").UnsupportedSchemaVersion | import("./FlowError.ts").WorkspacePathError | import("./FlowError.ts").WorkspaceLimitError | import("./FlowError.ts").WorkspaceIoError | import("./FlowError.ts").FlowAborted | import("./FlowError.ts").ProcessError | import("./FlowError.ts").FlowLlmError | import("./FlowError.ts").FlowCapabilityDenied | import("./FlowError.ts").ColumnNotFound | import("./FlowError.ts").BudgetExceeded | StoryPlanInvalid | import("./FlowError.ts").PerimeterViolation | import("./FlowError.ts").MissingDependency | import("./FlowError.ts").MergeConflict | import("./FlowError.ts").EpicCheckoutDirty | import("./FlowError.ts").RosterInvalid | import("./FlowError.ts").EpicIncomplete | import("./FlowError.ts").LandingFailed | import("./FlowError.ts").RefineRefused | import("./FlowError.ts").RosterExhausted | import("./FlowError.ts").StoryFailed | import("./FlowError.ts").DecisionsInvalid | import("./FlowError.ts").OpenPointsPending | import("./FlowError.ts").ExtractPackMissing | import("./FlowError.ts").EpicBriefInvalid | import("./FlowError.ts").EpicBriefNotApproved | import("./FlowError.ts").ContractConflict, never>;
|
|
211
|
+
}) => Effect.Effect<RetroPaths, PersistenceError | import("./FlowError.ts").PlanParseError | import("./FlowError.ts").UnsupportedSchemaVersion | import("./FlowError.ts").WorkspacePathError | import("./FlowError.ts").WorkspaceLimitError | import("./FlowError.ts").WorkspaceIoError | import("./FlowError.ts").FlowAborted | import("./FlowError.ts").ProcessError | import("./FlowError.ts").FlowLlmError | import("./FlowError.ts").FlowCapabilityDenied | import("./FlowError.ts").ColumnNotFound | import("./FlowError.ts").BudgetExceeded | StoryPlanInvalid | import("./FlowError.ts").PerimeterViolation | import("./FlowError.ts").MissingDependency | import("./FlowError.ts").MergeConflict | import("./FlowError.ts").EpicCheckoutDirty | import("./FlowError.ts").RosterInvalid | import("./FlowError.ts").EpicIncomplete | import("./FlowError.ts").LandingFailed | import("./FlowError.ts").RefineRefused | import("./FlowError.ts").RosterExhausted | import("./FlowError.ts").Stalled | import("./FlowError.ts").StoryFailed | import("./FlowError.ts").DecisionsInvalid | import("./FlowError.ts").OpenPointsPending | import("./FlowError.ts").ExtractPackMissing | import("./FlowError.ts").EpicBriefInvalid | import("./FlowError.ts").EpicBriefNotApproved | import("./FlowError.ts").ContractConflict, never>;
|
|
171
212
|
export interface AppliedRetros {
|
|
172
213
|
/** The plan after story edits, to run with. */
|
|
173
214
|
readonly plan: StoryPlan;
|
|
@@ -180,6 +221,12 @@ export interface AppliedRetros {
|
|
|
180
221
|
* so the executor's hash check restarts them). Says what it did on the
|
|
181
222
|
* events. Nothing here fails the run: a retro that no longer fits is skipped.
|
|
182
223
|
*/
|
|
183
|
-
export
|
|
224
|
+
export interface ApplyRetroOptions {
|
|
225
|
+
/** The repository root rule edits resolve against; without it they are reported, not applied. */
|
|
226
|
+
readonly rulesRoot?: string;
|
|
227
|
+
}
|
|
228
|
+
/** `append-rule`: the file with the rule added once; `replace-section`: with the section rewritten or appended. */
|
|
229
|
+
export declare const applyRuleEdit: (existing: string | undefined, edit: RuleEdit) => string | undefined;
|
|
230
|
+
export declare const applyApprovedRetros: (files: PlainFileStoreShape, stateDir: string, plan: StoryPlan, events: FlowEventsShape, now: number, options?: ApplyRetroOptions | undefined) => Effect.Effect<AppliedRetros, PersistenceError | import("./FlowError.ts").PlanParseError | import("./FlowError.ts").UnsupportedSchemaVersion | import("./FlowError.ts").WorkspacePathError | import("./FlowError.ts").WorkspaceLimitError | import("./FlowError.ts").WorkspaceIoError | import("./FlowError.ts").FlowAborted | import("./FlowError.ts").ProcessError | import("./FlowError.ts").FlowLlmError | import("./FlowError.ts").FlowCapabilityDenied | import("./FlowError.ts").ColumnNotFound | import("./FlowError.ts").BudgetExceeded | StoryPlanInvalid | import("./FlowError.ts").PerimeterViolation | import("./FlowError.ts").MissingDependency | import("./FlowError.ts").MergeConflict | import("./FlowError.ts").EpicCheckoutDirty | import("./FlowError.ts").RosterInvalid | import("./FlowError.ts").EpicIncomplete | import("./FlowError.ts").LandingFailed | import("./FlowError.ts").RefineRefused | import("./FlowError.ts").RosterExhausted | import("./FlowError.ts").Stalled | import("./FlowError.ts").StoryFailed | import("./FlowError.ts").DecisionsInvalid | import("./FlowError.ts").OpenPointsPending | import("./FlowError.ts").ExtractPackMissing | import("./FlowError.ts").EpicBriefInvalid | import("./FlowError.ts").EpicBriefNotApproved | import("./FlowError.ts").ContractConflict, never>;
|
|
184
231
|
export {};
|
|
185
232
|
//# sourceMappingURL=Retro.d.ts.map
|
package/dist/Retro.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Retro.d.ts","sourceRoot":"","sources":["../src/Retro.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,KAAK,EAAgB,MAAM,gBAAgB,CAAA;AAEpD,OAAO,EAAE,gBAAgB,EAAkB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACxF,OAAO,
|
|
1
|
+
{"version":3,"file":"Retro.d.ts","sourceRoot":"","sources":["../src/Retro.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,KAAK,EAAgB,MAAM,gBAAgB,CAAA;AAEpD,OAAO,EAAE,gBAAgB,EAAkB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACxF,OAAO,EAAE,SAAS,EAAQ,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAmB,MAAM,WAAW,CAAA;AACjD,OAAO,EAAgC,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACzF,OAAO,EAAE,YAAY,EAAuB,MAAM,aAAa,CAAA;AAC/D,OAAO,EACL,UAAU,EAEV,UAAU,EAGX,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE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AM,CAAA;CAC5B;AAED,mHAAmH;AACnH,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,GAAG,SAAS,EAAE,MAAM,QAAQ,KAAG,MAAM,GAAG,SA4BrF,CAAA;AAED,eAAO,MAAM,mBAAmB,w5CAkJ9B,CAAA"}
|
package/dist/Retro.js
CHANGED
|
@@ -20,7 +20,7 @@ import { PersistenceError } from "./FlowError.js";
|
|
|
20
20
|
import { FlowEvent, Info } from "./FlowEvents.js";
|
|
21
21
|
import { Plan, Task, parsePlan } from "./Plan.js";
|
|
22
22
|
import { loadVersioned, makePlanStore } from "./Persistence.js";
|
|
23
|
-
import { ReviewResult } from "./Review.js";
|
|
23
|
+
import { ReviewResult, repoReviewRulesPath } from "./Review.js";
|
|
24
24
|
import { EpicReport, EpicReportVersion, StoryState, StoryStateVersion, StoryVerdict } from "./Stories.js";
|
|
25
25
|
import { Story, StoryPlan, makeStoryPlanStore, validateStoryPlan } from "./StoryPlan.js";
|
|
26
26
|
/** Where a run's retro lives: `<state>/retro/<runId>.*`, indexed in `retro/retros.jsonl`. */
|
|
@@ -317,6 +317,7 @@ export const renderRetroDigest = (inputs) => {
|
|
|
317
317
|
break;
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
+
const signatures = signaturesOf(inputs, trace.events);
|
|
320
321
|
const header = [
|
|
321
322
|
`# Retro digest — run ${inputs.runId}, epic ${inputs.plan.epicId}`,
|
|
322
323
|
"",
|
|
@@ -329,6 +330,13 @@ export const renderRetroDigest = (inputs) => {
|
|
|
329
330
|
? "present, compacted (calls, tools and timings; content removed on land)"
|
|
330
331
|
: "present"}`,
|
|
331
332
|
...(retries.length === 0 ? [] : [`- retries across the run: ${countBy(retries)}`]),
|
|
333
|
+
...(signatures.length === 0
|
|
334
|
+
? []
|
|
335
|
+
: [
|
|
336
|
+
"",
|
|
337
|
+
"## Signatures (patterns across stories: a rule, not a task)",
|
|
338
|
+
...signatures.map((line) => `- ${line}`)
|
|
339
|
+
]),
|
|
332
340
|
...(runLines.length === 0
|
|
333
341
|
? []
|
|
334
342
|
: [
|
|
@@ -372,9 +380,29 @@ export const RetroStory = Schema.Struct({
|
|
|
372
380
|
/** `refine`: the feedback a new round should take. */
|
|
373
381
|
feedback: Schema.optionalKey(Schema.String)
|
|
374
382
|
});
|
|
383
|
+
export const RuleEditOp = Schema.Literals(["append-rule", "replace-section"]);
|
|
384
|
+
/**
|
|
385
|
+
* An edit to the loop rather than to a story (ADR 0027 decision 12): a line
|
|
386
|
+
* appended to a rules file, or a section replaced. Structured, never a
|
|
387
|
+
* diff; the report renders it as one for the human.
|
|
388
|
+
*/
|
|
389
|
+
export const RuleEdit = Schema.Struct({
|
|
390
|
+
/** Repo-relative: `.llm4ts/review-rules.md`, a pack's `reviewers/<name>.md`, `pack.md`, `lessons.md`, or a `patterns/pitfalls-*.md` card. */
|
|
391
|
+
target: Schema.String,
|
|
392
|
+
op: RuleEditOp,
|
|
393
|
+
/** `append-rule`: the rule, one line, without a leading dash. */
|
|
394
|
+
line: Schema.optionalKey(Schema.String),
|
|
395
|
+
/** `replace-section`: the `## heading` (without the hashes) and its new body. */
|
|
396
|
+
heading: Schema.optionalKey(Schema.String),
|
|
397
|
+
body: Schema.optionalKey(Schema.String),
|
|
398
|
+
/** The signature in the digest this answers. */
|
|
399
|
+
why: Schema.String
|
|
400
|
+
});
|
|
375
401
|
export class RetroProposal extends Schema.Class("RetroProposal")({
|
|
376
402
|
summary: Schema.String,
|
|
377
403
|
stories: Schema.Array(RetroStory),
|
|
404
|
+
/** Edits to the rules the next run reviews with; absent in proposals written before ADR 0027. */
|
|
405
|
+
rules: Schema.optionalKey(Schema.Array(RuleEdit)),
|
|
378
406
|
runAdvice: Schema.Array(Schema.Struct({ finding: Schema.String, evidence: Schema.String })),
|
|
379
407
|
libraryAdvice: Schema.Array(Schema.Struct({ title: Schema.String, evidence: Schema.String, suggestion: Schema.String }))
|
|
380
408
|
}) {
|
|
@@ -415,6 +443,21 @@ export const retroProposalJsonSchema = {
|
|
|
415
443
|
required: ["id", "diagnosis", "kind"]
|
|
416
444
|
}
|
|
417
445
|
},
|
|
446
|
+
rules: {
|
|
447
|
+
type: "array",
|
|
448
|
+
items: {
|
|
449
|
+
type: "object",
|
|
450
|
+
properties: {
|
|
451
|
+
target: { type: "string" },
|
|
452
|
+
op: { type: "string", enum: ["append-rule", "replace-section"] },
|
|
453
|
+
line: { type: "string" },
|
|
454
|
+
heading: { type: "string" },
|
|
455
|
+
body: { type: "string" },
|
|
456
|
+
why: { type: "string" }
|
|
457
|
+
},
|
|
458
|
+
required: ["target", "op", "why"]
|
|
459
|
+
}
|
|
460
|
+
},
|
|
418
461
|
runAdvice: {
|
|
419
462
|
type: "array",
|
|
420
463
|
items: {
|
|
@@ -458,6 +501,14 @@ export const retroPrompt = (digest, storiesWithPlan) => [
|
|
|
458
501
|
" no edit covers). Give the `feedback` text a planner should take.",
|
|
459
502
|
"- `none`: nothing to change (an outage, a dependency that will unblock it). Give `why`.",
|
|
460
503
|
"",
|
|
504
|
+
"`rules`: when the digest's Signatures section shows a pattern that repeats across stories",
|
|
505
|
+
"(the same reviewer finding, gaming such as stubs or skipped tests, fabricated status),",
|
|
506
|
+
"propose an edit to the loop rather than a task: `append-rule` adds one line to a rules",
|
|
507
|
+
"file, `replace-section` rewrites one `## heading` of it. Targets are repo-relative:",
|
|
508
|
+
"`.llm4ts/review-rules.md` (every run reads it as a review lens), a pack's",
|
|
509
|
+
"`reviewers/<name>.md`, `pack.md`, `lessons.md`, or a `patterns/pitfalls-*.md` card. Name",
|
|
510
|
+
"the signature in `why`. Nothing here is applied unreviewed.",
|
|
511
|
+
"",
|
|
461
512
|
"`runAdvice`: findings about the environment or configuration (a seat on an old CLI, Node",
|
|
462
513
|
"mismatch, gates missing, transcripts off), each with its evidence line.",
|
|
463
514
|
"`libraryAdvice`: only where the digest shows llm4ts itself — the flow, a seat's harness",
|
|
@@ -554,7 +605,81 @@ export const validateRetroProposal = (proposal, plan, storiesWithPlan) => {
|
|
|
554
605
|
break;
|
|
555
606
|
}
|
|
556
607
|
}
|
|
557
|
-
|
|
608
|
+
const rules = [];
|
|
609
|
+
for (const edit of proposal.rules ?? []) {
|
|
610
|
+
if (!allowedRuleTarget(edit.target)) {
|
|
611
|
+
dropped.push(`rule edit: ${edit.target} is not a rules file a retro may edit`);
|
|
612
|
+
continue;
|
|
613
|
+
}
|
|
614
|
+
if (edit.op === "append-rule" && (edit.line ?? "").trim().length === 0) {
|
|
615
|
+
dropped.push(`rule edit: append-rule to ${edit.target} with no line`);
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
if (edit.op === "replace-section" &&
|
|
619
|
+
((edit.heading ?? "").trim().length === 0 || (edit.body ?? "").trim().length === 0)) {
|
|
620
|
+
dropped.push(`rule edit: replace-section in ${edit.target} with no heading or body`);
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
rules.push(edit);
|
|
624
|
+
}
|
|
625
|
+
return {
|
|
626
|
+
proposal: RetroProposal.make({
|
|
627
|
+
...proposal,
|
|
628
|
+
stories,
|
|
629
|
+
...(rules.length === 0 ? {} : { rules })
|
|
630
|
+
}),
|
|
631
|
+
dropped
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
/** The files a retro may edit: the repository's review rules, a pack's lenses and rules, a pitfall card. */
|
|
635
|
+
export const allowedRuleTarget = (target) => !badPath(target) &&
|
|
636
|
+
(target === repoReviewRulesPath ||
|
|
637
|
+
/(?:^|\/)reviewers\/[^/]+\.md$/u.test(target) ||
|
|
638
|
+
/(?:^|\/)pack\.md$/u.test(target) ||
|
|
639
|
+
/(?:^|\/)lessons\.md$/u.test(target) ||
|
|
640
|
+
/(?:^|\/)patterns\/pitfalls-[^/]+\.md$/u.test(target));
|
|
641
|
+
const findingLine = /^- \[(Critical|Warning|Info)\] (.+?)(?: \(| — |: |$)/u;
|
|
642
|
+
/**
|
|
643
|
+
* Patterns across stories the digest flags for a rule (ADR 0027 decision 12):
|
|
644
|
+
* gaming (oracle-guard findings), the same reviewer finding in two or more
|
|
645
|
+
* stories, fabricated status in two or more stories.
|
|
646
|
+
*/
|
|
647
|
+
export const signaturesOf = (inputs, events) => {
|
|
648
|
+
const gaming = [];
|
|
649
|
+
const titles = new Map();
|
|
650
|
+
for (const entry of inputs.stories) {
|
|
651
|
+
const text = entry.findings ?? "";
|
|
652
|
+
if (/^- \[(?:Critical|Warning)\] oracle: /mu.test(text)) {
|
|
653
|
+
gaming.push(entry.story.id);
|
|
654
|
+
}
|
|
655
|
+
for (const raw of text.split(/\r?\n/u)) {
|
|
656
|
+
const match = findingLine.exec(raw.trim());
|
|
657
|
+
const title = match?.[2]?.trim().toLowerCase();
|
|
658
|
+
if (title === undefined || title.startsWith("lint failed") || title.startsWith("oracle:")) {
|
|
659
|
+
continue;
|
|
660
|
+
}
|
|
661
|
+
titles.set(title, (titles.get(title) ?? new Set()).add(entry.story.id));
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
const fabricated = new Set();
|
|
665
|
+
for (const event of events) {
|
|
666
|
+
if (event._tag === "EvidenceChecked" && event.unverified > 0 && event.lane !== undefined) {
|
|
667
|
+
fabricated.add(event.lane);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
const lines = [];
|
|
671
|
+
if (gaming.length > 0) {
|
|
672
|
+
lines.push(`gaming: the oracle guard caught deleted or skipped tests in ${gaming.length} stor${gaming.length === 1 ? "y" : "ies"} (${gaming.join(", ")})`);
|
|
673
|
+
}
|
|
674
|
+
for (const [title, stories] of titles) {
|
|
675
|
+
if (stories.size >= 2) {
|
|
676
|
+
lines.push(`the same reviewer finding in ${stories.size} stories (${[...stories].join(", ")}): "${title}"`);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if (fabricated.size >= 2) {
|
|
680
|
+
lines.push(`fabricated status in ${fabricated.size} stories (${[...fabricated].join(", ")}): the coder claimed commands that never ran`);
|
|
681
|
+
}
|
|
682
|
+
return lines;
|
|
558
683
|
};
|
|
559
684
|
// ---- Report ---------------------------------------------------------------------------------
|
|
560
685
|
export const AppliedMarkerPrefix = "- [x] Applied";
|
|
@@ -617,6 +742,23 @@ export const renderRetroReport = (inputs) => {
|
|
|
617
742
|
lines.push(`### ${entry.id}${story === undefined ? "" : ` — ${story.title}`}`, "", `**Diagnosis.** ${entry.diagnosis.trim()}`, "", ...fixLines(entry, story), "");
|
|
618
743
|
}
|
|
619
744
|
}
|
|
745
|
+
const rules = proposal.rules ?? [];
|
|
746
|
+
if (rules.length > 0) {
|
|
747
|
+
lines.push("## Rule edits", "");
|
|
748
|
+
for (const edit of rules) {
|
|
749
|
+
lines.push(`### ${edit.target}`, "", `**Why.** ${edit.why.trim()}`, "", "```diff");
|
|
750
|
+
if (edit.op === "append-rule") {
|
|
751
|
+
lines.push(`+ - ${(edit.line ?? "").trim()}`);
|
|
752
|
+
}
|
|
753
|
+
else {
|
|
754
|
+
lines.push(` ## ${(edit.heading ?? "").trim()}`, ...(edit.body ?? "")
|
|
755
|
+
.trim()
|
|
756
|
+
.split(/\r?\n/u)
|
|
757
|
+
.map((row) => `+ ${row}`));
|
|
758
|
+
}
|
|
759
|
+
lines.push("```", "");
|
|
760
|
+
}
|
|
761
|
+
}
|
|
620
762
|
if (proposal.runAdvice.length > 0) {
|
|
621
763
|
lines.push("## Run advice", "", ...proposal.runAdvice.map((item) => `- ${item.finding} — ${item.evidence}`), "");
|
|
622
764
|
}
|
|
@@ -626,13 +768,15 @@ export const renderRetroReport = (inputs) => {
|
|
|
626
768
|
const applies = proposal.stories.filter((entry) => entry.kind === "tasks" || entry.kind === "story");
|
|
627
769
|
const refines = proposal.stories.filter((entry) => entry.kind === "refine");
|
|
628
770
|
lines.push("## Approval", "");
|
|
629
|
-
if (applies.length === 0) {
|
|
771
|
+
if (applies.length === 0 && rules.length === 0) {
|
|
630
772
|
lines.push("Nothing here is applied by the next run; the report is for reading.", "");
|
|
631
773
|
}
|
|
632
774
|
else {
|
|
633
775
|
lines.push("Ticking the box lets the next `epic-stories` run of this epic apply:", "", ...applies.map((entry) => entry.kind === "tasks"
|
|
634
776
|
? `- ${entry.id}: append ${entry.tasks?.length ?? 0} task(s) to its plan`
|
|
635
|
-
: `- ${entry.id}: edit its entry and restart it from a fresh worktree`), ""
|
|
777
|
+
: `- ${entry.id}: edit its entry and restart it from a fresh worktree`), ...rules.map((edit) => edit.op === "append-rule"
|
|
778
|
+
? `- ${edit.target}: append one rule`
|
|
779
|
+
: `- ${edit.target}: replace the "${(edit.heading ?? "").trim()}" section`), "");
|
|
636
780
|
}
|
|
637
781
|
if (refines.length > 0) {
|
|
638
782
|
lines.push("A refine round is started by hand, with the feedback above:", "", ...refines.map(() => ` llm4ts run epic-stories --repo ${inputs.workDir} -- --refine --epic ${inputs.epicDir} "<feedback>"`), "");
|
|
@@ -677,13 +821,36 @@ export const writeRetro = Effect.fn("@llm4ts/flow/Retro.write")(function* (files
|
|
|
677
821
|
return paths;
|
|
678
822
|
});
|
|
679
823
|
const retroTaskTitle = (runId, title) => `Retro ${runId}: ${title}`;
|
|
680
|
-
/**
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
824
|
+
/** `append-rule`: the file with the rule added once; `replace-section`: with the section rewritten or appended. */
|
|
825
|
+
export const applyRuleEdit = (existing, edit) => {
|
|
826
|
+
const current = existing ?? "";
|
|
827
|
+
if (edit.op === "append-rule") {
|
|
828
|
+
const line = `- ${(edit.line ?? "").trim()}`;
|
|
829
|
+
if (current.split(/\r?\n/u).some((row) => row.trim() === line)) {
|
|
830
|
+
return undefined;
|
|
831
|
+
}
|
|
832
|
+
const base = current.trim().length === 0 && edit.target === repoReviewRulesPath
|
|
833
|
+
? "# Review rules\n\nRules every review round of this repository applies (ADR 0027).\n\n"
|
|
834
|
+
: current.length === 0 || current.endsWith("\n")
|
|
835
|
+
? current
|
|
836
|
+
: `${current}\n`;
|
|
837
|
+
return `${base}${line}\n`;
|
|
838
|
+
}
|
|
839
|
+
const heading = `## ${(edit.heading ?? "").trim()}`;
|
|
840
|
+
const body = (edit.body ?? "").trim();
|
|
841
|
+
const sections = current.split(/^(?=## )/mu);
|
|
842
|
+
const index = sections.findIndex((section) => section.split(/\r?\n/u)[0]?.trim() === heading);
|
|
843
|
+
const replacement = `${heading}\n\n${body}\n`;
|
|
844
|
+
if (index < 0) {
|
|
845
|
+
const base = current.length === 0 || current.endsWith("\n") ? current : `${current}\n`;
|
|
846
|
+
return `${base}${current.trim().length === 0 ? "" : "\n"}${replacement}`;
|
|
847
|
+
}
|
|
848
|
+
if (sections[index]?.trim() === replacement.trim()) {
|
|
849
|
+
return undefined;
|
|
850
|
+
}
|
|
851
|
+
return [...sections.slice(0, index), replacement, ...sections.slice(index + 1)].join("");
|
|
852
|
+
};
|
|
853
|
+
export const applyApprovedRetros = Effect.fn("@llm4ts/flow/Retro.apply")(function* (files, stateDir, plan, events, now, options = {}) {
|
|
687
854
|
const notes = [];
|
|
688
855
|
const say = (message) => Effect.sync(() => {
|
|
689
856
|
notes.push(message);
|
|
@@ -766,6 +933,24 @@ export const applyApprovedRetros = Effect.fn("@llm4ts/flow/Retro.apply")(functio
|
|
|
766
933
|
break;
|
|
767
934
|
}
|
|
768
935
|
}
|
|
936
|
+
for (const edit of proposal.rules ?? []) {
|
|
937
|
+
if (options.rulesRoot === undefined) {
|
|
938
|
+
yield* say(`${runId}: rule edit to ${edit.target} needs the repository root; not applied`);
|
|
939
|
+
continue;
|
|
940
|
+
}
|
|
941
|
+
if (!allowedRuleTarget(edit.target)) {
|
|
942
|
+
yield* say(`${runId}: rule edit to ${edit.target} is not allowed; skipped`);
|
|
943
|
+
continue;
|
|
944
|
+
}
|
|
945
|
+
const path = join(options.rulesRoot, edit.target);
|
|
946
|
+
const existing = yield* files.read(path).pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
947
|
+
const next = applyRuleEdit(existing, edit);
|
|
948
|
+
if (next === undefined) {
|
|
949
|
+
continue;
|
|
950
|
+
}
|
|
951
|
+
yield* files.writeAtomic(path, next);
|
|
952
|
+
yield* say(`${runId}: ${edit.target} — ${edit.op === "append-rule" ? "one rule appended" : `section "${(edit.heading ?? "").trim()}" replaced`} (${edit.why.trim()})`);
|
|
953
|
+
}
|
|
769
954
|
if (editedIds.length > 0) {
|
|
770
955
|
const valid = yield* validateStoryPlan(edited).pipe(Effect.map((plan) => ({ plan, problem: undefined })), Effect.catch((error) => Effect.succeed({ plan: current, problem: error.violations.join("; ") })));
|
|
771
956
|
if (valid.problem === undefined) {
|