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
@@ -52,12 +52,7 @@ const balanceFlags = [
52
52
  {
53
53
  name: "--package-json",
54
54
  arg: "<path>",
55
- description: "The target's package.json — its `scripts`, and its specController.fitnessChecks rows: each names a scenario's @SCN, a characteristic, and the command that is the check.",
56
- },
57
- {
58
- name: "--measurements",
59
- arg: "<report.json>",
60
- description: "A measurement report — the number each measured check posted, evidence for the measured fitness checks.",
55
+ description: "The target's package.json — its `scripts`, and its specController.runners, specController.notChecks and specController.deferralTags. A fitness check is declared by its @fitness scenario and the CI step whose id: is that scenario's @SCN; no manifest key names one.",
61
56
  },
62
57
  {
63
58
  name: "--ci-steps",
@@ -89,6 +84,10 @@ const balanceFlags = [
89
84
  name: "--strict",
90
85
  description: "Fail the run (exit 3) when it carries Pending Items — the opt-in that escalates otherwise-run-neutral deferred obligations.",
91
86
  },
87
+ {
88
+ name: "--exit-zero",
89
+ description: "Print the same report but exit 0 on an out-of-balance or scenario-code-error (1) or --strict pending (3) verdict — the on-ramp before gating. Usage (2), unsound (4) and nothing-to-reconcile (5) still fail.",
90
+ },
92
91
  {
93
92
  name: "--help",
94
93
  aliases: ["-h"],
@@ -111,33 +110,14 @@ const balanceConfigHelp = [
111
110
  ` Built-in deferral tags: ${DEFAULT_DEFERRAL_TAGS.map((tag) => `@${tag}`).join(", ")}`,
112
111
  ];
113
112
  /**
114
- * The `tags` command's per-command scope (3F-3300). Two input flags and `--help`/`-h`, and the
115
- * two are `balance`'s own spellings on purpose: a consumer pointing one command at a corpus and a
116
- * manifest should not have to learn a second name for each when they point the other at the same
117
- * two files. The descriptions are this command's — what it reads them FOR is not what `balance`
118
- * reads them for — but the flags are the same flags.
119
- *
120
- * NO `configHelp`. A command's config block documents the `package.json` fields THAT command
121
- * reads, and `tags` reads none yet: the check-tag union and the recognised deferral set arrive
122
- * with the grammar rules (3F-3302 onward), and the entry gains its block then. Appending
123
- * `balance`'s block here would document, under this command, fields this command does not read —
124
- * which is the fault 3F-3298 moved that block onto a command entry to prevent.
113
+ * The flags `balance` has retired. `--measurements` left with the measured route at 3F-3506: no
114
+ * number reaches the ledger, and a fitness check is credited by its own CI step's outcome.
125
115
  */
126
- const tagsFlags = [
127
- {
128
- name: "--features",
129
- arg: "<dir>",
130
- description: "Directory of Gherkin .feature files — the corpus these rules are asked about (default ./features).",
131
- },
116
+ const balanceRetiredFlags = [
132
117
  {
133
- name: "--package-json",
134
- arg: "<path>",
135
- description: "The target's package.json — its specController block, from which the words that name a check and the tags that park a scenario are resolved (default ./package.json).",
136
- },
137
- {
138
- name: "--help",
139
- aliases: ["-h"],
140
- description: "Show this help and exit.",
118
+ name: "--measurements",
119
+ retiredIn: "0.1.0-alpha.5",
120
+ replacement: "A fitness check is credited by the outcome of its own CI step: put the check's @SCN on that step's `id:` and hand balance the run's step record with --ci-steps.",
141
121
  },
142
122
  ];
143
123
  /** The global host-modifier scope — recognised before the command; the CLI-007 surface. */
@@ -164,11 +144,22 @@ export const cliRegistry = {
164
144
  summary: "Reconcile Gherkin scenarios against test/CI evidence and emit the Evidence Reconciliation (Markdown to stdout by default).",
165
145
  flags: balanceFlags,
166
146
  configHelp: balanceConfigHelp,
147
+ retiredFlags: balanceRetiredFlags,
167
148
  },
168
149
  {
169
- name: "tags",
170
- summary: "Police the @SCN scheme over your Gherkin corpus — the rules the scheme itself imposes on the tags and header codes a feature file carries (exit 1 on findings, 2 on a corpus that cannot be read).",
171
- flags: tagsFlags,
150
+ name: "allocate",
151
+ summary: "Print the next @SCN code for a feature part: one past the highest the repository has ever carried, the code alone on stdout.",
152
+ acceptsHostModifiers: false,
153
+ positionals: [
154
+ { name: "<FFF>", description: "The feature part: a feature file's header code, two to five of A-Z and 0-9." },
155
+ ],
156
+ flags: [
157
+ {
158
+ name: "--new",
159
+ description: "Start a part no feature file's header carries yet: its first code, or one past any number the repository already carries for it.",
160
+ },
161
+ { name: "--help", aliases: ["-h"], description: "Show this help and exit." },
162
+ ],
172
163
  },
173
164
  ],
174
165
  };
@@ -199,12 +190,26 @@ export function renderCommandHelp(registry, command) {
199
190
  const configHelp = entry?.configHelp ?? [];
200
191
  return [
201
192
  `spec-controller ${command} — ${entry?.summary ?? ""}`,
193
+ ...positionalHelp(command, entry?.positionals ?? []),
202
194
  "",
203
195
  "Options:",
204
196
  ...lines,
205
197
  ...(configHelp.length > 0 ? ["", ...configHelp] : []),
206
198
  ].join("\n");
207
199
  }
200
+ /** A command's usage line and its arguments, one line each; nothing for a command that takes flags only. */
201
+ function positionalHelp(command, positionals) {
202
+ if (positionals.length === 0)
203
+ return [];
204
+ const width = Math.max(...positionals.map((positional) => positional.name.length));
205
+ return [
206
+ "",
207
+ `Usage: spec-controller ${command} ${positionals.map((positional) => positional.name).join(" ")} [options]`,
208
+ "",
209
+ "Arguments:",
210
+ ...positionals.map((positional) => ` ${positional.name.padEnd(width + 2)}${positional.description}`),
211
+ ];
212
+ }
208
213
  /**
209
214
  * Render the top-level `spec-controller --help` surface (@SCN-CLI-007) FROM the registry:
210
215
  * a Commands section (each command's name + one-line summary) and a Host modifiers section
@@ -1 +1 @@
1
- {"version":3,"file":"cli-registry.js","sourceRoot":"","sources":["../src/cli-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AA0C1D;;;;GAIG;AACH,MAAM,YAAY,GAAe;IAC/B;QACE,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,OAAO;QACZ,WAAW,EACT,uIAAuI;KAC1I;IACD;QACE,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,eAAe;QACpB,WAAW,EAAE,+CAA+C;KAC7D;IACD;QACE,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,eAAe;QACpB,WAAW,EAAE,iDAAiD;KAC/D;IACD;QACE,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,UAAU;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AE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACtF,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CACvC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,GAAG,cAAc,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAC3F,CAAC;IACF,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtF,OAAO;QACL,iEAAiE;QACjE,EAAE;QACF,QAAQ;QACR,qBAAqB,aAAa,2BAA2B;QAC7D,EAAE;QACF,WAAW;QACX,GAAG,YAAY;QACf,EAAE;QACF,sCAAsC;QACtC,GAAG,aAAa;QAChB,EAAE;QACF,yDAAyD;KAC1D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -6,11 +6,10 @@
6
6
  * spec-controller [--store <root>] [--run-id <id>] <command> [command-args]
7
7
  *
8
8
  * Commands: `balance` — the deterministic reconciliation of scenarios against
9
- * observed evidence, standalone on the public core + app layer (no engine); `tags` — the
10
- * @SCN scheme policing itself over the same corpus, which is a fault about the corpus rather
11
- * than a verdict about its evidence, and so has its own status ladder rather than a fifth
12
- * meaning on balance's. The `analyse` / `migrate` capabilities are a separate, closed offering
13
- * built on the same core.
9
+ * observed evidence, standalone on the public core + app layer (no engine). It also polices the
10
+ * corpus's own scenario codes (3F-3635). `allocate` — a query, not a verdict: the next scenario code
11
+ * for a feature part, which keeps no run and so takes no host modifier. The
12
+ * `analyse` / `migrate` capabilities are a separate, closed offering built on the same core.
14
13
  *
15
14
  * Storage is a CROSS-CUTTING host modifier, not a command. A leading `--store <root>`
16
15
  * turns any command into a STORED run: the host wraps the command via the kept-run
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;GAoBG"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG"}
package/dist/cli.js CHANGED
@@ -6,11 +6,10 @@
6
6
  * spec-controller [--store <root>] [--run-id <id>] <command> [command-args]
7
7
  *
8
8
  * Commands: `balance` — the deterministic reconciliation of scenarios against
9
- * observed evidence, standalone on the public core + app layer (no engine); `tags` — the
10
- * @SCN scheme policing itself over the same corpus, which is a fault about the corpus rather
11
- * than a verdict about its evidence, and so has its own status ladder rather than a fifth
12
- * meaning on balance's. The `analyse` / `migrate` capabilities are a separate, closed offering
13
- * built on the same core.
9
+ * observed evidence, standalone on the public core + app layer (no engine). It also polices the
10
+ * corpus's own scenario codes (3F-3635). `allocate` — a query, not a verdict: the next scenario code
11
+ * for a feature part, which keeps no run and so takes no host modifier. The
12
+ * `analyse` / `migrate` capabilities are a separate, closed offering built on the same core.
14
13
  *
15
14
  * Storage is a CROSS-CUTTING host modifier, not a command. A leading `--store <root>`
16
15
  * turns any command into a STORED run: the host wraps the command via the kept-run
@@ -22,10 +21,10 @@
22
21
  */
23
22
  import { dirname } from "node:path";
24
23
  import { runBalance } from "./cli-balance/cli.js";
25
- import { runTags } from "./corpus/cli.js";
24
+ import { runAllocate } from "./cli-allocate/cli.js";
26
25
  import { resolveSourceSha, resolveToolIdentity } from "./run-management/resolveRunInputs.js";
27
26
  import { executeKeptRun, resolveRunId, } from "./run-management/keptRun.js";
28
- import { parseHostInvocation, wrapCommandArgv, peekFlag } from "./host.js";
27
+ import { parseHostInvocation, wrapCommandArgv, peekFlag, answerUnknownCommand, modifiersNotTakenRefusal, } from "./host.js";
29
28
  import { cliRegistry, renderTopLevelHelp } from "./cli-registry.js";
30
29
  /** Dispatch a command to its handler with the given (clean or store-wrapped) argv. */
31
30
  function runCommand(command, argv) {
@@ -33,16 +32,31 @@ function runCommand(command, argv) {
33
32
  case "balance":
34
33
  runBalance(argv);
35
34
  return;
36
- case "tags":
37
- runTags(argv);
35
+ case "allocate":
36
+ runAllocate(argv);
38
37
  return;
39
- default:
40
- process.stderr.write(`spec-controller: unknown command "${command}".\n\n${renderTopLevelHelp(cliRegistry)}\n`);
41
- process.exit(1);
38
+ default: {
39
+ const answer = answerUnknownCommand(command, renderTopLevelHelp(cliRegistry));
40
+ process.stderr.write(answer.stderr);
41
+ process.exit(answer.exitCode);
42
+ }
42
43
  }
43
44
  }
45
+ /**
46
+ * Refuse, at the usage status, what the leading tokens get wrong, before any command or stored run
47
+ * starts, so nothing is written anywhere: a usage fault among them (@SCN-CLI-059), or modifiers
48
+ * that would keep a run given to a command that keeps none.
49
+ */
50
+ function refuseLeadingFaults(inv) {
51
+ const refusal = inv.refusal ?? modifiersNotTakenRefusal(inv);
52
+ if (refusal === undefined)
53
+ return;
54
+ process.stderr.write(refusal + "\n");
55
+ process.exit(2);
56
+ }
44
57
  function main(hostArgv) {
45
58
  const inv = parseHostInvocation(hostArgv);
59
+ refuseLeadingFaults(inv);
46
60
  const command = inv.command;
47
61
  if (command === undefined || command === "help" || command === "--help" || command === "-h") {
48
62
  process.stdout.write(renderTopLevelHelp(cliRegistry) + "\n");
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,M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gB,CAAC;QACf,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC;QAClD,SAAS,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;KAClE,CAAC,IAAI,SAAS,CAAC;IAElB,MAAM,IAAI,GAAgB,EAAE,SAAS,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAClE,wFAAwF;IACxF,0CAA0C;IAC1C,oFAAoF;IACpF,sFAAsF;IACtF,0EAA0E;IAC1E,MAAM,YAAY,GAAG,mBAAmB,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAoB;QAC5B,SAAS;QACT,OAAO,EAAE,YAAY,CAAC,OAAO,IAAI,SAAS;QAC1C,WAAW,EAAE,YAAY,CAAC,WAAW;QACrC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KAC/B,CAAC;IAEF,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CACtD,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CACxE,CAAC;IAEF,0FAA0F;IAC1F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -5,8 +5,8 @@
5
5
  * established Cucumber deferral conventions.
6
6
  *
7
7
  * This is **product policy, not a core-domain invariant** — an evolvable list of tag
8
- * strings, so it lives in the application layer, NOT on the frozen v1 core barrel
9
- * (@SCN-API-001). The core `parseScenarios` recognises only the deferral set it is
8
+ * strings, so it lives in the application layer, NOT on the v1 core barrel.
9
+ * The core `parseScenarios` recognises only the deferral set it is
10
10
  * handed (its default is `[]`, a policy-free pure core); the app is the single source
11
11
  * of the starter policy and always passes the resolved set (starter ∪ configured) into
12
12
  * the parser at the ingest edge. Both `resolveDeferralTags` (the `@SCN-PND-021` config
@@ -5,8 +5,8 @@
5
5
  * established Cucumber deferral conventions.
6
6
  *
7
7
  * This is **product policy, not a core-domain invariant** — an evolvable list of tag
8
- * strings, so it lives in the application layer, NOT on the frozen v1 core barrel
9
- * (@SCN-API-001). The core `parseScenarios` recognises only the deferral set it is
8
+ * strings, so it lives in the application layer, NOT on the v1 core barrel.
9
+ * The core `parseScenarios` recognises only the deferral set it is
10
10
  * handed (its default is `[]`, a policy-free pure core); the app is the single source
11
11
  * of the starter policy and always passes the resolved set (starter ∪ configured) into
12
12
  * the parser at the ingest edge. Both `resolveDeferralTags` (the `@SCN-PND-021` config
package/dist/host.d.ts CHANGED
@@ -12,6 +12,7 @@
12
12
  *
13
13
  * @SCN-RMG-004 — features/run-management.feature.
14
14
  */
15
+ import { type CommandSpec, type FlagSpec } from "./cli-registry.js";
15
16
  /** A parsed host invocation: leading global options, then the command and its clean args. */
16
17
  export interface HostInvocation {
17
18
  /** The injected store root from a leading `--store <root>`, or undefined (no store). */
@@ -22,6 +23,11 @@ export interface HostInvocation {
22
23
  command?: string;
23
24
  /** The command's own args — everything after the command token, verbatim. */
24
25
  commandArgs: string[];
26
+ /**
27
+ * The usage fault in the leading tokens, when there is one: the host refuses it at exit 2 before
28
+ * any command or stored run starts (@SCN-CLI-059).
29
+ */
30
+ refusal?: string;
25
31
  }
26
32
  /**
27
33
  * Parse the host argv into its leading global options (`--store`, `--run-id`) and the
@@ -31,8 +37,9 @@ export interface HostInvocation {
31
37
  * --features f` yields the store + `balance` + `[--features, f]`, while `balance --store
32
38
  * /s` leaves `--store` in the command's args (a `--store` AFTER the command is the
33
39
  * command's own arg, never a host store directive) — the "global before command" contract.
40
+ * A modifier with nothing after it is refused (@SCN-CLI-067); an empty argv is the bare help.
34
41
  */
35
- export declare function parseHostInvocation(argv: readonly string[]): HostInvocation;
42
+ export declare function parseHostInvocation(argv: readonly string[], globalFlags?: readonly FlagSpec[], commands?: readonly string[]): HostInvocation;
36
43
  /**
37
44
  * Build the wrapped command argv: the command's clean args followed by a repeated
38
45
  * `--format <spec>` per store-dir output spec. Pure — the impure runner hands the result
@@ -47,4 +54,21 @@ export declare function wrapCommandArgv(commandArgs: readonly string[], formatSp
47
54
  * them in its own args. Returns undefined when the flag is absent or has no value.
48
55
  */
49
56
  export declare function peekFlag(argv: readonly string[], name: string): string | undefined;
57
+ /** The host's answer to a command it does not know: what goes to stderr, and the status. */
58
+ export interface UnknownCommandAnswer {
59
+ exitCode: number;
60
+ stderr: string;
61
+ }
62
+ /**
63
+ * Answer a command the registry does not carry. It is given the command token and the rendered
64
+ * help, never the command's args, so no flag after the command can change the answer.
65
+ *
66
+ * An unknown command is a usage fault, so it exits 2, the published usage code
67
+ * (packages/spec-controller/README.md), which `--exit-zero` never masks (3F-3649).
68
+ *
69
+ * @SCN-CLI-056 @SCN-CLI-057 — features/cli-balance.feature.
70
+ */
71
+ export declare function answerUnknownCommand(command: string, help: string): UnknownCommandAnswer;
72
+ /** The refusal for host modifiers given before a command that takes none, else undefined. */
73
+ export declare function modifiersNotTakenRefusal(inv: HostInvocation, commands?: readonly CommandSpec[]): string | undefined;
50
74
  //# sourceMappingURL=host.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,6FAA6F;AAC7F,MAAM,WAAW,cAAc;IAC7B,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,WAAW,EAAE,MAA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IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASlF;AAED,4FAA4F;AAC5F,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAKxF;AAED,6FAA6F;AAC7F,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,cAAc,EACnB,QAAQ,GAAE,SAAS,WAAW,EAAyB,GACtD,MAAM,GAAG,SAAS,CAUpB"}
package/dist/host.js CHANGED
@@ -12,6 +12,8 @@
12
12
  *
13
13
  * @SCN-RMG-004 — features/run-management.feature.
14
14
  */
15
+ import { equalsFormRefusal, givenTwiceRefusal, isEqualsForm, isMissingValue, missingValueRefusal, valueFlagsOf, } from "./cli-args.js";
16
+ import { cliRegistry } from "./cli-registry.js";
15
17
  /**
16
18
  * Parse the host argv into its leading global options (`--store`, `--run-id`) and the
17
19
  * command + its clean args. Global options are recognised ONLY before the command: the
@@ -20,26 +22,101 @@
20
22
  * --features f` yields the store + `balance` + `[--features, f]`, while `balance --store
21
23
  * /s` leaves `--store` in the command's args (a `--store` AFTER the command is the
22
24
  * command's own arg, never a host store directive) — the "global before command" contract.
25
+ * A modifier with nothing after it is refused (@SCN-CLI-067); an empty argv is the bare help.
23
26
  */
24
- export function parseHostInvocation(argv) {
25
- let store;
26
- let runId;
27
+ export function parseHostInvocation(argv, globalFlags = cliRegistry.global, commands = cliRegistry.commands.map((command) => command.name)) {
28
+ // The modifiers and the values they take are the registry's global scope, never a list kept here
29
+ // (@SCN-CLI-059): a modifier added later is read, and refused without its value, by construction.
30
+ const modifiers = valueFlagsOf(globalFlags);
31
+ const values = new Map();
27
32
  let i = 0;
28
33
  for (; i < argv.length; i++) {
29
- const token = argv[i];
30
- if (token === "--store" && i + 1 < argv.length) {
31
- store = argv[i + 1];
32
- i++;
33
- continue;
34
+ const token = argv[i] ?? "";
35
+ const modifier = modifiers.get(token);
36
+ if (modifier === undefined) {
37
+ const refusal = leadingFlagRefusal(token, modifiers, globalFlags);
38
+ if (refusal !== undefined)
39
+ return { commandArgs: [], refusal };
40
+ break; // first non-modifier token is the command
34
41
  }
35
- if (token === "--run-id" && i + 1 < argv.length) {
36
- runId = argv[i + 1];
37
- i++;
38
- continue;
39
- }
40
- break; // first non-global-option token is the command
42
+ const value = argv[i + 1];
43
+ const refusal = modifierRefusal(token, modifier, argv.slice(i + 1, i + 3), { values, commands });
44
+ if (refusal !== undefined)
45
+ return { commandArgs: [], refusal };
46
+ values.set(modifier.name, value ?? "");
47
+ i++;
48
+ }
49
+ if (i === argv.length && values.size > 0)
50
+ return { commandArgs: [], refusal: noCommandRefusal([...values.keys()]) };
51
+ return {
52
+ store: values.get("--store"),
53
+ runId: values.get("--run-id"),
54
+ command: argv[i],
55
+ commandArgs: argv.slice(i + 1),
56
+ };
57
+ }
58
+ /**
59
+ * The refusal a modifier earns where it stands, else undefined; `ahead` is its value and the token
60
+ * after it. Given twice, it is never read as its last value (@SCN-CLI-064): `--store A --store B` used
61
+ * to store under B without a word. Given no value, it is never handed the next token (@SCN-CLI-059):
62
+ * `--store --run-id r1` used to store under a directory called `--run-id`. Given the command as its
63
+ * value with no command after it, it has eaten the command (@SCN-CLI-066): `--store balance
64
+ * --features f` used to blame `--features`, and `--store balance` alone answered help at exit 0. A
65
+ * command name followed by the command is still a value: `--store balance balance …` is read.
66
+ */
67
+ function modifierRefusal(token, modifier, [value, after], read) {
68
+ if (read.values.has(modifier.name))
69
+ return givenTwiceRefusal(token, "spec-controller");
70
+ if (isMissingValue(value))
71
+ return missingValueRefusal(token, modifier, "spec-controller");
72
+ if (read.commands.includes(value ?? "") && (after === undefined || after.startsWith("-"))) {
73
+ return commandAsValueRefusal(token, modifier, value ?? "");
41
74
  }
42
- return { store, runId, command: argv[i], commandArgs: argv.slice(i + 1) };
75
+ return undefined;
76
+ }
77
+ /**
78
+ * The refusal for host modifiers with nothing after them: every modifier given, in one line, and the
79
+ * fix (@SCN-CLI-067). Given last, `--store <root>` used to answer the top-level help at exit 0 having
80
+ * run nothing, a false green for a CI step that lost its command word (3F-3686). Help after a
81
+ * modifier is a command here, and a bare `spec-controller` never reaches this.
82
+ */
83
+ function noCommandRefusal(given) {
84
+ return (`No command followed the host modifiers given (${given.join(", ")}), so nothing ran: ` +
85
+ `a host modifier needs a command after it, or --help.\n` +
86
+ `Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
87
+ }
88
+ /** The refusal for a modifier that took the command as its value: the modifier, the command, and the fix. */
89
+ function commandAsValueRefusal(token, modifier, command) {
90
+ return (`The ${token} host modifier took '${command}', a command, as its value, and left no command to run.\n` +
91
+ `Give ${token} its own value, as in 'spec-controller ${token} ${modifier.arg ?? ""} ${command} …'. ` +
92
+ `Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
93
+ }
94
+ /**
95
+ * The refusal a leading token that is no modifier earns, else undefined (it is the command). A
96
+ * modifier written `--store=<root>` is a form that is not read (@SCN-CLI-065), never a flag out of
97
+ * place; any other flag here is out of place, never a command (@SCN-CLI-060): `--exit-zero balance`
98
+ * used to answer `unknown command "--exit-zero"`. The top-level help stays where it was.
99
+ */
100
+ function leadingFlagRefusal(token, modifiers, globalFlags) {
101
+ if (isEqualsForm(token))
102
+ return equalsFormRefusal(token, modifiers, "spec-controller");
103
+ if (isFlagOutOfPlace(token))
104
+ return flagBeforeCommandRefusal(token, globalFlags);
105
+ return undefined;
106
+ }
107
+ /** The help the host answers in the command's place, which is the one flag it takes there. */
108
+ const TOP_LEVEL_HELP = new Set(["--help", "-h"]);
109
+ /** True for a flag-shaped token that is not the top-level help. */
110
+ function isFlagOutOfPlace(token) {
111
+ return token.length > 1 && token.startsWith("-") && !TOP_LEVEL_HELP.has(token);
112
+ }
113
+ /** The refusal for a flag given before the command: the flag, what goes there, and where it goes. */
114
+ function flagBeforeCommandRefusal(flag, globalFlags) {
115
+ const modifiers = globalFlags.map((modifier) => modifier.name).join(", ");
116
+ return (`The ${flag} flag was given before the command. Before the command, spec-controller takes ` +
117
+ `only its host modifiers (${modifiers}); a command's own flags go after it, as in ` +
118
+ `'spec-controller <command> ${flag}'.\n` +
119
+ `Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
43
120
  }
44
121
  /**
45
122
  * Build the wrapped command argv: the command's clean args followed by a repeated
@@ -66,4 +143,31 @@ export function peekFlag(argv, name) {
66
143
  }
67
144
  return undefined;
68
145
  }
146
+ /**
147
+ * Answer a command the registry does not carry. It is given the command token and the rendered
148
+ * help, never the command's args, so no flag after the command can change the answer.
149
+ *
150
+ * An unknown command is a usage fault, so it exits 2, the published usage code
151
+ * (packages/spec-controller/README.md), which `--exit-zero` never masks (3F-3649).
152
+ *
153
+ * @SCN-CLI-056 @SCN-CLI-057 — features/cli-balance.feature.
154
+ */
155
+ export function answerUnknownCommand(command, help) {
156
+ return {
157
+ exitCode: 2,
158
+ stderr: `spec-controller: unknown command "${command}".\n\n${help}\n`,
159
+ };
160
+ }
161
+ /** The refusal for host modifiers given before a command that takes none, else undefined. */
162
+ export function modifiersNotTakenRefusal(inv, commands = cliRegistry.commands) {
163
+ const entry = commands.find((command) => command.name === inv.command);
164
+ if (entry?.acceptsHostModifiers !== false)
165
+ return undefined;
166
+ const given = [inv.store === undefined ? [] : ["--store"], inv.runId === undefined ? [] : ["--run-id"]].flat();
167
+ if (given.length === 0)
168
+ return undefined;
169
+ return (`spec-controller: usage error — '${entry.name}' takes no host modifier, and was given ${given.join(", ")}: ` +
170
+ `it answers a query and keeps no run.\n` +
171
+ `Run 'spec-controller ${entry.name} …' without them.`);
172
+ }
69
173
  //# sourceMappingURL=host.js.map
package/dist/host.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH;;;;;;;;GA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E: `string → parse errors`. No fs, no process — the file READ lives beside it at the ingest
24
24
  * edge, as it does for every other input.
25
25
  *
26
- * WHY IT LIVES IN THE APP, NOT CORE. Core's barrel is the FROZEN v1 contract surface, guarded
27
- * both directions by @SCN-API-001 — a symbol added there reds CI. This validator is an INGEST
28
- * concern (it decides whether an input can be read at all), not part of the reconciliation
29
- * contract downstream consumers build on, so it belongs with the other readers at the app edge
30
- * and the frozen surface stays untouched.
26
+ * WHY IT LIVES IN THE APP, NOT CORE. Core's barrel is the v1 contract surface downstream consumers
27
+ * build on. Since 3F-3449 nothing reds when a symbol is added there — the guard that reconciled it
28
+ * both directions is gone — so keeping it narrow is a discipline rather than a gate. This validator
29
+ * is an INGEST concern (it decides whether an input can be read at all), not part of the
30
+ * reconciliation contract, so it belongs with the other readers at the app edge and the v1 surface
31
+ * stays untouched.
31
32
  */
32
33
  /** A Gherkin parse failure: the file could not be read as Gherkin at all. */
33
34
  export interface GherkinParseError {
@@ -73,13 +74,9 @@ export declare class UnreadableFeatureCorpusError extends Error {
73
74
  * refusal means for it.
74
75
  *
75
76
  * WHY A TYPED ERROR RATHER THAN AN EMPTY CORPUS. The obvious fix is for `discoverFeatures` to hand
76
- * back `[]` when the directory is not there. Measured, that would ship a NEW false green in a
77
- * second command: `spec-controller tags` reaches the same reader through `readCorpusInputs`, whose
78
- * GENERIC catch is the only thing turning an absent corpus — and, since `tags` carries no
79
- * `checkInputsExist`, a supplied-but-absent `--features` too — into `The corpus could not be
80
- * read: …` at exit 2. Tolerance at the reader turns both into `tags: OK …` at exit 0, inside the
81
- * slice whose whole purpose is killing a vacuous certification. Typed, both survive untouched:
82
- * this IS an `Error`, so it still lands in that generic catch.
77
+ * back `[]` when the directory is not there, and that would decide for every reader that absence
78
+ * is empty. Typed, each caller decides: `balance` reads it as no corpus (@SCN-CLI-017), and any
79
+ * other reader still meets a refusal. (The second command this guarded, `tags`, left at 3F-3635.)
83
80
  *
84
81
  * IT CARRIES THE DIRECTORY because the report is owed the name of what it examined — "I found no
85
82
  * record" and "I found no regression" must never wear one word (3F-2947), and a consumer told
@@ -1 +1 @@
1
- {"version":3,"file":"gherkinValidation.d.ts","sourceRoot":"","sources":["../../src/ingest/gherkinValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAKH,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAa/E;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC;gBAElC,MAAM,EAAE,SAAS,iBAAiB,EAAE;CAUjD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,SAAS,EAAE,MAAM;CAK9B"}
1
+ {"version":3,"file":"gherkinValidation.d.ts","sourceRoot":"","sources":["../../src/ingest/gherkinValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAa/E;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC;gBAElC,MAAM,EAAE,SAAS,iBAAiB,EAAE;CAUjD;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,SAAS,EAAE,MAAM;CAK9B"}
@@ -23,11 +23,12 @@
23
23
  * PURE: `string → parse errors`. No fs, no process — the file READ lives beside it at the ingest
24
24
  * edge, as it does for every other input.
25
25
  *
26
- * WHY IT LIVES IN THE APP, NOT CORE. Core's barrel is the FROZEN v1 contract surface, guarded
27
- * both directions by @SCN-API-001 — a symbol added there reds CI. This validator is an INGEST
28
- * concern (it decides whether an input can be read at all), not part of the reconciliation
29
- * contract downstream consumers build on, so it belongs with the other readers at the app edge
30
- * and the frozen surface stays untouched.
26
+ * WHY IT LIVES IN THE APP, NOT CORE. Core's barrel is the v1 contract surface downstream consumers
27
+ * build on. Since 3F-3449 nothing reds when a symbol is added there — the guard that reconciled it
28
+ * both directions is gone — so keeping it narrow is a discipline rather than a gate. This validator
29
+ * is an INGEST concern (it decides whether an input can be read at all), not part of the
30
+ * reconciliation contract, so it belongs with the other readers at the app edge and the v1 surface
31
+ * stays untouched.
31
32
  */
32
33
  import { AstBuilder, GherkinClassicTokenMatcher, Parser } from "@cucumber/gherkin";
33
34
  import { IdGenerator } from "@cucumber/messages";
@@ -88,13 +89,9 @@ export class UnreadableFeatureCorpusError extends Error {
88
89
  * refusal means for it.
89
90
  *
90
91
  * WHY A TYPED ERROR RATHER THAN AN EMPTY CORPUS. The obvious fix is for `discoverFeatures` to hand
91
- * back `[]` when the directory is not there. Measured, that would ship a NEW false green in a
92
- * second command: `spec-controller tags` reaches the same reader through `readCorpusInputs`, whose
93
- * GENERIC catch is the only thing turning an absent corpus — and, since `tags` carries no
94
- * `checkInputsExist`, a supplied-but-absent `--features` too — into `The corpus could not be
95
- * read: …` at exit 2. Tolerance at the reader turns both into `tags: OK …` at exit 0, inside the
96
- * slice whose whole purpose is killing a vacuous certification. Typed, both survive untouched:
97
- * this IS an `Error`, so it still lands in that generic catch.
92
+ * back `[]` when the directory is not there, and that would decide for every reader that absence
93
+ * is empty. Typed, each caller decides: `balance` reads it as no corpus (@SCN-CLI-017), and any
94
+ * other reader still meets a refusal. (The second command this guarded, `tags`, left at 3F-3635.)
98
95
  *
99
96
  * IT CARRIES THE DIRECTORY because the report is owed the name of what it examined — "I found no
100
97
  * record" and "I found no regression" must never wear one word (3F-2947), and a consumer told
@@ -1 +1 @@
1
- {"version":3,"file":"gherkinValidation.js","sourceRoot":"","sources":["../../src/ingest/gherkinValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAUjD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,MAAc;IACxD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,0BAA0B,EAAE,CAAC,CAAC;IAEhG,IAAI,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,0FAA0F;QAC1F,sFAAsF;QACtF,0FAA0F;QAC1F,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED;;;;;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