spec-controller 0.1.0-alpha.3 → 0.1.0-alpha.30

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 (76) hide show
  1. package/README.md +24 -4
  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 +45 -0
  5. package/dist/cli-allocate/cli.js.map +1 -0
  6. package/dist/cli-allocate/readHistory.d.ts +21 -0
  7. package/dist/cli-allocate/readHistory.d.ts.map +1 -0
  8. package/dist/cli-allocate/readHistory.js +97 -0
  9. package/dist/cli-allocate/readHistory.js.map +1 -0
  10. package/dist/cli-allocate/readParts.d.ts +3 -0
  11. package/dist/cli-allocate/readParts.d.ts.map +1 -0
  12. package/dist/cli-allocate/readParts.js +25 -0
  13. package/dist/cli-allocate/readParts.js.map +1 -0
  14. package/dist/cli-allocate/readTree.d.ts +17 -0
  15. package/dist/cli-allocate/readTree.d.ts.map +1 -0
  16. package/dist/cli-allocate/readTree.js +63 -0
  17. package/dist/cli-allocate/readTree.js.map +1 -0
  18. package/dist/cli-allocate/request.d.ts +11 -0
  19. package/dist/cli-allocate/request.d.ts.map +1 -0
  20. package/dist/cli-allocate/request.js +29 -0
  21. package/dist/cli-allocate/request.js.map +1 -0
  22. package/dist/cli-allocate/stderr.d.ts +14 -0
  23. package/dist/cli-allocate/stderr.d.ts.map +1 -0
  24. package/dist/cli-allocate/stderr.js +33 -0
  25. package/dist/cli-allocate/stderr.js.map +1 -0
  26. package/dist/cli-args.d.ts +70 -14
  27. package/dist/cli-args.d.ts.map +1 -1
  28. package/dist/cli-args.js +239 -18
  29. package/dist/cli-args.js.map +1 -1
  30. package/dist/cli-balance/cli.d.ts +18 -1
  31. package/dist/cli-balance/cli.d.ts.map +1 -1
  32. package/dist/cli-balance/cli.js +185 -161
  33. package/dist/cli-balance/cli.js.map +1 -1
  34. package/dist/cli-registry.d.ts +28 -0
  35. package/dist/cli-registry.d.ts.map +1 -1
  36. package/dist/cli-registry.js +39 -34
  37. package/dist/cli-registry.js.map +1 -1
  38. package/dist/cli.d.ts +4 -5
  39. package/dist/cli.d.ts.map +1 -1
  40. package/dist/cli.js +26 -12
  41. package/dist/cli.js.map +1 -1
  42. package/dist/deferralTags.d.ts +2 -2
  43. package/dist/deferralTags.js +2 -2
  44. package/dist/host.d.ts +25 -1
  45. package/dist/host.d.ts.map +1 -1
  46. package/dist/host.js +119 -15
  47. package/dist/host.js.map +1 -1
  48. package/dist/ingest/gherkinValidation.d.ts +9 -12
  49. package/dist/ingest/gherkinValidation.d.ts.map +1 -1
  50. package/dist/ingest/gherkinValidation.js +9 -12
  51. package/dist/ingest/gherkinValidation.js.map +1 -1
  52. package/dist/ingest/ingestQualityChecks.d.ts +3 -49
  53. package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
  54. package/dist/ingest/ingestQualityChecks.js +27 -120
  55. package/dist/ingest/ingestQualityChecks.js.map +1 -1
  56. package/dist/ingest/ingestScenarios.d.ts +8 -14
  57. package/dist/ingest/ingestScenarios.d.ts.map +1 -1
  58. package/dist/ingest/ingestScenarios.js +32 -55
  59. package/dist/ingest/ingestScenarios.js.map +1 -1
  60. package/package.json +2 -7
  61. package/dist/corpus/cli.d.ts +0 -34
  62. package/dist/corpus/cli.d.ts.map +0 -1
  63. package/dist/corpus/cli.js +0 -128
  64. package/dist/corpus/cli.js.map +0 -1
  65. package/dist/mutation-ratchet/index.d.ts +0 -46
  66. package/dist/mutation-ratchet/index.d.ts.map +0 -1
  67. package/dist/mutation-ratchet/index.js +0 -46
  68. package/dist/mutation-ratchet/index.js.map +0 -1
  69. package/dist/mutation-ratchet/record.d.ts +0 -178
  70. package/dist/mutation-ratchet/record.d.ts.map +0 -1
  71. package/dist/mutation-ratchet/record.js +0 -314
  72. package/dist/mutation-ratchet/record.js.map +0 -1
  73. package/dist/mutation-ratchet/report.d.ts +0 -109
  74. package/dist/mutation-ratchet/report.d.ts.map +0 -1
  75. package/dist/mutation-ratchet/report.js +0 -156
  76. package/dist/mutation-ratchet/report.js.map +0 -1
@@ -13,16 +13,16 @@
13
13
  */
14
14
  import { existsSync, readFileSync } from "node:fs";
15
15
  import { dirname } from "node:path";
16
- import { runReconcile, readEvidenceObligations, readFeatureNames, featureCorpusParseErrors, featureCorpusDuplicateScnIds, } from "../ingest/ingestQualityChecks.js";
16
+ import { runReconcile, readEvidenceObligations, readFeatureNames, featureCorpusParseErrors, } from "../ingest/ingestQualityChecks.js";
17
17
  import { planOutput } from "./emit/format.js";
18
18
  import { writeOutputs } from "./emit/writer.js";
19
- import { renderReportFromJson, isBalanced, hasPendingItems, hasBrokenEvidence, hasNothingToReconcile, } from "@3f-consulting/spec-controller-core";
19
+ import { renderReportFromJson, isBalanced, hasPendingItems, hasBrokenEvidence, hasNothingToReconcile, hasScenarioCodeErrors, } from "@3f-consulting/spec-controller-core";
20
20
  import { resolveSourceSha, resolveTargetRoot, resolveToolIdentity } from "../run-management/resolveRunInputs.js";
21
21
  import { cliRegistry, renderCommandHelp } from "../cli-registry.js";
22
22
  // THE ARGV READING AND ITS REGISTRY BOUNDING, SHARED WITH EVERY OTHER COMMAND (3F-3300). Both
23
23
  // lived here while `balance` was the only command; a second command needs them, and a second
24
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";
25
+ import { parseArgs, checkArgvShape, checkUnknownFlags, checkMissingValues, checkMisplacedHostModifiers, } from "../cli-args.js";
26
26
  /**
27
27
  * Collect the `--format <spec>` values from argv in order (the flag is REPEATABLE, unlike
28
28
  * the single-valued flags `parseArgs` records) — the raw specs `planOutput` parses. Empty
@@ -72,23 +72,6 @@ export function checkLegacyJson(args) {
72
72
  export function sourceTarget(args) {
73
73
  return args["target"] ?? "unknown-target";
74
74
  }
75
- /**
76
- * Guard the supplied input-file/dir flags at the CLI edge (@SCN-CLI-002). A
77
- * mistyped `--vitest` / `--cucumber` / `--features` / `--ci` / `--package-json`
78
- * pointing at a non-existent path used to reconcile silently against ZERO evidence —
79
- * a terrifying false all-red report meaning "you forgot the reports", not "your code
80
- * is broken" (the dogfooding fault). These flags are Examples of ONE boundary
81
- * rule: a supplied-but-absent input path is a hard error, and a flag added to the set
82
- * inherits it rather than restating it. Scope is existence only
83
- * (readability / file-vs-dir type-correctness out of scope; `exists` covers the dir
84
- * flag and the file flags alike).
85
- *
86
- * PURE and `@unit`-testable like `checkLegacyJson` / `sourceTarget`: reads the parsed
87
- * args + an injected `exists` fn (no fs), returns the FIRST supplied-but-absent
88
- * `(flag, path)` as a typed error naming both — routed to stderr + a non-zero exit by
89
- * `runBalance` (the shared typed-error surface) — else null. An OMITTED flag is not an
90
- * error (legitimately optional: simply no evidence of that kind).
91
- */
92
75
  /**
93
76
  * The parsed args, as the reconciler's input paths — the one place a `--flag` name becomes a
94
77
  * `ReconcileOptions` key.
@@ -104,16 +87,32 @@ function reconcileInputsOf(args) {
104
87
  cucumber: args["cucumber"],
105
88
  ci: args["ci"],
106
89
  packageJson: args["package-json"],
107
- measurements: args["measurements"],
108
90
  ciSteps: args["ci-steps"],
109
91
  };
110
92
  }
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
+ */
111
110
  export function checkInputsExist(args, exists) {
112
111
  // The input flags in a fixed order — the FIRST supplied-but-absent one is the
113
112
  // reported error (deterministic; the operator fixes and re-runs). Keys are the
114
113
  // parseArgs form (the `--` stripped); the message names the flag WITH its dashes.
115
114
  const flags = [
116
- "vitest", "cucumber", "features", "ci", "package-json", "measurements", "ci-steps",
115
+ "vitest", "cucumber", "features", "ci", "package-json", "ci-steps",
117
116
  ];
118
117
  for (const flag of flags) {
119
118
  const path = args[flag];
@@ -130,7 +129,7 @@ export function checkInputsExist(args, exists) {
130
129
  * process, and on garbage both reconcile normally (verified, 3F-1742 Discovery).
131
130
  */
132
131
  const JSON_INPUT_FLAGS = [
133
- "vitest", "cucumber", "package-json", "measurements", "ci-steps",
132
+ "vitest", "cucumber", "package-json", "ci-steps",
134
133
  ];
135
134
  /**
136
135
  * Guard the READABILITY of the supplied JSON inputs at the CLI edge (@SCN-CLI-014).
@@ -143,7 +142,7 @@ const JSON_INPUT_FLAGS = [
143
142
  *
144
143
  * PURE and `@unit`-testable like its sibling guards: reads the parsed args + an injected
145
144
  * `read` fn (no fs), returns the FIRST supplied-but-unparseable `(flag, path, failure)` as
146
- * a typed error naming all three — routed to stderr + exit 2 by `runBalance` — else null.
145
+ * a typed error naming all three — routed to stderr + exit 2 by `refuseUnreadableInputs` — else null.
147
146
  * An omitted flag is not an error, and an unreadable file (a race after the existence
148
147
  * check) reports as the same input fault rather than escaping as a crash.
149
148
  */
@@ -217,20 +216,27 @@ export function runBalance(argv) {
217
216
  // guard's typed error is routed to stderr + a non-zero exit, exactly as planOutput's error
218
217
  // is below (the shared typed-error surface).
219
218
  const legacyJsonError = checkLegacyJson(args);
220
- if (legacyJsonError) {
221
- process.stderr.write(legacyJsonError + "\n");
222
- // Usage/config error → exit 2 (the enumerated usage code, @SCN-CLI-002), distinct
223
- // from the out-of-balance verdict code 1 (@SCN-CLI-004): an out-of-balance run must
224
- // never masquerade as a usage error, nor the reverse.
225
- process.exit(2);
226
- }
227
- // Registry-bounded parse (@SCN-CLI-009): `balance` accepts ONLY the flags its registry
228
- // scope LISTS. An unregistered flag — a typo `--strcit`, a stray `--bogus` — is a
229
- // USAGE error: name it on stderr, set process.exitCode = 2 (the enumerated usage code,
230
- // 3F-1414's 0/1/2 taxonomy — never 1, never a silent swallow), and RETURN before any
231
- // reconcile. Runs AFTER the legacy-`--json` guard so `--json` keeps its specific migration
232
- // hint; the global `--store`/`--run-id` modifiers were consumed by the dispatcher before
233
- // balance, so they never reach here. This is the structural teeth behind "accepted =
219
+ if (legacyJsonError)
220
+ exitUsage(legacyJsonError);
221
+ // A host modifier after the command is out of place, not unknown (@SCN-CLI-061, 3F-3639), so it is
222
+ // refused before the drift advice, through `process.exit` so a stored run is never stamped.
223
+ const misplacedModifierError = checkMisplacedHostModifiers(args, cliRegistry, "balance");
224
+ if (misplacedModifierError)
225
+ exitUsage(misplacedModifierError);
226
+ // Every token is a flag or the value of the flag before it (3F-3672), refused through
227
+ // `process.exit` so a stored run is never stamped, and before the unknown-flag check below.
228
+ const shapeError = checkArgvShape(argv, cliRegistry, "balance");
229
+ if (shapeError)
230
+ exitUsage(shapeError);
231
+ // Registry-bounded flag NAMES (@SCN-CLI-009): `balance` accepts ONLY the flags its registry
232
+ // scope LISTS. An unregistered flag — a typo `--strcit`, a stray `--bogus` — is a USAGE error:
233
+ // name it on stderr, set process.exitCode = 2 (the enumerated usage code, 3F-1414's 0/1/2
234
+ // taxonomy — never 1, never 0), and RETURN before any reconcile. It bounds names only; that every
235
+ // other token is read or refused is the argv-shape check above (@SCN-CLI-062–066, 3F-3672).
236
+ // Runs AFTER the legacy-`--json` guard so `--json` keeps its specific migration hint, after the
237
+ // misplaced-modifier refusal, so a `--store` / `--run-id` written after the command is named as
238
+ // out of place rather than given pin advice, and after the argv-shape check, so `--format=json` is
239
+ // refused as a form and never given pin advice. This is the structural teeth behind "accepted =
234
240
  // registry = help" — a flag can't affect behaviour without a registry entry.
235
241
  const unknownFlagError = checkUnknownFlags(args, cliRegistry, "balance", resolveToolIdentity().toolVersion);
236
242
  if (unknownFlagError) {
@@ -238,97 +244,15 @@ export function runBalance(argv) {
238
244
  process.exitCode = 2;
239
245
  return;
240
246
  }
241
- // Render-from-saved-JSON mode (@SCN-RMD-007): regenerate the human markdown from a
242
- // banked spec-reconciliation.json ALONE — no reconcile, no live inputs, no RunContext. Reads
243
- // the file, JSON.parses it back into the whole-document report model, renders the markdown via
244
- // renderReport, and writes it to stdout (the same trailing-newline convention as the writer's
245
- // stdout path). The load-bearing proof that the JSON IS the model — returns before any reconcile.
246
- // Saved-report READABILITY guard (@SCN-CLI-015). This branch RETURNS before the input
247
- // guards below ever run, so it honoured NEITHER: a missing path crashed to ENOENT and a
248
- // malformed file to SyntaxError, both landing on Node's default exit 1 — the
249
- // out-of-balance code. The missing-path case was a live violation of @SCN-CLI-002's own
250
- // shipped principle, which the CLI enforced for the five evidence flags and not for this
251
- // one. The guard therefore runs INSIDE this branch, ahead of the read (3F-1764).
252
- const unreadableSavedReportError = checkRenderFromJson(args, (path) => readFileSync(path, "utf8"));
253
- if (unreadableSavedReportError) {
254
- process.stderr.write(unreadableSavedReportError + "\n");
255
- process.exit(2);
256
- }
257
- const rehydratePath = args["render-from-json"];
258
- if (rehydratePath !== undefined) {
259
- const savedReport = readFileSync(rehydratePath, "utf8");
260
- process.stdout.write(renderReportFromJson(savedReport) + "\n");
247
+ // A flag that takes a value, given none (@SCN-CLI-058, 3F-3639), refused before anything reads
248
+ // the value `parseArgs` made up for it. `process.exit`, never a set status and a return: inside a
249
+ // stored run the return would reach the kept-run scaffold, which stamps a run.yaml (3F-3650).
250
+ const missingValueError = checkMissingValues(argv, cliRegistry, "balance");
251
+ if (missingValueError)
252
+ exitUsage(missingValueError);
253
+ if (renderSavedReport(args))
261
254
  return;
262
- }
263
- // Input-existence guard (@SCN-CLI-002): a supplied input-file/dir flag pointing at a
264
- // non-existent path is a HARD ERROR — halt BEFORE reconciling, with a typed message
265
- // naming the flag + path, never the silent zero-evidence all-red report a mistyped
266
- // path used to produce (the dogfooding fault). Routed to stderr + a non-zero exit,
267
- // exactly as the legacy-`--json` guard above (the shared typed-error surface). An
268
- // omitted flag is legitimately optional and passes through untouched.
269
- const missingInputError = checkInputsExist(args, existsSync);
270
- if (missingInputError) {
271
- process.stderr.write(missingInputError + "\n");
272
- // Usage/input error → exit 2 (@SCN-CLI-002), distinct from the out-of-balance
273
- // verdict code 1 (@SCN-CLI-004).
274
- process.exit(2);
275
- }
276
- // Input-READABILITY guard (@SCN-CLI-014): existence is not enough. A report that is
277
- // PRESENT but UNPARSEABLE (`--vitest /dev/null`, truncated JSON, non-JSON) used to throw
278
- // mid-parse inside reconcileWithCensus, uncaught — and Node's default exit code is 1, the
279
- // code reserved for a genuine OUT-OF-BALANCE verdict (@SCN-CLI-004). So a tool that
280
- // CRASHED before reconciling was indistinguishable, by exit code, from an honest
281
- // disagreement (3F-1742). Runs immediately after the existence guard and BEFORE any
282
- // reconcile, routing to the same stderr + exit 2 lane: an input the tool cannot read is a
283
- // usage fault, sibling to a missing path and an unrecognised flag — never a verdict.
284
- const unparseableInputError = checkInputsParse(args, (path) => readFileSync(path, "utf8"));
285
- if (unparseableInputError) {
286
- process.stderr.write(unparseableInputError + "\n");
287
- process.exit(2);
288
- }
289
- // The FEATURE-CORPUS integrity checkpoint (@SCN-CLI-016, 3F-1767). The feature corpus is an
290
- // input too — the ledger's DEBIT side — and it was read by a hand-rolled TAG-LINE SCAN that
291
- // never consulted a parser. So a malformed tag line simply stopped being a tag line and its
292
- // scenario CEASED TO EXIST: one stray character deleted a failing row and turned an
293
- // out-of-balance run (exit 1) into a clean BALANCED (exit 0). A dropped scenario cannot even
294
- // reconcile `missing`, because it was never RAISED to be missing — the run read cleaner than
295
- // reality, the exact false-green this tool exists to prevent.
296
- //
297
- // Validated with the REAL Gherkin parser (cucumber's own), so a file the tool would reconcile is
298
- // at least a file cucumber would RUN. A file it rejects is an input we CANNOT READ: exit 2,
299
- // halting BEFORE any reconcile, naming the file and the parse failure — the same Rule as
300
- // @SCN-CLI-014 and @SCN-CLI-015 ("an input the tool cannot read is a usage error, never a
301
- // verdict"), now on the obligation side. Never a verdict, and never a green.
302
- //
303
- // The corpus is EXTRACTED from the same real AST (@SCN-LDG-020), so what the tool reconciles is
304
- // what cucumber runs — Feature/Rule tag inheritance included. This guard decides whether the file
305
- // can be read at all; parseScenarios then reads it exactly as cucumber would.
306
- const featureParseErrors = featureCorpusParseErrors(args["features"]);
307
- if (featureParseErrors.length > 0) {
308
- for (const { file, message } of featureParseErrors) {
309
- process.stderr.write(`The --features corpus contains a feature file that could not be parsed: ${file}\n${message}\n`);
310
- }
311
- process.exit(2);
312
- }
313
- // AMBIGUOUS-CORPUS guard (@SCN-LDG-020's guardrail, 3F-1775). An @SCN identifies exactly ONE
314
- // scenario — that is the whole basis of attributing evidence to it. Tag inheritance makes a
315
- // DUPLICATE reachable: an @SCN hoisted to a Feature:/Rule: is inherited by every scenario
316
- // beneath it (cucumber does this, so we do). One passing test would then mark EVERY scenario
317
- // sharing that id `balanced` — including scenarios nothing proves — a BALANCED-WHEN-BROKEN run
318
- // at exit 0. A new silent false-green, introduced by the very fix that closed the last one.
319
- //
320
- // So the corpus is REFUSED, not reconciled: the tool cannot know which scenario a citing test
321
- // proves, and any verdict over it would be a guess. Same Rule as @SCN-CLI-014/015/016 — an input
322
- // the tool cannot read is a usage error, never a verdict.
323
- const duplicateScnIds = featureCorpusDuplicateScnIds(args["features"]);
324
- if (duplicateScnIds.length > 0) {
325
- process.stderr.write(`The --features corpus names the same @SCN on more than one scenario: ` +
326
- `${duplicateScnIds.join(", ")}.\n` +
327
- `An @SCN identifies exactly one scenario — evidence citing a duplicated id cannot be ` +
328
- `attributed, so no verdict over this corpus would be trustworthy. (An @SCN on a Feature: ` +
329
- `or Rule: line is inherited by every scenario beneath it — name it on the scenario.)\n`);
330
- process.exit(2);
331
- }
255
+ refuseUnreadableInputs(args);
332
256
  const inputs = reconcileInputsOf(args);
333
257
  // Reconcile the obligation-vs-observation evidence into the Ledger. The runtime evidence-observation
334
258
  // views (Test volume, the evidence grid) are FOLDS the renderers derive off this Ledger's posted
@@ -348,31 +272,7 @@ export function runBalance(argv) {
348
272
  // — the by-feature cut's full-name labels. The 5th sibling, threaded to the MARKDOWN
349
273
  // renderer via writeOutputs only (markdown-only; the by-feature cut isn't on JSON).
350
274
  const featureNames = readFeatureNames(args["features"]);
351
- // Build the run provenance ONCE (project design §1) — a sibling RunContext, the
352
- // Ledger staying pure — reusing the existing runStart. The target is the
353
- // operator's --target VERBATIM (unknown-target on omit; Fork A — no
354
- // resolution, no basename guessing). Source SHA via the read-only target read, with
355
- // --source-sha as the override (resolveSourceSha).
356
- const ctx = {
357
- target: sourceTarget(args),
358
- inputs,
359
- runStart,
360
- sourceSha: resolveSourceSha({
361
- sourceSha: args["source-sha"],
362
- targetDir: args["features"] !== undefined ? dirname(args["features"]) : undefined,
363
- }),
364
- // The TARGET repo root the recorded input paths are made portable against (fixed to
365
- // the target root, not the run cwd, by @SCN-RPT-016) — the SAME
366
- // root readEvidenceObservations passes to countRuntimeEvidenceObservationKinds, derived from
367
- // --features, so a cross-repo reconcile records inputs relative (`features`) rather
368
- // than leaking the target's absolute path.
369
- root: resolveTargetRoot({ features: inputs.features }),
370
- // The TOOL's own identity (@SCN-RPT-026, 3F-1916) — which spec-controller produced
371
- // this run, distinct from the target's sourceSha. Read from the tool's OWN dir, never
372
- // cwd (which is the target). One call, spread into the ctx; the same identity feeds
373
- // the run.yaml manifest.
374
- ...resolveToolIdentity(),
375
- };
275
+ const ctx = runContextOf(args, inputs, runStart);
376
276
  // Plan the outputs from the --format specs (no flag → md→stdout) and write them via
377
277
  // the writer — the pure plan / impure writer split (@SCN-FMT-001). The plan
378
278
  // parse+validate is pure; the writer is the only IO for the emitted report. This is
@@ -380,12 +280,8 @@ export function runBalance(argv) {
380
280
  // legacy runs/<target>/<ISO>/ auto-archive was removed with @SCN-RUN-001, the
381
281
  // caller now routes stored runs (spec-controller's run-management layer).
382
282
  const planResult = planOutput(collectFormatSpecs(argv));
383
- if (!planResult.ok) {
384
- process.stderr.write(planResult.error + "\n");
385
- // Usage/config error (bad --format spec) → exit 2 (@SCN-CLI-002), distinct from the
386
- // out-of-balance verdict code 1 (@SCN-CLI-004).
387
- process.exit(2);
388
- }
283
+ if (!planResult.ok)
284
+ exitUsage(planResult.error);
389
285
  writeOutputs(planResult.plan, { balance, ctx, evidenceObligations, withRuntimeObservations: true, withStaticChecks: true, featureNames });
390
286
  // The CI gate (@SCN-CLI-004): `balance` is a GATE, not just a reporter. AFTER the report
391
287
  // is written in full, map the whole-run verdict to the process exit code. Out-of-balance
@@ -449,12 +345,126 @@ export function runBalance(argv) {
449
345
  // credits HAS a row — its suspense row — and is an ordinary out-of-balance report at exit 1
450
346
  // (@SCN-CLI-020). @SCN-CLI-004/005/010/012 are BYSTANDERS: every one of their fixtures carries
451
347
  // rows, so none reaches this branch.
452
- const code = verdictExitCode(balance.ledger, args["strict"] !== undefined);
348
+ const verdict = verdictExitCode(balance, args["strict"] !== undefined);
349
+ const code = args["exit-zero"] !== undefined ? exitZeroStatus(verdict) : verdict;
453
350
  // Assigned only when NON-ZERO, so a balanced run still LEAVES process.exitCode at its default
454
351
  // rather than writing a 0 over it — the distinction @SCN-CLI-005 and @SCN-CLI-010 both rest on.
455
352
  if (code !== 0)
456
353
  process.exitCode = code;
457
354
  }
355
+ /**
356
+ * A usage or input fault: the message on stderr, then exit 2 — the enumerated usage code
357
+ * (@SCN-CLI-002), distinct from the out-of-balance verdict code 1 (@SCN-CLI-004). An
358
+ * out-of-balance run must never masquerade as a usage error, nor the reverse.
359
+ */
360
+ function exitUsage(message) {
361
+ process.stderr.write(message + "\n");
362
+ process.exit(2);
363
+ }
364
+ /**
365
+ * Render-from-saved-JSON mode (@SCN-RMD-007): regenerate the human markdown from a
366
+ * banked spec-reconciliation.json ALONE — no reconcile, no live inputs, no RunContext. Reads
367
+ * the file, JSON.parses it back into the whole-document report model, renders the markdown via
368
+ * renderReport, and writes it to stdout (the same trailing-newline convention as the writer's
369
+ * stdout path). The load-bearing proof that the JSON IS the model — true when it answered the
370
+ * run, so `runBalance` returns before any reconcile.
371
+ */
372
+ function renderSavedReport(args) {
373
+ // Saved-report READABILITY guard (@SCN-CLI-015). This mode RETURNS before
374
+ // `refuseUnreadableInputs` ever runs, so it honoured NEITHER of its guards: a missing path
375
+ // crashed to ENOENT and a malformed file to SyntaxError, both landing on Node's default exit 1
376
+ // — the out-of-balance code. The missing-path case was a live violation of @SCN-CLI-002's own
377
+ // shipped principle, which the CLI enforced for the five evidence flags and not for this
378
+ // one. The guard therefore runs INSIDE this mode, ahead of the read (3F-1764).
379
+ const unreadableSavedReportError = checkRenderFromJson(args, (path) => readFileSync(path, "utf8"));
380
+ if (unreadableSavedReportError)
381
+ exitUsage(unreadableSavedReportError);
382
+ const rehydratePath = args["render-from-json"];
383
+ if (rehydratePath === undefined)
384
+ return false;
385
+ const savedReport = readFileSync(rehydratePath, "utf8");
386
+ process.stdout.write(renderReportFromJson(savedReport) + "\n");
387
+ return true;
388
+ }
389
+ /**
390
+ * The live-input guards, in the order they run: each halts at exit 2 BEFORE any reconcile,
391
+ * because an input the tool cannot read is a usage error, never a verdict.
392
+ */
393
+ function refuseUnreadableInputs(args) {
394
+ // Input-existence guard (@SCN-CLI-002): a supplied input-file/dir flag pointing at a
395
+ // non-existent path is a HARD ERROR — halt BEFORE reconciling, with a typed message
396
+ // naming the flag + path, never the silent zero-evidence all-red report a mistyped
397
+ // path used to produce (the dogfooding fault). Routed to stderr + a non-zero exit,
398
+ // exactly as the legacy-`--json` guard (the shared typed-error surface). An
399
+ // omitted flag is legitimately optional and passes through untouched.
400
+ const missingInputError = checkInputsExist(args, existsSync);
401
+ if (missingInputError)
402
+ exitUsage(missingInputError);
403
+ // Input-READABILITY guard (@SCN-CLI-014): existence is not enough. A report that is
404
+ // PRESENT but UNPARSEABLE (`--vitest /dev/null`, truncated JSON, non-JSON) used to throw
405
+ // mid-parse inside reconcileWithCensus, uncaught — and Node's default exit code is 1, the
406
+ // code reserved for a genuine OUT-OF-BALANCE verdict (@SCN-CLI-004). So a tool that
407
+ // CRASHED before reconciling was indistinguishable, by exit code, from an honest
408
+ // disagreement (3F-1742). Runs immediately after the existence guard and BEFORE any
409
+ // reconcile, routing to the same stderr + exit 2 lane: an input the tool cannot read is a
410
+ // usage fault, sibling to a missing path and an unrecognised flag — never a verdict.
411
+ const unparseableInputError = checkInputsParse(args, (path) => readFileSync(path, "utf8"));
412
+ if (unparseableInputError)
413
+ exitUsage(unparseableInputError);
414
+ // The FEATURE-CORPUS integrity checkpoint (@SCN-CLI-016, 3F-1767). The feature corpus is an
415
+ // input too — the ledger's DEBIT side — and it was read by a hand-rolled TAG-LINE SCAN that
416
+ // never consulted a parser. So a malformed tag line simply stopped being a tag line and its
417
+ // scenario CEASED TO EXIST: one stray character deleted a failing row and turned an
418
+ // out-of-balance run (exit 1) into a clean BALANCED (exit 0). A dropped scenario cannot even
419
+ // reconcile `missing`, because it was never RAISED to be missing — the run read cleaner than
420
+ // reality, the exact false-green this tool exists to prevent.
421
+ //
422
+ // Validated with the REAL Gherkin parser (cucumber's own), so a file the tool would reconcile is
423
+ // at least a file cucumber would RUN. A file it rejects is an input we CANNOT READ: exit 2,
424
+ // halting BEFORE any reconcile, naming the file and the parse failure — the same Rule as
425
+ // @SCN-CLI-014 and @SCN-CLI-015 ("an input the tool cannot read is a usage error, never a
426
+ // verdict"), now on the obligation side. Never a verdict, and never a green.
427
+ //
428
+ // The corpus is EXTRACTED from the same real AST (@SCN-LDG-020), so what the tool reconciles is
429
+ // what cucumber runs — Feature/Rule tag inheritance included. This guard decides whether the file
430
+ // can be read at all; parseScenarios then reads it exactly as cucumber would.
431
+ const featureParseErrors = featureCorpusParseErrors(args["features"]);
432
+ if (featureParseErrors.length > 0) {
433
+ for (const { file, message } of featureParseErrors) {
434
+ process.stderr.write(`The --features corpus contains a feature file that could not be parsed: ${file}\n${message}\n`);
435
+ }
436
+ process.exit(2);
437
+ }
438
+ }
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
+ function runContextOf(args, inputs, runStart) {
447
+ return {
448
+ target: sourceTarget(args),
449
+ inputs,
450
+ runStart,
451
+ sourceSha: resolveSourceSha({
452
+ sourceSha: args["source-sha"],
453
+ targetDir: args["features"] !== undefined ? dirname(args["features"]) : undefined,
454
+ }),
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
+ 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
+ ...resolveToolIdentity(),
466
+ };
467
+ }
458
468
  /**
459
469
  * THE DOMINANCE LADDER — the whole-run verdict as the enumerated status a consumer's CI branches
460
470
  * on, and the ONE place the order argued for above is written down. Extracted from `runBalance`
@@ -464,17 +474,31 @@ export function runBalance(argv) {
464
474
  * ENUMERATED, NEVER A COUNT — a count would 8-bit `& 0xFF` wrap into a false pass. Returns 0 for a
465
475
  * balanced run; the caller leaves the process's default alone rather than writing that 0 back.
466
476
  */
467
- function verdictExitCode(ledger, strict) {
477
+ function verdictExitCode(balance, strict) {
478
+ const { ledger } = balance;
468
479
  if (hasNothingToReconcile(ledger))
469
480
  return 5;
470
481
  if (hasBrokenEvidence(ledger))
471
482
  return 4;
483
+ // A misfiled code (3F-3635): every account still reconciles, so `isBalanced` alone would pass it.
484
+ if (hasScenarioCodeErrors(balance))
485
+ return 1;
472
486
  if (!isBalanced(ledger))
473
487
  return 1;
474
488
  if (strict && hasPendingItems(ledger))
475
489
  return 3;
476
490
  return 0;
477
491
  }
492
+ /**
493
+ * The codes `--exit-zero` moves to 0 (@SCN-CLI-021, 3F-3100): the two VERDICTS on the target —
494
+ * out-of-balance and pending-under-`--strict`. Enumerated rather than "anything non-zero", because
495
+ * unsound (4) and nothing-to-reconcile (5) are not verdicts but the absence of a trustworthy one,
496
+ * and suppressing a verdict never suppresses that. Usage (2) exits before the ladder is reached.
497
+ */
498
+ const VERDICT_CODES = new Set([1, 3]);
499
+ function exitZeroStatus(code) {
500
+ return VERDICT_CODES.has(code) ? 0 : code;
501
+ }
478
502
  // Only run the balance command when this module is executed directly
479
503
  // (`tsx cli-balance/cli.ts`), NOT when imported by the top-level `spec-controller`
480
504
  // bin dispatcher or by a test that exercises the pure edge guards.
@@ -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,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,qBA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CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACnF,IAAI,eAAe;IAAE,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -35,6 +35,13 @@ export interface FlagSpec {
35
35
  /** One-line help text — the description migrated from doc/how_to_use.md. */
36
36
  description: string;
37
37
  }
38
+ /** A positional argument a command takes: its placeholder, and what it is. */
39
+ export interface PositionalSpec {
40
+ /** The placeholder as help shows it (e.g. "<FFF>"). */
41
+ name: string;
42
+ /** One-line help text. */
43
+ description: string;
44
+ }
38
45
  /** A command: its token, a one-line summary, its per-command flag scope, and any config it reads. */
39
46
  export interface CommandSpec {
40
47
  /** The command token (e.g. "balance"). */
@@ -43,6 +50,10 @@ export interface CommandSpec {
43
50
  summary: string;
44
51
  /** The command's per-command flag scope. */
45
52
  flags: FlagSpec[];
53
+ /** The positional arguments the command takes, in order, each once. Omit when it takes flags only. */
54
+ positionals?: PositionalSpec[];
55
+ /** False for a command that keeps no run, so the host refuses `--store`/`--run-id` before it. Omit otherwise. */
56
+ acceptsHostModifiers?: false;
46
57
  /**
47
58
  * Trailing help lines documenting `package.json` config THIS command reads, rendered
48
59
  * verbatim after the flag list. It lives on the command's entry rather than in the
@@ -51,6 +62,23 @@ export interface CommandSpec {
51
62
  * every later command, a field that command does not read (3F-3298). Omit when none.
52
63
  */
53
64
  configHelp?: string[];
65
+ /**
66
+ * Flags this command once accepted and no longer does (3F-3528). Refused like any flag
67
+ * outside `flags`, but as retired: a flag every earlier version accepts and no later one will
68
+ * cannot be cured by bumping a pin, only by moving to what replaced it. Never read by the help
69
+ * renderers, so a retired flag cannot reach `--help` or become accepted by being listed here.
70
+ * APPEND-ONLY. Omit when none.
71
+ */
72
+ retiredFlags?: RetiredFlagSpec[];
73
+ }
74
+ /** A flag a command has retired: what it was, the first version to refuse it, and its successor. */
75
+ export interface RetiredFlagSpec {
76
+ /** The retired flag with dashes (e.g. "--measurements"). */
77
+ name: string;
78
+ /** The first published version whose command no longer accepted it. */
79
+ retiredIn: string;
80
+ /** One sentence naming what a consumer does instead. */
81
+ replacement: string;
54
82
  }
55
83
  /** The two-scope registry: the global host-modifier scope, and the per-command scopes. */
56
84
  export interface CliRegistry {
@@ -1 +1 @@
1
- {"version":3,"file":"cli-registry.d.ts","sourceRoot":"","sources":["../src/cli-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,0FAA0F;AAC1F,MAAM,WAAW,QAAQ;IACvB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,kFAAkF;IAClF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qGAAqG;AACrG,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,0FAA0F;AAC1F,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,8BAA8B;IAC9B,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAgJD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAiBzB,CAAC;AAQF;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAgBhF;AAED;;;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