spec-controller 0.1.0-alpha.21 → 0.1.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cli-args.d.ts +33 -7
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +64 -6
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-balance/cli.d.ts.map +1 -1
- package/dist/cli-balance/cli.js +22 -7
- package/dist/cli-balance/cli.js.map +1 -1
- package/dist/cli-registry.d.ts.map +1 -1
- package/dist/cli-registry.js +1 -36
- package/dist/cli-registry.js.map +1 -1
- package/dist/cli.d.ts +3 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -9
- package/dist/cli.js.map +1 -1
- package/dist/host.d.ts +7 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +42 -14
- package/dist/host.js.map +1 -1
- package/dist/ingest/gherkinValidation.d.ts +3 -7
- package/dist/ingest/gherkinValidation.d.ts.map +1 -1
- package/dist/ingest/gherkinValidation.js +3 -7
- package/dist/ingest/gherkinValidation.js.map +1 -1
- package/dist/ingest/ingestQualityChecks.d.ts +3 -4
- package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
- package/dist/ingest/ingestQualityChecks.js +16 -10
- package/dist/ingest/ingestQualityChecks.js.map +1 -1
- package/package.json +2 -2
- package/dist/corpus/cli.d.ts +0 -34
- package/dist/corpus/cli.d.ts.map +0 -1
- package/dist/corpus/cli.js +0 -125
- package/dist/corpus/cli.js.map +0 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Or without installing anything:
|
|
|
20
20
|
npx spec-controller@alpha balance --help
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
`@alpha` is not optional until `0.1.0` publishes: a bare install resolves `latest`, which npm set to `0.1.0-alpha.1` on the first publish, and that version has
|
|
23
|
+
`@alpha` is not optional until `0.1.0` publishes: a bare install resolves `latest`, which npm set to `0.1.0-alpha.1` on the first publish, and that version has no `--ci-steps` and no scenario code errors.
|
|
24
24
|
|
|
25
25
|
## Your first run
|
|
26
26
|
|
|
@@ -42,7 +42,7 @@ To bring it into a pipeline you already have without redding it on day one, add
|
|
|
42
42
|
spec-controller balance --features ./features --vitest ./vitest-report.json --exit-zero
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
The report is byte for byte the one the gate prints: the same rows, the same out-of-balance count, and the same headline naming the code the gate would give. Only the exit status moves. Out-of-balance (`1`) and pending under `--strict` (`3`) exit `0`. Usage (`2`), unsound (`4`) and nothing to reconcile (`5`) still fail, because each means the run could not give a verdict at all, and a flag that suppresses verdicts does not suppress that.
|
|
45
|
+
The report is byte for byte the one the gate prints: the same rows, the same out-of-balance count, and the same headline naming the code the gate would give. Only the exit status moves. Out-of-balance and scenario code errors (`1`), and pending under `--strict` (`3`), exit `0`. Usage (`2`), unsound (`4`) and nothing to reconcile (`5`) still fail, because each means the run could not give a verdict at all, and a flag that suppresses verdicts does not suppress that.
|
|
46
46
|
|
|
47
47
|
Work the out-of-balance rows down, then delete `--exit-zero`, and the gate is on. Don't wrap the step in `continue-on-error` or `|| true` instead: those swallow the codes that mean the run could not be trusted, and they leave nothing in the command to say the gate is off.
|
|
48
48
|
|
|
@@ -62,7 +62,7 @@ A scenario tagged `@unit` names an obligation — a unit test must exist and pas
|
|
|
62
62
|
| Exit | What it says |
|
|
63
63
|
| --- | --- |
|
|
64
64
|
| `0` | balanced — every obligation has evidence, and it holds |
|
|
65
|
-
| `1` | out-of-balance — the two records disagree, and the report says where |
|
|
65
|
+
| `1` | out-of-balance — the two records disagree, and the report says where; or a scenario code is misfiled, listed under `## Scenario code errors` |
|
|
66
66
|
| `2` | usage — the invocation was wrong |
|
|
67
67
|
| `3` | balanced, but carrying Pending Items, and you asked for `--strict` |
|
|
68
68
|
| `4` | unsound — a proving suite failed to collect, so the ledger could not be trusted to disagree |
|
package/dist/cli-args.d.ts
CHANGED
|
@@ -13,11 +13,9 @@
|
|
|
13
13
|
* command rather than for the one this code was written beside. `checkUnknownFlags` took the
|
|
14
14
|
* registry and looked `balance` up inside itself; the command is a parameter now, exactly as it
|
|
15
15
|
* became one for `renderCommandHelp` (3F-3298). @SCN-CLI-009's scenario is unchanged and still
|
|
16
|
-
* asks about `balance`:
|
|
17
|
-
* residual — that an unregistered flag to `tags` is unproven by a scenario of its own — is named
|
|
18
|
-
* on 3F-3286 rather than left silent.
|
|
16
|
+
* asks about `balance`: a command added later gets the same bounding BY CONSTRUCTION.
|
|
19
17
|
*/
|
|
20
|
-
import type { CliRegistry } from "./cli-registry.js";
|
|
18
|
+
import type { CliRegistry, FlagSpec } from "./cli-registry.js";
|
|
21
19
|
/**
|
|
22
20
|
* Parse `--flag value` pairs from a command's argv into a record, keys with the `--` stripped.
|
|
23
21
|
*
|
|
@@ -31,6 +29,33 @@ import type { CliRegistry } from "./cli-registry.js";
|
|
|
31
29
|
* bounding has nothing else to do.
|
|
32
30
|
*/
|
|
33
31
|
export declare function parseArgs(argv: readonly string[]): Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* The value flags of one scope: every flag the registry gives a value placeholder (`arg`), by
|
|
34
|
+
* name and alias, dashes kept. Read from the registry alone, so a value flag added later is one.
|
|
35
|
+
*/
|
|
36
|
+
export declare function valueFlagsOf(flags: readonly FlagSpec[]): Map<string, FlagSpec>;
|
|
37
|
+
/**
|
|
38
|
+
* True when the token after a value flag is not a value: there is none, it is the next flag (the
|
|
39
|
+
* same `--` test `parseArgs` reads a flag by), or it is empty — an unset variable, quoted.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isMissingValue(next: string | undefined): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* A flag that takes a value, given none, is a usage fault (@SCN-CLI-058, 3F-3639). It reads the
|
|
44
|
+
* RAW argv, because `parseArgs` has already turned a missing value into the string "true" — which a
|
|
45
|
+
* path flag then looked for on disk, `--target` recorded, and `--format` dropped on its way to a
|
|
46
|
+
* verdict `--exit-zero` turned green. Returns the refusal for the first such flag, else null.
|
|
47
|
+
*/
|
|
48
|
+
export declare function checkMissingValues(argv: readonly string[], registry: CliRegistry, command: string): string | null;
|
|
49
|
+
/** The refusal for a value flag given none: the flag, the value it takes, and where the flags are listed. */
|
|
50
|
+
export declare function missingValueRefusal(given: string, flag: FlagSpec, scope: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* A host modifier given after the command is out of place, not unknown (@SCN-CLI-061, 3F-3639): the
|
|
53
|
+
* flag exists, so @SCN-CLI-009's advice to bump a pin to a version that accepts it is false. Its own
|
|
54
|
+
* check rather than a branch of `checkUnknownFlags`, because the caller refuses this one through
|
|
55
|
+
* `process.exit` — the unknown-flag path sets a status and returns, which inside a stored run reaches
|
|
56
|
+
* the scaffold that stamps a run.yaml (3F-3650). Returns the refusal for the first such flag, else null.
|
|
57
|
+
*/
|
|
58
|
+
export declare function checkMisplacedHostModifiers(args: Record<string, string>, registry: CliRegistry, command: string): string | null;
|
|
34
59
|
/**
|
|
35
60
|
* The registry-bounded flag check at a command's CLI edge (@SCN-CLI-009). A command accepts ONLY
|
|
36
61
|
* the flags its per-command registry scope LISTS (by `name` or `alias`); an unregistered flag — a
|
|
@@ -42,9 +67,10 @@ export declare function parseArgs(argv: readonly string[]): Record<string, strin
|
|
|
42
67
|
* PURE and `@unit`-testable: the parsed args (keys already `--`-stripped) plus the registry and
|
|
43
68
|
* the command to bound against, returning the FIRST unregistered flag as a typed usage error
|
|
44
69
|
* naming it WITH its dashes — routed to stderr and the enumerated usage status 2 by the caller,
|
|
45
|
-
* never 1, never a silent run — else null. The global `--store`/`--run-id` modifiers
|
|
46
|
-
*
|
|
47
|
-
*
|
|
70
|
+
* never 1, never a silent run — else null. The global `--store`/`--run-id` modifiers are consumed
|
|
71
|
+
* by the top-level dispatcher when they come BEFORE the command; written after it they reach the
|
|
72
|
+
* command, and `checkMisplacedHostModifiers` refuses them as out of place before this runs
|
|
73
|
+
* (@SCN-CLI-061).
|
|
48
74
|
*
|
|
49
75
|
* A COMMAND THE REGISTRY DOES NOT NAME ACCEPTS NOTHING, which is the honest reading rather than a
|
|
50
76
|
* degenerate one: an unregistered command has no scope, so every flag given to it is outside it.
|
package/dist/cli-args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAe,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5E;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBzE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAO9E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,IAAI,CAUf;AAED,6GAA6G;AAC7G,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAKxF;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,IAAI,CASf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CA2Bf"}
|
package/dist/cli-args.js
CHANGED
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
* command rather than for the one this code was written beside. `checkUnknownFlags` took the
|
|
14
14
|
* registry and looked `balance` up inside itself; the command is a parameter now, exactly as it
|
|
15
15
|
* became one for `renderCommandHelp` (3F-3298). @SCN-CLI-009's scenario is unchanged and still
|
|
16
|
-
* asks about `balance`:
|
|
17
|
-
* residual — that an unregistered flag to `tags` is unproven by a scenario of its own — is named
|
|
18
|
-
* on 3F-3286 rather than left silent.
|
|
16
|
+
* asks about `balance`: a command added later gets the same bounding BY CONSTRUCTION.
|
|
19
17
|
*/
|
|
20
18
|
/**
|
|
21
19
|
* Parse `--flag value` pairs from a command's argv into a record, keys with the `--` stripped.
|
|
@@ -47,6 +45,65 @@ export function parseArgs(argv) {
|
|
|
47
45
|
}
|
|
48
46
|
return args;
|
|
49
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The value flags of one scope: every flag the registry gives a value placeholder (`arg`), by
|
|
50
|
+
* name and alias, dashes kept. Read from the registry alone, so a value flag added later is one.
|
|
51
|
+
*/
|
|
52
|
+
export function valueFlagsOf(flags) {
|
|
53
|
+
const valueFlags = new Map();
|
|
54
|
+
for (const flag of flags) {
|
|
55
|
+
if (flag.arg === undefined)
|
|
56
|
+
continue;
|
|
57
|
+
for (const name of [flag.name, ...(flag.aliases ?? [])])
|
|
58
|
+
valueFlags.set(name, flag);
|
|
59
|
+
}
|
|
60
|
+
return valueFlags;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* True when the token after a value flag is not a value: there is none, it is the next flag (the
|
|
64
|
+
* same `--` test `parseArgs` reads a flag by), or it is empty — an unset variable, quoted.
|
|
65
|
+
*/
|
|
66
|
+
export function isMissingValue(next) {
|
|
67
|
+
return next === undefined || next === "" || next.startsWith("--");
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A flag that takes a value, given none, is a usage fault (@SCN-CLI-058, 3F-3639). It reads the
|
|
71
|
+
* RAW argv, because `parseArgs` has already turned a missing value into the string "true" — which a
|
|
72
|
+
* path flag then looked for on disk, `--target` recorded, and `--format` dropped on its way to a
|
|
73
|
+
* verdict `--exit-zero` turned green. Returns the refusal for the first such flag, else null.
|
|
74
|
+
*/
|
|
75
|
+
export function checkMissingValues(argv, registry, command) {
|
|
76
|
+
const entry = registry.commands.find((c) => c.name === command);
|
|
77
|
+
const valueFlags = valueFlagsOf(entry?.flags ?? []);
|
|
78
|
+
for (let i = 0; i < argv.length; i++) {
|
|
79
|
+
const flag = valueFlags.get(argv[i] ?? "");
|
|
80
|
+
if (flag !== undefined && isMissingValue(argv[i + 1])) {
|
|
81
|
+
return missingValueRefusal(argv[i] ?? flag.name, flag, `spec-controller ${command}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
/** The refusal for a value flag given none: the flag, the value it takes, and where the flags are listed. */
|
|
87
|
+
export function missingValueRefusal(given, flag, scope) {
|
|
88
|
+
return (`The ${given} flag of '${scope}' needs a value — ${given} ${flag.arg ?? ""} — and was given none.\n` +
|
|
89
|
+
`Run '${scope} --help' to see the flags this version accepts and the values they take.`);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A host modifier given after the command is out of place, not unknown (@SCN-CLI-061, 3F-3639): the
|
|
93
|
+
* flag exists, so @SCN-CLI-009's advice to bump a pin to a version that accepts it is false. Its own
|
|
94
|
+
* check rather than a branch of `checkUnknownFlags`, because the caller refuses this one through
|
|
95
|
+
* `process.exit` — the unknown-flag path sets a status and returns, which inside a stored run reaches
|
|
96
|
+
* the scaffold that stamps a run.yaml (3F-3650). Returns the refusal for the first such flag, else null.
|
|
97
|
+
*/
|
|
98
|
+
export function checkMisplacedHostModifiers(args, registry, command) {
|
|
99
|
+
const modifiers = new Set(registry.global.map((flag) => flag.name.replace(/^-+/, "")));
|
|
100
|
+
const key = Object.keys(args).find((k) => modifiers.has(k));
|
|
101
|
+
if (key === undefined)
|
|
102
|
+
return null;
|
|
103
|
+
return (`The --${key} flag is a host modifier: it goes before the command, as in ` +
|
|
104
|
+
`'spec-controller --${key} <value> ${command} …', never after it.\n` +
|
|
105
|
+
`Run 'spec-controller --help' to see the host modifiers this version accepts.`);
|
|
106
|
+
}
|
|
50
107
|
/**
|
|
51
108
|
* The registry-bounded flag check at a command's CLI edge (@SCN-CLI-009). A command accepts ONLY
|
|
52
109
|
* the flags its per-command registry scope LISTS (by `name` or `alias`); an unregistered flag — a
|
|
@@ -58,9 +115,10 @@ export function parseArgs(argv) {
|
|
|
58
115
|
* PURE and `@unit`-testable: the parsed args (keys already `--`-stripped) plus the registry and
|
|
59
116
|
* the command to bound against, returning the FIRST unregistered flag as a typed usage error
|
|
60
117
|
* naming it WITH its dashes — routed to stderr and the enumerated usage status 2 by the caller,
|
|
61
|
-
* never 1, never a silent run — else null. The global `--store`/`--run-id` modifiers
|
|
62
|
-
*
|
|
63
|
-
*
|
|
118
|
+
* never 1, never a silent run — else null. The global `--store`/`--run-id` modifiers are consumed
|
|
119
|
+
* by the top-level dispatcher when they come BEFORE the command; written after it they reach the
|
|
120
|
+
* command, and `checkMisplacedHostModifiers` refuses them as out of place before this runs
|
|
121
|
+
* (@SCN-CLI-061).
|
|
64
122
|
*
|
|
65
123
|
* A COMMAND THE REGISTRY DOES NOT NAME ACCEPTS NOTHING, which is the honest reading rather than a
|
|
66
124
|
* degenerate one: an unregistered command has no scope, so every flag given to it is outside it.
|
package/dist/cli-args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC/C,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1C,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC1B,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnD,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBAClB,CAAC,EAAE,CAAC;YACN,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAA0B;IACrD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC/C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS;YAAE,SAAS;QACrC,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE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
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiDH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAS3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAEjE;AAqBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAChC,MAAM,GAAG,IAAI,CAcf;AAYD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC7B,MAAM,GAAG,IAAI,CAef;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC7B,MAAM,GAAG,IAAI,CAcf;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CA6J/C"}
|
package/dist/cli-balance/cli.js
CHANGED
|
@@ -16,13 +16,13 @@ import { dirname } from "node:path";
|
|
|
16
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, 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
|
|
@@ -218,20 +218,31 @@ export function runBalance(argv) {
|
|
|
218
218
|
const legacyJsonError = checkLegacyJson(args);
|
|
219
219
|
if (legacyJsonError)
|
|
220
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);
|
|
221
226
|
// Registry-bounded parse (@SCN-CLI-009): `balance` accepts ONLY the flags its registry
|
|
222
227
|
// scope LISTS. An unregistered flag — a typo `--strcit`, a stray `--bogus` — is a
|
|
223
228
|
// USAGE error: name it on stderr, set process.exitCode = 2 (the enumerated usage code,
|
|
224
229
|
// 3F-1414's 0/1/2 taxonomy — never 1, never a silent swallow), and RETURN before any
|
|
225
230
|
// reconcile. Runs AFTER the legacy-`--json` guard so `--json` keeps its specific migration
|
|
226
|
-
// hint
|
|
227
|
-
//
|
|
228
|
-
// registry = help" — a flag can't affect behaviour without a registry entry.
|
|
231
|
+
// hint, and after the misplaced-modifier refusal above, so a `--store` / `--run-id` written after
|
|
232
|
+
// the command is named as out of place rather than given pin advice. This is the structural teeth
|
|
233
|
+
// behind "accepted = registry = help" — a flag can't affect behaviour without a registry entry.
|
|
229
234
|
const unknownFlagError = checkUnknownFlags(args, cliRegistry, "balance", resolveToolIdentity().toolVersion);
|
|
230
235
|
if (unknownFlagError) {
|
|
231
236
|
process.stderr.write(unknownFlagError + "\n");
|
|
232
237
|
process.exitCode = 2;
|
|
233
238
|
return;
|
|
234
239
|
}
|
|
240
|
+
// A flag that takes a value, given none (@SCN-CLI-058, 3F-3639), refused before anything reads
|
|
241
|
+
// the value `parseArgs` made up for it. `process.exit`, never a set status and a return: inside a
|
|
242
|
+
// stored run the return would reach the kept-run scaffold, which stamps a run.yaml (3F-3650).
|
|
243
|
+
const missingValueError = checkMissingValues(argv, cliRegistry, "balance");
|
|
244
|
+
if (missingValueError)
|
|
245
|
+
exitUsage(missingValueError);
|
|
235
246
|
if (renderSavedReport(args))
|
|
236
247
|
return;
|
|
237
248
|
refuseUnreadableInputs(args);
|
|
@@ -327,7 +338,7 @@ export function runBalance(argv) {
|
|
|
327
338
|
// credits HAS a row — its suspense row — and is an ordinary out-of-balance report at exit 1
|
|
328
339
|
// (@SCN-CLI-020). @SCN-CLI-004/005/010/012 are BYSTANDERS: every one of their fixtures carries
|
|
329
340
|
// rows, so none reaches this branch.
|
|
330
|
-
const verdict = verdictExitCode(balance
|
|
341
|
+
const verdict = verdictExitCode(balance, args["strict"] !== undefined);
|
|
331
342
|
const code = args["exit-zero"] !== undefined ? exitZeroStatus(verdict) : verdict;
|
|
332
343
|
// Assigned only when NON-ZERO, so a balanced run still LEAVES process.exitCode at its default
|
|
333
344
|
// rather than writing a 0 over it — the distinction @SCN-CLI-005 and @SCN-CLI-010 both rest on.
|
|
@@ -456,11 +467,15 @@ function runContextOf(args, inputs, runStart) {
|
|
|
456
467
|
* ENUMERATED, NEVER A COUNT — a count would 8-bit `& 0xFF` wrap into a false pass. Returns 0 for a
|
|
457
468
|
* balanced run; the caller leaves the process's default alone rather than writing that 0 back.
|
|
458
469
|
*/
|
|
459
|
-
function verdictExitCode(
|
|
470
|
+
function verdictExitCode(balance, strict) {
|
|
471
|
+
const { ledger } = balance;
|
|
460
472
|
if (hasNothingToReconcile(ledger))
|
|
461
473
|
return 5;
|
|
462
474
|
if (hasBrokenEvidence(ledger))
|
|
463
475
|
return 4;
|
|
476
|
+
// A misfiled code (3F-3635): every account still reconciles, so `isBalanced` alone would pass it.
|
|
477
|
+
if (hasScenarioCodeErrors(balance))
|
|
478
|
+
return 1;
|
|
464
479
|
if (!isBalanced(ledger))
|
|
465
480
|
return 1;
|
|
466
481
|
if (strict && hasPendingItems(ledger))
|
|
@@ -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,GAEzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO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,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,0FAA0F;AAC1F,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,8BAA8B;IAC9B,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AA0HD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAYzB,CAAC;AAQF;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAgBhF;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CA0BhE"}
|
package/dist/cli-registry.js
CHANGED
|
@@ -86,7 +86,7 @@ const balanceFlags = [
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
name: "--exit-zero",
|
|
89
|
-
description: "Print the same report but exit 0 on an out-of-balance (1) or --strict pending (3) verdict — the on-ramp before gating. Usage (2), unsound (4) and nothing-to-reconcile (5) still fail.",
|
|
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
90
|
},
|
|
91
91
|
{
|
|
92
92
|
name: "--help",
|
|
@@ -120,36 +120,6 @@ const balanceRetiredFlags = [
|
|
|
120
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.",
|
|
121
121
|
},
|
|
122
122
|
];
|
|
123
|
-
/**
|
|
124
|
-
* The `tags` command's per-command scope (3F-3300). Two input flags and `--help`/`-h`, and the
|
|
125
|
-
* two are `balance`'s own spellings on purpose: a consumer pointing one command at a corpus and a
|
|
126
|
-
* manifest should not have to learn a second name for each when they point the other at the same
|
|
127
|
-
* two files. The descriptions are this command's — what it reads them FOR is not what `balance`
|
|
128
|
-
* reads them for — but the flags are the same flags.
|
|
129
|
-
*
|
|
130
|
-
* NO `configHelp`. A command's config block documents the `package.json` fields THAT command
|
|
131
|
-
* reads, and `tags` reads none yet: the check-tag union and the recognised deferral set arrive
|
|
132
|
-
* with the grammar rules (3F-3302 onward), and the entry gains its block then. Appending
|
|
133
|
-
* `balance`'s block here would document, under this command, fields this command does not read —
|
|
134
|
-
* which is the fault 3F-3298 moved that block onto a command entry to prevent.
|
|
135
|
-
*/
|
|
136
|
-
const tagsFlags = [
|
|
137
|
-
{
|
|
138
|
-
name: "--features",
|
|
139
|
-
arg: "<dir>",
|
|
140
|
-
description: "Directory of Gherkin .feature files — the corpus these rules are asked about (default ./features).",
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
name: "--package-json",
|
|
144
|
-
arg: "<path>",
|
|
145
|
-
description: "The target's package.json — its specController block, from which the configured fitness rows and the tags that park a scenario are resolved (default ./package.json).",
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
name: "--help",
|
|
149
|
-
aliases: ["-h"],
|
|
150
|
-
description: "Show this help and exit.",
|
|
151
|
-
},
|
|
152
|
-
];
|
|
153
123
|
/** The global host-modifier scope — recognised before the command; the CLI-007 surface. */
|
|
154
124
|
const globalFlags = [
|
|
155
125
|
{
|
|
@@ -176,11 +146,6 @@ export const cliRegistry = {
|
|
|
176
146
|
configHelp: balanceConfigHelp,
|
|
177
147
|
retiredFlags: balanceRetiredFlags,
|
|
178
148
|
},
|
|
179
|
-
{
|
|
180
|
-
name: "tags",
|
|
181
|
-
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).",
|
|
182
|
-
flags: tagsFlags,
|
|
183
|
-
},
|
|
184
149
|
],
|
|
185
150
|
};
|
|
186
151
|
/** The display label for a flag: its name, any aliases, then its arg-placeholder. */
|
package/dist/cli-registry.js.map
CHANGED
|
@@ -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;AA4D1D;;;;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;QACf,WAAW,EACT,uOAAuO;KAC1O;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,QAAQ;QACb,WAAW,EACT,4OAA4O;KAC/O;IACD;QACE,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,eAAe;QACpB,WAAW,EACT,8KAA8K;KACjL;IACD;QACE,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,QAAQ;QACb,WAAW,EAAE,0FAA0F;KACxG;IACD;QACE,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,OAAO;QACZ,WAAW,EAAE,qFAAqF;KACnG;IACD;QACE,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,gBAAgB;QACrB,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,uFAAuF;KACrG;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,GAAG,EAAE,QAAQ;QACb,WAAW,EAAE,yGAAyG;KACvH;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,6HAA6H;KAC3I;IACD;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE
|
|
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;AA4D1D;;;;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;QACf,WAAW,EACT,uOAAuO;KAC1O;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,QAAQ;QACb,WAAW,EACT,4OAA4O;KAC/O;IACD;QACE,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,eAAe;QACpB,WAAW,EACT,8KAA8K;KACjL;IACD;QACE,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,QAAQ;QACb,WAAW,EAAE,0FAA0F;KACxG;IACD;QACE,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,OAAO;QACZ,WAAW,EAAE,qFAAqF;KACnG;IACD;QACE,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,gBAAgB;QACrB,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,uFAAuF;KACrG;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,GAAG,EAAE,QAAQ;QACb,WAAW,EAAE,yGAAyG;KACvH;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,6HAA6H;KAC3I;IACD;QACE,IAAI,EAA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.d.ts
CHANGED
|
@@ -6,11 +6,9 @@
|
|
|
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)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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), which is why there is no second command for that. The
|
|
11
|
+
* `analyse` / `migrate` capabilities are a separate, closed offering built on the same core.
|
|
14
12
|
*
|
|
15
13
|
* Storage is a CROSS-CUTTING host modifier, not a command. A leading `--store <root>`
|
|
16
14
|
* 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
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG"}
|
package/dist/cli.js
CHANGED
|
@@ -6,11 +6,9 @@
|
|
|
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)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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), which is why there is no second command for that. The
|
|
11
|
+
* `analyse` / `migrate` capabilities are a separate, closed offering built on the same core.
|
|
14
12
|
*
|
|
15
13
|
* Storage is a CROSS-CUTTING host modifier, not a command. A leading `--store <root>`
|
|
16
14
|
* turns any command into a STORED run: the host wraps the command via the kept-run
|
|
@@ -22,7 +20,6 @@
|
|
|
22
20
|
*/
|
|
23
21
|
import { dirname } from "node:path";
|
|
24
22
|
import { runBalance } from "./cli-balance/cli.js";
|
|
25
|
-
import { runTags } from "./corpus/cli.js";
|
|
26
23
|
import { resolveSourceSha, resolveToolIdentity } from "./run-management/resolveRunInputs.js";
|
|
27
24
|
import { executeKeptRun, resolveRunId, } from "./run-management/keptRun.js";
|
|
28
25
|
import { parseHostInvocation, wrapCommandArgv, peekFlag, answerUnknownCommand } from "./host.js";
|
|
@@ -33,9 +30,6 @@ function runCommand(command, argv) {
|
|
|
33
30
|
case "balance":
|
|
34
31
|
runBalance(argv);
|
|
35
32
|
return;
|
|
36
|
-
case "tags":
|
|
37
|
-
runTags(argv);
|
|
38
|
-
return;
|
|
39
33
|
default: {
|
|
40
34
|
const answer = answerUnknownCommand(command, renderTopLevelHelp(cliRegistry));
|
|
41
35
|
process.stderr.write(answer.stderr);
|
|
@@ -45,6 +39,12 @@ function runCommand(command, argv) {
|
|
|
45
39
|
}
|
|
46
40
|
function main(hostArgv) {
|
|
47
41
|
const inv = parseHostInvocation(hostArgv);
|
|
42
|
+
// A usage fault in the leading tokens is refused before any command or stored run starts, so
|
|
43
|
+
// nothing is written anywhere (@SCN-CLI-059).
|
|
44
|
+
if (inv.refusal !== undefined) {
|
|
45
|
+
process.stderr.write(inv.refusal + "\n");
|
|
46
|
+
process.exit(2);
|
|
47
|
+
}
|
|
48
48
|
const command = inv.command;
|
|
49
49
|
if (command === undefined || command === "help" || command === "--help" || command === "-h") {
|
|
50
50
|
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":[],"m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pF,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"}
|
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 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
|
|
@@ -32,7 +38,7 @@ export interface HostInvocation {
|
|
|
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.
|
|
34
40
|
*/
|
|
35
|
-
export declare function parseHostInvocation(argv: readonly string[]): HostInvocation;
|
|
41
|
+
export declare function parseHostInvocation(argv: readonly string[], globalFlags?: readonly FlagSpec[]): HostInvocation;
|
|
36
42
|
/**
|
|
37
43
|
* Build the wrapped command argv: the command's clean args followed by a repeated
|
|
38
44
|
* `--format <spec>` per store-dir output spec. Pure — the impure runner hands the result
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE/D,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,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,WAAW,GAAE,SAAS,QAAQ,EAAuB,GACpD,cAAc,CA8BhB;AAqBD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAExG;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,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"}
|
package/dist/host.js
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @SCN-RMG-004 — features/run-management.feature.
|
|
14
14
|
*/
|
|
15
|
+
import { 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
|
|
@@ -21,25 +23,51 @@
|
|
|
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.
|
|
23
25
|
*/
|
|
24
|
-
export function parseHostInvocation(argv) {
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
export function parseHostInvocation(argv, globalFlags = cliRegistry.global) {
|
|
27
|
+
// The modifiers and the values they take are the registry's global scope, never a list kept here
|
|
28
|
+
// (@SCN-CLI-059): a modifier added later is read, and refused without its value, by construction.
|
|
29
|
+
const modifiers = valueFlagsOf(globalFlags);
|
|
30
|
+
const values = new Map();
|
|
27
31
|
let i = 0;
|
|
28
32
|
for (; i < argv.length; i++) {
|
|
29
|
-
const token = argv[i];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const token = argv[i] ?? "";
|
|
34
|
+
const modifier = modifiers.get(token);
|
|
35
|
+
if (modifier === undefined) {
|
|
36
|
+
// Any other flag here is out of place, never a command (@SCN-CLI-060): `--exit-zero balance`
|
|
37
|
+
// used to answer `unknown command "--exit-zero"`. The top-level help stays where it was.
|
|
38
|
+
if (isFlagOutOfPlace(token))
|
|
39
|
+
return { commandArgs: [], refusal: flagBeforeCommandRefusal(token, globalFlags) };
|
|
40
|
+
break; // first non-modifier token is the command
|
|
34
41
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
const value = argv[i + 1];
|
|
43
|
+
// A modifier given no value is refused, never handed the next token: `--store --run-id r1`
|
|
44
|
+
// used to store under a directory called `--run-id`, and an empty `--store` under the cwd.
|
|
45
|
+
if (isMissingValue(value)) {
|
|
46
|
+
return { commandArgs: [], refusal: missingValueRefusal(token, modifier, "spec-controller") };
|
|
39
47
|
}
|
|
40
|
-
|
|
48
|
+
values.set(modifier.name, value ?? "");
|
|
49
|
+
i++;
|
|
41
50
|
}
|
|
42
|
-
return {
|
|
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
|
+
/** The help the host answers in the command's place, which is the one flag it takes there. */
|
|
59
|
+
const TOP_LEVEL_HELP = new Set(["--help", "-h"]);
|
|
60
|
+
/** True for a flag-shaped token that is not the top-level help. */
|
|
61
|
+
function isFlagOutOfPlace(token) {
|
|
62
|
+
return token.length > 1 && token.startsWith("-") && !TOP_LEVEL_HELP.has(token);
|
|
63
|
+
}
|
|
64
|
+
/** The refusal for a flag given before the command: the flag, what goes there, and where it goes. */
|
|
65
|
+
function flagBeforeCommandRefusal(flag, globalFlags) {
|
|
66
|
+
const modifiers = globalFlags.map((modifier) => modifier.name).join(", ");
|
|
67
|
+
return (`The ${flag} flag was given before the command. Before the command, spec-controller takes ` +
|
|
68
|
+
`only its host modifiers (${modifiers}); a command's own flags go after it, as in ` +
|
|
69
|
+
`'spec-controller <command> ${flag}'.\n` +
|
|
70
|
+
`Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
|
|
43
71
|
}
|
|
44
72
|
/**
|
|
45
73
|
* Build the wrapped command argv: the command's clean args followed by a repeated
|
package/dist/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAmB/D;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAuB,EACvB,cAAmC,WAAW,CAAC,MAAM;IAErD,iGAAiG;IACjG,kGAAkG;IAClG,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,6FAA6F;YAC7F,yFAAyF;YACzF,IAAI,gBAAgB,CAAC,KAAK,CAAC;gB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|
|
76
76
|
* WHY A TYPED ERROR RATHER THAN AN EMPTY CORPUS. The obvious fix is for `discoverFeatures` to hand
|
|
77
|
-
* back `[]` when the directory is not there
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* `checkInputsExist`, a supplied-but-absent `--features` too — into `The corpus could not be
|
|
81
|
-
* read: …` at exit 2. Tolerance at the reader turns both into `tags: OK …` at exit 0, inside the
|
|
82
|
-
* slice whose whole purpose is killing a vacuous certification. Typed, both survive untouched:
|
|
83
|
-
* 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.)
|
|
84
80
|
*
|
|
85
81
|
* IT CARRIES THE DIRECTORY because the report is owed the name of what it examined — "I found no
|
|
86
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
|
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"}
|
|
@@ -89,13 +89,9 @@ export class UnreadableFeatureCorpusError extends Error {
|
|
|
89
89
|
* refusal means for it.
|
|
90
90
|
*
|
|
91
91
|
* WHY A TYPED ERROR RATHER THAN AN EMPTY CORPUS. The obvious fix is for `discoverFeatures` to hand
|
|
92
|
-
* back `[]` when the directory is not there
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* `checkInputsExist`, a supplied-but-absent `--features` too — into `The corpus could not be
|
|
96
|
-
* read: …` at exit 2. Tolerance at the reader turns both into `tags: OK …` at exit 0, inside the
|
|
97
|
-
* slice whose whole purpose is killing a vacuous certification. Typed, both survive untouched:
|
|
98
|
-
* 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.)
|
|
99
95
|
*
|
|
100
96
|
* IT CARRIES THE DIRECTORY because the report is owed the name of what it examined — "I found no
|
|
101
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;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;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IAC5C,MAAM,CAA+B;IAE9C,YAAY,MAAoC;QAC9C,KAAK,CACH;YACE,yEAAyE;YACzE,GAAG,MAAM,CAAC,GAAG,CAAC,CAA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;YACzE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC;SAC5D,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,8FAA8F;IACrF,SAAS,CAAS;IAE3B,YAAY,SAAiB;QAC3B,KAAK,CAAC,gDAAgD,SAAS,EAAE,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -68,10 +68,9 @@ export declare function featureCorpusParseErrors(featuresDir: string | undefined
|
|
|
68
68
|
* the balance, threaded to `renderMarkdown` (via `writeOutputs`) as the 5th sibling arg
|
|
69
69
|
* (markdown-only — the by-feature cut is markdown-only, so it is NOT serialised to JSON).
|
|
70
70
|
* Uncoded files (`featureCode === null`) are omitted, so the by-feature emitter falls
|
|
71
|
-
* back to the bare `FFF` for any id whose code no file registers.
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* now, which is the first time a CONSUMER of this reader has it too.
|
|
71
|
+
* back to the bare `FFF` for any id whose code no file registers. When two files carry one
|
|
72
|
+
* code the map keeps the last, and that run lists `duplicate-feature-code` under Scenario code
|
|
73
|
+
* errors and fails (@SCN-STG-010, 3F-3635), so a report whose map is ambiguous never passes.
|
|
75
74
|
*/
|
|
76
75
|
export declare function readFeatureNames(featuresDir?: string): Map<string, string>;
|
|
77
76
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestQualityChecks.d.ts","sourceRoot":"","sources":["../../src/ingest/ingestQualityChec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oE3E"}
|
|
@@ -48,10 +48,9 @@ const CUCUMBER_QUALITY_CHECK = "integration";
|
|
|
48
48
|
* publishes and `balance` is the command that reconciles; the engine holds neither, and a core
|
|
49
49
|
* that assumed them would be asserting something about a command line it never sees.
|
|
50
50
|
*
|
|
51
|
-
* BOTH TOKENS, AND THE SECOND IS NOT DECORATION.
|
|
52
|
-
* `
|
|
53
|
-
*
|
|
54
|
-
* would take that step off the books. The comparison is whole, adjacent shell tokens
|
|
51
|
+
* BOTH TOKENS, AND THE SECOND IS NOT DECORATION. A step running the same binary for anything but
|
|
52
|
+
* `balance` is an ordinary step of the pipeline being reconciled, so an invocation naming the
|
|
53
|
+
* binary alone would take that step off the books. The comparison is whole, adjacent shell tokens
|
|
55
54
|
* (`parse/commandRuns`), so this names the reconciliation and nothing else the tool can do.
|
|
56
55
|
*/
|
|
57
56
|
const RECONCILER_INVOCATION = "spec-controller balance";
|
|
@@ -75,7 +74,7 @@ function readJsonIfPresent(path) {
|
|
|
75
74
|
* this by hand is five chances for one to stay intolerant, and a run that reports on a corpus for
|
|
76
75
|
* four of its readings and throws on the fifth is worse than one that throws. The translation is
|
|
77
76
|
* also why `discoverFeatures` is not the place to be tolerant — see its own note, and
|
|
78
|
-
* `MissingFeatureCorpusError`'s
|
|
77
|
+
* `MissingFeatureCorpusError`'s.
|
|
79
78
|
*
|
|
80
79
|
* IT IS `[]`, NOT A VERDICT. Zero rows is what @SCN-CLI-019 reads as NOTHING TO RECONCILE, and a
|
|
81
80
|
* corpus-less target that still has uncited credits keeps its suspense row and its exit 1
|
|
@@ -158,10 +157,9 @@ export function featureCorpusParseErrors(featuresDir) {
|
|
|
158
157
|
* the balance, threaded to `renderMarkdown` (via `writeOutputs`) as the 5th sibling arg
|
|
159
158
|
* (markdown-only — the by-feature cut is markdown-only, so it is NOT serialised to JSON).
|
|
160
159
|
* Uncoded files (`featureCode === null`) are omitted, so the by-feature emitter falls
|
|
161
|
-
* back to the bare `FFF` for any id whose code no file registers.
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* now, which is the first time a CONSUMER of this reader has it too.
|
|
160
|
+
* back to the bare `FFF` for any id whose code no file registers. When two files carry one
|
|
161
|
+
* code the map keeps the last, and that run lists `duplicate-feature-code` under Scenario code
|
|
162
|
+
* errors and fails (@SCN-STG-010, 3F-3635), so a report whose map is ambiguous never passes.
|
|
165
163
|
*/
|
|
166
164
|
export function readFeatureNames(featuresDir) {
|
|
167
165
|
const map = new Map();
|
|
@@ -245,11 +243,19 @@ export function runReconcile(opts) {
|
|
|
245
243
|
// keeping the core that way is the point. Resolving the list twice would be two chances for the
|
|
246
244
|
// bytes and the names to fall out of the order they are paired by.
|
|
247
245
|
const ciPaths = ciSourcePathsOf(ciPath);
|
|
246
|
+
// The corpus, discovered and read ONCE: its bytes, and — paired by index — which file each came
|
|
247
|
+
// from and the header code it carries, for the scenario code errors (3F-3635).
|
|
248
|
+
const corpusFiles = balanceCorpus(opts.features).map((f) => ({
|
|
249
|
+
slug: f.slug,
|
|
250
|
+
featureCode: f.featureCode,
|
|
251
|
+
source: readFileSync(f.path, "utf8"),
|
|
252
|
+
}));
|
|
248
253
|
return evidenceReconciliationFromSources({
|
|
249
254
|
// The corpus's bytes, read ONCE at this impure edge (3F-3088). The engine composes the three
|
|
250
255
|
// readings a citing run needs from this one array, so they cannot be assembled from two
|
|
251
256
|
// discoveries that disagree about the corpus (@SCN-LNT-009).
|
|
252
|
-
featureSources:
|
|
257
|
+
featureSources: corpusFiles.map((f) => f.source),
|
|
258
|
+
featureFiles: corpusFiles.map(({ slug, featureCode }) => ({ slug, featureCode })),
|
|
253
259
|
// The untagged half by its `<feature> : <scenario>` locator — parsed here because the locator
|
|
254
260
|
// names the FILE, which the discovery knows and a source string does not.
|
|
255
261
|
untaggedScenarios: untaggedScenariosFromFeatures(opts.features),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestQualityChecks.js","sourceRoot":"","sources":["../../src/ingest/ingestQualityChecks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAA0B,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,yBAAyB,EACzB,4BAA4B,GAE7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,mBAAmB,GAGpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,+BAA+B,GAEhC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,iCAAiC,GAElC,MAAM,qCAAqC,CAAC;AAC7C,mGAAmG;AACnG,yFAAyF;AACzF,yFAAyF;AACzF,gGAAgG;AAChG,iGAAiG;AACjG,oGAAoG;AACpG,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAExF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAQ1E;;;;;;GAMG;AACH,MAAM,oBAAoB,GAAwB,MAAM,CAAC;AACzD,MAAM,sBAAsB,GAAwB,aAAa,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"ingestQualityChecks.js","sourceRoot":"","sources":["../../src/ingest/ingestQualityChecks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OA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AAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpD,+FAA+F;QAC/F,2FAA2F;QAC3F,8FAA8F;QAC9F,6CAA6C;QAC7C,gIAAgI;QAChI,gGAAgG;QAChG,6EAA6E;QAC7E,YAAY,EAAE,iBAAiB,CAC7B,IAAI,CAAC,OAAO,CACb;QACD,mBAAmB,EAAE,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC;QACzD,sFAAsF;QACtF,8FAA8F;QAC9F,kIAAkI;QAClI,4FAA4F;QAC5F,wBAAwB;QACxB,YAAY,EAAE,qBAAqB;QACnC,oBAAoB,EAAE,qBAAqB;KAC5C,CAAC,CAAC;AACL,CAAC;AAED,iGAAiG;AACjG,8FAA8F;AAC9F,gGAAgG;AAChG,+FAA+F;AAC/F,oGAAoG;AACpG,yFAAyF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-controller",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.23",
|
|
4
4
|
"description": "Reconcile the behaviour your scenarios name against the evidence that actually ran — the deterministic `balance` CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reconciliation",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@cucumber/gherkin": "^41.0.0",
|
|
26
26
|
"@cucumber/messages": "^34.0.1",
|
|
27
27
|
"yaml": "^2.9.0",
|
|
28
|
-
"@3f-consulting/spec-controller-core": "0.1.0-alpha.
|
|
28
|
+
"@3f-consulting/spec-controller-core": "0.1.0-alpha.23"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
package/dist/corpus/cli.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `tags` command — `spec-controller tags`, the `@SCN` scheme policing itself over a
|
|
3
|
-
* target's Gherkin corpus.
|
|
4
|
-
*
|
|
5
|
-
* THIS EDGE OWNS ONLY THE READS. The rule is `corpusFaults`, in core, reached through the ROOT
|
|
6
|
-
* barrel and nothing else: `./internal` is dropped by `publishConfig.exports` at pack time, and
|
|
7
|
-
* this module travels in the tarball. That is not a style preference — an installed
|
|
8
|
-
* `balance --help` once threw ERR_PACKAGE_PATH_NOT_EXPORTED behind thirteen green gates because a
|
|
9
|
-
* published module reached that subpath (3F-3086). So what happens here is: discover the corpus,
|
|
10
|
-
* read the manifest, build the mutation-record reader, hand over the bytes.
|
|
11
|
-
*
|
|
12
|
-
* ITS OWN COMMAND RATHER THAN A `balance` FLAG. `balance`'s exit code IS its verdict — 0
|
|
13
|
-
* balanced, 1 out of balance, 3 pending-under-strict, 4 unsound, 5 nothing to reconcile — and a
|
|
14
|
-
* corpus FAULT is not a reconciliation verdict. A flag would either overload one of those codes or
|
|
15
|
-
* add a further meaning to a status a consumer's CI branches on. A second command costs one registry entry and gives
|
|
16
|
-
* the fault its own ladder:
|
|
17
|
-
*
|
|
18
|
-
* 0 — the corpus obeys the scheme.
|
|
19
|
-
* 1 — findings; the corpus was read and it breaks a rule.
|
|
20
|
-
* 2 — the corpus (or the manifest) could not be READ at all. Not a verdict, because nothing was
|
|
21
|
-
* concluded. Sibling to @SCN-CLI-014/015/016 on `balance`, and the same argument: an input
|
|
22
|
-
* the tool cannot read is a usage error, never a verdict.
|
|
23
|
-
*
|
|
24
|
-
* Usage:
|
|
25
|
-
* spec-controller tags [--features <dir>] [--package-json <path>]
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Police a target's corpus against the `@SCN` scheme's own rules.
|
|
29
|
-
*
|
|
30
|
-
* `process.exitCode` RATHER THAN `process.exit`, so whatever has been written is flushed intact
|
|
31
|
-
* rather than truncated mid-write — the convention `balance`'s own gate settled on.
|
|
32
|
-
*/
|
|
33
|
-
export declare function runTags(argv: string[]): void;
|
|
34
|
-
//# sourceMappingURL=cli.d.ts.map
|
package/dist/corpus/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/corpus/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA8DH;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAiD5C"}
|
package/dist/corpus/cli.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `tags` command — `spec-controller tags`, the `@SCN` scheme policing itself over a
|
|
3
|
-
* target's Gherkin corpus.
|
|
4
|
-
*
|
|
5
|
-
* THIS EDGE OWNS ONLY THE READS. The rule is `corpusFaults`, in core, reached through the ROOT
|
|
6
|
-
* barrel and nothing else: `./internal` is dropped by `publishConfig.exports` at pack time, and
|
|
7
|
-
* this module travels in the tarball. That is not a style preference — an installed
|
|
8
|
-
* `balance --help` once threw ERR_PACKAGE_PATH_NOT_EXPORTED behind thirteen green gates because a
|
|
9
|
-
* published module reached that subpath (3F-3086). So what happens here is: discover the corpus,
|
|
10
|
-
* read the manifest, build the mutation-record reader, hand over the bytes.
|
|
11
|
-
*
|
|
12
|
-
* ITS OWN COMMAND RATHER THAN A `balance` FLAG. `balance`'s exit code IS its verdict — 0
|
|
13
|
-
* balanced, 1 out of balance, 3 pending-under-strict, 4 unsound, 5 nothing to reconcile — and a
|
|
14
|
-
* corpus FAULT is not a reconciliation verdict. A flag would either overload one of those codes or
|
|
15
|
-
* add a further meaning to a status a consumer's CI branches on. A second command costs one registry entry and gives
|
|
16
|
-
* the fault its own ladder:
|
|
17
|
-
*
|
|
18
|
-
* 0 — the corpus obeys the scheme.
|
|
19
|
-
* 1 — findings; the corpus was read and it breaks a rule.
|
|
20
|
-
* 2 — the corpus (or the manifest) could not be READ at all. Not a verdict, because nothing was
|
|
21
|
-
* concluded. Sibling to @SCN-CLI-014/015/016 on `balance`, and the same argument: an input
|
|
22
|
-
* the tool cannot read is a usage error, never a verdict.
|
|
23
|
-
*
|
|
24
|
-
* Usage:
|
|
25
|
-
* spec-controller tags [--features <dir>] [--package-json <path>]
|
|
26
|
-
*/
|
|
27
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
28
|
-
import { corpusFaults } from "@3f-consulting/spec-controller-core";
|
|
29
|
-
import { cliRegistry, renderCommandHelp } from "../cli-registry.js";
|
|
30
|
-
import { checkUnknownFlags, parseArgs } from "../cli-args.js";
|
|
31
|
-
import { DEFAULT_DEFERRAL_TAGS } from "../deferralTags.js";
|
|
32
|
-
import { UnreadableFeatureCorpusError } from "../ingest/gherkinValidation.js";
|
|
33
|
-
import { discoverFeatures } from "../ingest/ingestScenarios.js";
|
|
34
|
-
import { resolveToolIdentity } from "../run-management/resolveRunInputs.js";
|
|
35
|
-
/**
|
|
36
|
-
* Read everything the rule takes, or say why it could not be read.
|
|
37
|
-
*
|
|
38
|
-
* ONE PLACE, ONE STATUS, because it is one Rule. A corpus the Gherkin parser rejects, a features
|
|
39
|
-
* directory that is not there, and a manifest that is not JSON are three spellings of "the tool
|
|
40
|
-
* could not read its input" — and every one of them, left to escape, lands on Node's default exit
|
|
41
|
-
* 1, which is this command's code for FINDINGS. A crashed invocation would then be
|
|
42
|
-
* indistinguishable by status from a corpus that genuinely breaks a rule, which is exactly the
|
|
43
|
-
* collision 3F-1742 closed on `balance`.
|
|
44
|
-
*
|
|
45
|
-
* THE PARSE REFUSAL IS INHERITED, NOT RESTATED (@SCN-GPG-001). `discoverFeatures` refuses a corpus
|
|
46
|
-
* cucumber could not run rather than returning one, so this command gets that refusal by going
|
|
47
|
-
* through the shared discovery — the same way `balance` does — and what is left here is turning
|
|
48
|
-
* it into this command's status. Its message carries the parser's own words verbatim.
|
|
49
|
-
*
|
|
50
|
-
* THE SOURCES ARE READ HERE because the rule is pure and takes bytes. `DiscoveredFeature` carries
|
|
51
|
-
* the header code and the scenario ids but not the file's text, and the grammar rules that follow
|
|
52
|
-
* this one need the text to walk the tags.
|
|
53
|
-
*/
|
|
54
|
-
function readCorpusInputs(featuresDir, manifestPath) {
|
|
55
|
-
try {
|
|
56
|
-
const discovered = featuresDir === undefined ? discoverFeatures() : discoverFeatures(featuresDir);
|
|
57
|
-
return {
|
|
58
|
-
ok: true,
|
|
59
|
-
features: discovered.map((f) => ({
|
|
60
|
-
slug: f.slug,
|
|
61
|
-
featureCode: f.featureCode,
|
|
62
|
-
source: readFileSync(f.path, "utf8"),
|
|
63
|
-
})),
|
|
64
|
-
packageJson: existsSync(manifestPath)
|
|
65
|
-
? JSON.parse(readFileSync(manifestPath, "utf8"))
|
|
66
|
-
: {},
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
catch (err) {
|
|
70
|
-
if (err instanceof UnreadableFeatureCorpusError)
|
|
71
|
-
return { ok: false, error: err.message };
|
|
72
|
-
const failure = err instanceof Error ? err.message : String(err);
|
|
73
|
-
return { ok: false, error: `The corpus could not be read: ${failure}` };
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Police a target's corpus against the `@SCN` scheme's own rules.
|
|
78
|
-
*
|
|
79
|
-
* `process.exitCode` RATHER THAN `process.exit`, so whatever has been written is flushed intact
|
|
80
|
-
* rather than truncated mid-write — the convention `balance`'s own gate settled on.
|
|
81
|
-
*/
|
|
82
|
-
export function runTags(argv) {
|
|
83
|
-
// Answer `--help`/`-h` from the registry BEFORE any parse, so it never falls through as a stray
|
|
84
|
-
// flag while the command runs anyway. The registry is the single source, so a flag that exists
|
|
85
|
-
// is a flag that appears in help — there is no hand-kept list here to drift.
|
|
86
|
-
if (argv.includes("--help") || argv.includes("-h")) {
|
|
87
|
-
process.stdout.write(renderCommandHelp(cliRegistry, "tags") + "\n");
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const args = parseArgs(argv);
|
|
91
|
-
// Registry-bounded parse (@SCN-CLI-009's rule, applied to this command's own scope): `tags`
|
|
92
|
-
// accepts ONLY the flags its registry entry lists. By construction, not by assertion — the
|
|
93
|
-
// helper is the one `balance` uses, given this command's name.
|
|
94
|
-
const unknownFlagError = checkUnknownFlags(args, cliRegistry, "tags", resolveToolIdentity().toolVersion);
|
|
95
|
-
if (unknownFlagError) {
|
|
96
|
-
process.stderr.write(unknownFlagError + "\n");
|
|
97
|
-
process.exitCode = 2;
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
// `--package-json` defaults to the manifest at the cwd, matching `balance`'s default: the
|
|
101
|
-
// target is the tree you are standing in unless you say otherwise.
|
|
102
|
-
const inputs = readCorpusInputs(args["features"], args["package-json"] ?? "package.json");
|
|
103
|
-
if (!inputs.ok) {
|
|
104
|
-
process.stderr.write(inputs.error + "\n");
|
|
105
|
-
process.exitCode = 2;
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
const faults = corpusFaults({
|
|
109
|
-
features: inputs.features,
|
|
110
|
-
packageJson: inputs.packageJson,
|
|
111
|
-
// The STARTER deferral set — the application layer's own policy, which a target's config may
|
|
112
|
-
// only extend. Single-sourced here for the reason the reconcile composition takes it as a
|
|
113
|
-
// parameter: which words the community recognises is the product's answer, not the engine's.
|
|
114
|
-
deferralTags: DEFAULT_DEFERRAL_TAGS,
|
|
115
|
-
});
|
|
116
|
-
if (faults.length === 0) {
|
|
117
|
-
process.stdout.write("tags: OK — every feature code names one feature file, and every tag on the corpus obeys the @SCN scheme's own rules.\n");
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
process.stderr.write(`tags: FAILED — ${faults.length} finding(s):\n`);
|
|
121
|
-
for (const fault of faults)
|
|
122
|
-
process.stderr.write(` ${fault.message}\n`);
|
|
123
|
-
process.exitCode = 1;
|
|
124
|
-
}
|
|
125
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/corpus/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/corpus/cli.ts"],"names":[],"m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