spec-controller 0.1.0-alpha.5 → 0.1.0-alpha.51

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 (122) hide show
  1. package/README.md +34 -6
  2. package/dist/cli-allocate/cli.d.ts +2 -0
  3. package/dist/cli-allocate/cli.d.ts.map +1 -0
  4. package/dist/cli-allocate/cli.js +60 -0
  5. package/dist/cli-allocate/cli.js.map +1 -0
  6. package/dist/cli-allocate/readHistory.d.ts +15 -0
  7. package/dist/cli-allocate/readHistory.d.ts.map +1 -0
  8. package/dist/cli-allocate/readHistory.js +108 -0
  9. package/dist/cli-allocate/readHistory.js.map +1 -0
  10. package/dist/cli-allocate/readParts.d.ts +2 -0
  11. package/dist/cli-allocate/readParts.d.ts.map +1 -0
  12. package/dist/cli-allocate/readParts.js +22 -0
  13. package/dist/cli-allocate/readParts.js.map +1 -0
  14. package/dist/cli-allocate/readTree.d.ts +5 -0
  15. package/dist/cli-allocate/readTree.d.ts.map +1 -0
  16. package/dist/cli-allocate/readTree.js +74 -0
  17. package/dist/cli-allocate/readTree.js.map +1 -0
  18. package/dist/cli-allocate/refStore.d.ts +2 -0
  19. package/dist/cli-allocate/refStore.d.ts.map +1 -0
  20. package/dist/cli-allocate/refStore.js +34 -0
  21. package/dist/cli-allocate/refStore.js.map +1 -0
  22. package/dist/cli-allocate/request.d.ts +9 -0
  23. package/dist/cli-allocate/request.d.ts.map +1 -0
  24. package/dist/cli-allocate/request.js +22 -0
  25. package/dist/cli-allocate/request.js.map +1 -0
  26. package/dist/cli-allocate/stderr.d.ts +7 -0
  27. package/dist/cli-allocate/stderr.d.ts.map +1 -0
  28. package/dist/cli-allocate/stderr.js +26 -0
  29. package/dist/cli-allocate/stderr.js.map +1 -0
  30. package/dist/cli-allocate/unreadable.d.ts +11 -0
  31. package/dist/cli-allocate/unreadable.d.ts.map +1 -0
  32. package/dist/cli-allocate/unreadable.js +30 -0
  33. package/dist/cli-allocate/unreadable.js.map +1 -0
  34. package/dist/cli-args.d.ts +12 -70
  35. package/dist/cli-args.d.ts.map +1 -1
  36. package/dist/cli-args.js +158 -81
  37. package/dist/cli-args.js.map +1 -1
  38. package/dist/cli-balance/cli.d.ts +1 -81
  39. package/dist/cli-balance/cli.d.ts.map +1 -1
  40. package/dist/cli-balance/cli.js +71 -357
  41. package/dist/cli-balance/cli.js.map +1 -1
  42. package/dist/cli-balance/emit/format.d.ts +16 -38
  43. package/dist/cli-balance/emit/format.d.ts.map +1 -1
  44. package/dist/cli-balance/emit/format.js +31 -58
  45. package/dist/cli-balance/emit/format.js.map +1 -1
  46. package/dist/cli-balance/emit/writer.d.ts +2 -32
  47. package/dist/cli-balance/emit/writer.d.ts.map +1 -1
  48. package/dist/cli-balance/emit/writer.js +50 -37
  49. package/dist/cli-balance/emit/writer.js.map +1 -1
  50. package/dist/cli-balance/exitStatus.d.ts +2 -0
  51. package/dist/cli-balance/exitStatus.d.ts.map +1 -0
  52. package/dist/cli-balance/exitStatus.js +5 -0
  53. package/dist/cli-balance/exitStatus.js.map +1 -0
  54. package/dist/cli-balance/inputsRead.d.ts +11 -0
  55. package/dist/cli-balance/inputsRead.d.ts.map +1 -0
  56. package/dist/cli-balance/inputsRead.js +53 -0
  57. package/dist/cli-balance/inputsRead.js.map +1 -0
  58. package/dist/cli-balance/reRender.d.ts +8 -0
  59. package/dist/cli-balance/reRender.d.ts.map +1 -0
  60. package/dist/cli-balance/reRender.js +21 -0
  61. package/dist/cli-balance/reRender.js.map +1 -0
  62. package/dist/cli-balance/unreadableInputs.d.ts +14 -0
  63. package/dist/cli-balance/unreadableInputs.d.ts.map +1 -0
  64. package/dist/cli-balance/unreadableInputs.js +80 -0
  65. package/dist/cli-balance/unreadableInputs.js.map +1 -0
  66. package/dist/cli-registry.d.ts +12 -70
  67. package/dist/cli-registry.d.ts.map +1 -1
  68. package/dist/cli-registry.js +37 -97
  69. package/dist/cli-registry.js.map +1 -1
  70. package/dist/cli.d.ts +0 -21
  71. package/dist/cli.d.ts.map +1 -1
  72. package/dist/cli.js +62 -55
  73. package/dist/cli.js.map +1 -1
  74. package/dist/deferralTags.d.ts +0 -14
  75. package/dist/deferralTags.d.ts.map +1 -1
  76. package/dist/deferralTags.js +0 -14
  77. package/dist/deferralTags.js.map +1 -1
  78. package/dist/host.d.ts +10 -41
  79. package/dist/host.d.ts.map +1 -1
  80. package/dist/host.js +103 -50
  81. package/dist/host.js.map +1 -1
  82. package/dist/ingest/ciSourcePaths.d.ts +0 -38
  83. package/dist/ingest/ciSourcePaths.d.ts.map +1 -1
  84. package/dist/ingest/ciSourcePaths.js +0 -38
  85. package/dist/ingest/ciSourcePaths.js.map +1 -1
  86. package/dist/ingest/gherkinValidation.d.ts +0 -80
  87. package/dist/ingest/gherkinValidation.d.ts.map +1 -1
  88. package/dist/ingest/gherkinValidation.js +0 -80
  89. package/dist/ingest/gherkinValidation.js.map +1 -1
  90. package/dist/ingest/ingestQualityChecks.d.ts +8 -93
  91. package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
  92. package/dist/ingest/ingestQualityChecks.js +57 -214
  93. package/dist/ingest/ingestQualityChecks.js.map +1 -1
  94. package/dist/ingest/ingestScenarios.d.ts +0 -45
  95. package/dist/ingest/ingestScenarios.d.ts.map +1 -1
  96. package/dist/ingest/ingestScenarios.js +28 -108
  97. package/dist/ingest/ingestScenarios.js.map +1 -1
  98. package/dist/ingest/inputShapes.d.ts +16 -0
  99. package/dist/ingest/inputShapes.d.ts.map +1 -0
  100. package/dist/ingest/inputShapes.js +113 -0
  101. package/dist/ingest/inputShapes.js.map +1 -0
  102. package/dist/outputLocation.d.ts +27 -0
  103. package/dist/outputLocation.d.ts.map +1 -0
  104. package/dist/outputLocation.js +135 -0
  105. package/dist/outputLocation.js.map +1 -0
  106. package/dist/run-management/keptRun.d.ts +5 -105
  107. package/dist/run-management/keptRun.d.ts.map +1 -1
  108. package/dist/run-management/keptRun.js +16 -82
  109. package/dist/run-management/keptRun.js.map +1 -1
  110. package/dist/run-management/resolveRunInputs.d.ts +0 -67
  111. package/dist/run-management/resolveRunInputs.d.ts.map +1 -1
  112. package/dist/run-management/resolveRunInputs.js +0 -88
  113. package/dist/run-management/resolveRunInputs.js.map +1 -1
  114. package/dist/storedRun.d.ts +6 -0
  115. package/dist/storedRun.d.ts.map +1 -0
  116. package/dist/storedRun.js +28 -0
  117. package/dist/storedRun.js.map +1 -0
  118. package/package.json +2 -2
  119. package/dist/corpus/cli.d.ts +0 -34
  120. package/dist/corpus/cli.d.ts.map +0 -1
  121. package/dist/corpus/cli.js +0 -125
  122. package/dist/corpus/cli.js.map +0 -1
@@ -1,34 +1,17 @@
1
- /**
2
- * The balance CLI — thin wiring over the reconciler seams. The orchestration half of
3
- * the old cli.ts: arg parsing, the render-from-JSON mode, and the reconcile →
4
- * census → provenance → plan → write sequence. The impure file reads it calls
5
- * (runReconcile + the read* siblings) live in ingest/ingestQualityChecks.ts; the output
6
- * plan/write in ./emit; the git-derived run inputs in run-management/resolveRunInputs.ts.
7
- *
8
- * Usage:
9
- * pnpm reconcile [--features <dir>] [--vitest <report.json>]
10
- * [--cucumber <report.json>] [--ci-steps <record.json>]
11
- * [--ci <ci.yml>]
12
- * [--format <fmt>[:<path>]]
13
- */
14
1
  import { existsSync, readFileSync } from "node:fs";
15
2
  import { dirname } from "node:path";
16
- import { runReconcile, readEvidenceObligations, readFeatureNames, featureCorpusParseErrors, featureCorpusDuplicateScnIds, } from "../ingest/ingestQualityChecks.js";
3
+ import { runReconcile, readEvidenceObligations, readFeatureNames, featureCorpusParseErrors, } from "../ingest/ingestQualityChecks.js";
17
4
  import { planOutput } from "./emit/format.js";
18
5
  import { writeOutputs } from "./emit/writer.js";
19
- import { renderReportFromJson, isBalanced, hasPendingItems, hasBrokenEvidence, hasNothingToReconcile, } from "@3f-consulting/spec-controller-core";
6
+ import { namesStdout, refuse, settlingRefusal, stdoutIdentity } from "../outputLocation.js";
7
+ import { identifiedInputs, inputsReadBy, NODE_INPUT_READER } from "./inputsRead.js";
8
+ import { checkReRenderFlags } from "./reRender.js";
9
+ import { checkInputPaths, checkInputShapes, checkSavedReconciliation, jsonInputsOf, reRenderOrRefusal, } from "./unreadableInputs.js";
10
+ import { statusFor } from "./exitStatus.js";
11
+ import { verdictCode, } from "@3f-consulting/spec-controller-core";
20
12
  import { resolveSourceSha, resolveTargetRoot, resolveToolIdentity } from "../run-management/resolveRunInputs.js";
21
13
  import { cliRegistry, renderCommandHelp } from "../cli-registry.js";
22
- // THE ARGV READING AND ITS REGISTRY BOUNDING, SHARED WITH EVERY OTHER COMMAND (3F-3300). Both
23
- // lived here while `balance` was the only command; a second command needs them, and a second
24
- // copy of "what did the operator type" is the one thing this tree least wants two of.
25
- import { parseArgs, checkUnknownFlags } from "../cli-args.js";
26
- /**
27
- * Collect the `--format <spec>` values from argv in order (the flag is REPEATABLE, unlike
28
- * the single-valued flags `parseArgs` records) — the raw specs `planOutput` parses. Empty
29
- * when no `--format` was given, which `planOutput` reads as the md→stdout default
30
- * (@SCN-FMT-001). Later sub-issues (FMT-004) route several specs in one invocation.
31
- */
14
+ import { asksForHelp, parseArgs, checkArgvShape, checkUnknownFlags, checkMissingValues, checkMisplacedHostModifiers, } from "../cli-args.js";
32
15
  function collectFormatSpecs(argv) {
33
16
  const specs = [];
34
17
  for (let i = 0; i < argv.length; i++) {
@@ -42,15 +25,6 @@ function collectFormatSpecs(argv) {
42
25
  }
43
26
  return specs;
44
27
  }
45
- /**
46
- * The legacy-`--json` guard at the CLI edge (@SCN-FMT-006). The earlier
47
- * `--json <path>` flag is removed; supplying it must fail fast with a migration hint to
48
- * `--format json:<path>`, so the removed flag never silently no-ops and drops output. PURE
49
- * and `@unit`-testable: the removed flag is NOT a `--format` spec (planOutput never sees
50
- * it), so the guard reads the parsed args directly and returns the typed migration-hint
51
- * error message when `--json` is present — routed to stderr + a non-zero exit by main(),
52
- * the same handling planOutput's typed error gets (the shared error surface) — else null.
53
- */
54
28
  export function checkLegacyJson(args) {
55
29
  if (args["json"] !== undefined) {
56
30
  return ("The --json <path> flag has been removed. " +
@@ -59,27 +33,9 @@ export function checkLegacyJson(args) {
59
33
  }
60
34
  return null;
61
35
  }
62
- /**
63
- * Source the provenance "Target repo:" name for a run (@SCN-RPT-001 Update —
64
- * Fork A). The operator's `--target` is recorded VERBATIM — no resolution — defaulting to
65
- * `"unknown-target"` when omitted (parallel to `sourceSha`'s `"unknown"`; the facts
66
- * artefact is self-describing, so the line always renders). PURE and `@unit`-testable at
67
- * the CLI edge, like `checkLegacyJson`. It never inspects `--features`: the prior
68
- * `basename(dirname(--features))` resolution (the deleted `resolveTarget`) and its
69
- * degenerate `.` are impossible now — the target is only ever the given value or the
70
- * explicit default.
71
- */
72
36
  export function sourceTarget(args) {
73
37
  return args["target"] ?? "unknown-target";
74
38
  }
75
- /**
76
- * The parsed args, as the reconciler's input paths — the one place a `--flag` name becomes a
77
- * `ReconcileOptions` key.
78
- *
79
- * Its own function rather than an object literal inside `runBalance`, which sits at the
80
- * `max-lines-per-function` standard: a flag is added here, not by growing the orchestration. The
81
- * mapping is also the only thing in that function with nothing to do with orchestration.
82
- */
83
39
  function reconcileInputsOf(args) {
84
40
  return {
85
41
  features: args["features"],
@@ -90,27 +46,7 @@ function reconcileInputsOf(args) {
90
46
  ciSteps: args["ci-steps"],
91
47
  };
92
48
  }
93
- /**
94
- * Guard the supplied input-file/dir flags at the CLI edge (@SCN-CLI-002). A
95
- * mistyped `--vitest` / `--cucumber` / `--features` / `--ci` / `--package-json`
96
- * pointing at a non-existent path used to reconcile silently against ZERO evidence —
97
- * a terrifying false all-red report meaning "you forgot the reports", not "your code
98
- * is broken" (the dogfooding fault). These flags are Examples of ONE boundary
99
- * rule: a supplied-but-absent input path is a hard error, and a flag added to the set
100
- * inherits it rather than restating it. Scope is existence only
101
- * (readability / file-vs-dir type-correctness out of scope; `exists` covers the dir
102
- * flag and the file flags alike).
103
- *
104
- * PURE and `@unit`-testable like `checkLegacyJson` / `sourceTarget`: reads the parsed
105
- * args + an injected `exists` fn (no fs), returns the FIRST supplied-but-absent
106
- * `(flag, path)` as a typed error naming both — routed to stderr + a non-zero exit by
107
- * `refuseUnreadableInputs` (the shared typed-error surface) — else null. An OMITTED flag is not an
108
- * error (legitimately optional: simply no evidence of that kind).
109
- */
110
49
  export function checkInputsExist(args, exists) {
111
- // The input flags in a fixed order — the FIRST supplied-but-absent one is the
112
- // reported error (deterministic; the operator fixes and re-runs). Keys are the
113
- // parseArgs form (the `--` stripped); the message names the flag WITH its dashes.
114
50
  const flags = [
115
51
  "vitest", "cucumber", "features", "ci", "package-json", "ci-steps",
116
52
  ];
@@ -122,63 +58,33 @@ export function checkInputsExist(args, exists) {
122
58
  }
123
59
  return null;
124
60
  }
125
- /**
126
- * The JSON-BEARING input flags — the ones whose content is `JSON.parse`d, and so the only
127
- * ones whose content can throw. `--features` is Gherkin (parsed tolerantly) and `--ci` is
128
- * read as raw TEXT and scanned for `run:` steps — neither is JSON, neither can crash the
129
- * process, and on garbage both reconcile normally (verified, 3F-1742 Discovery).
130
- */
131
61
  const JSON_INPUT_FLAGS = [
132
62
  "vitest", "cucumber", "package-json", "ci-steps",
133
63
  ];
134
- /**
135
- * Guard the READABILITY of the supplied JSON inputs at the CLI edge (@SCN-CLI-014).
136
- * `checkInputsExist` already guards their PRESENCE — but a path that is present yet
137
- * UNPARSEABLE fell straight through it: the reader threw mid-parse, nothing caught it, and
138
- * the process hit Node's default exit 1 — the code reserved for a genuine OUT-OF-BALANCE
139
- * verdict. A crashed invocation was therefore indistinguishable, by exit code, from an
140
- * honest disagreement (3F-1742). An input the tool cannot read is a USAGE fault: exit 2,
141
- * sibling to a missing path (@SCN-CLI-002) and an unrecognised flag (@SCN-CLI-009).
142
- *
143
- * PURE and `@unit`-testable like its sibling guards: reads the parsed args + an injected
144
- * `read` fn (no fs), returns the FIRST supplied-but-unparseable `(flag, path, failure)` as
145
- * a typed error naming all three — routed to stderr + exit 2 by `refuseUnreadableInputs` — else null.
146
- * An omitted flag is not an error, and an unreadable file (a race after the existence
147
- * check) reports as the same input fault rather than escaping as a crash.
148
- */
149
64
  export function checkInputsParse(args, read) {
150
65
  for (const flag of JSON_INPUT_FLAGS) {
151
66
  const path = args[flag];
152
67
  if (path === undefined)
153
68
  continue;
69
+ let text;
154
70
  try {
155
- JSON.parse(read(path));
71
+ text = read(path);
156
72
  }
157
73
  catch (err) {
158
- // Both a parse failure and an unreadable file are the SAME input fault. Anything
159
- // that escapes this catch lands on Node's default exit 1 — the collision itself.
160
- const failure = err instanceof Error ? err.message : String(err);
161
- return `The --${flag} report is not valid JSON: ${path} (${failure})`;
74
+ return `The --${flag} file could not be read: ${path} (${failureOf(err)})`;
75
+ }
76
+ try {
77
+ JSON.parse(text);
78
+ }
79
+ catch (err) {
80
+ return `The --${flag} report is not valid JSON: ${path} (${failureOf(err)})`;
162
81
  }
163
82
  }
164
83
  return null;
165
84
  }
166
- /**
167
- * Guard the readability of `--render-from-json` at the CLI edge (@SCN-CLI-015). The
168
- * render-from-saved-JSON branch RETURNS before the input guards ever run, so it honoured
169
- * NEITHER: a missing path crashed to `ENOENT` and a malformed file to `SyntaxError`, both
170
- * landing on Node's default exit 1 — the out-of-balance code (3F-1764).
171
- *
172
- * The missing-path case was a live violation of @SCN-CLI-002's own shipped principle: a
173
- * supplied input path that does not exist is a hard error at exit 2, enforced for the five
174
- * evidence flags and not for this one. The CLI shipped a guard that half-honoured its Rule.
175
- *
176
- * MISSING and UNPARSEABLE are two Examples of one boundary rule — an input the tool cannot
177
- * read is a usage error, never a verdict — so one guard covers both. PURE and
178
- * `@unit`-testable like its siblings: the parsed args + an injected `read` (no fs), which
179
- * throws for an absent/unreadable path exactly as `readFileSync` does. An OMITTED flag is
180
- * not an error (the ordinary reconcile path).
181
- */
85
+ function failureOf(err) {
86
+ return err instanceof Error ? err.message : String(err);
87
+ }
182
88
  export function checkRenderFromJson(args, read) {
183
89
  const path = args["render-from-json"];
184
90
  if (path === undefined)
@@ -187,262 +93,101 @@ export function checkRenderFromJson(args, read) {
187
93
  JSON.parse(read(path));
188
94
  }
189
95
  catch (err) {
190
- // MISSING (read throws ENOENT) and UNPARSEABLE (JSON.parse throws) are the same input
191
- // fault, caught in the same place. Anything escaping here lands on Node's default
192
- // exit 1 — the out-of-balance code — which is the collision this closes.
193
96
  const failure = err instanceof Error ? err.message : String(err);
194
97
  return `The --render-from-json saved report could not be read: ${path} (${failure})`;
195
98
  }
196
99
  return null;
197
100
  }
198
101
  export function runBalance(argv) {
199
- // Answer `--help`/`-h` from the command/flag registry (@SCN-CLI-006) BEFORE any
200
- // parse or reconcile: render the balance command's per-command scope (a line per
201
- // registered flag — name + arg + description), leave process.exitCode at its default 0,
202
- // and return. This intercepts --help so it never falls through parseArgs as a stray flag
203
- // while balance runs anyway. The registry is the single source, so a flag that exists is
204
- // a flag that appears in help — no hand-kept list to drift.
205
- if (argv.includes("--help") || argv.includes("-h")) {
102
+ return settlingRefusal(() => balance(argv), false);
103
+ }
104
+ function balance(argv) {
105
+ if (asksForHelp(argv)) {
206
106
  process.stdout.write(renderCommandHelp(cliRegistry, "balance") + "\n");
207
- return;
107
+ return false;
208
108
  }
209
- // Capture the run-start instant up front — the run provenance's UTC timestamp,
210
- // threaded through ctx.runStart to the renderers.
211
109
  const runStart = new Date();
212
110
  const args = parseArgs(argv);
213
- // Legacy-`--json` guard (@SCN-FMT-006): the earlier `--json <path>` flag is
214
- // removed. Reject it fast — before any reconcile or write — with a migration hint to
215
- // `--format json:<path>`, so the removed flag never silently no-ops and drops output. The
216
- // guard's typed error is routed to stderr + a non-zero exit, exactly as planOutput's error
217
- // is below (the shared typed-error surface).
218
111
  const legacyJsonError = checkLegacyJson(args);
219
112
  if (legacyJsonError)
220
- exitUsage(legacyJsonError);
221
- // Registry-bounded parse (@SCN-CLI-009): `balance` accepts ONLY the flags its registry
222
- // scope LISTS. An unregistered flag — a typo `--strcit`, a stray `--bogus` — is a
223
- // USAGE error: name it on stderr, set process.exitCode = 2 (the enumerated usage code,
224
- // 3F-1414's 0/1/2 taxonomy — never 1, never a silent swallow), and RETURN before any
225
- // reconcile. Runs AFTER the legacy-`--json` guard so `--json` keeps its specific migration
226
- // hint; the global `--store`/`--run-id` modifiers were consumed by the dispatcher before
227
- // balance, so they never reach here. This is the structural teeth behind "accepted =
228
- // registry = help" — a flag can't affect behaviour without a registry entry.
113
+ refuse(legacyJsonError);
114
+ const misplacedModifierError = checkMisplacedHostModifiers(args, cliRegistry, "balance");
115
+ if (misplacedModifierError)
116
+ refuse(misplacedModifierError);
117
+ const shapeError = checkArgvShape(argv, cliRegistry, "balance");
118
+ if (shapeError)
119
+ refuse(shapeError);
229
120
  const unknownFlagError = checkUnknownFlags(args, cliRegistry, "balance", resolveToolIdentity().toolVersion);
230
121
  if (unknownFlagError) {
231
122
  process.stderr.write(unknownFlagError + "\n");
232
123
  process.exitCode = 2;
233
- return;
124
+ return false;
234
125
  }
126
+ const missingValueError = checkMissingValues(argv, cliRegistry, "balance");
127
+ if (missingValueError)
128
+ refuse(missingValueError);
235
129
  if (renderSavedReport(args))
236
- return;
130
+ return false;
237
131
  refuseUnreadableInputs(args);
238
132
  const inputs = reconcileInputsOf(args);
239
- // Reconcile the obligation-vs-observation evidence into the Ledger. The runtime evidence-observation
240
- // views (Test volume, the evidence grid) are FOLDS the renderers derive off this Ledger's posted
241
- // credits (@SCN-RPT-010 / 3F-2103 — the census is retired), so they cannot drift from the
242
- // reconciler's verdict: they ARE the same rows. `withRuntimeObservations: true` (below) tells the
243
- // renderers the axis is in play.
244
133
  const balance = runReconcile(inputs);
245
- // Read the scenario-corpus census alongside the balance (@SCN-RPT-008) —
246
- // the raw-vs-parsed @SCN-occurrence delta over the same discovered feature corpus.
247
- // A sibling to the balance, threaded to the renderers via writeOutputs like ctx.
248
134
  const evidenceObligations = readEvidenceObligations(args["features"]);
249
- // The static-check kind-counts are a FOLD OVER THE LEDGER (@SCN-USG-001 / 3F-2118) — the
250
- // renderers count the balance's own posted static-check credits (`staticObservationTally`), so
251
- // they cannot drift from the reconciler's verdict: they ARE the same rows. The parallel static
252
- // census is RETIRED; `withStaticChecks: true` (below) tells the renderers the axis is in play.
253
- // Read the target's feature-code→slug map alongside the balance (@SCN-RPT-006)
254
- // — the by-feature cut's full-name labels. The 5th sibling, threaded to the MARKDOWN
255
- // renderer via writeOutputs only (markdown-only; the by-feature cut isn't on JSON).
256
135
  const featureNames = readFeatureNames(args["features"]);
257
136
  const ctx = runContextOf(args, inputs, runStart);
258
- // Plan the outputs from the --format specs (no flag → md→stdout) and write them via
259
- // the writer — the pure plan / impure writer split (@SCN-FMT-001). The plan
260
- // parse+validate is pure; the writer is the only IO for the emitted report. This is
261
- // the SOLE output path: the tool emits via --format and holds no storage opinion — the
262
- // legacy runs/<target>/<ISO>/ auto-archive was removed with @SCN-RUN-001, the
263
- // caller now routes stored runs (spec-controller's run-management layer).
264
- const planResult = planOutput(collectFormatSpecs(argv));
137
+ const planResult = planOutput(collectFormatSpecs(argv), namesStdout);
265
138
  if (!planResult.ok)
266
- exitUsage(planResult.error);
267
- writeOutputs(planResult.plan, { balance, ctx, evidenceObligations, withRuntimeObservations: true, withStaticChecks: true, featureNames });
268
- // The CI gate (@SCN-CLI-004): `balance` is a GATE, not just a reporter. AFTER the report
269
- // is written in full, map the whole-run verdict to the process exit code. Out-of-balance
270
- // (ANY reconciling item anywhere: an out-of-balance scenario OR a suspense-row item such
271
- // as a no-evidence-obligation static-check watermelon) sets process.exitCode = 1 and RETURNS — set,
272
- // never `process.exit(1)`, so the buffered report is flushed intact rather than truncated
273
- // mid-write. It exits EXACTLY 1 so it reds a CI build and can't masquerade as the usage
274
- // error (2, above). An ENUMERATED status, never a count (8-bit wrap → false pass). A
275
- // balanced run leaves process.exitCode at its default 0 and returns.
276
- //
277
- // The --strict escalation (@SCN-CLI-011): Pending Items are run-neutral by DEFAULT
278
- // (@SCN-PND-008 — they never red a build), but `--strict` is the OPT-IN that fails an
279
- // OTHERWISE-BALANCED run carrying them, exiting the DISTINCT code 3 (taxonomy 0 balanced /
280
- // 1 out-of-balance / 2 usage / 3 pending-under-strict / 4 unsound / 5 nothing to reconcile —
281
- // a Pending Item is not out-of-balance,
282
- // so it must NEVER share code 1). Out-of-balance DOMINATES: the escalation is checked ONLY in
283
- // the `isBalanced` branch, so an out-of-balance run exits 1 regardless of --strict. Like the
284
- // CLI-004 gate this SETS process.exitCode (never process.exit) AFTER writeOutputs, so the
285
- // buffered report is flushed intact. `--strict` is a registry-LISTED boolean, recorded by
286
- // parseArgs as the string "true" — presence is what matters, so `!== undefined` reads it.
287
- //
288
- // The UNSOUND pre-emption (@SCN-CLI-012): a run carrying BROKEN evidence — a proving suite
289
- // that failed to COLLECT, so the behaviour was never exercised — exits the DISTINCT code 4
290
- // (taxonomy 0 balanced / 1 out-of-balance / 2 usage / 3 pending-under-strict / 4 unsound /
291
- // 5 nothing to reconcile).
292
- // Exit 1 says "the ledger disagrees"; exit 4 says "the ledger could not be TRUSTED to
293
- // disagree" — you cannot trust a reconciliation whose evidence never materialised, so
294
- // unsound DOMINATES.
295
- //
296
- // THE ORDER IS LOAD-BEARING, NOT COSMETIC. A broken run is ALWAYS out-of-balance: its
297
- // `broken` item sits on the SUSPENSE row, so `isBalanced` is already false. Check it AFTER
298
- // `isBalanced` and the branch is UNREACHABLE — every broken run would exit 1 and the
299
- // collection failure would stay masked as an honest disagreement (the AWTY dogfood fault,
300
- // 3F-1642). So `hasBrokenEvidence` is checked FIRST, PRE-EMPTING the balance verdict it
301
- // would otherwise be swallowed by. @SCN-CLI-004 is a BYSTANDER, not an Update: its fixture
302
- // is a SOUND out-of-balance run (no broken item), so it falls through this branch and still
303
- // exits exactly 1 — the pre-emption fires only when evidence genuinely failed to collect.
304
- //
305
- // THE NOTHING-TO-RECONCILE PRE-EMPTION (@SCN-CLI-019): a run whose ledger carries ZERO Scenario
306
- // Reconciliation rows — a target that declared nothing AND produced nothing — exits the DISTINCT
307
- // code 5. It is its own state: not balanced (no accounts to agree), not out-of-balance (nothing
308
- // disagrees), not a usage fault (the invocation was valid and `new-client` is a supported
309
- // adoption state), not unsound (no proof failed; none was owed).
310
- //
311
- // IT IS NOT THE UNSOUND PRE-EMPTION ONE CODE FURTHER ON, THOUGH IT LOOKS LIKE IT — measured,
312
- // because the ticket predicted it was. An empty ledger is MUTUALLY EXCLUSIVE with all three
313
- // predicates above: with no rows there is no row to carry a broken item, a reconciling item or a
314
- // Pending Item, so it fires none of them. Moved below `!isBalanced`, this branch STILL returns 5
315
- // (the prescribed plant stayed green). Its position among the predicates is free, and it is
316
- // first only so this ladder and `runVerdictSection` read in the SAME order — the shape
317
- // @SCN-CLI-013's invariant leans on.
318
- //
319
- // WHAT IS LOAD-BEARING is its position against the DEFAULT below. "Balanced" is not a branch
320
- // here, it is the `return 0` a run reaches by failing every test — so there is no "after the
321
- // balanced case" to append a fifth code to. Appended after that return the branch is dead code
322
- // and an empty run exits 0 (measured: the plant that DID red). That is why the fault survived a
323
- // taxonomy that had already grown twice: a fifth code cannot be ADDED to this chain, it has to
324
- // DISPLACE the default, and nothing about the other three says so.
325
- //
326
- // Keyed on the EMPTY LEDGER, never on the empty corpus: a corpus-less run carrying uncited
327
- // credits HAS a row — its suspense row — and is an ordinary out-of-balance report at exit 1
328
- // (@SCN-CLI-020). @SCN-CLI-004/005/010/012 are BYSTANDERS: every one of their fixtures carries
329
- // rows, so none reaches this branch.
330
- const code = verdictExitCode(balance.ledger, args["strict"] !== undefined);
331
- // Assigned only when NON-ZERO, so a balanced run still LEAVES process.exitCode at its default
332
- // rather than writing a 0 over it — the distinction @SCN-CLI-005 and @SCN-CLI-010 both rest on.
139
+ refuse(planResult.error);
140
+ const payloads = { balance, ctx, evidenceObligations, withRuntimeObservations: true, withStaticChecks: true, featureNames };
141
+ writeOutputs(planResult.plan, payloads, stdoutIdentity, identifiedInputs(inputsReadBy(args, NODE_INPUT_READER)));
142
+ const verdict = verdictCode({ ...balance, strict: ctx.strict === true });
143
+ const code = statusFor(verdict, args["exit-zero"] !== undefined);
333
144
  if (code !== 0)
334
145
  process.exitCode = code;
146
+ return true;
335
147
  }
336
- /**
337
- * A usage or input fault: the message on stderr, then exit 2 — the enumerated usage code
338
- * (@SCN-CLI-002), distinct from the out-of-balance verdict code 1 (@SCN-CLI-004). An
339
- * out-of-balance run must never masquerade as a usage error, nor the reverse.
340
- */
341
- function exitUsage(message) {
342
- process.stderr.write(message + "\n");
343
- process.exit(2);
344
- }
345
- /**
346
- * Render-from-saved-JSON mode (@SCN-RMD-007): regenerate the human markdown from a
347
- * banked spec-reconciliation.json ALONE — no reconcile, no live inputs, no RunContext. Reads
348
- * the file, JSON.parses it back into the whole-document report model, renders the markdown via
349
- * renderReport, and writes it to stdout (the same trailing-newline convention as the writer's
350
- * stdout path). The load-bearing proof that the JSON IS the model — true when it answered the
351
- * run, so `runBalance` returns before any reconcile.
352
- */
353
148
  function renderSavedReport(args) {
354
- // Saved-report READABILITY guard (@SCN-CLI-015). This mode RETURNS before
355
- // `refuseUnreadableInputs` ever runs, so it honoured NEITHER of its guards: a missing path
356
- // crashed to ENOENT and a malformed file to SyntaxError, both landing on Node's default exit 1
357
- // — the out-of-balance code. The missing-path case was a live violation of @SCN-CLI-002's own
358
- // shipped principle, which the CLI enforced for the five evidence flags and not for this
359
- // one. The guard therefore runs INSIDE this mode, ahead of the read (3F-1764).
149
+ const ignoredFlagError = checkReRenderFlags(args);
150
+ if (ignoredFlagError)
151
+ refuse(ignoredFlagError);
360
152
  const unreadableSavedReportError = checkRenderFromJson(args, (path) => readFileSync(path, "utf8"));
361
153
  if (unreadableSavedReportError)
362
- exitUsage(unreadableSavedReportError);
154
+ refuse(unreadableSavedReportError);
363
155
  const rehydratePath = args["render-from-json"];
364
156
  if (rehydratePath === undefined)
365
157
  return false;
366
- const savedReport = readFileSync(rehydratePath, "utf8");
367
- process.stdout.write(renderReportFromJson(savedReport) + "\n");
158
+ const savedJson = readFileSync(rehydratePath, "utf8");
159
+ const notSavedError = checkSavedReconciliation(rehydratePath, savedJson);
160
+ if (notSavedError)
161
+ refuse(notSavedError);
162
+ const saved = reRenderOrRefusal(rehydratePath, savedJson, args["strict"] !== undefined);
163
+ if (typeof saved === "string")
164
+ refuse(saved);
165
+ process.stdout.write(saved.markdown + "\n");
166
+ const code = statusFor(saved.code, args["exit-zero"] !== undefined);
167
+ if (code !== 0)
168
+ process.exitCode = code;
368
169
  return true;
369
170
  }
370
- /**
371
- * The live-input guards, in the order they run: each halts at exit 2 BEFORE any reconcile,
372
- * because an input the tool cannot read is a usage error, never a verdict.
373
- */
374
171
  function refuseUnreadableInputs(args) {
375
- // Input-existence guard (@SCN-CLI-002): a supplied input-file/dir flag pointing at a
376
- // non-existent path is a HARD ERROR — halt BEFORE reconciling, with a typed message
377
- // naming the flag + path, never the silent zero-evidence all-red report a mistyped
378
- // path used to produce (the dogfooding fault). Routed to stderr + a non-zero exit,
379
- // exactly as the legacy-`--json` guard (the shared typed-error surface). An
380
- // omitted flag is legitimately optional and passes through untouched.
381
172
  const missingInputError = checkInputsExist(args, existsSync);
382
173
  if (missingInputError)
383
- exitUsage(missingInputError);
384
- // Input-READABILITY guard (@SCN-CLI-014): existence is not enough. A report that is
385
- // PRESENT but UNPARSEABLE (`--vitest /dev/null`, truncated JSON, non-JSON) used to throw
386
- // mid-parse inside reconcileWithCensus, uncaught — and Node's default exit code is 1, the
387
- // code reserved for a genuine OUT-OF-BALANCE verdict (@SCN-CLI-004). So a tool that
388
- // CRASHED before reconciling was indistinguishable, by exit code, from an honest
389
- // disagreement (3F-1742). Runs immediately after the existence guard and BEFORE any
390
- // reconcile, routing to the same stderr + exit 2 lane: an input the tool cannot read is a
391
- // usage fault, sibling to a missing path and an unrecognised flag — never a verdict.
174
+ refuse(missingInputError);
392
175
  const unparseableInputError = checkInputsParse(args, (path) => readFileSync(path, "utf8"));
393
176
  if (unparseableInputError)
394
- exitUsage(unparseableInputError);
395
- // The FEATURE-CORPUS integrity checkpoint (@SCN-CLI-016, 3F-1767). The feature corpus is an
396
- // input too — the ledger's DEBIT side — and it was read by a hand-rolled TAG-LINE SCAN that
397
- // never consulted a parser. So a malformed tag line simply stopped being a tag line and its
398
- // scenario CEASED TO EXIST: one stray character deleted a failing row and turned an
399
- // out-of-balance run (exit 1) into a clean BALANCED (exit 0). A dropped scenario cannot even
400
- // reconcile `missing`, because it was never RAISED to be missing — the run read cleaner than
401
- // reality, the exact false-green this tool exists to prevent.
402
- //
403
- // Validated with the REAL Gherkin parser (cucumber's own), so a file the tool would reconcile is
404
- // at least a file cucumber would RUN. A file it rejects is an input we CANNOT READ: exit 2,
405
- // halting BEFORE any reconcile, naming the file and the parse failure — the same Rule as
406
- // @SCN-CLI-014 and @SCN-CLI-015 ("an input the tool cannot read is a usage error, never a
407
- // verdict"), now on the obligation side. Never a verdict, and never a green.
408
- //
409
- // The corpus is EXTRACTED from the same real AST (@SCN-LDG-020), so what the tool reconciles is
410
- // what cucumber runs — Feature/Rule tag inheritance included. This guard decides whether the file
411
- // can be read at all; parseScenarios then reads it exactly as cucumber would.
177
+ refuse(unparseableInputError);
178
+ const unreadablePathError = checkInputPaths(args);
179
+ if (unreadablePathError)
180
+ refuse(unreadablePathError);
181
+ const misshapenInputError = checkInputShapes(jsonInputsOf(args, existsSync), (path) => readFileSync(path, "utf8"));
182
+ if (misshapenInputError)
183
+ refuse(misshapenInputError);
412
184
  const featureParseErrors = featureCorpusParseErrors(args["features"]);
413
185
  if (featureParseErrors.length > 0) {
414
- for (const { file, message } of featureParseErrors) {
415
- process.stderr.write(`The --features corpus contains a feature file that could not be parsed: ${file}\n${message}\n`);
416
- }
417
- process.exit(2);
418
- }
419
- // AMBIGUOUS-CORPUS guard (@SCN-LDG-020's guardrail, 3F-1775). An @SCN identifies exactly ONE
420
- // scenario — that is the whole basis of attributing evidence to it. Tag inheritance makes a
421
- // DUPLICATE reachable: an @SCN hoisted to a Feature:/Rule: is inherited by every scenario
422
- // beneath it (cucumber does this, so we do). One passing test would then mark EVERY scenario
423
- // sharing that id `balanced` — including scenarios nothing proves — a BALANCED-WHEN-BROKEN run
424
- // at exit 0. A new silent false-green, introduced by the very fix that closed the last one.
425
- //
426
- // So the corpus is REFUSED, not reconciled: the tool cannot know which scenario a citing test
427
- // proves, and any verdict over it would be a guess. Same Rule as @SCN-CLI-014/015/016 — an input
428
- // the tool cannot read is a usage error, never a verdict.
429
- const duplicateScnIds = featureCorpusDuplicateScnIds(args["features"]);
430
- if (duplicateScnIds.length > 0) {
431
- process.stderr.write(`The --features corpus names the same @SCN on more than one scenario: ` +
432
- `${duplicateScnIds.join(", ")}.\n` +
433
- `An @SCN identifies exactly one scenario — evidence citing a duplicated id cannot be ` +
434
- `attributed, so no verdict over this corpus would be trustworthy. (An @SCN on a Feature: ` +
435
- `or Rule: line is inherited by every scenario beneath it — name it on the scenario.)\n`);
436
- process.exit(2);
186
+ refuse(featureParseErrors
187
+ .map(({ file, message }) => `The --features corpus contains a feature file that could not be parsed: ${file}\n${message}`)
188
+ .join("\n"));
437
189
  }
438
190
  }
439
- /**
440
- * Build the run provenance ONCE (project design §1) — a sibling RunContext, the
441
- * Ledger staying pure — reusing the existing runStart. The target is the
442
- * operator's --target VERBATIM (unknown-target on omit; Fork A — no
443
- * resolution, no basename guessing). Source SHA via the read-only target read, with
444
- * --source-sha as the override (resolveSourceSha).
445
- */
446
191
  function runContextOf(args, inputs, runStart) {
447
192
  return {
448
193
  target: sourceTarget(args),
@@ -452,42 +197,11 @@ function runContextOf(args, inputs, runStart) {
452
197
  sourceSha: args["source-sha"],
453
198
  targetDir: args["features"] !== undefined ? dirname(args["features"]) : undefined,
454
199
  }),
455
- // The TARGET repo root the recorded input paths are made portable against (fixed to
456
- // the target root, not the run cwd, by @SCN-RPT-016) — the SAME
457
- // root readEvidenceObservations passes to countRuntimeEvidenceObservationKinds, derived from
458
- // --features, so a cross-repo reconcile records inputs relative (`features`) rather
459
- // than leaking the target's absolute path.
460
200
  root: resolveTargetRoot({ features: inputs.features }),
461
- // The TOOL's own identity (@SCN-RPT-026, 3F-1916) — which spec-controller produced
462
- // this run, distinct from the target's sourceSha. Read from the tool's OWN dir, never
463
- // cwd (which is the target). One call, spread into the ctx; the same identity feeds
464
- // the run.yaml manifest.
465
201
  ...resolveToolIdentity(),
202
+ strict: args["strict"] !== undefined,
466
203
  };
467
204
  }
468
- /**
469
- * THE DOMINANCE LADDER — the whole-run verdict as the enumerated status a consumer's CI branches
470
- * on, and the ONE place the order argued for above is written down. Extracted from `runBalance`
471
- * (3F-3344) so the ladder is a named thing with its own reading rather than a tail the reader
472
- * arrives at, and so the pre-emption argument sits ON it.
473
- *
474
- * ENUMERATED, NEVER A COUNT — a count would 8-bit `& 0xFF` wrap into a false pass. Returns 0 for a
475
- * balanced run; the caller leaves the process's default alone rather than writing that 0 back.
476
- */
477
- function verdictExitCode(ledger, strict) {
478
- if (hasNothingToReconcile(ledger))
479
- return 5;
480
- if (hasBrokenEvidence(ledger))
481
- return 4;
482
- if (!isBalanced(ledger))
483
- return 1;
484
- if (strict && hasPendingItems(ledger))
485
- return 3;
486
- return 0;
487
- }
488
- // Only run the balance command when this module is executed directly
489
- // (`tsx cli-balance/cli.ts`), NOT when imported by the top-level `spec-controller`
490
- // bin dispatcher or by a test that exercises the pure edge guards.
491
205
  const invokedDirectly = process.argv[1] !== undefined && import.meta.url === `file://${process.argv[1]}`;
492
206
  if (invokedDirectly)
493
207
  runBalance(process.argv.slice(2));
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,4BAA4B,GAE7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EA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