spec-controller 0.1.0-alpha.4 → 0.1.0-alpha.40
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 +34 -6
- 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 +57 -0
- package/dist/cli-allocate/cli.js.map +1 -0
- package/dist/cli-allocate/readHistory.d.ts +29 -0
- package/dist/cli-allocate/readHistory.d.ts.map +1 -0
- package/dist/cli-allocate/readHistory.js +136 -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 +28 -0
- package/dist/cli-allocate/readParts.js.map +1 -0
- package/dist/cli-allocate/readTree.d.ts +16 -0
- package/dist/cli-allocate/readTree.d.ts.map +1 -0
- package/dist/cli-allocate/readTree.js +106 -0
- package/dist/cli-allocate/readTree.js.map +1 -0
- package/dist/cli-allocate/refStore.d.ts +3 -0
- package/dist/cli-allocate/refStore.d.ts.map +1 -0
- package/dist/cli-allocate/refStore.js +47 -0
- package/dist/cli-allocate/refStore.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-allocate/unreadable.d.ts +24 -0
- package/dist/cli-allocate/unreadable.d.ts.map +1 -0
- package/dist/cli-allocate/unreadable.js +43 -0
- package/dist/cli-allocate/unreadable.js.map +1 -0
- package/dist/cli-args.d.ts +73 -18
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +244 -22
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-balance/cli.d.ts +31 -13
- package/dist/cli-balance/cli.d.ts.map +1 -1
- package/dist/cli-balance/cli.js +205 -251
- 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-balance/exitStatus.d.ts +3 -0
- package/dist/cli-balance/exitStatus.d.ts.map +1 -0
- package/dist/cli-balance/exitStatus.js +12 -0
- package/dist/cli-balance/exitStatus.js.map +1 -0
- package/dist/cli-balance/reRender.d.ts +22 -0
- package/dist/cli-balance/reRender.d.ts.map +1 -0
- package/dist/cli-balance/reRender.js +36 -0
- package/dist/cli-balance/reRender.js.map +1 -0
- package/dist/cli-balance/unreadableInputs.d.ts +35 -0
- package/dist/cli-balance/unreadableInputs.d.ts.map +1 -0
- package/dist/cli-balance/unreadableInputs.js +101 -0
- package/dist/cli-balance/unreadableInputs.js.map +1 -0
- package/dist/cli-registry.d.ts +28 -0
- package/dist/cli-registry.d.ts.map +1 -1
- package/dist/cli-registry.js +40 -35
- 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 +37 -21
- package/dist/cli.js.map +1 -1
- package/dist/host.d.ts +28 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +137 -17
- 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 +25 -54
- package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
- package/dist/ingest/ingestQualityChecks.js +112 -145
- package/dist/ingest/ingestQualityChecks.js.map +1 -1
- package/dist/ingest/ingestScenarios.d.ts +11 -17
- package/dist/ingest/ingestScenarios.d.ts.map +1 -1
- package/dist/ingest/ingestScenarios.js +52 -62
- package/dist/ingest/ingestScenarios.js.map +1 -1
- package/dist/ingest/inputShapes.d.ts +47 -0
- package/dist/ingest/inputShapes.d.ts.map +1 -0
- package/dist/ingest/inputShapes.js +143 -0
- package/dist/ingest/inputShapes.js.map +1 -0
- 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 +27 -25
- package/dist/run-management/keptRun.d.ts.map +1 -1
- package/dist/run-management/keptRun.js +20 -21
- package/dist/run-management/keptRun.js.map +1 -1
- package/dist/storedRun.d.ts +27 -0
- package/dist/storedRun.d.ts.map +1 -0
- package/dist/storedRun.js +49 -0
- package/dist/storedRun.js.map +1 -0
- 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 -128
- package/dist/corpus/cli.js.map +0 -1
- package/dist/mutation-ratchet/index.d.ts +0 -51
- package/dist/mutation-ratchet/index.d.ts.map +0 -1
- package/dist/mutation-ratchet/index.js +0 -51
- 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
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. */
|
|
@@ -150,7 +130,7 @@ const globalFlags = [
|
|
|
150
130
|
{
|
|
151
131
|
name: "--run-id",
|
|
152
132
|
arg: "<id>",
|
|
153
|
-
description: "Name the stored run (default: an ISO-8601 UTC timestamp).",
|
|
133
|
+
description: "Name the stored run (default: an ISO-8601 UTC timestamp). Read only with --store: given without it, the run is refused, since no run would be kept under the name.",
|
|
154
134
|
},
|
|
155
135
|
];
|
|
156
136
|
/**
|
|
@@ -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;;;;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,yQAAyQ;KAC5Q;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;Q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AAC,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. `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. `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,34 +21,50 @@
|
|
|
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
|
+
import { dispatchesUnstored, storedReRenderRefusal, unstoredRunIdRefusal } from "./storedRun.js";
|
|
30
|
+
/** Dispatch a command to its handler with the given (clean or store-wrapped) argv; true when it wrote its report. */
|
|
31
31
|
function runCommand(command, argv) {
|
|
32
32
|
switch (command) {
|
|
33
33
|
case "balance":
|
|
34
|
-
runBalance(argv);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
process.stderr.write(
|
|
41
|
-
process.exit(
|
|
34
|
+
return runBalance(argv);
|
|
35
|
+
case "allocate":
|
|
36
|
+
runAllocate(argv);
|
|
37
|
+
return false;
|
|
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, or modifiers
|
|
48
|
+
* that would keep a run given to a command, or a re-render, that keeps none, or a run-id with no
|
|
49
|
+
* store to keep the run it names.
|
|
50
|
+
*/
|
|
51
|
+
function refuseLeadingFaults(inv) {
|
|
52
|
+
const refusal = inv.refusal ?? modifiersNotTakenRefusal(inv) ?? storedReRenderRefusal(inv) ?? unstoredRunIdRefusal(inv);
|
|
53
|
+
if (refusal === undefined)
|
|
54
|
+
return;
|
|
55
|
+
process.stderr.write(refusal + "\n");
|
|
56
|
+
process.exit(2);
|
|
57
|
+
}
|
|
44
58
|
function main(hostArgv) {
|
|
45
59
|
const inv = parseHostInvocation(hostArgv);
|
|
60
|
+
refuseLeadingFaults(inv);
|
|
46
61
|
const command = inv.command;
|
|
47
62
|
if (command === undefined || command === "help" || command === "--help" || command === "-h") {
|
|
48
63
|
process.stdout.write(renderTopLevelHelp(cliRegistry) + "\n");
|
|
49
64
|
return;
|
|
50
65
|
}
|
|
51
|
-
// No store directive → dispatch the command directly; its output is unchanged.
|
|
52
|
-
if (inv.store === undefined) {
|
|
66
|
+
// No store directive, or a request for help → dispatch the command directly; its output is unchanged.
|
|
67
|
+
if (dispatchesUnstored(inv) || inv.store === undefined) {
|
|
53
68
|
runCommand(command, inv.commandArgs);
|
|
54
69
|
return;
|
|
55
70
|
}
|
|
@@ -69,7 +84,7 @@ function main(hostArgv) {
|
|
|
69
84
|
const spec = { storeRoot: inv.store, target, runId };
|
|
70
85
|
// `mode` is the command's run kind; only `balance` ships today (analyse/migrate are the
|
|
71
86
|
// private engine's, added when it lands).
|
|
72
|
-
// The TOOL's own identity
|
|
87
|
+
// The TOOL's own identity — which spec-controller produced this run, read
|
|
73
88
|
// from the tool's OWN dir (never cwd, which is the target). "unknown" for a null SHA,
|
|
74
89
|
// matching sourceSha's own fallback so run.yaml is internally consistent.
|
|
75
90
|
const toolIdentity = resolveToolIdentity();
|
|
@@ -81,8 +96,9 @@ function main(hostArgv) {
|
|
|
81
96
|
date: new Date().toISOString(),
|
|
82
97
|
};
|
|
83
98
|
const plan = executeKeptRun(spec, meta, (formatSpecs) => runCommand(command, wrapCommandArgv(inv.commandArgs, [...formatSpecs])));
|
|
84
|
-
// The command's
|
|
85
|
-
|
|
99
|
+
// The command's report was routed into the run dir, so tell the operator where it landed.
|
|
100
|
+
if (plan !== undefined)
|
|
101
|
+
process.stdout.write(plan.runDir + "\n");
|
|
86
102
|
}
|
|
87
103
|
main(process.argv.slice(2));
|
|
88
104
|
//# sourceMappingURL=cli.js.map
|
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;AACpE,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEjG,qHAAqH;AACrH,SAAS,UAAU,CAAC,OAAe,EAAE,I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AAE;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,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/host.d.ts
CHANGED
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
* holds the pure rules the impure dispatcher (`cli.ts`) drives — parsing the leading
|
|
10
10
|
* options, building the wrapped command argv, and peeking the conventional provenance
|
|
11
11
|
* flags — so the whole host contract is `@unit`-testable with no IO.
|
|
12
|
-
*
|
|
13
|
-
* @SCN-RMG-004 — features/run-management.feature.
|
|
14
12
|
*/
|
|
13
|
+
import { type CommandSpec, type FlagSpec } from "./cli-registry.js";
|
|
15
14
|
/** A parsed host invocation: leading global options, then the command and its clean args. */
|
|
16
15
|
export interface HostInvocation {
|
|
17
16
|
/** The injected store root from a leading `--store <root>`, or undefined (no store). */
|
|
@@ -22,6 +21,11 @@ export interface HostInvocation {
|
|
|
22
21
|
command?: string;
|
|
23
22
|
/** The command's own args — everything after the command token, verbatim. */
|
|
24
23
|
commandArgs: string[];
|
|
24
|
+
/**
|
|
25
|
+
* The usage fault in the leading tokens, when there is one: the host refuses it at exit 2 before
|
|
26
|
+
* any command or stored run starts.
|
|
27
|
+
*/
|
|
28
|
+
refusal?: string;
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
31
|
* Parse the host argv into its leading global options (`--store`, `--run-id`) and the
|
|
@@ -31,8 +35,10 @@ export interface HostInvocation {
|
|
|
31
35
|
* --features f` yields the store + `balance` + `[--features, f]`, while `balance --store
|
|
32
36
|
* /s` leaves `--store` in the command's args (a `--store` AFTER the command is the
|
|
33
37
|
* command's own arg, never a host store directive) — the "global before command" contract.
|
|
38
|
+
* A modifier with nothing after it is refused; an empty argv is the bare help. A `--help` or `-h`
|
|
39
|
+
* among the host's own tokens answers the top-level help ahead of any refusal beside it.
|
|
34
40
|
*/
|
|
35
|
-
export declare function parseHostInvocation(argv: readonly string[]): HostInvocation;
|
|
41
|
+
export declare function parseHostInvocation(argv: readonly string[], globalFlags?: readonly FlagSpec[], commands?: readonly string[]): 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
|
|
@@ -47,4 +53,23 @@ export declare function wrapCommandArgv(commandArgs: readonly string[], formatSp
|
|
|
47
53
|
* them in its own args. Returns undefined when the flag is absent or has no value.
|
|
48
54
|
*/
|
|
49
55
|
export declare function peekFlag(argv: readonly string[], name: string): string | undefined;
|
|
56
|
+
/** The host's answer to a command it does not know: what goes to stderr, and the status. */
|
|
57
|
+
export interface UnknownCommandAnswer {
|
|
58
|
+
exitCode: number;
|
|
59
|
+
stderr: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Answer a command the registry does not carry. It is given the command token and the rendered
|
|
63
|
+
* help, never the command's args, so no flag after the command can change the answer.
|
|
64
|
+
*
|
|
65
|
+
* An unknown command is a usage fault, so it exits 2, the published usage code
|
|
66
|
+
* (packages/spec-controller/README.md), which `--exit-zero` never masks.
|
|
67
|
+
*/
|
|
68
|
+
export declare function answerUnknownCommand(command: string, help: string): UnknownCommandAnswer;
|
|
69
|
+
/**
|
|
70
|
+
* The refusal for host modifiers given before a command that takes none, else undefined. A request
|
|
71
|
+
* for that command's own help is answered instead, wherever the help token stands among its args:
|
|
72
|
+
* help runs nothing and keeps no run, so there is nothing for the modifiers to be refused from.
|
|
73
|
+
*/
|
|
74
|
+
export declare function modifiersNotTakenRefusal(inv: HostInvocation, commands?: readonly CommandSpec[]): string | undefined;
|
|
50
75
|
//# 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
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,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;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,WAAW,GAAE,SAAS,QAAQ,EAAuB,EACrD,QAAQ,GAAE,SAAS,MAAM,EAAwD,GAChF,cAAc,CAIhB;AAoID;;;;;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;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAKxF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,cAAc,EACnB,QAAQ,GAAE,SAAS,WAAW,EAAyB,GACtD,MAAM,GAAG,SAAS,CAUpB"}
|
package/dist/host.js
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* holds the pure rules the impure dispatcher (`cli.ts`) drives — parsing the leading
|
|
10
10
|
* options, building the wrapped command argv, and peeking the conventional provenance
|
|
11
11
|
* flags — so the whole host contract is `@unit`-testable with no IO.
|
|
12
|
-
*
|
|
13
|
-
* @SCN-RMG-004 — features/run-management.feature.
|
|
14
12
|
*/
|
|
13
|
+
import { asksForHelp, equalsFormRefusal, givenTwiceRefusal, isEqualsForm, isMissingValue, missingValueRefusal, valueFlagsOf, } from "./cli-args.js";
|
|
14
|
+
import { cliRegistry } from "./cli-registry.js";
|
|
15
15
|
/**
|
|
16
16
|
* Parse the host argv into its leading global options (`--store`, `--run-id`) and the
|
|
17
17
|
* command + its clean args. Global options are recognised ONLY before the command: the
|
|
@@ -20,26 +20,117 @@
|
|
|
20
20
|
* --features f` yields the store + `balance` + `[--features, f]`, while `balance --store
|
|
21
21
|
* /s` leaves `--store` in the command's args (a `--store` AFTER the command is the
|
|
22
22
|
* command's own arg, never a host store directive) — the "global before command" contract.
|
|
23
|
+
* A modifier with nothing after it is refused; an empty argv is the bare help. A `--help` or `-h`
|
|
24
|
+
* among the host's own tokens answers the top-level help ahead of any refusal beside it.
|
|
25
|
+
*/
|
|
26
|
+
export function parseHostInvocation(argv, globalFlags = cliRegistry.global, commands = cliRegistry.commands.map((command) => command.name)) {
|
|
27
|
+
const read = readHostTokens(argv, globalFlags, commands);
|
|
28
|
+
const help = argv.slice(0, hostTokenCount(argv, read)).find((token) => TOP_LEVEL_HELP.has(token));
|
|
29
|
+
return help === undefined ? read : { command: help, commandArgs: [] };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* How many leading tokens are the host's own: those before the command it hands the rest to, or
|
|
33
|
+
* every token when it hands them to none, because it refused one or found no command.
|
|
23
34
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
function hostTokenCount(argv, read) {
|
|
36
|
+
if (read.refusal !== undefined || read.command === undefined)
|
|
37
|
+
return argv.length;
|
|
38
|
+
return argv.length - read.commandArgs.length - 1;
|
|
39
|
+
}
|
|
40
|
+
/** The host's tokens read in order: its modifiers, then the command and the command's own args. */
|
|
41
|
+
function readHostTokens(argv, globalFlags, commands) {
|
|
42
|
+
// The modifiers and the values they take are the registry's global scope, never a list kept here:
|
|
43
|
+
// a modifier added later is read, and refused without its value, by construction.
|
|
44
|
+
const modifiers = valueFlagsOf(globalFlags);
|
|
45
|
+
const values = new Map();
|
|
27
46
|
let i = 0;
|
|
28
47
|
for (; i < argv.length; i++) {
|
|
29
|
-
const token = argv[i];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
runId = argv[i + 1];
|
|
37
|
-
i++;
|
|
38
|
-
continue;
|
|
48
|
+
const token = argv[i] ?? "";
|
|
49
|
+
const modifier = modifiers.get(token);
|
|
50
|
+
if (modifier === undefined) {
|
|
51
|
+
const refusal = leadingFlagRefusal(token, modifiers, globalFlags);
|
|
52
|
+
if (refusal !== undefined)
|
|
53
|
+
return { commandArgs: [], refusal };
|
|
54
|
+
break; // first non-modifier token is the command
|
|
39
55
|
}
|
|
40
|
-
|
|
56
|
+
const value = argv[i + 1];
|
|
57
|
+
const refusal = modifierRefusal(token, modifier, argv.slice(i + 1, i + 3), { values, commands });
|
|
58
|
+
if (refusal !== undefined)
|
|
59
|
+
return { commandArgs: [], refusal };
|
|
60
|
+
values.set(modifier.name, value ?? "");
|
|
61
|
+
i++;
|
|
62
|
+
}
|
|
63
|
+
if (i === argv.length && values.size > 0)
|
|
64
|
+
return { commandArgs: [], refusal: noCommandRefusal([...values.keys()]) };
|
|
65
|
+
return {
|
|
66
|
+
store: values.get("--store"),
|
|
67
|
+
runId: values.get("--run-id"),
|
|
68
|
+
command: argv[i],
|
|
69
|
+
commandArgs: argv.slice(i + 1),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The refusal a modifier earns where it stands, else undefined; `ahead` is its value and the token
|
|
74
|
+
* after it. Given twice, it is never read as its last value: `--store A --store B` used
|
|
75
|
+
* to store under B without a word. Given no value, it is never handed the next token:
|
|
76
|
+
* `--store --run-id r1` used to store under a directory called `--run-id`. Given the command as its
|
|
77
|
+
* value with no command after it, it has eaten the command: `--store balance
|
|
78
|
+
* --features f` used to blame `--features`, and `--store balance` alone answered help at exit 0. A
|
|
79
|
+
* command name followed by the command is still a value: `--store balance balance …` is read.
|
|
80
|
+
*/
|
|
81
|
+
function modifierRefusal(token, modifier, [value, after], read) {
|
|
82
|
+
if (read.values.has(modifier.name))
|
|
83
|
+
return givenTwiceRefusal(token, "spec-controller");
|
|
84
|
+
if (isMissingValue(value))
|
|
85
|
+
return missingValueRefusal(token, modifier, "spec-controller");
|
|
86
|
+
if (read.commands.includes(value ?? "") && (after === undefined || after.startsWith("-"))) {
|
|
87
|
+
return commandAsValueRefusal(token, modifier, value ?? "");
|
|
41
88
|
}
|
|
42
|
-
return
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The refusal for host modifiers with nothing after them: every modifier given, in one line, and the
|
|
93
|
+
* fix. Given last, `--store <root>` used to answer the top-level help at exit 0 having
|
|
94
|
+
* run nothing, a false green for a CI step that lost its command word. Help after a
|
|
95
|
+
* modifier is a command here, and a bare `spec-controller` never reaches this.
|
|
96
|
+
*/
|
|
97
|
+
function noCommandRefusal(given) {
|
|
98
|
+
return (`No command followed the host modifiers given (${given.join(", ")}), so nothing ran: ` +
|
|
99
|
+
`a host modifier needs a command after it, or --help.\n` +
|
|
100
|
+
`Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
|
|
101
|
+
}
|
|
102
|
+
/** The refusal for a modifier that took the command as its value: the modifier, the command, and the fix. */
|
|
103
|
+
function commandAsValueRefusal(token, modifier, command) {
|
|
104
|
+
return (`The ${token} host modifier took '${command}', a command, as its value, and left no command to run.\n` +
|
|
105
|
+
`Give ${token} its own value, as in 'spec-controller ${token} ${modifier.arg ?? ""} ${command} …'. ` +
|
|
106
|
+
`Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The refusal a leading token that is no modifier earns, else undefined (it is the command). A
|
|
110
|
+
* modifier written `--store=<root>` is a form that is not read, never a flag out of
|
|
111
|
+
* place; any other flag here is out of place, never a command: `--exit-zero balance`
|
|
112
|
+
* used to answer `unknown command "--exit-zero"`. The top-level help stays where it was.
|
|
113
|
+
*/
|
|
114
|
+
function leadingFlagRefusal(token, modifiers, globalFlags) {
|
|
115
|
+
if (isEqualsForm(token))
|
|
116
|
+
return equalsFormRefusal(token, modifiers, "spec-controller");
|
|
117
|
+
if (isFlagOutOfPlace(token))
|
|
118
|
+
return flagBeforeCommandRefusal(token, globalFlags);
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
/** The help the host answers in the command's place, which is the one flag it takes there. */
|
|
122
|
+
const TOP_LEVEL_HELP = new Set(["--help", "-h"]);
|
|
123
|
+
/** True for a flag-shaped token that is not the top-level help. */
|
|
124
|
+
function isFlagOutOfPlace(token) {
|
|
125
|
+
return token.length > 1 && token.startsWith("-") && !TOP_LEVEL_HELP.has(token);
|
|
126
|
+
}
|
|
127
|
+
/** The refusal for a flag given before the command: the flag, what goes there, and where it goes. */
|
|
128
|
+
function flagBeforeCommandRefusal(flag, globalFlags) {
|
|
129
|
+
const modifiers = globalFlags.map((modifier) => modifier.name).join(", ");
|
|
130
|
+
return (`The ${flag} flag was given before the command. Before the command, spec-controller takes ` +
|
|
131
|
+
`only its host modifiers (${modifiers}); a command's own flags go after it, as in ` +
|
|
132
|
+
`'spec-controller <command> ${flag}'.\n` +
|
|
133
|
+
`Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
|
|
43
134
|
}
|
|
44
135
|
/**
|
|
45
136
|
* Build the wrapped command argv: the command's clean args followed by a repeated
|
|
@@ -66,4 +157,33 @@ export function peekFlag(argv, name) {
|
|
|
66
157
|
}
|
|
67
158
|
return undefined;
|
|
68
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Answer a command the registry does not carry. It is given the command token and the rendered
|
|
162
|
+
* help, never the command's args, so no flag after the command can change the answer.
|
|
163
|
+
*
|
|
164
|
+
* An unknown command is a usage fault, so it exits 2, the published usage code
|
|
165
|
+
* (packages/spec-controller/README.md), which `--exit-zero` never masks.
|
|
166
|
+
*/
|
|
167
|
+
export function answerUnknownCommand(command, help) {
|
|
168
|
+
return {
|
|
169
|
+
exitCode: 2,
|
|
170
|
+
stderr: `spec-controller: unknown command "${command}".\n\n${help}\n`,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The refusal for host modifiers given before a command that takes none, else undefined. A request
|
|
175
|
+
* for that command's own help is answered instead, wherever the help token stands among its args:
|
|
176
|
+
* help runs nothing and keeps no run, so there is nothing for the modifiers to be refused from.
|
|
177
|
+
*/
|
|
178
|
+
export function modifiersNotTakenRefusal(inv, commands = cliRegistry.commands) {
|
|
179
|
+
const entry = commands.find((command) => command.name === inv.command);
|
|
180
|
+
if (entry?.acceptsHostModifiers !== false || asksForHelp(inv.commandArgs))
|
|
181
|
+
return undefined;
|
|
182
|
+
const given = [inv.store === undefined ? [] : ["--store"], inv.runId === undefined ? [] : ["--run-id"]].flat();
|
|
183
|
+
if (given.length === 0)
|
|
184
|
+
return undefined;
|
|
185
|
+
return (`spec-controller: usage error — '${entry.name}' takes no host modifier, and was given ${given.join(", ")}: ` +
|
|
186
|
+
`it answers a query and keeps no run.\n` +
|
|
187
|
+
`Run 'spec-controller ${entry.name} …' without them.`);
|
|
188
|
+
}
|
|
69
189
|
//# sourceMappingURL=host.js.map
|
package/dist/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAmC,MAAM,mBAAmB,CAAC;AAmBjF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAuB,EACvB,cAAmC,WAAW,CAAC,MAAM,EACrD,WAA8B,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAEjF,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACzD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAClG,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;AACxE,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAuB,EAAE,IAAoB;IACnE,IAAI,I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EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC;IACvE,IAAI,KAAK,EAAE,oBAAoB,KAAK,KAAK,IAAI,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5F,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/G,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACzC,OAAO,CACL,mCAAmC,KAAK,CAAC,IAAI,2CAA2C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;QAC5G,wCAAwC;QACxC,wBAAwB,KAAK,CAAC,IAAI,mBAAmB,CACtD,CAAC;AACJ,CAAC"}
|
|
@@ -74,13 +74,9 @@ export declare class UnreadableFeatureCorpusError extends Error {
|
|
|
74
74
|
* refusal means for it.
|
|
75
75
|
*
|
|
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,CA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