@llm4ts/shell 4.10.0 → 4.11.1

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/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.1",
4
4
  "description": "Interactive shell and CLI for llm4ts: flow discovery, run-a-flow, and view",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -44,17 +44,17 @@
44
44
  "typescript"
45
45
  ],
46
46
  "dependencies": {
47
- "@effect/platform-node": "4.1.4",
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"
47
+ "@effect/platform-node": "4.1.5",
48
+ "@effect/platform-node-shared": "4.1.5",
49
+ "@llm4ts/core": "4.11.1",
50
+ "@llm4ts/runner": "4.11.1",
51
+ "@llm4ts/flow": "4.11.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "effect": "4.1.4"
54
+ "effect": "4.1.5"
55
55
  },
56
56
  "devDependencies": {
57
- "effect": "4.1.4"
57
+ "effect": "4.1.5"
58
58
  },
59
59
  "scripts": {
60
60
  "clean": "tsc -b tsconfig.json --clean",
package/src/Config.ts CHANGED
@@ -192,13 +192,11 @@ export const parseConfigFile = (text: string, path: string): ConfigFile => {
192
192
  lines,
193
193
  problems: lines
194
194
  .filter((line) => line._tag === "Malformed")
195
- .map(
196
- (line): ConfigProblem => ({
197
- severity: "error",
198
- kind: "malformed",
199
- message: `${path}:${line.line}: not a NAME=value line`
200
- })
201
- )
195
+ .map((line): ConfigProblem => ({
196
+ severity: "error",
197
+ kind: "malformed",
198
+ message: `${path}:${line.line}: not a NAME=value line`
199
+ }))
202
200
  }
203
201
  }
204
202
 
package/src/ConfigEdit.ts CHANGED
@@ -98,12 +98,10 @@ export interface ActionChoice {
98
98
  /** What an open setting offers; a removal only for a file that holds it. */
99
99
  export const settingActions = (held: ReadonlyArray<FileLayer>): ReadonlyArray<ActionChoice> => [
100
100
  { title: "change the value", action: { kind: "change" } },
101
- ...held.map(
102
- (layer): ActionChoice => ({
103
- title: `remove it from the ${layer} file`,
104
- action: { kind: "remove", layer }
105
- })
106
- ),
101
+ ...held.map((layer): ActionChoice => ({
102
+ title: `remove it from the ${layer} file`,
103
+ action: { kind: "remove", layer }
104
+ })),
107
105
  { title: "back", action: { kind: "back" } }
108
106
  ]
109
107
 
package/src/Menu.ts CHANGED
@@ -47,15 +47,13 @@ const selectCoder = Effect.fn("@llm4ts/shell/Menu.selectCoder")(function* (
47
47
  value: undefined,
48
48
  description: "LLM4TS_CODER from the environment or the config files"
49
49
  },
50
- ...coderChoices.map(
51
- (choice): Prompt.SelectChoice<string | undefined> => ({
52
- title:
53
- findOnPath(choice.executable, environment) === undefined
54
- ? choice.token
55
- : `${choice.token} ✓ found`,
56
- value: choice.token
57
- })
58
- )
50
+ ...coderChoices.map((choice): Prompt.SelectChoice<string | undefined> => ({
51
+ title:
52
+ findOnPath(choice.executable, environment) === undefined
53
+ ? choice.token
54
+ : `${choice.token} ✓ found`,
55
+ value: choice.token
56
+ }))
59
57
  ]
60
58
  return yield* Prompt.run(Prompt.Select({ message: "Which coding agent?", choices }))
61
59
  })
@@ -366,17 +366,15 @@ export const readHandlers = (
366
366
  Effect.gen(function* () {
367
367
  const repo = yield* resolveRepo(deps.config, repoId)
368
368
  const doctor = yield* deps.doctor
369
- const connectors = doctor.connectors.map(
370
- (connector): ConnectorHealthOut => ({
371
- id: connector.id,
372
- availability: connector.status.availability,
373
- authStatus: connector.status.authStatus,
374
- probe: connector.probe,
375
- ...(connector.status.latency === undefined
376
- ? {}
377
- : { latencyMs: Math.round(Duration.toMillis(connector.status.latency)) })
378
- })
379
- )
369
+ const connectors = doctor.connectors.map((connector): ConnectorHealthOut => ({
370
+ id: connector.id,
371
+ availability: connector.status.availability,
372
+ authStatus: connector.status.authStatus,
373
+ probe: connector.probe,
374
+ ...(connector.status.latency === undefined
375
+ ? {}
376
+ : { latencyMs: Math.round(Duration.toMillis(connector.status.latency)) })
377
+ }))
380
378
  const roster = yield* deps.roster(repo.path).pipe(
381
379
  Effect.map((report) => ({ report, note: undefined })),
382
380
  Effect.catch((error) =>
package/src/Refine.ts CHANGED
@@ -109,14 +109,7 @@ export interface RefineSessionOptions {
109
109
  }
110
110
 
111
111
  type Action =
112
- | "programs"
113
- | "scenarios"
114
- | "deepen"
115
- | "run"
116
- | "answer"
117
- | "regroup"
118
- | "approve"
119
- | "exit"
112
+ "programs" | "scenarios" | "deepen" | "run" | "answer" | "regroup" | "approve" | "exit"
120
113
 
121
114
  const dispositionChoices: ReadonlyArray<Prompt.SelectChoice<Disposition | "?">> = [
122
115
  { title: "drop", value: "drop", description: "deprecated — will not exist in the target" },
package/src/WebWatch.ts CHANGED
@@ -236,14 +236,11 @@ export const webWatchApp = Effect.fn("@llm4ts/shell/WebWatch.app")(function* (
236
236
  const target: WatchTarget = yield* resolveTraceTarget(options, dependencies)
237
237
  const replay = options.replay === true
238
238
  const start = yield* startingTree(target, dependencies.files, options.idleAfterMs)
239
- const load = Effect.map(
240
- readTrace(dependencies.files, target.tracePath),
241
- (lines): Loaded => ({
242
- runId: lines[0]?.runId,
243
- lastSeq: lines.at(-1)?.seq,
244
- steps: stepsOfTrace(lines)
245
- })
246
- )
239
+ const load = Effect.map(readTrace(dependencies.files, target.tracePath), (lines): Loaded => ({
240
+ runId: lines[0]?.runId,
241
+ lastSeq: lines.at(-1)?.seq,
242
+ steps: stepsOfTrace(lines)
243
+ }))
247
244
  // Read once up front, so a missing or unreadable trace fails before serving.
248
245
  yield* load
249
246
  const speedOf = (asked: number | undefined): number =>