@llm4ts/shell 3.2.6 → 3.4.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.
Files changed (105) hide show
  1. package/README.md +36 -0
  2. package/dist/Cli.d.ts +11 -3
  3. package/dist/Cli.d.ts.map +1 -1
  4. package/dist/Cli.js +127 -39
  5. package/dist/Cli.js.map +1 -1
  6. package/dist/CoderChoice.d.ts +2 -4
  7. package/dist/CoderChoice.d.ts.map +1 -1
  8. package/dist/CoderChoice.js +8 -12
  9. package/dist/CoderChoice.js.map +1 -1
  10. package/dist/Config.d.ts +238 -0
  11. package/dist/Config.d.ts.map +1 -0
  12. package/dist/Config.js +594 -0
  13. package/dist/Config.js.map +1 -0
  14. package/dist/ConfigCommand.d.ts +180 -0
  15. package/dist/ConfigCommand.d.ts.map +1 -0
  16. package/dist/ConfigCommand.js +903 -0
  17. package/dist/ConfigCommand.js.map +1 -0
  18. package/dist/ConfigEdit.d.ts +79 -0
  19. package/dist/ConfigEdit.d.ts.map +1 -0
  20. package/dist/ConfigEdit.js +110 -0
  21. package/dist/ConfigEdit.js.map +1 -0
  22. package/dist/ConfigTrust.d.ts +45 -0
  23. package/dist/ConfigTrust.d.ts.map +1 -0
  24. package/dist/ConfigTrust.js +72 -0
  25. package/dist/ConfigTrust.js.map +1 -0
  26. package/dist/FlowLaunch.d.ts +2 -3
  27. package/dist/FlowLaunch.d.ts.map +1 -1
  28. package/dist/FlowLaunch.js +1 -5
  29. package/dist/FlowLaunch.js.map +1 -1
  30. package/dist/FlowProcess.d.ts +3 -1
  31. package/dist/FlowProcess.d.ts.map +1 -1
  32. package/dist/FlowProcess.js.map +1 -1
  33. package/dist/Menu.d.ts +1 -1
  34. package/dist/Menu.d.ts.map +1 -1
  35. package/dist/Menu.js +33 -6
  36. package/dist/Menu.js.map +1 -1
  37. package/dist/OperatorConfig.d.ts.map +1 -1
  38. package/dist/OperatorConfig.js +2 -1
  39. package/dist/OperatorConfig.js.map +1 -1
  40. package/dist/OperatorTools.d.ts +2 -0
  41. package/dist/OperatorTools.d.ts.map +1 -1
  42. package/dist/Refine.d.ts.map +1 -1
  43. package/dist/Refine.js +3 -2
  44. package/dist/Refine.js.map +1 -1
  45. package/dist/RunSupervisor.d.ts +4 -3
  46. package/dist/RunSupervisor.d.ts.map +1 -1
  47. package/dist/RunSupervisor.js +26 -13
  48. package/dist/RunSupervisor.js.map +1 -1
  49. package/flows/epic-design.js +7 -5
  50. package/flows/epic-retro.js +3 -2
  51. package/flows/implement.js +3 -2
  52. package/flows/issue-pr.js +3 -2
  53. package/flows/judge-suite.js +2 -2
  54. package/flows/lib/debt.js +2 -2
  55. package/flows/lib/epic-retro.js +3 -6
  56. package/flows/lib/epic-stories.js +54 -115
  57. package/flows/lib/modernize-extract.js +3 -6
  58. package/flows/lib/pack-fork.js +8 -10
  59. package/flows/lib/port.js +8 -10
  60. package/flows/local.js +3 -2
  61. package/flows/modernize-bench.js +5 -5
  62. package/flows/modernize-extract.js +8 -7
  63. package/flows/modernize-implement.js +4 -6
  64. package/flows/modernize-pack-check.js +2 -1
  65. package/flows/modernize-pack-upgrade.js +2 -1
  66. package/flows/modernize-refine.js +6 -5
  67. package/flows/modernize-review.js +2 -2
  68. package/flows/modernize-seed.js +8 -8
  69. package/flows/modernize-survey.js +4 -7
  70. package/flows/modernize-verify.js +2 -2
  71. package/flows/pack-fork.js +4 -3
  72. package/flows/port-compile.js +4 -3
  73. package/flows/port-files.js +2 -2
  74. package/flows/port-guide.js +5 -4
  75. package/flows/port-ledger.js +2 -2
  76. package/flows/port-tests.js +5 -4
  77. package/flows/roundtable.js +2 -2
  78. package/flows/sdd.js +8 -13
  79. package/flows/taskforce.js +5 -4
  80. package/kits/j2ee-nextjs/README.md +2 -1
  81. package/kits/j2ee-nextjs/fixtures/demo-bank/RUNBOOK.md +32 -14
  82. package/kits/j2ee-nextjs/fixtures/demo-bank/reset-demo.mjs +3 -1
  83. package/kits/j2ee-nextjs/flows/convert-all.js +8 -7
  84. package/kits/j2ee-nextjs/flows/convert-feature.js +2 -2
  85. package/kits/j2ee-nextjs/flows/convert-page.js +2 -2
  86. package/kits/j2ee-nextjs/flows/lib/convert.js +7 -10
  87. package/kits/soap-ace/flows/soap-design.js +5 -8
  88. package/kits/soap-ace/flows/soap-discover.js +4 -3
  89. package/kits/soap-ace/flows/soap-epic.js +4 -7
  90. package/kits/soap-ace/flows/soap-explore.js +8 -7
  91. package/kits/soap-ace/flows/soap-sample.js +10 -10
  92. package/kits/soap-ace/tools/soap-call.js +3 -2
  93. package/package.json +8 -4
  94. package/src/Cli.ts +176 -46
  95. package/src/CoderChoice.ts +10 -16
  96. package/src/Config.ts +868 -0
  97. package/src/ConfigCommand.ts +1423 -0
  98. package/src/ConfigEdit.ts +180 -0
  99. package/src/ConfigTrust.ts +145 -0
  100. package/src/FlowLaunch.ts +3 -8
  101. package/src/FlowProcess.ts +3 -1
  102. package/src/Menu.ts +40 -7
  103. package/src/OperatorConfig.ts +2 -1
  104. package/src/Refine.ts +3 -2
  105. package/src/RunSupervisor.ts +26 -14
@@ -27,6 +27,7 @@ import { FlowAborted, Info, makeNodeWorkspace, mock, openPack, resolveFlowInput,
27
27
  import { graphStats, probeResults } from "@llm4ts/flow/GraphQuery";
28
28
  import { coverageUnits, matchingFiles } from "@llm4ts/flow/SpecChecks";
29
29
  import { buildCodeGraph, nodeId, nodeKind } from "@llm4ts/flow/Survey";
30
+ import { settingValue } from "@llm4ts/flow/Settings";
30
31
  import { legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
31
32
  /** Prompt sidecars the modernization phases read, with the phase that reads each. */
32
33
  const phasePrompts = [
@@ -218,7 +219,7 @@ const program = Effect.gen(function* () {
218
219
  });
219
220
  }
220
221
  yield* say(`pack '${pack.name}' check passed with ${plural(warnings.length, "warning")} — ` +
221
- `next: LLM4TS_PACK=${process.env.LLM4TS_PACK ?? opened.dir} modernize-survey --repo ${input.workDir}`);
222
+ `next: LLM4TS_PACK=${settingValue("LLM4TS_PACK", process.env) ?? opened.dir} modernize-survey --repo ${input.workDir}`);
222
223
  }));
223
224
  }));
224
225
  });
@@ -30,6 +30,7 @@ import { withDraftApproval } from "@llm4ts/flow/Approval";
30
30
  import { DeepenMark, Decisions, parseDecisions, renderDecisions, scenarioTitles, waivedUnits } from "@llm4ts/flow/Decisions";
31
31
  import { packageVersion } from "@llm4ts/flow/Package";
32
32
  import { coverageReport, coverageUnits, features, matchingFiles, specSchemaIssues } from "@llm4ts/flow/SpecChecks";
33
+ import { settingValue } from "@llm4ts/flow/Settings";
33
34
  import { legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
34
35
  import { FlowAborted, Info, makeNodeWorkspace, mock, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
35
36
  import { ModDir, programName, readmeFor, readmeVersion } from "./lib/modernize-extract.js";
@@ -37,7 +38,7 @@ const program = Effect.gen(function* () {
37
38
  const input = yield* resolveFlowInput("Check a spec pack an older llm4ts extracted against the current release");
38
39
  const files = nodePlainFileStore;
39
40
  const modDirAbs = join(input.workDir, ModDir);
40
- const markDeepen = process.env.LLM4TS_MARK_DEEPEN?.trim() === "1";
41
+ const markDeepen = settingValue("LLM4TS_MARK_DEEPEN", process.env);
41
42
  yield* runNode({
42
43
  workDir: input.workDir,
43
44
  workspace: input.workspace,
@@ -40,17 +40,18 @@ import { coverageUnits, matchingFiles } from "@llm4ts/flow/SpecChecks";
40
40
  import { SurveyGraph, closureFor } from "@llm4ts/flow/Survey";
41
41
  import { freshGraph, graphCachePath } from "@llm4ts/flow/GraphCache";
42
42
  import { withDraftApproval } from "@llm4ts/flow/Approval";
43
+ import { settingValue } from "@llm4ts/flow/Settings";
43
44
  import { legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
44
- import { FlowAborted, Info, Plan, asReadOnly, coderFromEnv, defaultPlanInstructions, makeNodeWorkspace, nodePlainFileStore, openPack, planFrom, resolveFlowInput, runFlowMain, runNode, stage, withTurnLimit } from "@llm4ts/runner";
45
+ import { FlowAborted, Info, Plan, asReadOnly, coderFromEnvironment, defaultPlanInstructions, makeNodeWorkspace, nodePlainFileStore, openPack, planFrom, resolveFlowInput, runFlowMain, runNode, stage, withTurnLimit } from "@llm4ts/runner";
45
46
  import { ModDir, analystSystem, analystTurns, fixTurn, makeProgramJudge, maxClosureFiles, programArtifactsJsonSchema, programAsk, programFixAsk, programName, readmeFor } from "./lib/modernize-extract.js";
46
47
  const today = () => new Date().toISOString().slice(0, 10);
47
48
  const program = Effect.gen(function* () {
48
49
  const input = yield* resolveFlowInput("Refine the extracted spec pack: prune, deepen, and consolidate it before approval");
49
- const coder = withTurnLimit(coderFromEnv(process.env), analystTurns());
50
+ const coder = withTurnLimit(yield* coderFromEnvironment(), analystTurns());
50
51
  const files = nodePlainFileStore;
51
52
  const modDirAbs = join(input.workDir, ModDir);
52
- const targetRepo = process.env.LLM4TS_TARGET_REPO?.trim();
53
- const regroup = process.env.LLM4TS_REGROUP?.trim() === "1";
53
+ const targetRepo = settingValue("LLM4TS_TARGET_REPO", process.env);
54
+ const regroup = settingValue("LLM4TS_REGROUP", process.env);
54
55
  yield* runNode({
55
56
  workDir: input.workDir,
56
57
  workspace: input.workspace,
@@ -210,7 +211,7 @@ const program = Effect.gen(function* () {
210
211
  spec: packState.specs[name] ?? "",
211
212
  feature: packState.features[name] ?? ""
212
213
  }));
213
- const targetMounted = targetRepo !== undefined && targetRepo.length > 0;
214
+ const targetMounted = targetRepo !== undefined;
214
215
  if (!targetMounted) {
215
216
  yield* say("no LLM4TS_TARGET_REPO — the proposal cannot claim anything is provided by the target");
216
217
  }
@@ -20,7 +20,7 @@ import * as Schema from "effect/Schema";
20
20
  import { Dimension } from "@llm4ts/core/eval/Eval";
21
21
  import { judge } from "@llm4ts/core/eval/Judge";
22
22
  import { capped, renderTruncation, truncations, withShrink } from "@llm4ts/flow/Context";
23
- import { FlowAborted, Info, Plan, ReviewResult, asReadOnly, coderFromEnv, makeNodeWorkspace, makePlanStore, mergeReviewResults, nodePlainFileStore, openPack, resolveFlowInput, reviewFingerprint, runFlowMain, runNode, stage } from "@llm4ts/runner";
23
+ import { FlowAborted, Info, Plan, ReviewResult, asReadOnly, coderFromEnvironment, makeNodeWorkspace, makePlanStore, mergeReviewResults, nodePlainFileStore, openPack, resolveFlowInput, reviewFingerprint, runFlowMain, runNode, stage } from "@llm4ts/runner";
24
24
  import { structuredAndPublish } from "@llm4ts/flow/Flow";
25
25
  import { FlowEvents } from "@llm4ts/flow/FlowEvents";
26
26
  import { judgeAllPrograms } from "@llm4ts/flow/ProgramJudge";
@@ -145,7 +145,7 @@ const recordTruncations = (manifestPath, events) => Effect.gen(function* () {
145
145
  });
146
146
  const program = Effect.gen(function* () {
147
147
  const input = yield* resolveFlowInput("Review the modernization increment against its spec pack");
148
- const coder = coderFromEnv(process.env);
148
+ const coder = yield* coderFromEnvironment();
149
149
  const files = nodePlainFileStore;
150
150
  const planPath = join(input.workDir, ModDir, "plan.md");
151
151
  yield* runNode({
@@ -22,12 +22,13 @@ import { join } from "node:path";
22
22
  import * as Effect from "effect/Effect";
23
23
  import * as Schema from "effect/Schema";
24
24
  import { PersistenceError } from "@llm4ts/flow/FlowError";
25
- import { FlowAborted, Info, coderFromEnv, makeNodeWorkspace, nodePlainFileStore, openPack, parsePlan, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
25
+ import { FlowAborted, Info, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, parsePlan, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
26
26
  import { packageVersion } from "@llm4ts/flow/Package";
27
27
  import { Provenance, makeProvenanceStore } from "@llm4ts/flow/Provenance";
28
28
  import { matchingFiles } from "@llm4ts/flow/SpecChecks";
29
29
  import { requireApproval } from "@llm4ts/flow/Approval";
30
30
  import { Decisions, filterFeature, parseDecisions } from "@llm4ts/flow/Decisions";
31
+ import { settingValue } from "@llm4ts/flow/Settings";
31
32
  const ModDir = "docs/modernization";
32
33
  const skipped = new Set([".git", "target", "node_modules", "dist"]);
33
34
  const Seats = Schema.Record(Schema.String, Schema.String);
@@ -60,18 +61,19 @@ const copyFile = Effect.fn("modernize-seed.copyFile")(function* (source, target,
60
61
  });
61
62
  const program = Effect.gen(function* () {
62
63
  const input = yield* resolveFlowInput("Seed the target repository from the approved spec pack");
63
- const legacyRepo = process.env.LLM4TS_LEGACY_REPO?.trim();
64
+ const legacyRepo = settingValue("LLM4TS_LEGACY_REPO", process.env);
64
65
  const files = nodePlainFileStore;
66
+ const coder = yield* coderFromEnvironment();
65
67
  yield* runNode({
66
68
  workDir: input.workDir,
67
69
  workspace: input.workspace,
68
70
  userPrompt: input.prompt,
69
71
  // This phase makes no model call; the seat is wired only because the
70
72
  // runner composes one context shape for every flow.
71
- coder: coderFromEnv(process.env),
73
+ coder,
72
74
  environment: process.env
73
75
  }, (context) => Effect.gen(function* () {
74
- if (legacyRepo === undefined || legacyRepo.length === 0) {
76
+ if (legacyRepo === undefined) {
75
77
  return yield* FlowAborted.make({
76
78
  message: "set LLM4TS_LEGACY_REPO to the legacy repository holding the approved spec pack"
77
79
  });
@@ -202,15 +204,13 @@ const program = Effect.gen(function* () {
202
204
  try: () => Schema.decodeUnknownSync(Schema.fromJsonString(Seats))(seatsText),
203
205
  catch: () => undefined
204
206
  }).pipe(Effect.orElseSucceed(() => ({})));
205
- const approver = process.env.LLM4TS_APPROVER?.trim();
207
+ const approver = settingValue("LLM4TS_APPROVER", process.env);
206
208
  yield* provenance.write(join(input.workDir, ModDir, "provenance.json"), Provenance.make({
207
209
  schema: 1,
208
210
  pack: pack.name,
209
211
  llm4tsVersion: packageVersion,
210
212
  createdAt: new Date().toISOString(),
211
- ...(approver === undefined || approver.length === 0
212
- ? {}
213
- : { approvedBy: approver }),
213
+ ...(approver === undefined ? {} : { approvedBy: approver }),
214
214
  seats,
215
215
  specs,
216
216
  gateVerdicts: Object.fromEntries(Object.entries(verdicts).map(([path, hash]) => [
@@ -25,7 +25,7 @@ import { join } from "node:path";
25
25
  import * as Effect from "effect/Effect";
26
26
  import * as Schema from "effect/Schema";
27
27
  import { capped, withShrink } from "@llm4ts/flow/Context";
28
- import { FlowAborted, Info, asReadOnly, coderFromEnv, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
28
+ import { FlowAborted, Info, asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
29
29
  import { FlowEvents } from "@llm4ts/flow/FlowEvents";
30
30
  import { structuredAndPublish } from "@llm4ts/flow/Flow";
31
31
  import { loadBenchRecords, renderBenchReport } from "@llm4ts/flow/BenchReport";
@@ -36,6 +36,7 @@ import { freshGraph, graphCachePath, updateGraphCache } from "@llm4ts/flow/Graph
36
36
  import { WorklistAnswer, mergeWorklist, renderWorklistReport, verifyWorklistAnswer, worklistAnswerJsonSchema, worklistBatches, worklistOf, worklistPrompt } from "@llm4ts/flow/GraphWorklist";
37
37
  import { wholeView } from "@llm4ts/flow/GraphQuery";
38
38
  import { renderClusterDiagrams, renderEntryPaths, renderGraphDot } from "@llm4ts/flow/GraphRender";
39
+ import { settingValue } from "@llm4ts/flow/Settings";
39
40
  const ModDir = "docs/modernization";
40
41
  class NodeTriage extends Schema.Class("NodeTriage")({
41
42
  name: Schema.String,
@@ -124,13 +125,9 @@ const renderWavePlan = (outcome, graph, projection) => {
124
125
  ...(projection === undefined ? [] : [projection])
125
126
  ].join("\n") + "\n");
126
127
  };
127
- const refineDisabled = (environment) => {
128
- const value = environment.LLM4TS_GRAPH_REFINE?.trim().toLowerCase();
129
- return value === "off" || value === "0" || value === "false";
130
- };
131
128
  const program = Effect.gen(function* () {
132
129
  const input = yield* resolveFlowInput("Survey the legacy estate and propose a migration wave plan");
133
- const coder = coderFromEnv(process.env);
130
+ const coder = yield* coderFromEnvironment();
134
131
  yield* runNode({
135
132
  workDir: input.workDir,
136
133
  workspace: input.workspace,
@@ -171,7 +168,7 @@ const program = Effect.gen(function* () {
171
168
  return built;
172
169
  }));
173
170
  const graph = fresh.graph;
174
- const refined = yield* stage(context.events, "graph refine", refineDisabled(process.env)
171
+ const refined = yield* stage(context.events, "graph refine", !settingValue("LLM4TS_GRAPH_REFINE", process.env)
175
172
  ? context.events
176
173
  .publish(Info.make({ message: "LLM4TS_GRAPH_REFINE=off — regex graph ships unrefined" }))
177
174
  .pipe(Effect.as(graph))
@@ -26,7 +26,7 @@ import { renderEquivReport, VectorVerdict } from "@llm4ts/flow/EquivReport";
26
26
  import { PlanParseError } from "@llm4ts/flow/FlowError";
27
27
  import { structuredAndPublish } from "@llm4ts/flow/Flow";
28
28
  import { FlowEvents } from "@llm4ts/flow/FlowEvents";
29
- import { FlowAborted, Info, Plan, asReadOnly, coderFromEnv, makeNodeWorkspace, makePlanStore, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
29
+ import { FlowAborted, Info, Plan, asReadOnly, coderFromEnvironment, makeNodeWorkspace, makePlanStore, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
30
30
  import { Task } from "@llm4ts/flow/Plan";
31
31
  import { Provenance, makeProvenanceStore } from "@llm4ts/flow/Provenance";
32
32
  import { matchingFiles } from "@llm4ts/flow/SpecChecks";
@@ -237,7 +237,7 @@ const specPrograms = Effect.fn("modernize-verify.specPrograms")(function* (targe
237
237
  });
238
238
  const program = Effect.gen(function* () {
239
239
  const input = yield* resolveFlowInput("Prove the implementation equivalent to its spec pack");
240
- const coder = coderFromEnv(process.env);
240
+ const coder = yield* coderFromEnvironment();
241
241
  const files = nodePlainFileStore;
242
242
  const planPath = join(input.workDir, ModDir, "plan.md");
243
243
  const vectorsDir = join(input.workDir, ModDir, "vectors");
@@ -35,7 +35,7 @@ import { FlowEvents, Info } from "@llm4ts/flow/FlowEvents";
35
35
  import { capped, withShrink } from "@llm4ts/flow/Context";
36
36
  import { withDraftApproval } from "@llm4ts/flow/Approval";
37
37
  import { legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
38
- import { asReadOnly, asToolless, coderFromEnv, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, ScriptUsage, stage } from "@llm4ts/runner";
38
+ import { asReadOnly, asToolless, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, ScriptUsage, stage } from "@llm4ts/runner";
39
39
  import { ConventionSection, conventionPassAsk, conventionSectionJsonSchema, forkPackMarkdown, forkedReadme, GroundingSelection, groundingSelectionAsk, groundingSelectionJsonSchema, parseFeedback, parseForkAs, parseTargetKind, passesForTargetKind, provenanceMarkdown, readGroundingFiles, selectionsForCategory, targetConventionsReviewer, validSelections } from "./lib/pack-fork.js";
40
40
  const forkPackFiles = Effect.fn("flows/pack-fork.forkPackFiles")(function* (source, destinationAbs, files) {
41
41
  // `source.dir` is "." for an absolute-path pack reference (Packs.ts's
@@ -81,7 +81,8 @@ const program = Effect.gen(function* () {
81
81
  const targetKind = yield* parseTargetKind(process.env);
82
82
  const forkAs = yield* parseForkAs(process.env);
83
83
  const feedback = parseFeedback(process.env);
84
- const coder = asReadOnly(coderFromEnv(process.env));
84
+ const selected = yield* coderFromEnvironment();
85
+ const coder = asReadOnly(selected);
85
86
  const files = nodePlainFileStore;
86
87
  yield* runNode({
87
88
  workDir: input.workDir,
@@ -95,7 +96,7 @@ const program = Effect.gen(function* () {
95
96
  // ("empty response … no text to parse as structured output"). A
96
97
  // read-only coder still offers a read tool over some connectors
97
98
  // (pi in particular); asToolless offers none.
98
- reasoning: asToolless(coderFromEnv(process.env)),
99
+ reasoning: asToolless(selected),
99
100
  environment: process.env
100
101
  }, (context) => Effect.gen(function* () {
101
102
  const repo = yield* makeNodeWorkspace(input.workDir, workspaceLimitsFromEnv(process.env, legacySourceWorkspaceLimits));
@@ -16,15 +16,16 @@ import { groupDiagnostics, parseDiagnostics, renderDiagnostics } from "@llm4ts/f
16
16
  import { FlowAborted, ProcessError, Stalled } from "@llm4ts/flow/FlowError";
17
17
  import { Info } from "@llm4ts/flow/FlowEvents";
18
18
  import { adversarialReviewer, reviewAndFixLoop } from "@llm4ts/flow/Review";
19
+ import { settingValue } from "@llm4ts/flow/Settings";
19
20
  import { runQueue } from "@llm4ts/flow/WorkQueue";
20
- import { asReadOnly, coderFromEnv, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
21
+ import { asReadOnly, coderFromEnvironment, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
21
22
  import { asPortingPack, compileFixerSystem, portEnv, portStateDir } from "./lib/port.js";
22
23
  const program = Effect.gen(function* () {
23
24
  const input = yield* resolveFlowInput("Fix every compiler diagnostic, one unit at a time");
24
- const coder = coderFromEnv(process.env);
25
+ const coder = yield* coderFromEnvironment();
25
26
  const files = nodePlainFileStore;
26
27
  const knobs = portEnv(process.env);
27
- const maxRounds = Math.max(1, Number.parseInt(process.env.LLM4TS_PORT_COMPILE_ROUNDS ?? "6", 10) || 6);
28
+ const maxRounds = settingValue("LLM4TS_PORT_COMPILE_ROUNDS", process.env);
28
29
  const stateDir = portStateDir(input.workDir);
29
30
  yield* runNode({
30
31
  workDir: input.workDir,
@@ -22,7 +22,7 @@ import { Info } from "@llm4ts/flow/FlowEvents";
22
22
  import { asAddedFileDiff, batchesOf, ledgerRowsFor, portStatusIn, renderPilotReport } from "@llm4ts/flow/Port";
23
23
  import { adversarialReviewer, reviewAndFixLoop } from "@llm4ts/flow/Review";
24
24
  import { runQueue } from "@llm4ts/flow/WorkQueue";
25
- import { asReadOnly, coderFromEnv, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
25
+ import { asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
26
26
  import { asPortingPack, implementerPrompt, implementerSystem, ledgerPath, portEnv, readLedgerRows, portFixerSystem, portManifest, portStateDir } from "./lib/port.js";
27
27
  const renderReport = (outcomes, total, pending) => {
28
28
  const done = outcomes.filter((outcome) => outcome.status === "done");
@@ -50,7 +50,7 @@ const renderReport = (outcomes, total, pending) => {
50
50
  };
51
51
  const program = Effect.gen(function* () {
52
52
  const input = yield* resolveFlowInput("Port every source file the pack matches to its target");
53
- const coder = coderFromEnv(process.env);
53
+ const coder = yield* coderFromEnvironment();
54
54
  const files = nodePlainFileStore;
55
55
  const knobs = portEnv(process.env);
56
56
  const stateDir = portStateDir(input.workDir);
@@ -17,8 +17,9 @@ import { cap } from "@llm4ts/flow/Context";
17
17
  import { Info } from "@llm4ts/flow/FlowEvents";
18
18
  import { GuideFinding, defaultAuditDimensions, renderGuideAudit, standsAfterRefutes } from "@llm4ts/flow/Port";
19
19
  import { AppliedMarkerPrefix, applyRuleEdit, retroApprovalOf } from "@llm4ts/flow/Retro";
20
- import { asReadOnly, coderFromEnv, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
20
+ import { asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
21
21
  import { structuredAndPublish } from "@llm4ts/flow/Flow";
22
+ import { settingValue } from "@llm4ts/flow/Settings";
22
23
  import { asPortingPack, implementerPrompt, implementerSystem, nativeImplementerSystem, portEnv, portManifest, portStateDir } from "./lib/port.js";
23
24
  class Findings extends Schema.Class("Findings")({
24
25
  findings: Schema.Array(GuideFinding)
@@ -70,11 +71,11 @@ const encodeAudit = Schema.encodeSync(Schema.fromJsonString(AuditRecord));
70
71
  const decodeAudit = Schema.decodeUnknownOption(Schema.fromJsonString(AuditRecord));
71
72
  const program = Effect.gen(function* () {
72
73
  const input = yield* resolveFlowInput("Audit the porting rulebook against sample sources");
73
- const coder = coderFromEnv(process.env);
74
+ const coder = yield* coderFromEnvironment();
74
75
  const files = nodePlainFileStore;
75
76
  const knobs = portEnv(process.env);
76
- const sampleSize = Math.max(1, Number.parseInt(process.env.LLM4TS_PORT_GUIDE_SAMPLE ?? "3", 10) || 3);
77
- const trialOn = process.env.LLM4TS_PORT_GUIDE_TRIAL?.trim().toLowerCase() !== "off";
77
+ const sampleSize = settingValue("LLM4TS_PORT_GUIDE_SAMPLE", process.env);
78
+ const trialOn = settingValue("LLM4TS_PORT_GUIDE_TRIAL", process.env);
78
79
  const stateDir = portStateDir(input.workDir);
79
80
  const reportPath = join(stateDir, "guide-audit.md");
80
81
  const recordPath = join(stateDir, "guide-audit.json");
@@ -17,7 +17,7 @@ import { FlowAborted } from "@llm4ts/flow/FlowError";
17
17
  import { Info } from "@llm4ts/flow/FlowEvents";
18
18
  import { LedgerRow, renderLedger, standsAfterRefutes, unitsIn } from "@llm4ts/flow/Port";
19
19
  import { runQueue } from "@llm4ts/flow/WorkQueue";
20
- import { asReadOnly, coderFromEnv, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
20
+ import { asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
21
21
  import { structuredAndPublish } from "@llm4ts/flow/Flow";
22
22
  import { asPortingPack, ledgerPath, portEnv, portManifest } from "./lib/port.js";
23
23
  class Classified extends Schema.Class("Classified")({
@@ -65,7 +65,7 @@ const refuteJson = {
65
65
  };
66
66
  const program = Effect.gen(function* () {
67
67
  const input = yield* resolveFlowInput("Classify every unit the pack's ledger regex names");
68
- const coder = coderFromEnv(process.env);
68
+ const coder = yield* coderFromEnvironment();
69
69
  const files = nodePlainFileStore;
70
70
  const knobs = portEnv(process.env);
71
71
  yield* runNode({
@@ -20,8 +20,9 @@ import { Info } from "@llm4ts/flow/FlowEvents";
20
20
  import { diffVerdict, renderDiag, renderDifferentialReport } from "@llm4ts/flow/Port";
21
21
  import { ReviewResult, adversarialReviewer, lintCommand, reviewAndFixLoop } from "@llm4ts/flow/Review";
22
22
  import { matchingFiles } from "@llm4ts/flow/SpecChecks";
23
+ import { settingValue } from "@llm4ts/flow/Settings";
23
24
  import { runQueue } from "@llm4ts/flow/WorkQueue";
24
- import { asReadOnly, coderFromEnv, makeNodeWorkspace, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
25
+ import { asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
25
26
  import { asPortingPack, compileFixerSystem, portEnv, portStateDir } from "./lib/port.js";
26
27
  const Baseline = Schema.fromJsonString(ReviewResult);
27
28
  const encodeBaseline = Schema.encodeSync(Baseline);
@@ -29,11 +30,11 @@ const decodeBaseline = Schema.decodeUnknownOption(Baseline);
29
30
  const slug = (path) => path.replace(/[^a-z0-9]+/giu, "-").replace(/^-|-$/gu, "");
30
31
  const program = Effect.gen(function* () {
31
32
  const input = yield* resolveFlowInput("Run every test file on the legacy and the target build, fix what diverges");
32
- const coder = coderFromEnv(process.env);
33
+ const coder = yield* coderFromEnvironment();
33
34
  const files = nodePlainFileStore;
34
35
  const knobs = portEnv(process.env);
35
- const maxRounds = Math.max(1, Number.parseInt(process.env.LLM4TS_PORT_TEST_ROUNDS ?? "4", 10) || 4);
36
- const tailChars = Math.max(500, Number.parseInt(process.env.LLM4TS_GATE_TAIL_CHARS ?? "4000", 10) || 4000);
36
+ const maxRounds = settingValue("LLM4TS_PORT_TEST_ROUNDS", process.env);
37
+ const tailChars = Math.max(500, settingValue("LLM4TS_GATE_TAIL_CHARS", process.env));
37
38
  const stateDir = join(portStateDir(input.workDir), "tests");
38
39
  yield* runNode({
39
40
  workDir: input.workDir,
@@ -35,7 +35,7 @@ import { budget } from "@llm4ts/flow/Context";
35
35
  import { judgmentOf } from "@llm4ts/flow/Judgment";
36
36
  import { parseMeeting } from "@llm4ts/flow/Roundtable";
37
37
  import { ScriptUsage, asToolless, nodePlainFileStore, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
38
- import { reasonerFromEnvironment } from "./lib/epic-stories.js";
38
+ import { reasonerFromEnvironment } from "@llm4ts/runner/Connectors";
39
39
  import { describePersonas, ejectPersonas, meetingDir, meetingSlug, meetingsDir, parseRoundtableArgs, personasDir, resolvePersonas, runRoundtable } from "./lib/roundtable.js";
40
40
  import { defaultAttendees } from "./lib/roundtable-personas.js";
41
41
  const files = nodePlainFileStore;
@@ -125,7 +125,7 @@ const program = Effect.gen(function* () {
125
125
  const personas = yield* resolvePersonas(custom, attendeeNames);
126
126
  // Relative to the repository: the standards usually live beside the code.
127
127
  const docs = yield* contextDocs(flags.context === undefined ? undefined : resolve(workDir, flags.context));
128
- const reasoning = asToolless(yield* reasonerFromEnvironment(process.env));
128
+ const reasoning = asToolless(yield* reasonerFromEnvironment());
129
129
  const outcome = yield* runNode({
130
130
  workDir,
131
131
  workspace: given.workspace,
package/flows/sdd.js CHANGED
@@ -2,10 +2,11 @@
2
2
  import { join } from "node:path";
3
3
  import * as Effect from "effect/Effect";
4
4
  import { withContract } from "@llm4ts/flow/AutonomyContract";
5
- import { FlowAborted, Plan, asReadOnly, coderFromEnv, defaultPlanInstructions, defaultPlanPath, implementTaskLoop, lintCommand, makeChat, makePlanStore, minimalReviewers, nodePlainFileStore, nodeProcessExecutor, planFrom, resolveFlowInput, reviewAndFixLoop, runFlowMain, runNode, stage, withModel, writeBrief } from "@llm4ts/runner";
5
+ import { settingGiven, settingValue } from "@llm4ts/flow/Settings";
6
+ import { FlowAborted, Plan, asReadOnly, coderFromEnvironment, defaultPlanInstructions, defaultPlanPath, implementTaskLoop, lintCommand, makeChat, makePlanStore, minimalReviewers, nodePlainFileStore, nodeProcessExecutor, planFrom, resolveFlowInput, reviewAndFixLoop, runFlowMain, runNode, stage, withModel, writeBrief } from "@llm4ts/runner";
6
7
  import { gemini } from "@llm4ts/runner/Connectors";
7
- const proModel = process.env.LLM4TS_REASONING_MODEL ?? "gemini-3-pro-preview";
8
- const flashModel = process.env.LLM4TS_CODER_MODEL ?? "gemini-2.5-flash";
8
+ const proModel = settingValue("LLM4TS_REASONING_MODEL", process.env) ?? "gemini-3-pro-preview";
9
+ const flashModel = settingValue("LLM4TS_CODER_MODEL", process.env) ?? "gemini-2.5-flash";
9
10
  const specInstructions = [
10
11
  "Turn the change request into a precise repository specification with context, goals,",
11
12
  "non-goals, and a numbered list of testable Given/When/Then acceptance criteria.",
@@ -26,16 +27,10 @@ const verificationFailure = (result) => FlowAborted.make({
26
27
  });
27
28
  const program = Effect.gen(function* () {
28
29
  const input = yield* resolveFlowInput("Add due dates, mark overdue items in list output, and show items due today.");
29
- const explicitCoder = process.env.LLM4TS_CODER?.trim();
30
- const coder = explicitCoder === undefined || explicitCoder.length === 0
31
- ? withModel(gemini, flashModel)
32
- : coderFromEnv(process.env);
33
- const reasoning = explicitCoder === undefined || explicitCoder.length === 0
34
- ? asReadOnly(withModel(gemini, proModel))
35
- : asReadOnly(coder);
36
- const reviewer = explicitCoder === undefined || explicitCoder.length === 0
37
- ? asReadOnly(withModel(gemini, flashModel))
38
- : asReadOnly(coder);
30
+ const coderNamed = settingGiven("LLM4TS_CODER", process.env)._tag !== "Unset";
31
+ const coder = yield* coderFromEnvironment(process.env, withModel(gemini, flashModel));
32
+ const reasoning = coderNamed ? asReadOnly(coder) : asReadOnly(withModel(gemini, proModel));
33
+ const reviewer = coderNamed ? asReadOnly(coder) : asReadOnly(withModel(gemini, flashModel));
39
34
  const store = makePlanStore(nodePlainFileStore);
40
35
  const planPath = join(input.workDir, defaultPlanPath(input.prompt));
41
36
  yield* runNode({
@@ -38,8 +38,8 @@ import { parseNote } from "@llm4ts/flow/Memory";
38
38
  import { parseReviewer, Reviewer } from "@llm4ts/flow/Reviewer";
39
39
  import { parsePlan } from "@llm4ts/flow/Taskforce";
40
40
  import { ScriptUsage, asReadOnly, asToolless, nodePlainFileStore, nodeProcessExecutor, resolveFlowInput, runFlowMain, runNode, stage, withTurnLimit } from "@llm4ts/runner";
41
- import { coderFromEnvironment } from "@llm4ts/runner/Connectors";
42
- import { reasonerFromEnvironment, worktreeRootFor } from "./lib/epic-stories.js";
41
+ import { claude, seatsFromEnvironment } from "@llm4ts/runner/Connectors";
42
+ import { worktreeRootFor } from "./lib/epic-stories.js";
43
43
  import { bundledLenses, commandsPath, declaredCommands, defaultAgents, describeCast, ejectPersonas, lensesDir, parseTaskforceArgs, personasDir, resolveCast, runDir, runSlug, runsDir, runTaskforce } from "./lib/taskforce.js";
44
44
  const files = nodePlainFileStore;
45
45
  const namesIn = (dir, suffix) => Effect.tryPromise(() => readdir(dir, { withFileTypes: true })).pipe(Effect.map((entries) => entries
@@ -144,8 +144,9 @@ const program = Effect.gen(function* () {
144
144
  ? bundledLenses.map((lens) => Reviewer.make(lens))
145
145
  : Object.entries(lensCards).map(([name, text]) => parseReviewer(name, text));
146
146
  const allowedCommand = declaredCommands(yield* files.read(join(workDir, "package.json")), yield* files.read(commandsPath(workDir)));
147
- const reasoner = yield* reasonerFromEnvironment(process.env);
148
- const coder = withTurnLimit(yield* coderFromEnvironment(process.env), flags.turns ?? 30);
147
+ const seats = yield* seatsFromEnvironment({ reasoner: claude });
148
+ const reasoner = seats.reasoning;
149
+ const coder = withTurnLimit(seats.coder, flags.turns ?? 30);
149
150
  const worktreeRoot = worktreeRootFor(workDir, `taskforce-${runId}`, process.env);
150
151
  const outcome = yield* runNode({
151
152
  workDir,
@@ -23,7 +23,8 @@ target) the [workshop runbook](fixtures/demo-bank/RUNBOOK.md) rehearses on.
23
23
 
24
24
  ```sh
25
25
  llm4ts run modernize-pack-check --pack j2ee-nextjs-spa --repo /path/to/legacy-estate
26
- LLM4TS_LEGACY_REPO=/path/to/legacy-estate llm4ts run convert-page --pack j2ee-nextjs-spa --repo /path/to/nextjs accountOverview
26
+ llm4ts config set --repo /path/to/nextjs LLM4TS_LEGACY_REPO=/path/to/legacy-estate # once per target
27
+ llm4ts run convert-page --pack j2ee-nextjs-spa --repo /path/to/nextjs accountOverview
27
28
  ```
28
29
 
29
30
  The convert flows default to `j2ee-nextjs-spa`; `kits/test/packs.test.ts`
@@ -43,16 +43,33 @@ Node itself (one download, then offline), or wrap the pack's gate commands
43
43
  in a version manager (`fnm exec --using=.nvmrc pnpm lint` works as a gate
44
44
  line, since gates are plain argv). `LLM4TS_NODE_CHECK=off` skips the check.
45
45
 
46
- Timing bounds for the day (set in the environment you run flows from):
46
+ Timing bounds for the day, written once to each repository's settings file
47
+ (`.llm4ts/config.env`, llm4ts 3.3.0 or newer), so no command below needs a
48
+ prefix. `reset-demo.mjs` recreates both repositories: run these two commands
49
+ again after every reset.
47
50
 
48
51
  ```bash
49
- export LLM4TS_PACK=j2ee-nextjs-spa
50
- export LLM4TS_LEGACY_REPO=~/demo/legacy-j2ee
51
- export LLM4TS_JUDGE_ROUNDS=1 # bound judge feedback to one round on stage
52
- export LLM4TS_MAX_CLOSURE_FILES=8 # bound legacy evidence per page
53
- export LLM4TS_EXTRACT_CONCURRENCY=3 # pages extracted and judged at once (measure in rehearsal)
52
+ # the legacy estate: survey, extract, refine
53
+ llm4ts config set --repo ~/demo/legacy-j2ee \
54
+ LLM4TS_PACK=j2ee-nextjs-spa \
55
+ LLM4TS_JUDGE_ROUNDS=1 \
56
+ LLM4TS_MAX_CLOSURE_FILES=8 \
57
+ LLM4TS_EXTRACT_CONCURRENCY=3
58
+
59
+ # the target: convert-page, convert-all
60
+ llm4ts config set --repo ~/demo/nextjs \
61
+ LLM4TS_PACK=j2ee-nextjs-spa \
62
+ LLM4TS_LEGACY_REPO=~/demo/legacy-j2ee \
63
+ LLM4TS_JUDGE_ROUNDS=1 \
64
+ LLM4TS_MAX_CLOSURE_FILES=8
54
65
  ```
55
66
 
67
+ `LLM4TS_JUDGE_ROUNDS=1` bounds judge feedback to one round on stage,
68
+ `LLM4TS_MAX_CLOSURE_FILES=8` bounds the legacy evidence per page, and
69
+ `LLM4TS_EXTRACT_CONCURRENCY=3` is the pages extracted and judged at once
70
+ (measure in rehearsal). `llm4ts config show --repo ~/demo/nextjs` prints
71
+ what is in effect and where each value comes from.
72
+
56
73
  `LLM4TS_PACK` is the one that matters for Act 1: it is what makes the survey
57
74
  reason in J2EE terms (web.xml mappings, includes, forwards, ajax targets)
58
75
  instead of the default COBOL pack's. It is a bare pack name, resolved across
@@ -77,8 +94,8 @@ entered. Keep these two in your back pocket for a real estate with an
77
94
  unusual layout, never set them on stage without a reason:
78
95
 
79
96
  ```bash
80
- export LLM4TS_EXCLUDE_DIRS=.git,node_modules,target,generated # replaces the pruned list
81
- export LLM4TS_MAX_DISCOVER_RESULTS=50000 # default 20000 for estates
97
+ llm4ts config set --repo <estate> LLM4TS_EXCLUDE_DIRS=.git,node_modules,target,generated # replaces the pruned list
98
+ llm4ts config set --repo <estate> LLM4TS_MAX_DISCOVER_RESULTS=50000 # default 20000 for estates
82
99
  ```
83
100
 
84
101
  ## Act 1 — breadth: survey and extract (~duration: measure in rehearsal)
@@ -114,7 +131,7 @@ audience, flip `- [x] Approved` (the human gate is the point — banks like
114
131
  this beat).
115
132
 
116
133
  ```bash
117
- LLM4TS_WAVE=wave-1 llm4ts run modernize-extract --repo ~/demo/legacy-j2ee
134
+ llm4ts run modernize-extract --repo ~/demo/legacy-j2ee --set LLM4TS_WAVE=wave-1
118
135
  ```
119
136
 
120
137
  Act 2 opens with `accountOverview`, and the survey's plan puts that page in
@@ -123,11 +140,11 @@ dashboard, profile, settings, messages, help), so extract wave-2 as well
123
140
  before Act 2 — it is one page plus its servlet and DTO, minutes not tens of
124
141
  minutes. Each wave gates only its own units; the pages of later waves are
125
142
  listed as "not gating" — say so when the line scrolls past, and mention the
126
- closing run without `LLM4TS_WAVE` that enforces coverage over the whole
143
+ closing run without `--set LLM4TS_WAVE` that enforces coverage over the whole
127
144
  estate once every wave is in.
128
145
 
129
146
  ```bash
130
- LLM4TS_WAVE=wave-2 llm4ts run modernize-extract --repo ~/demo/legacy-j2ee
147
+ llm4ts run modernize-extract --repo ~/demo/legacy-j2ee --set LLM4TS_WAVE=wave-2
131
148
  ```
132
149
 
133
150
  ### Refine — the pack becomes what the client wants built (optional beat)
@@ -216,8 +233,9 @@ and the lessons the review phase appends, in one directory they own.
216
233
  Optional ADO mirror (decide before the workshop, never set it up live):
217
234
 
218
235
  ```bash
219
- export LLM4TS_ADO_ORG_URL=https://dev.azure.com/<org>
220
- export LLM4TS_ADO_PROJECT=<project>
236
+ llm4ts config set --repo ~/demo/nextjs \
237
+ LLM4TS_ADO_ORG_URL=https://dev.azure.com/<org> \
238
+ LLM4TS_ADO_PROJECT=<project>
221
239
  # Auth belongs to the az CLI itself: `az devops login` beforehand (or
222
240
  # AZURE_DEVOPS_EXT_PAT in the shell) — llm4ts never sees the PAT.
223
241
  ```
@@ -233,7 +251,7 @@ export LLM4TS_ADO_PROJECT=<project>
233
251
  | Judge keeps rejecting | `LLM4TS_JUDGE_ROUNDS=1` already bounds it; the failure lands on the board with its reason — governance beat, not a crash. |
234
252
  | `⟳ flaky … (fresh retry)` lines scrolling past — Gemini CLI's `Loop detected` / `A potential loop was detected`, an empty response, a malformed tool call | Nothing to do: the seat restarts the turn in a fresh process, up to 6 times, and the flow carries on. Say it out loud: the turn was lost, the quota and the prompt were not. Only if all 6 fail does the stage abort — rerun, it resumes. |
235
253
  | `⟳ structured output (repair retry)` lines — `Failed to parse response as structured output` | Nothing to do: the model gets its own parse failure quoted back and is asked for the JSON alone, up to 2 more times. If the third reply still does not parse the stage aborts with the reason — rerun resumes; a schema the model can never satisfy is a pack bug, not a stage bug. |
236
- | `pack 'j2ee-nextjs-spa' not found: no kit ships it` | The shell predates kits (0.18.0) or `LLM4TS_PACK` was overwritten with a path: `llm4ts kits` shows what it sees; `npm i -g @llm4ts/shell@latest`; re-export the bare name. Never happens after a green Act 0. |
254
+ | `pack 'j2ee-nextjs-spa' not found: no kit ships it` | The shell predates kits (0.18.0) or `LLM4TS_PACK` was overwritten with a path: `llm4ts kits` shows what it sees; `npm i -g @llm4ts/shell@latest`; set the bare name again with `llm4ts config set --repo <repo> LLM4TS_PACK=j2ee-nextjs-spa`. Never happens after a green Act 0. |
237
255
  | Survey aborts with `discovery stopped at N matching files` (a client's real estate, never the fixture) | The abort names the knobs: tighten the pack's `sources:`/`exclude:`, prune more with `LLM4TS_EXCLUDE_DIRS=.git,node_modules,generated`, or raise `LLM4TS_MAX_DISCOVER_RESULTS`. Rerun. |
238
256
  | Everything is on fire | `node kits/j2ee-nextjs/fixtures/demo-bank/reset-demo.mjs ~/demo` and restart the act; Act 1 re-runs in minutes. |
239
257
 
@@ -37,4 +37,6 @@ try {
37
37
  }
38
38
 
39
39
  console.log(`\ndemo estate ready:\n legacy: ${legacy}\n target: ${target}`)
40
- console.log(`next: export LLM4TS_LEGACY_REPO=${legacy} (see RUNBOOK.md Act 0)`)
40
+ console.log(
41
+ `next: llm4ts config set --repo ${target} LLM4TS_LEGACY_REPO=${legacy} (see RUNBOOK.md Act 0)`
42
+ )
@@ -23,11 +23,12 @@ import * as Effect from "effect/Effect";
23
23
  import { AdoConfig, makeAzureDevOpsTool } from "@llm4ts/flow/AzureDevOpsTool";
24
24
  import { BoardItem, composeBoardSync, makeAdoBoardSync, makeLocalBoardSync } from "@llm4ts/flow/BoardSync";
25
25
  import { describeFlowError } from "@llm4ts/flow/FlowError";
26
- import { Info, asReadOnly, coderFromEnv, nodePlainFileStore, nodeProcessExecutor, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
26
+ import { Info, asReadOnly, coderFromEnvironment, nodePlainFileStore, nodeProcessExecutor, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
27
27
  import { conversionInventory, convertFeature, convertPage, featureInventory, migrationReport, setupConversion } from "./lib/convert.js";
28
+ import { settingValue } from "@llm4ts/flow/Settings";
28
29
  const program = Effect.gen(function* () {
29
30
  const input = yield* resolveFlowInput("Convert the legacy estate into the destination SPA");
30
- const coder = coderFromEnv(process.env);
31
+ const coder = yield* coderFromEnvironment();
31
32
  yield* runNode({
32
33
  workDir: input.workDir,
33
34
  workspace: input.workspace,
@@ -43,15 +44,15 @@ const program = Effect.gen(function* () {
43
44
  const boards = [
44
45
  makeLocalBoardSync(files, join(input.workDir, ".llm4ts", "convert"), boardTitle)
45
46
  ];
46
- const orgUrl = process.env.LLM4TS_ADO_ORG_URL?.trim();
47
- const project = process.env.LLM4TS_ADO_PROJECT?.trim();
48
- if (orgUrl !== undefined && orgUrl.length > 0 && project !== undefined) {
47
+ const orgUrl = settingValue("LLM4TS_ADO_ORG_URL", process.env);
48
+ const project = settingValue("LLM4TS_ADO_PROJECT", process.env);
49
+ if (orgUrl !== undefined && project !== undefined) {
49
50
  // az CLI owns the credentials (`az devops login` / AZURE_DEVOPS_EXT_PAT);
50
51
  // no PAT ever passes through llm4ts configuration.
51
52
  const ado = makeAzureDevOpsTool(AdoConfig.make({
52
53
  orgUrl,
53
54
  project,
54
- repository: process.env.LLM4TS_ADO_REPO?.trim() || project
55
+ repository: settingValue("LLM4TS_ADO_REPO", process.env) ?? project
55
56
  }), nodeProcessExecutor, input.workDir, context.events);
56
57
  boards.push(yield* makeAdoBoardSync(ado, boardTitle));
57
58
  yield* context.events.publish(Info.make({ message: `ADO board mirror enabled: ${orgUrl}/${project}` }));
@@ -108,7 +109,7 @@ const program = Effect.gen(function* () {
108
109
  ...(item.detail === undefined ? {} : { detail: item.detail })
109
110
  }))));
110
111
  const baseBranch = yield* context.git.currentBranch;
111
- const failFast = process.env.LLM4TS_FAIL_FAST === "1";
112
+ const failFast = settingValue("LLM4TS_FAIL_FAST", process.env);
112
113
  for (const item of items) {
113
114
  const snapshot = yield* board.snapshot;
114
115
  const known = snapshot.items.find((candidate) => candidate.id === item.id);
@@ -14,12 +14,12 @@
14
14
  // and tests per page. Gates and judge as convert-page, plus the feature
15
15
  // judged against its contract of record. Branch `convert/<feature>`, no PR.
16
16
  import * as Effect from "effect/Effect";
17
- import { FlowAborted, Info, asReadOnly, coderFromEnv, resolveFlowInput, runFlowMain, runNode } from "@llm4ts/runner";
17
+ import { FlowAborted, Info, asReadOnly, coderFromEnvironment, resolveFlowInput, runFlowMain, runNode } from "@llm4ts/runner";
18
18
  import { convertFeature, setupConversion } from "./lib/convert.js";
19
19
  const program = Effect.gen(function* () {
20
20
  const input = yield* resolveFlowInput("Convert one domain feature into the destination SPA");
21
21
  const feature = input.prompt.trim().split(/\s+/)[0] ?? "";
22
- const coder = coderFromEnv(process.env);
22
+ const coder = yield* coderFromEnvironment();
23
23
  yield* runNode({
24
24
  workDir: input.workDir,
25
25
  workspace: input.workspace,