spec-controller 0.1.0-alpha.3 → 0.1.0-alpha.31
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 +27 -5
- package/dist/cli-allocate/cli.d.ts +2 -0
- package/dist/cli-allocate/cli.d.ts.map +1 -0
- package/dist/cli-allocate/cli.js +45 -0
- package/dist/cli-allocate/cli.js.map +1 -0
- package/dist/cli-allocate/readHistory.d.ts +21 -0
- package/dist/cli-allocate/readHistory.d.ts.map +1 -0
- package/dist/cli-allocate/readHistory.js +97 -0
- package/dist/cli-allocate/readHistory.js.map +1 -0
- package/dist/cli-allocate/readParts.d.ts +3 -0
- package/dist/cli-allocate/readParts.d.ts.map +1 -0
- package/dist/cli-allocate/readParts.js +25 -0
- package/dist/cli-allocate/readParts.js.map +1 -0
- package/dist/cli-allocate/readTree.d.ts +17 -0
- package/dist/cli-allocate/readTree.d.ts.map +1 -0
- package/dist/cli-allocate/readTree.js +63 -0
- package/dist/cli-allocate/readTree.js.map +1 -0
- package/dist/cli-allocate/request.d.ts +11 -0
- package/dist/cli-allocate/request.d.ts.map +1 -0
- package/dist/cli-allocate/request.js +29 -0
- package/dist/cli-allocate/request.js.map +1 -0
- package/dist/cli-allocate/stderr.d.ts +14 -0
- package/dist/cli-allocate/stderr.d.ts.map +1 -0
- package/dist/cli-allocate/stderr.js +33 -0
- package/dist/cli-allocate/stderr.js.map +1 -0
- package/dist/cli-args.d.ts +70 -14
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +239 -18
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-balance/cli.d.ts +18 -1
- package/dist/cli-balance/cli.d.ts.map +1 -1
- package/dist/cli-balance/cli.js +185 -161
- package/dist/cli-balance/cli.js.map +1 -1
- package/dist/cli-balance/emit/writer.d.ts +8 -23
- package/dist/cli-balance/emit/writer.d.ts.map +1 -1
- package/dist/cli-balance/emit/writer.js +24 -32
- package/dist/cli-balance/emit/writer.js.map +1 -1
- package/dist/cli-registry.d.ts +28 -0
- package/dist/cli-registry.d.ts.map +1 -1
- package/dist/cli-registry.js +39 -34
- package/dist/cli-registry.js.map +1 -1
- package/dist/cli.d.ts +4 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +26 -12
- package/dist/cli.js.map +1 -1
- package/dist/deferralTags.d.ts +2 -2
- package/dist/deferralTags.js +2 -2
- package/dist/host.d.ts +25 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +119 -15
- package/dist/host.js.map +1 -1
- package/dist/ingest/gherkinValidation.d.ts +9 -12
- package/dist/ingest/gherkinValidation.d.ts.map +1 -1
- package/dist/ingest/gherkinValidation.js +9 -12
- package/dist/ingest/gherkinValidation.js.map +1 -1
- package/dist/ingest/ingestQualityChecks.d.ts +3 -49
- package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
- package/dist/ingest/ingestQualityChecks.js +27 -120
- package/dist/ingest/ingestQualityChecks.js.map +1 -1
- package/dist/ingest/ingestScenarios.d.ts +8 -14
- package/dist/ingest/ingestScenarios.d.ts.map +1 -1
- package/dist/ingest/ingestScenarios.js +32 -55
- package/dist/ingest/ingestScenarios.js.map +1 -1
- package/dist/outputLocation.d.ts +15 -0
- package/dist/outputLocation.d.ts.map +1 -0
- package/dist/outputLocation.js +39 -0
- package/dist/outputLocation.js.map +1 -0
- package/dist/run-management/keptRun.d.ts +14 -19
- package/dist/run-management/keptRun.d.ts.map +1 -1
- package/dist/run-management/keptRun.js +15 -20
- package/dist/run-management/keptRun.js.map +1 -1
- package/package.json +2 -7
- package/dist/corpus/cli.d.ts +0 -34
- package/dist/corpus/cli.d.ts.map +0 -1
- package/dist/corpus/cli.js +0 -128
- package/dist/corpus/cli.js.map +0 -1
- package/dist/mutation-ratchet/index.d.ts +0 -46
- package/dist/mutation-ratchet/index.d.ts.map +0 -1
- package/dist/mutation-ratchet/index.js +0 -46
- package/dist/mutation-ratchet/index.js.map +0 -1
- package/dist/mutation-ratchet/record.d.ts +0 -178
- package/dist/mutation-ratchet/record.d.ts.map +0 -1
- package/dist/mutation-ratchet/record.js +0 -314
- package/dist/mutation-ratchet/record.js.map +0 -1
- package/dist/mutation-ratchet/report.d.ts +0 -109
- package/dist/mutation-ratchet/report.d.ts.map +0 -1
- package/dist/mutation-ratchet/report.js +0 -156
- package/dist/mutation-ratchet/report.js.map +0 -1
|
@@ -1,48 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The output
|
|
3
|
-
*
|
|
4
|
-
* the payload via the PURE renderers (`renderMarkdown` / `renderJson` in `src/render/`)
|
|
5
|
-
* and performs the IO: stdout, or a file.
|
|
6
|
-
*
|
|
7
|
-
* This is the ONLY layer that performs IO — the renderers stay pure (`model → string`)
|
|
8
|
-
* and `planOutput` stays pure (parse+validate). So the writer carries the `@integration`
|
|
9
|
-
* evidence: its real stdout/file effect is asserted directly (the anti-watermelon rule),
|
|
10
|
-
* never a re-run of the `planOutput` `@unit`.
|
|
11
|
-
*
|
|
12
|
-
* FMT-001 (`@SCN-FMT-001`) writes markdown to stdout. The `json` format (FMT-002) and the
|
|
13
|
-
* file destination (FMT-002/003) are wired on the same `render` + `dest` switch below as
|
|
14
|
-
* later sub-issues plan them.
|
|
15
|
-
*
|
|
16
|
-
* Parent: @SCN-FMT-001 — the output-dispatch rework.
|
|
2
|
+
* The output writer: renders each planned output through the pure renderers and performs the only
|
|
3
|
+
* IO in the pipeline, to stdout or to a file.
|
|
17
4
|
*/
|
|
18
5
|
import { writeFileSync } from "node:fs";
|
|
19
6
|
import { renderMarkdown } from "@3f-consulting/spec-controller-core";
|
|
20
7
|
import { renderJson } from "@3f-consulting/spec-controller-core";
|
|
21
|
-
|
|
8
|
+
import { probeWritable, writeOrRefuse } from "../../outputLocation.js";
|
|
22
9
|
function render(fmt, p) {
|
|
23
|
-
// The axis gates moved onto the concept's factory (3F-2233) — by the time a payload reaches a
|
|
24
|
-
// renderer the totals are already folded, so there is nothing left here to switch on.
|
|
25
10
|
return fmt === "json"
|
|
26
11
|
? renderJson(p.balance, p.ctx, p.evidenceObligations, p.featureNames)
|
|
27
12
|
: renderMarkdown(p.balance, p.ctx, p.evidenceObligations, p.featureNames);
|
|
28
13
|
}
|
|
29
14
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
15
|
+
* Every file destination is proved writable before any output is emitted, so a refused run never
|
|
16
|
+
* leaves a report behind, on stdout or in a file, whose headline names an exit the process does not
|
|
17
|
+
* take. Writing files first and stdout last would not do: an earlier file would still be written.
|
|
32
18
|
*/
|
|
33
19
|
export function writeOutputs(plan, payloads) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
process.stdout.write(rendered + "\n");
|
|
40
|
-
break;
|
|
41
|
-
case "file":
|
|
42
|
-
// The file destination (FMT-002/003) — same rendered bytes, to a caller path.
|
|
43
|
-
writeFileSync(output.dest.path, rendered + "\n", "utf8");
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
20
|
+
const emissions = plan.outputs.map((output) => ({ output, text: render(output.fmt, payloads) + "\n" }));
|
|
21
|
+
for (const { output } of emissions) {
|
|
22
|
+
const dest = output.dest;
|
|
23
|
+
if (dest.kind === "file")
|
|
24
|
+
writeOrRefuse(refusalSubject(output), dest.path, () => probeWritable(dest.path));
|
|
46
25
|
}
|
|
26
|
+
for (const { output, text } of emissions)
|
|
27
|
+
emit(output, text);
|
|
28
|
+
}
|
|
29
|
+
function refusalSubject(output) {
|
|
30
|
+
return `The ${output.fmt} report could not be written`;
|
|
31
|
+
}
|
|
32
|
+
function emit(output, text) {
|
|
33
|
+
const dest = output.dest;
|
|
34
|
+
if (dest.kind === "stdout") {
|
|
35
|
+
process.stdout.write(text);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
writeOrRefuse(refusalSubject(output), dest.path, () => writeFileSync(dest.path, text, "utf8"));
|
|
47
39
|
}
|
|
48
40
|
//# sourceMappingURL=writer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../../src/cli-balance/emit/writer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../../src/cli-balance/emit/writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAMjE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAiBvE,SAAS,MAAM,CAAC,GAAiB,EAAE,CAAiB;IAClD,OAAO,GAAG,KAAK,MAAM;QACnB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,mBAAmB,EAAE,CAAC,CAAC,YAAY,CAAC;QACrE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,mBAAmB,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;AAC9E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAgB,EAAE,QAAwB;IACrE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;IACxG,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACzB,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;YAAE,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7G,CAAC;IACD,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,SAAS;QAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,cAAc,CAAC,MAAqB;IAC3C,OAAO,OAAO,MAAM,CAAC,GAAG,8BAA8B,CAAC;AACzD,CAAC;AAED,SAAS,IAAI,CAAC,MAAqB,EAAE,IAAY;IAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO;IACT,CAAC;IACD,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AACjG,CAAC"}
|
package/dist/cli-registry.d.ts
CHANGED
|
@@ -35,6 +35,13 @@ export interface FlagSpec {
|
|
|
35
35
|
/** One-line help text — the description migrated from doc/how_to_use.md. */
|
|
36
36
|
description: string;
|
|
37
37
|
}
|
|
38
|
+
/** A positional argument a command takes: its placeholder, and what it is. */
|
|
39
|
+
export interface PositionalSpec {
|
|
40
|
+
/** The placeholder as help shows it (e.g. "<FFF>"). */
|
|
41
|
+
name: string;
|
|
42
|
+
/** One-line help text. */
|
|
43
|
+
description: string;
|
|
44
|
+
}
|
|
38
45
|
/** A command: its token, a one-line summary, its per-command flag scope, and any config it reads. */
|
|
39
46
|
export interface CommandSpec {
|
|
40
47
|
/** The command token (e.g. "balance"). */
|
|
@@ -43,6 +50,10 @@ export interface CommandSpec {
|
|
|
43
50
|
summary: string;
|
|
44
51
|
/** The command's per-command flag scope. */
|
|
45
52
|
flags: FlagSpec[];
|
|
53
|
+
/** The positional arguments the command takes, in order, each once. Omit when it takes flags only. */
|
|
54
|
+
positionals?: PositionalSpec[];
|
|
55
|
+
/** False for a command that keeps no run, so the host refuses `--store`/`--run-id` before it. Omit otherwise. */
|
|
56
|
+
acceptsHostModifiers?: false;
|
|
46
57
|
/**
|
|
47
58
|
* Trailing help lines documenting `package.json` config THIS command reads, rendered
|
|
48
59
|
* verbatim after the flag list. It lives on the command's entry rather than in the
|
|
@@ -51,6 +62,23 @@ export interface CommandSpec {
|
|
|
51
62
|
* every later command, a field that command does not read (3F-3298). Omit when none.
|
|
52
63
|
*/
|
|
53
64
|
configHelp?: string[];
|
|
65
|
+
/**
|
|
66
|
+
* Flags this command once accepted and no longer does (3F-3528). Refused like any flag
|
|
67
|
+
* outside `flags`, but as retired: a flag every earlier version accepts and no later one will
|
|
68
|
+
* cannot be cured by bumping a pin, only by moving to what replaced it. Never read by the help
|
|
69
|
+
* renderers, so a retired flag cannot reach `--help` or become accepted by being listed here.
|
|
70
|
+
* APPEND-ONLY. Omit when none.
|
|
71
|
+
*/
|
|
72
|
+
retiredFlags?: RetiredFlagSpec[];
|
|
73
|
+
}
|
|
74
|
+
/** A flag a command has retired: what it was, the first version to refuse it, and its successor. */
|
|
75
|
+
export interface RetiredFlagSpec {
|
|
76
|
+
/** The retired flag with dashes (e.g. "--measurements"). */
|
|
77
|
+
name: string;
|
|
78
|
+
/** The first published version whose command no longer accepted it. */
|
|
79
|
+
retiredIn: string;
|
|
80
|
+
/** One sentence naming what a consumer does instead. */
|
|
81
|
+
replacement: string;
|
|
54
82
|
}
|
|
55
83
|
/** The two-scope registry: the global host-modifier scope, and the per-command scopes. */
|
|
56
84
|
export interface CliRegistry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-registry.d.ts","sourceRoot":"","sources":["../src/cli-registry.ts"],"names":[],"mappings":"AAAA;;;;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,CAAC;IAChB,4CAA4C;IAC5C,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,sGAAsG;IACtG,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,iHAAiH;IACjH,oBAAoB,CAAC,EAAE,KAAK,CAAC;IAC7B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;CAClC;AAED,oGAAoG;AACpG,MAAM,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,WA6BzB,CAAC;AAQF;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAiBhF;AAeD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CA0BhE"}
|
package/dist/cli-registry.js
CHANGED
|
@@ -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.
|
|
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 `
|
|
115
|
-
*
|
|
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
|
|
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: "--
|
|
134
|
-
|
|
135
|
-
|
|
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: "
|
|
170
|
-
summary: "
|
|
171
|
-
|
|
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
|
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;
|
|
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;AAwE1D;;;;GA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,MAAM,cAAc,GAAG,CAAC,CAAC;IACzB,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,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)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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
|
|
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)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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 {
|
|
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 "
|
|
37
|
-
|
|
35
|
+
case "allocate":
|
|
36
|
+
runAllocate(argv);
|
|
38
37
|
return;
|
|
39
|
-
default:
|
|
40
|
-
|
|
41
|
-
process.
|
|
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
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EACL,cAAc,EACd,YAAY,GAGb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACR,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,sFAAsF;AACtF,SAAS,UAAU,CAAC,OAAe,EAAE,IAAc;IACjD,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,SAAS;YACZ,UAAU,CAAC,IAAI,CAAC,CAAC;YACjB,OAAO;QACT,KAAK,UAAU;YACb,WAAW,CAAC,IAAI,CAAC,CAAC;YAClB,OAAO;QACT,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;YAC9E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;AACH,CAAC;AA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AAE,UAAU,CAAC,CAAC;IACvD,MAAM,SAAS,GACb,gBAAgB,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"}
|
package/dist/deferralTags.d.ts
CHANGED
|
@@ -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
|
|
9
|
-
*
|
|
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/deferralTags.js
CHANGED
|
@@ -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
|
|
9
|
-
*
|
|
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
|
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;AAUH,OAAO,EAAe,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEjF,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;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,WAAW,GAAE,SAAS,QAAQ,EAAuB,EACrD,QAAQ,GAAE,SAAS,MAAM,EAAwD,GAChF,cAAc,CA2BhB;AAyFD;;;;;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,CASl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