spec-controller 0.1.0-alpha.45 → 0.1.0-alpha.46
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/dist/cli-allocate/cli.d.ts.map +1 -1
- package/dist/cli-allocate/cli.js +0 -5
- package/dist/cli-allocate/cli.js.map +1 -1
- package/dist/cli-allocate/readHistory.d.ts +0 -13
- package/dist/cli-allocate/readHistory.d.ts.map +1 -1
- package/dist/cli-allocate/readHistory.js +0 -33
- package/dist/cli-allocate/readHistory.js.map +1 -1
- package/dist/cli-allocate/readParts.d.ts +0 -1
- package/dist/cli-allocate/readParts.d.ts.map +1 -1
- package/dist/cli-allocate/readParts.js +0 -6
- package/dist/cli-allocate/readParts.js.map +1 -1
- package/dist/cli-allocate/readTree.d.ts +0 -11
- package/dist/cli-allocate/readTree.d.ts.map +1 -1
- package/dist/cli-allocate/readTree.js +0 -32
- package/dist/cli-allocate/readTree.js.map +1 -1
- package/dist/cli-allocate/refStore.d.ts +0 -1
- package/dist/cli-allocate/refStore.d.ts.map +1 -1
- package/dist/cli-allocate/refStore.js +0 -13
- package/dist/cli-allocate/refStore.js.map +1 -1
- package/dist/cli-allocate/request.d.ts +0 -2
- package/dist/cli-allocate/request.d.ts.map +1 -1
- package/dist/cli-allocate/request.js +0 -7
- package/dist/cli-allocate/request.js.map +1 -1
- package/dist/cli-allocate/stderr.d.ts +0 -7
- package/dist/cli-allocate/stderr.d.ts.map +1 -1
- package/dist/cli-allocate/stderr.js +0 -7
- package/dist/cli-allocate/stderr.js.map +1 -1
- package/dist/cli-allocate/unreadable.d.ts +0 -13
- package/dist/cli-allocate/unreadable.d.ts.map +1 -1
- package/dist/cli-allocate/unreadable.js +0 -13
- package/dist/cli-allocate/unreadable.js.map +1 -1
- package/dist/cli-args.d.ts +0 -113
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +0 -145
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-balance/cli.d.ts +0 -85
- package/dist/cli-balance/cli.d.ts.map +1 -1
- package/dist/cli-balance/cli.js +0 -230
- package/dist/cli-balance/cli.js.map +1 -1
- package/dist/cli-balance/emit/format.d.ts +0 -52
- package/dist/cli-balance/emit/format.d.ts.map +1 -1
- package/dist/cli-balance/emit/format.js +0 -70
- package/dist/cli-balance/emit/format.js.map +1 -1
- package/dist/cli-balance/emit/writer.d.ts +0 -17
- package/dist/cli-balance/emit/writer.d.ts.map +1 -1
- package/dist/cli-balance/emit/writer.js +0 -13
- package/dist/cli-balance/emit/writer.js.map +1 -1
- package/dist/cli-balance/exitStatus.d.ts +0 -1
- package/dist/cli-balance/exitStatus.d.ts.map +1 -1
- package/dist/cli-balance/exitStatus.js +0 -7
- package/dist/cli-balance/exitStatus.js.map +1 -1
- package/dist/cli-balance/inputsRead.d.ts +0 -12
- package/dist/cli-balance/inputsRead.d.ts.map +1 -1
- package/dist/cli-balance/inputsRead.js +0 -12
- package/dist/cli-balance/inputsRead.js.map +1 -1
- package/dist/cli-balance/reRender.d.ts +0 -14
- package/dist/cli-balance/reRender.d.ts.map +1 -1
- package/dist/cli-balance/reRender.js +0 -15
- package/dist/cli-balance/reRender.js.map +1 -1
- package/dist/cli-balance/unreadableInputs.d.ts +0 -21
- package/dist/cli-balance/unreadableInputs.d.ts.map +1 -1
- package/dist/cli-balance/unreadableInputs.js +0 -21
- package/dist/cli-balance/unreadableInputs.js.map +1 -1
- package/dist/cli-registry.d.ts +0 -86
- package/dist/cli-registry.d.ts.map +1 -1
- package/dist/cli-registry.js +0 -70
- package/dist/cli-registry.js.map +1 -1
- package/dist/cli.d.ts +0 -20
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +0 -21
- package/dist/cli.js.map +1 -1
- package/dist/deferralTags.d.ts +0 -14
- package/dist/deferralTags.d.ts.map +1 -1
- package/dist/deferralTags.js +0 -14
- package/dist/deferralTags.js.map +1 -1
- package/dist/host.d.ts +0 -61
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +1 -84
- package/dist/host.js.map +1 -1
- package/dist/ingest/ciSourcePaths.d.ts +0 -38
- package/dist/ingest/ciSourcePaths.d.ts.map +1 -1
- package/dist/ingest/ciSourcePaths.js +0 -38
- package/dist/ingest/ciSourcePaths.js.map +1 -1
- package/dist/ingest/gherkinValidation.d.ts +0 -76
- package/dist/ingest/gherkinValidation.d.ts.map +1 -1
- package/dist/ingest/gherkinValidation.js +0 -76
- package/dist/ingest/gherkinValidation.js.map +1 -1
- package/dist/ingest/ingestQualityChecks.d.ts +0 -81
- package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
- package/dist/ingest/ingestQualityChecks.js +0 -194
- package/dist/ingest/ingestQualityChecks.js.map +1 -1
- package/dist/ingest/ingestScenarios.d.ts +0 -39
- package/dist/ingest/ingestScenarios.d.ts.map +1 -1
- package/dist/ingest/ingestScenarios.js +0 -70
- package/dist/ingest/ingestScenarios.js.map +1 -1
- package/dist/ingest/inputShapes.d.ts +0 -31
- package/dist/ingest/inputShapes.d.ts.map +1 -1
- package/dist/ingest/inputShapes.js +0 -30
- package/dist/ingest/inputShapes.js.map +1 -1
- package/dist/outputLocation.d.ts +0 -48
- package/dist/outputLocation.d.ts.map +1 -1
- package/dist/outputLocation.js +0 -48
- package/dist/outputLocation.js.map +1 -1
- package/dist/run-management/keptRun.d.ts +0 -107
- package/dist/run-management/keptRun.d.ts.map +1 -1
- package/dist/run-management/keptRun.js +0 -75
- package/dist/run-management/keptRun.js.map +1 -1
- package/dist/run-management/resolveRunInputs.d.ts +0 -67
- package/dist/run-management/resolveRunInputs.d.ts.map +1 -1
- package/dist/run-management/resolveRunInputs.js +0 -88
- package/dist/run-management/resolveRunInputs.js.map +1 -1
- package/dist/storedRun.d.ts +0 -21
- package/dist/storedRun.d.ts.map +1 -1
- package/dist/storedRun.js +0 -21
- package/dist/storedRun.js.map +1 -1
- package/package.json +2 -2
package/dist/cli-registry.js
CHANGED
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The data-driven command/flag registry — the single source the CLI answers `--help`
|
|
3
|
-
* from (@SCN-CLI-006). Two scopes mirror the two help surfaces:
|
|
4
|
-
*
|
|
5
|
-
* - `global` — the host modifiers recognised BEFORE the command (`--store`,
|
|
6
|
-
* `--run-id`), consumed by the top-level dispatcher; rendered by
|
|
7
|
-
* `spec-controller --help` (the sibling @SCN-CLI-007 surface).
|
|
8
|
-
* - `commands` — the per-command scopes; each command's own flags (+ `--help`/`-h`),
|
|
9
|
-
* rendered by `<command> --help`. No count is written here: @SCN-CLI-008 holds
|
|
10
|
-
* registry and render together whatever the number is, and a figure repeated in
|
|
11
|
-
* prose is one nothing reads (3F-3277).
|
|
12
|
-
*
|
|
13
|
-
* A flag exists ⇒ a registry entry ⇒ it appears in help, by construction — the
|
|
14
|
-
* single-source discipline the completeness guard (@SCN-CLI-008) will enforce and the
|
|
15
|
-
* registry-bounded parser (@SCN-CLI-009) will reject against. Registry + renderers live in the
|
|
16
|
-
* CLI/app layer, never the domain.
|
|
17
|
-
*
|
|
18
|
-
* THE REGISTRY IS THE SOURCE OF TRUTH FOR A FLAG'S DESCRIPTION AND NOTHING RECONCILES THE DOC
|
|
19
|
-
* AGAINST IT. This docblock used to say the doc was reconciled by @SCN-CLI-007/008; it is not —
|
|
20
|
-
* those two are about the registry and the two RENDERERS, and nothing in `tests/` or `features/`
|
|
21
|
-
* reads doc/how_to_use.md at all (3F-3256 deleted the checks that read documentation). So the
|
|
22
|
-
* flag table in that page is kept in step by hand, and it has drifted in BOTH directions before
|
|
23
|
-
* now: ahead of the registry on one sentence and behind it on the next (3F-3083).
|
|
24
|
-
*/
|
|
25
1
|
import { DEFAULT_DEFERRAL_TAGS } from "./deferralTags.js";
|
|
26
|
-
/**
|
|
27
|
-
* The `balance` command's per-command scope — its reconciliation flags plus `--help`/`-h`.
|
|
28
|
-
* This registry is where a flag's description LIVES; doc/how_to_use.md's flag table restates it
|
|
29
|
-
* by hand, reconciled by nobody (see the header).
|
|
30
|
-
*/
|
|
31
2
|
const balanceFlags = [
|
|
32
3
|
{
|
|
33
4
|
name: "--features",
|
|
@@ -94,14 +65,6 @@ const balanceFlags = [
|
|
|
94
65
|
description: "Show this help and exit.",
|
|
95
66
|
},
|
|
96
67
|
];
|
|
97
|
-
/**
|
|
98
|
-
* `balance`'s config block: the `specController.deferralTags` field it reads, with its
|
|
99
|
-
* recognised starter set SINGLE-SOURCED from DEFAULT_DEFERRAL_TAGS (@SCN-PND-021 / the
|
|
100
|
-
* 3F-1405 completeness discipline — the lines are built FROM the constant, never a
|
|
101
|
-
* hand-kept copy, so the documented set cannot drift from the recognised one). It hangs
|
|
102
|
-
* off balance's registry entry, not off the renderer, so it renders under `balance --help`
|
|
103
|
-
* and under nothing else.
|
|
104
|
-
*/
|
|
105
68
|
const balanceConfigHelp = [
|
|
106
69
|
"Configuration (in the target repo's package.json):",
|
|
107
70
|
" specController.deferralTags: string[]",
|
|
@@ -109,10 +72,6 @@ const balanceConfigHelp = [
|
|
|
109
72
|
" names to a Pending Item, extending (never replacing) the built-in set.",
|
|
110
73
|
` Built-in deferral tags: ${DEFAULT_DEFERRAL_TAGS.map((tag) => `@${tag}`).join(", ")}`,
|
|
111
74
|
];
|
|
112
|
-
/**
|
|
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.
|
|
115
|
-
*/
|
|
116
75
|
const balanceRetiredFlags = [
|
|
117
76
|
{
|
|
118
77
|
name: "--measurements",
|
|
@@ -120,7 +79,6 @@ const balanceRetiredFlags = [
|
|
|
120
79
|
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
80
|
},
|
|
122
81
|
];
|
|
123
|
-
/** The global host-modifier scope — recognised before the command; the CLI-007 surface. */
|
|
124
82
|
const globalFlags = [
|
|
125
83
|
{
|
|
126
84
|
name: "--store",
|
|
@@ -133,9 +91,6 @@ const globalFlags = [
|
|
|
133
91
|
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.",
|
|
134
92
|
},
|
|
135
93
|
];
|
|
136
|
-
/**
|
|
137
|
-
* The registry singleton — the single source both help surfaces render from.
|
|
138
|
-
*/
|
|
139
94
|
export const cliRegistry = {
|
|
140
95
|
global: globalFlags,
|
|
141
96
|
commands: [
|
|
@@ -163,24 +118,10 @@ export const cliRegistry = {
|
|
|
163
118
|
},
|
|
164
119
|
],
|
|
165
120
|
};
|
|
166
|
-
/** The display label for a flag: its name, any aliases, then its arg-placeholder. */
|
|
167
121
|
function flagLabel(flag) {
|
|
168
122
|
const names = [flag.name, ...(flag.aliases ?? [])].join(", ");
|
|
169
123
|
return flag.arg !== undefined ? `${names} ${flag.arg}` : names;
|
|
170
124
|
}
|
|
171
|
-
/**
|
|
172
|
-
* Render THE NAMED command's per-command scope as help text: one line per registered flag
|
|
173
|
-
* (name + arg-placeholder + description), then whatever config lines that command's entry
|
|
174
|
-
* carries — driven BY the registry, so a flag that exists is a flag that appears, by
|
|
175
|
-
* construction. Returns the help block WITHOUT a trailing newline (the caller adds it,
|
|
176
|
-
* matching the writer's stdout convention).
|
|
177
|
-
*
|
|
178
|
-
* THE COMMAND IS A PARAMETER (3F-3298). It used to be the literal `"balance"`, found by name
|
|
179
|
-
* inside this function, which is what the single registered command made look general. A
|
|
180
|
-
* second command had no help surface at all under that signature — not an empty one; there
|
|
181
|
-
* was no argument by which to ask. What the renderer covers is now the registry's shape
|
|
182
|
-
* rather than the command set's size on the day it was written.
|
|
183
|
-
*/
|
|
184
125
|
export function renderCommandHelp(registry, command) {
|
|
185
126
|
const entry = registry.commands.find((c) => c.name === command);
|
|
186
127
|
const flags = entry?.flags ?? [];
|
|
@@ -197,7 +138,6 @@ export function renderCommandHelp(registry, command) {
|
|
|
197
138
|
...(configHelp.length > 0 ? ["", ...configHelp] : []),
|
|
198
139
|
].join("\n");
|
|
199
140
|
}
|
|
200
|
-
/** A command's usage line and its arguments, one line each; nothing for a command that takes flags only. */
|
|
201
141
|
function positionalHelp(command, positionals) {
|
|
202
142
|
if (positionals.length === 0)
|
|
203
143
|
return [];
|
|
@@ -210,16 +150,6 @@ function positionalHelp(command, positionals) {
|
|
|
210
150
|
...positionals.map((positional) => ` ${positional.name.padEnd(width + 2)}${positional.description}`),
|
|
211
151
|
];
|
|
212
152
|
}
|
|
213
|
-
/**
|
|
214
|
-
* Render the top-level `spec-controller --help` surface (@SCN-CLI-007) FROM the registry:
|
|
215
|
-
* a Commands section (each command's name + one-line summary) and a Host modifiers section
|
|
216
|
-
* (each global-scope flag: name + arg-placeholder + one-line description). The global-scope
|
|
217
|
-
* half of the two-scope registry — the counterpart to `renderCommandHelp`'s per-command
|
|
218
|
-
* half — so the top-level usage no longer hand-keeps (and can no longer silently drift
|
|
219
|
-
* from) the command set or the host modifiers; both are sourced from `cliRegistry`.
|
|
220
|
-
* Summaries and descriptions render on a single line (no wrapping) so a registered string
|
|
221
|
-
* appears verbatim. Returns the block WITHOUT a trailing newline (the caller adds it).
|
|
222
|
-
*/
|
|
223
153
|
export function renderTopLevelHelp(registry) {
|
|
224
154
|
const commandGutter = 4;
|
|
225
155
|
const commandWidth = Math.max(0, ...registry.commands.map((c) => c.name.length));
|
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
|
|
1
|
+
{"version":3,"file":"cli-registry.js","sourceRoot":"","sources":["../src/cli-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAoC1D,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,E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AAI,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
|
@@ -1,23 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* The `spec-controller` binary — the top-level command host + dispatcher.
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* spec-controller [--store <root>] [--run-id <id>] <command> [command-args]
|
|
7
|
-
*
|
|
8
|
-
* Commands: `balance` — the deterministic reconciliation of scenarios against
|
|
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.
|
|
13
|
-
*
|
|
14
|
-
* Storage is a CROSS-CUTTING host modifier, not a command. A leading `--store <root>`
|
|
15
|
-
* turns any command into a STORED run: the host wraps the command via the kept-run
|
|
16
|
-
* scaffold — a named `<root>/<target>/<run-id>/` directory, the command's outputs routed
|
|
17
|
-
* in, and a `run.yaml` manifest — and hands the command its own clean args, unchanged. So
|
|
18
|
-
* `balance` stays emit-only (its default, no-store output is byte-identical); the store
|
|
19
|
-
* opinion lives at the host, injected via `--store` (required — there is no default, a
|
|
20
|
-
* default would write inside the repo). `--run-id` defaults to a timestamp.
|
|
21
|
-
*/
|
|
22
2
|
export {};
|
|
23
3
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* The `spec-controller` binary — the top-level command host + dispatcher.
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* spec-controller [--store <root>] [--run-id <id>] <command> [command-args]
|
|
7
|
-
*
|
|
8
|
-
* Commands: `balance` — the deterministic reconciliation of scenarios against
|
|
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.
|
|
13
|
-
*
|
|
14
|
-
* Storage is a CROSS-CUTTING host modifier, not a command. A leading `--store <root>`
|
|
15
|
-
* turns any command into a STORED run: the host wraps the command via the kept-run
|
|
16
|
-
* scaffold — a named `<root>/<target>/<run-id>/` directory, the command's outputs routed
|
|
17
|
-
* in, and a `run.yaml` manifest — and hands the command its own clean args, unchanged. So
|
|
18
|
-
* `balance` stays emit-only (its default, no-store output is byte-identical); the store
|
|
19
|
-
* opinion lives at the host, injected via `--store` (required — there is no default, a
|
|
20
|
-
* default would write inside the repo). `--run-id` defaults to a timestamp.
|
|
21
|
-
*/
|
|
22
2
|
import { dirname } from "node:path";
|
|
23
3
|
import { runBalance } from "./cli-balance/cli.js";
|
|
24
4
|
import { inputsReadBy, NODE_INPUT_READER } from "./cli-balance/inputsRead.js";
|
|
@@ -30,7 +10,6 @@ import { parseHostInvocation, wrapCommandArgv, peekFlag, formatFilePaths, answer
|
|
|
30
10
|
import { cliRegistry, renderTopLevelHelp } from "./cli-registry.js";
|
|
31
11
|
import { dispatchesUnstored, storedReRenderRefusal, unstoredRunIdRefusal } from "./storedRun.js";
|
|
32
12
|
import { settlingRefusal } from "./outputLocation.js";
|
|
33
|
-
/** Dispatch a command to its handler with the given (clean or store-wrapped) argv; true when it wrote its report. */
|
|
34
13
|
function runCommand(command, argv) {
|
|
35
14
|
switch (command) {
|
|
36
15
|
case "balance":
|
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,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EACL,cAAc,EACd,YAAY,GAIb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACR,eAAe,EACf,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAE,k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KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/deferralTags.d.ts
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The single-sourced STARTER set of recognised community deferral tags — bare names
|
|
3
|
-
* (the `@` is tag-line syntax). A scenario whose tag block carries one of these DEFERS
|
|
4
|
-
* every obligation it raises to a Pending Item (scenario-scope). These are the
|
|
5
|
-
* established Cucumber deferral conventions.
|
|
6
|
-
*
|
|
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 v1 core barrel.
|
|
9
|
-
* The core `parseScenarios` recognises only the deferral set it is
|
|
10
|
-
* handed (its default is `[]`, a policy-free pure core); the app is the single source
|
|
11
|
-
* of the starter policy and always passes the resolved set (starter ∪ configured) into
|
|
12
|
-
* the parser at the ingest edge. Both `resolveDeferralTags` (the `@SCN-PND-021` config
|
|
13
|
-
* union) and `renderCommandHelp`'s `--help` listing source this constant.
|
|
14
|
-
*/
|
|
15
1
|
export declare const DEFAULT_DEFERRAL_TAGS: readonly string[];
|
|
16
2
|
//# sourceMappingURL=deferralTags.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferralTags.d.ts","sourceRoot":"","sources":["../src/deferralTags.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"deferralTags.d.ts","sourceRoot":"","sources":["../src/deferralTags.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAMlD,CAAC"}
|
package/dist/deferralTags.js
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The single-sourced STARTER set of recognised community deferral tags — bare names
|
|
3
|
-
* (the `@` is tag-line syntax). A scenario whose tag block carries one of these DEFERS
|
|
4
|
-
* every obligation it raises to a Pending Item (scenario-scope). These are the
|
|
5
|
-
* established Cucumber deferral conventions.
|
|
6
|
-
*
|
|
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 v1 core barrel.
|
|
9
|
-
* The core `parseScenarios` recognises only the deferral set it is
|
|
10
|
-
* handed (its default is `[]`, a policy-free pure core); the app is the single source
|
|
11
|
-
* of the starter policy and always passes the resolved set (starter ∪ configured) into
|
|
12
|
-
* the parser at the ingest edge. Both `resolveDeferralTags` (the `@SCN-PND-021` config
|
|
13
|
-
* union) and `renderCommandHelp`'s `--help` listing source this constant.
|
|
14
|
-
*/
|
|
15
1
|
export const DEFAULT_DEFERRAL_TAGS = [
|
|
16
2
|
"wip",
|
|
17
3
|
"ignore",
|
package/dist/deferralTags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferralTags.js","sourceRoot":"","sources":["../src/deferralTags.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"deferralTags.js","sourceRoot":"","sources":["../src/deferralTags.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,KAAK;IACL,QAAQ;IACR,MAAM;IACN,MAAM;IACN,SAAS;CACV,CAAC"}
|
package/dist/host.d.ts
CHANGED
|
@@ -1,80 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The host-invocation parse — the pure half of the `spec-controller` command host.
|
|
3
|
-
*
|
|
4
|
-
* The shipped binary is `spec-controller [--store <root>] [--run-id <id>] <command>
|
|
5
|
-
* [command-args]`. `--store` / `--run-id` are CROSS-CUTTING host options recognised
|
|
6
|
-
* ONLY in leading position, before the command: storage applies across balance /
|
|
7
|
-
* analyse / migrate, so it belongs at the host (wrapping any command via the kept-run
|
|
8
|
-
* scaffold), not as a peer command and never as a flag inside `balance`. This module
|
|
9
|
-
* holds the pure rules the impure dispatcher (`cli.ts`) drives — parsing the leading
|
|
10
|
-
* options, building the wrapped command argv, and peeking the conventional provenance
|
|
11
|
-
* flags — so the whole host contract is `@unit`-testable with no IO.
|
|
12
|
-
*/
|
|
13
1
|
import { type CommandSpec, type FlagSpec } from "./cli-registry.js";
|
|
14
|
-
/** A parsed host invocation: leading global options, then the command and its clean args. */
|
|
15
2
|
export interface HostInvocation {
|
|
16
|
-
/** The injected store root from a leading `--store <root>`, or undefined (no store). */
|
|
17
3
|
store?: string;
|
|
18
|
-
/** The mnemonic from a leading `--run-id <id>`, or undefined (→ the timestamp default). */
|
|
19
4
|
runId?: string;
|
|
20
|
-
/** The command token (e.g. "balance"), or undefined when none was given. */
|
|
21
5
|
command?: string;
|
|
22
|
-
/** The command's own args — everything after the command token, verbatim. */
|
|
23
6
|
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
7
|
refusal?: string;
|
|
29
8
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Parse the host argv into its leading global options (`--store`, `--run-id`) and the
|
|
32
|
-
* command + its clean args. Global options are recognised ONLY before the command: the
|
|
33
|
-
* first token that is not a consumed global option (or its value) is the command, and
|
|
34
|
-
* everything after it is the command's own args, verbatim. So `--store /s balance
|
|
35
|
-
* --features f` yields the store + `balance` + `[--features, f]`, while `balance --store
|
|
36
|
-
* /s` leaves `--store` in the command's args (a `--store` AFTER the command is the
|
|
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.
|
|
40
|
-
*/
|
|
41
9
|
export declare function parseHostInvocation(argv: readonly string[], globalFlags?: readonly FlagSpec[], commands?: readonly string[]): HostInvocation;
|
|
42
|
-
/**
|
|
43
|
-
* Build the wrapped command argv: the command's clean args followed by a repeated
|
|
44
|
-
* `--format <spec>` per store-dir output spec. Pure — the impure runner hands the result
|
|
45
|
-
* straight to the command, so the command's OWN writer produces the stored artefacts
|
|
46
|
-
* (byte-identical to a bare `--format` run; no writer duplication).
|
|
47
|
-
*/
|
|
48
10
|
export declare function wrapCommandArgv(commandArgs: readonly string[], formatSpecs: readonly string[]): string[];
|
|
49
|
-
/**
|
|
50
|
-
* Read a `--<name> <value>` flag's value from an arg list WITHOUT consuming it — the host
|
|
51
|
-
* peeks the conventional cross-cutting provenance flags (`--target`, `--features`,
|
|
52
|
-
* `--source-sha`) to name the run dir + stamp run.yaml, while the command still receives
|
|
53
|
-
* them in its own args. Returns undefined when the flag is absent or has no value.
|
|
54
|
-
*/
|
|
55
11
|
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
12
|
export interface UnknownCommandAnswer {
|
|
58
13
|
exitCode: number;
|
|
59
14
|
stderr: string;
|
|
60
15
|
}
|
|
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
16
|
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
17
|
export declare function modifiersNotTakenRefusal(inv: HostInvocation, commands?: readonly CommandSpec[]): string | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* The file paths a command's own `--format` values name: each value's text after its first colon,
|
|
77
|
-
* as `planOutput` reads it. A value with no colon goes to stdout and names no file.
|
|
78
|
-
*/
|
|
79
18
|
export declare function formatFilePaths(argv: readonly string[]): string[];
|
|
80
19
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AASA,OAAO,EAAe,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEjF,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,WAAW,GAAE,SAAS,QAAQ,EAAuB,EACrD,QAAQ,GAAE,SAAS,MAAM,EAAwD,GAChF,cAAc,CAIhB;AAmGD,wBAAgB,eAAe,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAExG;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASlF;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAKxF;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,cAAc,EACnB,QAAQ,GAAE,SAAS,WAAW,EAAyB,GACtD,MAAM,GAAG,SAAS,CAUpB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CASjE"}
|
package/dist/host.js
CHANGED
|
@@ -1,46 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The host-invocation parse — the pure half of the `spec-controller` command host.
|
|
3
|
-
*
|
|
4
|
-
* The shipped binary is `spec-controller [--store <root>] [--run-id <id>] <command>
|
|
5
|
-
* [command-args]`. `--store` / `--run-id` are CROSS-CUTTING host options recognised
|
|
6
|
-
* ONLY in leading position, before the command: storage applies across balance /
|
|
7
|
-
* analyse / migrate, so it belongs at the host (wrapping any command via the kept-run
|
|
8
|
-
* scaffold), not as a peer command and never as a flag inside `balance`. This module
|
|
9
|
-
* holds the pure rules the impure dispatcher (`cli.ts`) drives — parsing the leading
|
|
10
|
-
* options, building the wrapped command argv, and peeking the conventional provenance
|
|
11
|
-
* flags — so the whole host contract is `@unit`-testable with no IO.
|
|
12
|
-
*/
|
|
13
1
|
import { asksForHelp, equalsFormRefusal, givenTwiceRefusal, isEqualsForm, isMissingValue, missingValueRefusal, valueFlagsOf, } from "./cli-args.js";
|
|
14
2
|
import { cliRegistry } from "./cli-registry.js";
|
|
15
|
-
/**
|
|
16
|
-
* Parse the host argv into its leading global options (`--store`, `--run-id`) and the
|
|
17
|
-
* command + its clean args. Global options are recognised ONLY before the command: the
|
|
18
|
-
* first token that is not a consumed global option (or its value) is the command, and
|
|
19
|
-
* everything after it is the command's own args, verbatim. So `--store /s balance
|
|
20
|
-
* --features f` yields the store + `balance` + `[--features, f]`, while `balance --store
|
|
21
|
-
* /s` leaves `--store` in the command's args (a `--store` AFTER the command is the
|
|
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
3
|
export function parseHostInvocation(argv, globalFlags = cliRegistry.global, commands = cliRegistry.commands.map((command) => command.name)) {
|
|
27
4
|
const read = readHostTokens(argv, globalFlags, commands);
|
|
28
5
|
const help = argv.slice(0, hostTokenCount(argv, read)).find((token) => TOP_LEVEL_HELP.has(token));
|
|
29
6
|
return help === undefined ? read : { command: help, commandArgs: [] };
|
|
30
7
|
}
|
|
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.
|
|
34
|
-
*/
|
|
35
8
|
function hostTokenCount(argv, read) {
|
|
36
9
|
if (read.refusal !== undefined || read.command === undefined)
|
|
37
10
|
return argv.length;
|
|
38
11
|
return argv.length - read.commandArgs.length - 1;
|
|
39
12
|
}
|
|
40
|
-
/** The host's tokens read in order: its modifiers, then the command and the command's own args. */
|
|
41
13
|
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
14
|
const modifiers = valueFlagsOf(globalFlags);
|
|
45
15
|
const values = new Map();
|
|
46
16
|
let i = 0;
|
|
@@ -51,7 +21,7 @@ function readHostTokens(argv, globalFlags, commands) {
|
|
|
51
21
|
const refusal = leadingFlagRefusal(token, modifiers, globalFlags);
|
|
52
22
|
if (refusal !== undefined)
|
|
53
23
|
return { commandArgs: [], refusal };
|
|
54
|
-
break;
|
|
24
|
+
break;
|
|
55
25
|
}
|
|
56
26
|
const value = argv[i + 1];
|
|
57
27
|
const refusal = modifierRefusal(token, modifier, argv.slice(i + 1, i + 3), { values, commands });
|
|
@@ -69,15 +39,6 @@ function readHostTokens(argv, globalFlags, commands) {
|
|
|
69
39
|
commandArgs: argv.slice(i + 1),
|
|
70
40
|
};
|
|
71
41
|
}
|
|
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
42
|
function modifierRefusal(token, modifier, [value, after], read) {
|
|
82
43
|
if (read.values.has(modifier.name))
|
|
83
44
|
return givenTwiceRefusal(token, "spec-controller");
|
|
@@ -88,29 +49,16 @@ function modifierRefusal(token, modifier, [value, after], read) {
|
|
|
88
49
|
}
|
|
89
50
|
return undefined;
|
|
90
51
|
}
|
|
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
52
|
function noCommandRefusal(given) {
|
|
98
53
|
return (`No command followed the host modifiers given (${given.join(", ")}), so nothing ran: ` +
|
|
99
54
|
`a host modifier needs a command after it, or --help.\n` +
|
|
100
55
|
`Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
|
|
101
56
|
}
|
|
102
|
-
/** The refusal for a modifier that took the command as its value: the modifier, the command, and the fix. */
|
|
103
57
|
function commandAsValueRefusal(token, modifier, command) {
|
|
104
58
|
return (`The ${token} host modifier took '${command}', a command, as its value, and left no command to run.\n` +
|
|
105
59
|
`Give ${token} its own value, as in 'spec-controller ${token} ${modifier.arg ?? ""} ${command} …'. ` +
|
|
106
60
|
`Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
|
|
107
61
|
}
|
|
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
62
|
function leadingFlagRefusal(token, modifiers, globalFlags) {
|
|
115
63
|
if (isEqualsForm(token))
|
|
116
64
|
return equalsFormRefusal(token, modifiers, "spec-controller");
|
|
@@ -118,13 +66,10 @@ function leadingFlagRefusal(token, modifiers, globalFlags) {
|
|
|
118
66
|
return flagBeforeCommandRefusal(token, globalFlags);
|
|
119
67
|
return undefined;
|
|
120
68
|
}
|
|
121
|
-
/** The help the host answers in the command's place, which is the one flag it takes there. */
|
|
122
69
|
const TOP_LEVEL_HELP = new Set(["--help", "-h"]);
|
|
123
|
-
/** True for a flag-shaped token that is not the top-level help. */
|
|
124
70
|
function isFlagOutOfPlace(token) {
|
|
125
71
|
return token.length > 1 && token.startsWith("-") && !TOP_LEVEL_HELP.has(token);
|
|
126
72
|
}
|
|
127
|
-
/** The refusal for a flag given before the command: the flag, what goes there, and where it goes. */
|
|
128
73
|
function flagBeforeCommandRefusal(flag, globalFlags) {
|
|
129
74
|
const modifiers = globalFlags.map((modifier) => modifier.name).join(", ");
|
|
130
75
|
return (`The ${flag} flag was given before the command. Before the command, spec-controller takes ` +
|
|
@@ -132,21 +77,9 @@ function flagBeforeCommandRefusal(flag, globalFlags) {
|
|
|
132
77
|
`'spec-controller <command> ${flag}'.\n` +
|
|
133
78
|
`Run 'spec-controller --help' to see the commands and host modifiers this version accepts.`);
|
|
134
79
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Build the wrapped command argv: the command's clean args followed by a repeated
|
|
137
|
-
* `--format <spec>` per store-dir output spec. Pure — the impure runner hands the result
|
|
138
|
-
* straight to the command, so the command's OWN writer produces the stored artefacts
|
|
139
|
-
* (byte-identical to a bare `--format` run; no writer duplication).
|
|
140
|
-
*/
|
|
141
80
|
export function wrapCommandArgv(commandArgs, formatSpecs) {
|
|
142
81
|
return [...commandArgs, ...formatSpecs.flatMap((spec) => ["--format", spec])];
|
|
143
82
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Read a `--<name> <value>` flag's value from an arg list WITHOUT consuming it — the host
|
|
146
|
-
* peeks the conventional cross-cutting provenance flags (`--target`, `--features`,
|
|
147
|
-
* `--source-sha`) to name the run dir + stamp run.yaml, while the command still receives
|
|
148
|
-
* them in its own args. Returns undefined when the flag is absent or has no value.
|
|
149
|
-
*/
|
|
150
83
|
export function peekFlag(argv, name) {
|
|
151
84
|
const flag = `--${name}`;
|
|
152
85
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -157,24 +90,12 @@ export function peekFlag(argv, name) {
|
|
|
157
90
|
}
|
|
158
91
|
return undefined;
|
|
159
92
|
}
|
|
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
93
|
export function answerUnknownCommand(command, help) {
|
|
168
94
|
return {
|
|
169
95
|
exitCode: 2,
|
|
170
96
|
stderr: `spec-controller: unknown command "${command}".\n\n${help}\n`,
|
|
171
97
|
};
|
|
172
98
|
}
|
|
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
99
|
export function modifiersNotTakenRefusal(inv, commands = cliRegistry.commands) {
|
|
179
100
|
const entry = commands.find((command) => command.name === inv.command);
|
|
180
101
|
if (entry?.acceptsHostModifiers !== false || asksForHelp(inv.commandArgs))
|
|
@@ -186,10 +107,6 @@ export function modifiersNotTakenRefusal(inv, commands = cliRegistry.commands) {
|
|
|
186
107
|
`it answers a query and keeps no run.\n` +
|
|
187
108
|
`Run 'spec-controller ${entry.name} …' without them.`);
|
|
188
109
|
}
|
|
189
|
-
/**
|
|
190
|
-
* The file paths a command's own `--format` values name: each value's text after its first colon,
|
|
191
|
-
* as `planOutput` reads it. A value with no colon goes to stdout and names no file.
|
|
192
|
-
*/
|
|
193
110
|
export function formatFilePaths(argv) {
|
|
194
111
|
const paths = [];
|
|
195
112
|
argv.forEach((token, index) => {
|
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,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;AAUjF,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,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,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;AAED,MAAM,UAAU,eAAe,CAAC,IAAuB;IACrD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC9B,IAAI,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO;QACxD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,46 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve a CI input to the workflow files it names (@SCN-USG-006, 3F-2497).
|
|
3
|
-
*
|
|
4
|
-
* A target's pipeline is routinely split across files — a nightly sweep, a security
|
|
5
|
-
* scan — and reading one of them scores the rest against the target twice over: a
|
|
6
|
-
* NAMED check enforced elsewhere is called a watermelon it is not, an UNNAMED one
|
|
7
|
-
* never reaches the books at all (3F-2238).
|
|
8
|
-
*
|
|
9
|
-
* THIS IS THE ONLY PLACE THAT KNOWS A CI INPUT CAN BE A DIRECTORY. The core takes
|
|
10
|
-
* anonymous source strings so a second ecosystem can supply its own; teaching it to
|
|
11
|
-
* walk a folder would import a filesystem and one provider's layout into a pure
|
|
12
|
-
* parser and close that seam for good. So the walk lives here, at the edge that
|
|
13
|
-
* already resolved `.github/workflows/ci.yml`, and the edge knows exactly as much
|
|
14
|
-
* about GitHub after this slice as it did before.
|
|
15
|
-
*
|
|
16
|
-
* Pure, with the filesystem injected — the resolution rules are the part worth
|
|
17
|
-
* asserting directly, and a fixture tree can only show one of them going wrong at a
|
|
18
|
-
* time.
|
|
19
|
-
*/
|
|
20
|
-
/** The filesystem reads the resolution needs, injected so the rules stay pure. */
|
|
21
1
|
export interface CiPathReader {
|
|
22
2
|
exists(path: string): boolean;
|
|
23
3
|
isDirectory(path: string): boolean;
|
|
24
4
|
readDir(path: string): string[];
|
|
25
5
|
}
|
|
26
|
-
/** The real filesystem, for the CLI edge. */
|
|
27
6
|
export declare const NODE_CI_PATH_READER: CiPathReader;
|
|
28
|
-
/**
|
|
29
|
-
* The workflow files a CI input names: every workflow in a directory, or the single
|
|
30
|
-
* file itself.
|
|
31
|
-
*
|
|
32
|
-
* Sorted, so two runs over one tree cannot differ and a diff of two reports never
|
|
33
|
-
* turns on `readdir` ordering.
|
|
34
|
-
*
|
|
35
|
-
* A FILE RESOLVES TO ITSELF ALONE. Sweeping its parent directory would silently widen
|
|
36
|
-
* a caller's deliberate scope, which is the promise @SCN-USG-008 pins at the report level.
|
|
37
|
-
*
|
|
38
|
-
* An absent path resolves to nothing — no sources, no commands, every static check
|
|
39
|
-
* read as unenforced. That over-reports gaps and hides none, the same fail-safe
|
|
40
|
-
* direction `ciRunCommands` takes on a document it cannot parse. The HARD error for a
|
|
41
|
-
* path the caller SUPPLIED and that does not exist is @SCN-CLI-002's, raised upstream;
|
|
42
|
-
* reaching here with nothing means the DEFAULT found no workflows, which is a fact
|
|
43
|
-
* about the target rather than a mistake by its author.
|
|
44
|
-
*/
|
|
45
7
|
export declare function ciSourcePathsOf(ciPath: string, reader?: CiPathReader): string[];
|
|
46
8
|
//# sourceMappingURL=ciSourcePaths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ciSourcePaths.d.ts","sourceRoot":"","sources":["../../src/ingest/ciSourcePaths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ciSourcePaths.d.ts","sourceRoot":"","sources":["../../src/ingest/ciSourcePaths.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACjC;AAED,eAAO,MAAM,mBAAmB,EAAE,YAIjC,CAAC;AAIF,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,YAAkC,GACzC,MAAM,EAAE,CAQV"}
|