@llm4ts/shell 4.10.0 → 4.11.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.
@@ -28,6 +28,9 @@
28
28
  // Test-first by default (ADR 0053): before a story's tasks are planned, its
29
29
  // coder writes one test per acceptance criterion, the test gate proves them
30
30
  // red, and they are frozen; --no-test-first (LLM4TS_TEST_FIRST=off) skips it.
31
+ // A story its last round would fail gets one rescue turn by the judge's
32
+ // agent, with write access, before it fails (ADR 0054); --no-rescue
33
+ // (LLM4TS_RESCUE=off) fails it at once.
31
34
  import * as Effect from "effect/Effect";
32
35
  import { runFlowMain } from "@llm4ts/runner";
33
36
  import { epicStoriesOptions, parseStoriesFlags } from "./lib/debt.js";
package/flows/lib/debt.js CHANGED
@@ -123,25 +123,31 @@ export const parseStoriesFlags = (argv, environment) => Effect.gen(function* ()
123
123
  settingValue("LLM4TS_TEST_FIRST", environment) &&
124
124
  !deferTests &&
125
125
  !harden;
126
- const rest = argv.filter((arg) => arg !== "--defer-tests" && arg !== "--harden" && arg !== "--no-test-first");
126
+ const rescue = !argv.includes("--no-rescue") && settingValue("LLM4TS_RESCUE", environment);
127
+ const ours = new Set(["--defer-tests", "--harden", "--no-test-first", "--no-rescue"]);
128
+ const rest = argv.filter((arg) => !ours.has(arg));
127
129
  return {
128
130
  deferTests,
129
131
  harden,
130
132
  testFirst,
133
+ rescue,
131
134
  testEvidence: evidenceSourceFromEnvironment(environment),
132
135
  argv: harden ? ["--refine", ...rest] : rest
133
136
  };
134
137
  });
135
- /** epic-stories' policy for its flags: the rubric judge, excusing tests, or hardening. */
136
- export const epicStoriesOptions = (flags) => flags.harden
137
- ? hardenOptions
138
- : flags.deferTests
139
- ? {
140
- storyJudge: deferringTestsJudge,
141
- stories: () => ({ judgeBar: "defer-tests" }),
142
- afterUnit: testsDebtAfterUnit
143
- }
144
- : {
145
- storyJudge: rubricStoryJudge,
146
- ...(flags.testFirst ? { stories: storiesTestFirst(flags.testEvidence) } : {})
147
- };
138
+ /** epic-stories' policy for its flags: the rubric judge, excusing tests, or hardening; then the rescue. */
139
+ export const epicStoriesOptions = (flags) => {
140
+ const policy = flags.harden
141
+ ? hardenOptions
142
+ : flags.deferTests
143
+ ? {
144
+ storyJudge: deferringTestsJudge,
145
+ stories: () => ({ judgeBar: "defer-tests" }),
146
+ afterUnit: testsDebtAfterUnit
147
+ }
148
+ : {
149
+ storyJudge: rubricStoryJudge,
150
+ ...(flags.testFirst ? { stories: storiesTestFirst(flags.testEvidence) } : {})
151
+ };
152
+ return flags.rescue ? { ...policy, rescue: true } : policy;
153
+ };
@@ -79,6 +79,9 @@ export const epicUsage = [
79
79
  " excused are written to debt.md (the coder is still asked for tests;",
80
80
  " a red test gate still fails). LLM4TS_DEFER_TESTS=1 sets it too",
81
81
  " --harden plan the epic's open debt as a refine round under the full bar",
82
+ " --no-rescue fail a story its last review round leaves open; by default the",
83
+ " judge's agent first takes the coder's seat for one rescue turn, then",
84
+ " the gates and the judge decide (ADR 0054). LLM4TS_RESCUE=off sets it",
82
85
  " --no-test-first plan a story's tasks straight from it; by default its coder first",
83
86
  " writes one test per acceptance criterion, proves them red with the",
84
87
  " test gate, and they are frozen (ADR 0053). LLM4TS_TEST_FIRST=off sets it",
@@ -1565,6 +1568,8 @@ export const runEpicStories = (options) => Effect.gen(function* () {
1565
1568
  coder,
1566
1569
  reasoning,
1567
1570
  reviewers: [asReadOnly(reasoning)],
1571
+ // The judge's agent, writable, for a story's rescue turn (ADR 0054).
1572
+ ...(options.rescue === true ? { rescuer: reasoning } : {}),
1568
1573
  environment: storiesEnvironment(process.env),
1569
1574
  ...runnerOptions
1570
1575
  }, (context) => Effect.gen(function* () {
@@ -1891,6 +1896,7 @@ export const runEpicStories = (options) => Effect.gen(function* () {
1891
1896
  concurrency,
1892
1897
  ...(deferring ? { deferNonBlocking: true } : {}),
1893
1898
  failFast: flags.failFast,
1899
+ ...(options.rescue === true ? { rescue: true } : {}),
1894
1900
  ...(options.stories === undefined ? {} : options.stories(unitContext(work)))
1895
1901
  });
1896
1902
  const summarize = (work, report) => events.publish(Info.make({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llm4ts/shell",
3
- "version": "4.10.0",
3
+ "version": "4.11.0",
4
4
  "description": "Interactive shell and CLI for llm4ts: flow discovery, run-a-flow, and view",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -46,9 +46,9 @@
46
46
  "dependencies": {
47
47
  "@effect/platform-node": "4.1.4",
48
48
  "@effect/platform-node-shared": "4.1.4",
49
- "@llm4ts/core": "4.10.0",
50
- "@llm4ts/runner": "4.10.0",
51
- "@llm4ts/flow": "4.10.0"
49
+ "@llm4ts/core": "4.11.0",
50
+ "@llm4ts/flow": "4.11.0",
51
+ "@llm4ts/runner": "4.11.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "effect": "4.1.4"