spec-controller 0.1.0-alpha.32 → 0.1.0-alpha.34
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-args.d.ts +17 -18
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +22 -21
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-balance/cli.d.ts +1 -1
- package/dist/cli-balance/cli.d.ts.map +1 -1
- package/dist/cli-balance/cli.js +10 -10
- package/dist/cli-balance/cli.js.map +1 -1
- package/dist/cli-balance/reRender.d.ts.map +1 -1
- package/dist/cli-balance/reRender.js +1 -2
- package/dist/cli-balance/reRender.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +14 -13
- package/dist/cli.js.map +1 -1
- package/dist/host.d.ts +4 -7
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +27 -15
- package/dist/host.js.map +1 -1
- package/dist/run-management/keptRun.d.ts +16 -9
- package/dist/run-management/keptRun.d.ts.map +1 -1
- package/dist/run-management/keptRun.js +8 -4
- package/dist/run-management/keptRun.js.map +1 -1
- package/dist/storedRun.d.ts +18 -0
- package/dist/storedRun.d.ts.map +1 -0
- package/dist/storedRun.js +29 -0
- package/dist/storedRun.js.map +1 -0
- package/package.json +2 -2
package/dist/cli-args.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THE ONE READING OF A COMMAND'S ARGV, and the one bounding of it against the registry.
|
|
3
3
|
*
|
|
4
|
-
* WHY IT IS ITS OWN MODULE
|
|
4
|
+
* WHY IT IS ITS OWN MODULE. Both halves lived inside `cli-balance/cli.ts` while
|
|
5
5
|
* `balance` was the only command — `parseArgs` private to it, `checkUnknownFlags` exported for
|
|
6
6
|
* its own `@unit` arm. A second command needs both, and the two ways of giving it them were
|
|
7
7
|
* worse than moving them: copying `parseArgs` would put a second reading of argv in a tree whose
|
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
* THE BOUNDING IS PER-COMMAND, which is what makes "accepted = registry = help" hold for every
|
|
13
13
|
* command rather than for the one this code was written beside. `checkUnknownFlags` took the
|
|
14
14
|
* registry and looked `balance` up inside itself; the command is a parameter now, exactly as it
|
|
15
|
-
* became one for `renderCommandHelp
|
|
15
|
+
* became one for `renderCommandHelp`. The unknown-flag scenario is unchanged and still
|
|
16
16
|
* asks about `balance`: a command added later gets the same bounding BY CONSTRUCTION.
|
|
17
17
|
*/
|
|
18
18
|
import type { CliRegistry, FlagSpec } from "./cli-registry.js";
|
|
19
|
+
/** True when a command's argv asks for its help, wherever `--help` or `-h` stands in it. */
|
|
20
|
+
export declare function asksForHelp(argv: readonly string[]): boolean;
|
|
19
21
|
/**
|
|
20
22
|
* Parse `--flag value` pairs from a command's argv into a record, keys with the `--` stripped.
|
|
21
23
|
*
|
|
@@ -26,7 +28,7 @@ import type { CliRegistry, FlagSpec } from "./cli-registry.js";
|
|
|
26
28
|
* PERMISSIVE BY ITSELF, AND BOUNDED BY THE CALLER. It records whatever it is given — a flag no
|
|
27
29
|
* registry names, the last of two copies, a word after a flag that takes none — and drops a word
|
|
28
30
|
* that follows no flag. `checkArgvShape` and `checkUnknownFlags` below are what refuse those, before
|
|
29
|
-
* anything reads the record
|
|
31
|
+
* anything reads the record. The split is deliberate — the parse has no opinion about which
|
|
30
32
|
* command it is reading for, and the bounding has nothing else to do.
|
|
31
33
|
*/
|
|
32
34
|
export declare function parseArgs(argv: readonly string[]): Record<string, string>;
|
|
@@ -41,7 +43,7 @@ export declare function valueFlagsOf(flags: readonly FlagSpec[]): Map<string, Fl
|
|
|
41
43
|
*/
|
|
42
44
|
export declare function isMissingValue(next: string | undefined): boolean;
|
|
43
45
|
/**
|
|
44
|
-
* A flag that takes a value, given none, is a usage fault
|
|
46
|
+
* A flag that takes a value, given none, is a usage fault. It reads the
|
|
45
47
|
* RAW argv, because `parseArgs` has already turned a missing value into the string "true" — which a
|
|
46
48
|
* path flag then looked for on disk, `--target` recorded, and `--format` dropped on its way to a
|
|
47
49
|
* verdict `--exit-zero` turned green. Returns the refusal for the first such flag, else null.
|
|
@@ -50,7 +52,7 @@ export declare function checkMissingValues(argv: readonly string[], registry: Cl
|
|
|
50
52
|
/** The refusal for a value flag given none: the flag, the value it takes, and where the flags are listed. */
|
|
51
53
|
export declare function missingValueRefusal(given: string, flag: FlagSpec, scope: string): string;
|
|
52
54
|
/**
|
|
53
|
-
* The shape of a command's argv, read against its registry scope
|
|
55
|
+
* The shape of a command's argv, read against its registry scope: every token is a flag,
|
|
54
56
|
* or the value of the flag before it, or a usage fault. Returns the refusal for the first token that
|
|
55
57
|
* is neither, else null.
|
|
56
58
|
*/
|
|
@@ -66,7 +68,7 @@ export declare function givenTwiceRefusal(given: string, scope: string): string;
|
|
|
66
68
|
/** A flag written with its value after an `=`, as in `--format=json`: a form this CLI does not read. */
|
|
67
69
|
export declare function isEqualsForm(token: string): boolean;
|
|
68
70
|
/**
|
|
69
|
-
* The refusal for a flag written `--flag=value
|
|
71
|
+
* The refusal for a flag written `--flag=value`: the form as given, and the
|
|
70
72
|
* spelling that is read — the flag and its value as two arguments, or the flag alone when it takes
|
|
71
73
|
* none. Never the unknown-flag pin advice: no version reads the form, so no pin cures it. Refused
|
|
72
74
|
* rather than split, by ruling: one spelling means one reader of argv, where splitting would teach
|
|
@@ -74,21 +76,19 @@ export declare function isEqualsForm(token: string): boolean;
|
|
|
74
76
|
*/
|
|
75
77
|
export declare function equalsFormRefusal(token: string, flags: ReadonlyMap<string, FlagSpec>, scope: string): string;
|
|
76
78
|
/**
|
|
77
|
-
* A host modifier given after the command is out of place, not unknown
|
|
78
|
-
* flag exists, so
|
|
79
|
-
*
|
|
80
|
-
* `process.exit` — the unknown-flag path sets a status and returns, which inside a stored run reaches
|
|
81
|
-
* the scaffold that stamps a run.yaml (3F-3650). Returns the refusal for the first such flag, else null.
|
|
79
|
+
* A host modifier given after the command is out of place, not unknown: the
|
|
80
|
+
* flag exists, so the unknown-flag advice to bump a pin to a version that accepts it is false. Returns the
|
|
81
|
+
* refusal for the first such flag, else null.
|
|
82
82
|
*/
|
|
83
83
|
export declare function checkMisplacedHostModifiers(args: Record<string, string>, registry: CliRegistry, command: string): string | null;
|
|
84
84
|
/**
|
|
85
|
-
* The registry-bounded flag check at a command's CLI edge
|
|
85
|
+
* The registry-bounded flag check at a command's CLI edge. A command accepts ONLY
|
|
86
86
|
* the flags its per-command registry scope LISTS (by `name` or `alias`); an unregistered flag — a
|
|
87
87
|
* typo like `--strcit`, a stray `--bogus` — is a usage error, where the permissive parse above would
|
|
88
88
|
* have recorded it. It bounds flag NAMES and nothing else: a word that is no flag, a value given to a
|
|
89
89
|
* flag that takes none, a second copy, a `--flag=value` form, are `checkArgvShape`'s, which runs
|
|
90
|
-
* first
|
|
91
|
-
* = help": a flag cannot affect behaviour without a registry entry, and so (by
|
|
90
|
+
* first. This is the structural teeth behind "accepted = registry
|
|
91
|
+
* = help": a flag cannot affect behaviour without a registry entry, and so (by the help-completeness
|
|
92
92
|
* guard) without appearing in that command's help.
|
|
93
93
|
*
|
|
94
94
|
* PURE and `@unit`-testable: the parsed args (keys already `--`-stripped) plus the registry and
|
|
@@ -96,15 +96,14 @@ export declare function checkMisplacedHostModifiers(args: Record<string, string>
|
|
|
96
96
|
* naming it WITH its dashes — routed to stderr and the enumerated usage status 2 by the caller,
|
|
97
97
|
* never 1, never a silent run — else null. The global `--store`/`--run-id` modifiers are consumed
|
|
98
98
|
* by the top-level dispatcher when they come BEFORE the command; written after it they reach the
|
|
99
|
-
* command, and `checkMisplacedHostModifiers` refuses them as out of place before this runs
|
|
100
|
-
* (@SCN-CLI-061).
|
|
99
|
+
* command, and `checkMisplacedHostModifiers` refuses them as out of place before this runs.
|
|
101
100
|
*
|
|
102
101
|
* A COMMAND THE REGISTRY DOES NOT NAME ACCEPTS NOTHING, which is the honest reading rather than a
|
|
103
102
|
* degenerate one: an unregistered command has no scope, so every flag given to it is outside it.
|
|
104
103
|
* The dispatcher refuses such a command before this is ever reached, so the case is unreachable
|
|
105
104
|
* today and stated here so it cannot become a silent "accept everything" later.
|
|
106
105
|
*
|
|
107
|
-
* IT NAMES THE VERSION THAT REFUSED, AND THAT IS FOR THE PINNED READER
|
|
106
|
+
* IT NAMES THE VERSION THAT REFUSED, AND THAT IS FOR THE PINNED READER.
|
|
108
107
|
* A consumer pins spec-controller and then moves their own tree; the pinned reader is handed argv
|
|
109
108
|
* it was published too early — or too late — to understand, and an unadorned "unknown flag" is
|
|
110
109
|
* indistinguishable from a typo. Naming the running version makes version skew legible from the CI
|
|
@@ -119,7 +118,7 @@ export declare function checkMisplacedHostModifiers(args: Record<string, string>
|
|
|
119
118
|
* refusal is the tool's own, which makes it universal rather than local.
|
|
120
119
|
*
|
|
121
120
|
* EXCEPT FOR A FLAG THE COMMAND HAS RETIRED, where the bump is false advice: `retiredFlagRefusal`
|
|
122
|
-
* below names the retirement and its replacement instead
|
|
121
|
+
* below names the retirement and its replacement instead.
|
|
123
122
|
*
|
|
124
123
|
* THE STATUS DOES NOT MOVE. The caller still routes this to stderr and exit 2. A mistyped `--strcit`
|
|
125
124
|
* is still a usage fault, and giving skew its own status would cost every adopter the ordinary
|
package/dist/cli-args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAe,QAAQ,EAAkB,MAAM,mBAAmB,CAAC;AAE5F;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBzE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAO9E;AAED;;;GA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AAK,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAW5G;AAgDD;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,IAAI,CASf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CA2Bf"}
|
package/dist/cli-args.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THE ONE READING OF A COMMAND'S ARGV, and the one bounding of it against the registry.
|
|
3
3
|
*
|
|
4
|
-
* WHY IT IS ITS OWN MODULE
|
|
4
|
+
* WHY IT IS ITS OWN MODULE. Both halves lived inside `cli-balance/cli.ts` while
|
|
5
5
|
* `balance` was the only command — `parseArgs` private to it, `checkUnknownFlags` exported for
|
|
6
6
|
* its own `@unit` arm. A second command needs both, and the two ways of giving it them were
|
|
7
7
|
* worse than moving them: copying `parseArgs` would put a second reading of argv in a tree whose
|
|
@@ -12,9 +12,13 @@
|
|
|
12
12
|
* THE BOUNDING IS PER-COMMAND, which is what makes "accepted = registry = help" hold for every
|
|
13
13
|
* command rather than for the one this code was written beside. `checkUnknownFlags` took the
|
|
14
14
|
* registry and looked `balance` up inside itself; the command is a parameter now, exactly as it
|
|
15
|
-
* became one for `renderCommandHelp
|
|
15
|
+
* became one for `renderCommandHelp`. The unknown-flag scenario is unchanged and still
|
|
16
16
|
* asks about `balance`: a command added later gets the same bounding BY CONSTRUCTION.
|
|
17
17
|
*/
|
|
18
|
+
/** True when a command's argv asks for its help, wherever `--help` or `-h` stands in it. */
|
|
19
|
+
export function asksForHelp(argv) {
|
|
20
|
+
return argv.includes("--help") || argv.includes("-h");
|
|
21
|
+
}
|
|
18
22
|
/**
|
|
19
23
|
* Parse `--flag value` pairs from a command's argv into a record, keys with the `--` stripped.
|
|
20
24
|
*
|
|
@@ -25,7 +29,7 @@
|
|
|
25
29
|
* PERMISSIVE BY ITSELF, AND BOUNDED BY THE CALLER. It records whatever it is given — a flag no
|
|
26
30
|
* registry names, the last of two copies, a word after a flag that takes none — and drops a word
|
|
27
31
|
* that follows no flag. `checkArgvShape` and `checkUnknownFlags` below are what refuse those, before
|
|
28
|
-
* anything reads the record
|
|
32
|
+
* anything reads the record. The split is deliberate — the parse has no opinion about which
|
|
29
33
|
* command it is reading for, and the bounding has nothing else to do.
|
|
30
34
|
*/
|
|
31
35
|
export function parseArgs(argv) {
|
|
@@ -68,7 +72,7 @@ export function isMissingValue(next) {
|
|
|
68
72
|
return next === undefined || next === "" || next.startsWith("--");
|
|
69
73
|
}
|
|
70
74
|
/**
|
|
71
|
-
* A flag that takes a value, given none, is a usage fault
|
|
75
|
+
* A flag that takes a value, given none, is a usage fault. It reads the
|
|
72
76
|
* RAW argv, because `parseArgs` has already turned a missing value into the string "true" — which a
|
|
73
77
|
* path flag then looked for on disk, `--target` recorded, and `--format` dropped on its way to a
|
|
74
78
|
* verdict `--exit-zero` turned green. Returns the refusal for the first such flag, else null.
|
|
@@ -90,7 +94,7 @@ export function missingValueRefusal(given, flag, scope) {
|
|
|
90
94
|
`Run '${scope} --help' to see the flags this version accepts and the values they take.`);
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
|
-
* The shape of a command's argv, read against its registry scope
|
|
97
|
+
* The shape of a command's argv, read against its registry scope: every token is a flag,
|
|
94
98
|
* or the value of the flag before it, or a usage fault. Returns the refusal for the first token that
|
|
95
99
|
* is neither, else null.
|
|
96
100
|
*/
|
|
@@ -177,7 +181,7 @@ export function isEqualsForm(token) {
|
|
|
177
181
|
return isFlagShaped(token) && token.includes("=");
|
|
178
182
|
}
|
|
179
183
|
/**
|
|
180
|
-
* The refusal for a flag written `--flag=value
|
|
184
|
+
* The refusal for a flag written `--flag=value`: the form as given, and the
|
|
181
185
|
* spelling that is read — the flag and its value as two arguments, or the flag alone when it takes
|
|
182
186
|
* none. Never the unknown-flag pin advice: no version reads the form, so no pin cures it. Refused
|
|
183
187
|
* rather than split, by ruling: one spelling means one reader of argv, where splitting would teach
|
|
@@ -195,8 +199,8 @@ export function equalsFormRefusal(token, flags, scope) {
|
|
|
195
199
|
/**
|
|
196
200
|
* How many tokens after a flag are its value: one for a value flag given one, and — for a flag the
|
|
197
201
|
* scope does not have — one for the word after it, exactly as `parseArgs` pairs them, so an unknown
|
|
198
|
-
* flag and its word stay
|
|
199
|
-
*
|
|
202
|
+
* flag and its word stay the unknown-flag check's to refuse. An empty value is consumed as one, so it
|
|
203
|
+
* stays a missing value rather than becoming a stray argument.
|
|
200
204
|
*/
|
|
201
205
|
function valueTokensAfter(flag, next) {
|
|
202
206
|
if (next === undefined || isFlagShaped(next))
|
|
@@ -229,11 +233,9 @@ function notAFlagRefusal(token, command) {
|
|
|
229
233
|
`Run 'spec-controller ${command} --help' to see the flags this version accepts.`);
|
|
230
234
|
}
|
|
231
235
|
/**
|
|
232
|
-
* A host modifier given after the command is out of place, not unknown
|
|
233
|
-
* flag exists, so
|
|
234
|
-
*
|
|
235
|
-
* `process.exit` — the unknown-flag path sets a status and returns, which inside a stored run reaches
|
|
236
|
-
* the scaffold that stamps a run.yaml (3F-3650). Returns the refusal for the first such flag, else null.
|
|
236
|
+
* A host modifier given after the command is out of place, not unknown: the
|
|
237
|
+
* flag exists, so the unknown-flag advice to bump a pin to a version that accepts it is false. Returns the
|
|
238
|
+
* refusal for the first such flag, else null.
|
|
237
239
|
*/
|
|
238
240
|
export function checkMisplacedHostModifiers(args, registry, command) {
|
|
239
241
|
const modifiers = new Set(registry.global.map((flag) => flag.name.replace(/^-+/, "")));
|
|
@@ -245,13 +247,13 @@ export function checkMisplacedHostModifiers(args, registry, command) {
|
|
|
245
247
|
`Run 'spec-controller --help' to see the host modifiers this version accepts.`);
|
|
246
248
|
}
|
|
247
249
|
/**
|
|
248
|
-
* The registry-bounded flag check at a command's CLI edge
|
|
250
|
+
* The registry-bounded flag check at a command's CLI edge. A command accepts ONLY
|
|
249
251
|
* the flags its per-command registry scope LISTS (by `name` or `alias`); an unregistered flag — a
|
|
250
252
|
* typo like `--strcit`, a stray `--bogus` — is a usage error, where the permissive parse above would
|
|
251
253
|
* have recorded it. It bounds flag NAMES and nothing else: a word that is no flag, a value given to a
|
|
252
254
|
* flag that takes none, a second copy, a `--flag=value` form, are `checkArgvShape`'s, which runs
|
|
253
|
-
* first
|
|
254
|
-
* = help": a flag cannot affect behaviour without a registry entry, and so (by
|
|
255
|
+
* first. This is the structural teeth behind "accepted = registry
|
|
256
|
+
* = help": a flag cannot affect behaviour without a registry entry, and so (by the help-completeness
|
|
255
257
|
* guard) without appearing in that command's help.
|
|
256
258
|
*
|
|
257
259
|
* PURE and `@unit`-testable: the parsed args (keys already `--`-stripped) plus the registry and
|
|
@@ -259,15 +261,14 @@ export function checkMisplacedHostModifiers(args, registry, command) {
|
|
|
259
261
|
* naming it WITH its dashes — routed to stderr and the enumerated usage status 2 by the caller,
|
|
260
262
|
* never 1, never a silent run — else null. The global `--store`/`--run-id` modifiers are consumed
|
|
261
263
|
* by the top-level dispatcher when they come BEFORE the command; written after it they reach the
|
|
262
|
-
* command, and `checkMisplacedHostModifiers` refuses them as out of place before this runs
|
|
263
|
-
* (@SCN-CLI-061).
|
|
264
|
+
* command, and `checkMisplacedHostModifiers` refuses them as out of place before this runs.
|
|
264
265
|
*
|
|
265
266
|
* A COMMAND THE REGISTRY DOES NOT NAME ACCEPTS NOTHING, which is the honest reading rather than a
|
|
266
267
|
* degenerate one: an unregistered command has no scope, so every flag given to it is outside it.
|
|
267
268
|
* The dispatcher refuses such a command before this is ever reached, so the case is unreachable
|
|
268
269
|
* today and stated here so it cannot become a silent "accept everything" later.
|
|
269
270
|
*
|
|
270
|
-
* IT NAMES THE VERSION THAT REFUSED, AND THAT IS FOR THE PINNED READER
|
|
271
|
+
* IT NAMES THE VERSION THAT REFUSED, AND THAT IS FOR THE PINNED READER.
|
|
271
272
|
* A consumer pins spec-controller and then moves their own tree; the pinned reader is handed argv
|
|
272
273
|
* it was published too early — or too late — to understand, and an unadorned "unknown flag" is
|
|
273
274
|
* indistinguishable from a typo. Naming the running version makes version skew legible from the CI
|
|
@@ -282,7 +283,7 @@ export function checkMisplacedHostModifiers(args, registry, command) {
|
|
|
282
283
|
* refusal is the tool's own, which makes it universal rather than local.
|
|
283
284
|
*
|
|
284
285
|
* EXCEPT FOR A FLAG THE COMMAND HAS RETIRED, where the bump is false advice: `retiredFlagRefusal`
|
|
285
|
-
* below names the retirement and its replacement instead
|
|
286
|
+
* below names the retirement and its replacement instead.
|
|
286
287
|
*
|
|
287
288
|
* THE STATUS DOES NOT MOVE. The caller still routes this to stderr and exit 2. A mistyped `--strcit`
|
|
288
289
|
* is still a usage fault, and giving skew its own status would cost every adopter the ordinary
|
|
@@ -316,7 +317,7 @@ export function checkUnknownFlags(args, registry, command, toolVersion) {
|
|
|
316
317
|
return null;
|
|
317
318
|
}
|
|
318
319
|
/**
|
|
319
|
-
* THE REFUSAL FOR A FLAG THE COMMAND HAS RETIRED
|
|
320
|
+
* THE REFUSAL FOR A FLAG THE COMMAND HAS RETIRED, or `undefined` when the
|
|
320
321
|
* flag is merely unregistered. The drift advice above is true of a flag newer than the pin and
|
|
321
322
|
* false of a retired one: every earlier version accepts it and no later one will, so the only pin
|
|
322
323
|
* that satisfies "bump the pin to a version that accepts it" is a downgrade back onto the route
|
package/dist/cli-args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;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M,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,CACL,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC;gBACpD,kBAAkB,GAAG,yBAAyB,OAAO,8BAA8B;oBACnF,GAAG,WAAW,iCAAiC,OAAO,WAAW;oBACjE,oFAAoF;oBACpF,oCAAoC,OAAO,eAAe,GAAG,KAAK;oBAClE,kCAAkC,OAAO,iDAAiD,CAC3F,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAS,kBAAkB,CACzB,KAA8B,EAC9B,GAAW,EACX,OAAe,EACf,WAAmB;IAEnB,MAAM,OAAO,GAAG,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC;IAC1F,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,OAAO,CACL,gBAAgB,OAAO,CAAC,IAAI,yBAAyB,OAAO,iCAAiC;QAC7F,GAAG,OAAO,CAAC,SAAS,8DAA8D,WAAW,MAAM;QACnG,6FAA6F;QAC7F,GAAG,OAAO,CAAC,WAAW,IAAI;QAC1B,wBAAwB,OAAO,iDAAiD,CACjF,CAAC;AACJ,CAAC"}
|
|
@@ -83,5 +83,5 @@ export declare function checkInputsParse(args: Record<string, string>, read: (pa
|
|
|
83
83
|
* not an error (the ordinary reconcile path).
|
|
84
84
|
*/
|
|
85
85
|
export declare function checkRenderFromJson(args: Record<string, string>, read: (path: string) => string): string | null;
|
|
86
|
-
export declare function runBalance(argv: string[]):
|
|
86
|
+
export declare function runBalance(argv: string[]): boolean;
|
|
87
87
|
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAqDH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAS3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAEjE;AAqBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAChC,MAAM,GAAG,IAAI,CAcf;AAYD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC7B,MAAM,GAAG,IAAI,CAef;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC7B,MAAM,GAAG,IAAI,CAcf;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAwGlD"}
|
package/dist/cli-balance/cli.js
CHANGED
|
@@ -24,7 +24,7 @@ import { cliRegistry, renderCommandHelp } from "../cli-registry.js";
|
|
|
24
24
|
// THE ARGV READING AND ITS REGISTRY BOUNDING, SHARED WITH EVERY OTHER COMMAND. Both
|
|
25
25
|
// lived here while `balance` was the only command; a second command needs them, and a second
|
|
26
26
|
// copy of "what did the operator type" is the one thing this tree least wants two of.
|
|
27
|
-
import { parseArgs, checkArgvShape, checkUnknownFlags, checkMissingValues, checkMisplacedHostModifiers, } from "../cli-args.js";
|
|
27
|
+
import { asksForHelp, parseArgs, checkArgvShape, checkUnknownFlags, checkMissingValues, checkMisplacedHostModifiers, } from "../cli-args.js";
|
|
28
28
|
/**
|
|
29
29
|
* Collect the `--format <spec>` values from argv in order (the flag is REPEATABLE, unlike
|
|
30
30
|
* the single-valued flags `parseArgs` records) — the raw specs `planOutput` parses. Empty
|
|
@@ -204,9 +204,9 @@ export function runBalance(argv) {
|
|
|
204
204
|
// and return. This intercepts --help so it never falls through parseArgs as a stray flag
|
|
205
205
|
// while balance runs anyway. The registry is the single source, so a flag that exists is
|
|
206
206
|
// a flag that appears in help — no hand-kept list to drift.
|
|
207
|
-
if (
|
|
207
|
+
if (asksForHelp(argv)) {
|
|
208
208
|
process.stdout.write(renderCommandHelp(cliRegistry, "balance") + "\n");
|
|
209
|
-
return;
|
|
209
|
+
return false;
|
|
210
210
|
}
|
|
211
211
|
// Capture the run-start instant up front — the run provenance's UTC timestamp,
|
|
212
212
|
// threaded through ctx.runStart to the renderers.
|
|
@@ -221,12 +221,12 @@ export function runBalance(argv) {
|
|
|
221
221
|
if (legacyJsonError)
|
|
222
222
|
exitUsage(legacyJsonError);
|
|
223
223
|
// A host modifier after the command is out of place, not unknown, so it is
|
|
224
|
-
// refused before the drift advice
|
|
224
|
+
// refused before the drift advice.
|
|
225
225
|
const misplacedModifierError = checkMisplacedHostModifiers(args, cliRegistry, "balance");
|
|
226
226
|
if (misplacedModifierError)
|
|
227
227
|
exitUsage(misplacedModifierError);
|
|
228
|
-
// Every token is a flag or the value of the flag before it, refused
|
|
229
|
-
//
|
|
228
|
+
// Every token is a flag or the value of the flag before it, refused before the unknown-flag
|
|
229
|
+
// check below.
|
|
230
230
|
const shapeError = checkArgvShape(argv, cliRegistry, "balance");
|
|
231
231
|
if (shapeError)
|
|
232
232
|
exitUsage(shapeError);
|
|
@@ -244,16 +244,15 @@ export function runBalance(argv) {
|
|
|
244
244
|
if (unknownFlagError) {
|
|
245
245
|
process.stderr.write(unknownFlagError + "\n");
|
|
246
246
|
process.exitCode = 2;
|
|
247
|
-
return;
|
|
247
|
+
return false;
|
|
248
248
|
}
|
|
249
249
|
// A flag that takes a value, given none, refused before anything reads
|
|
250
|
-
// the value `parseArgs` made up for it.
|
|
251
|
-
// stored run the return would reach the kept-run scaffold, which stamps a run.yaml.
|
|
250
|
+
// the value `parseArgs` made up for it.
|
|
252
251
|
const missingValueError = checkMissingValues(argv, cliRegistry, "balance");
|
|
253
252
|
if (missingValueError)
|
|
254
253
|
exitUsage(missingValueError);
|
|
255
254
|
if (renderSavedReport(args))
|
|
256
|
-
return;
|
|
255
|
+
return false;
|
|
257
256
|
refuseUnreadableInputs(args);
|
|
258
257
|
const inputs = reconcileInputsOf(args);
|
|
259
258
|
// Reconcile the obligation-vs-observation evidence into the Ledger. The runtime evidence-observation
|
|
@@ -293,6 +292,7 @@ export function runBalance(argv) {
|
|
|
293
292
|
// rather than writing a 0 over it — the distinction the balanced-exit scenarios rest on.
|
|
294
293
|
if (code !== 0)
|
|
295
294
|
process.exitCode = code;
|
|
295
|
+
return true;
|
|
296
296
|
}
|
|
297
297
|
/**
|
|
298
298
|
* A usage or input fault: the message on stderr, then exit 2 — the enumerated usage code
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAA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.ts","sourceRoot":"","sources":["../../src/cli-balance/reRender.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEpF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,UAAU,CAQ5E;AAKD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAQ9E"}
|
|
@@ -30,8 +30,7 @@ export function checkReRenderFlags(args) {
|
|
|
30
30
|
const ignored = Object.keys(args).find((key) => !READ_BY_A_RE_RENDER.has(key));
|
|
31
31
|
if (ignored === undefined)
|
|
32
32
|
return null;
|
|
33
|
-
const stored = ignored === "format" ? " A run under --store passes --format for its report files, so a re-render is not stored." : "";
|
|
34
33
|
return (`--render-from-json re-renders a saved report and reads only --strict and --exit-zero beside it; ` +
|
|
35
|
-
`--${ignored} would be ignored. Remove it, or run balance without --render-from-json
|
|
34
|
+
`--${ignored} would be ignored. Remove it, or run balance without --render-from-json.`);
|
|
36
35
|
}
|
|
37
36
|
//# sourceMappingURL=reRender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reRender.js","sourceRoot":"","sources":["../../src/cli-balance/reRender.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAQhF;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,SAAiB,EAAE,WAAoB;IAC9D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAgB,CAAC;IACnD,MAAM,MAAM,G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AI,IAAI,WAAW,CAAC;IAClE,MAAM,MAAM,GAAgB,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,EAAE,GAAG,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC5F,OAAO;QACL,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC;QAC9B,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC;KACpG,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAEtG;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAA4B;IAC7D,IAAI,IAAI,CAAC,kBAAkB,CAAC,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACxD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/E,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,CACL,kGAAkG;QAClG,KAAK,OAAO,0EAA0E,CACvF,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Commands: `balance` — the deterministic reconciliation of scenarios against
|
|
9
9
|
* observed evidence, standalone on the public core + app layer (no engine). It also polices the
|
|
10
|
-
* corpus's own scenario codes
|
|
10
|
+
* corpus's own scenario codes. `allocate` — a query, not a verdict: the next scenario code
|
|
11
11
|
* for a feature part, which keeps no run and so takes no host modifier. The
|
|
12
12
|
* `analyse` / `migrate` capabilities are a separate, closed offering built on the same core.
|
|
13
13
|
*
|
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Commands: `balance` — the deterministic reconciliation of scenarios against
|
|
9
9
|
* observed evidence, standalone on the public core + app layer (no engine). It also polices the
|
|
10
|
-
* corpus's own scenario codes
|
|
10
|
+
* corpus's own scenario codes. `allocate` — a query, not a verdict: the next scenario code
|
|
11
11
|
* for a feature part, which keeps no run and so takes no host modifier. The
|
|
12
12
|
* `analyse` / `migrate` capabilities are a separate, closed offering built on the same core.
|
|
13
13
|
*
|
|
@@ -26,15 +26,15 @@ import { resolveSourceSha, resolveToolIdentity } from "./run-management/resolveR
|
|
|
26
26
|
import { executeKeptRun, resolveRunId, } from "./run-management/keptRun.js";
|
|
27
27
|
import { parseHostInvocation, wrapCommandArgv, peekFlag, answerUnknownCommand, modifiersNotTakenRefusal, } from "./host.js";
|
|
28
28
|
import { cliRegistry, renderTopLevelHelp } from "./cli-registry.js";
|
|
29
|
-
|
|
29
|
+
import { dispatchesUnstored, storedReRenderRefusal } from "./storedRun.js";
|
|
30
|
+
/** Dispatch a command to its handler with the given (clean or store-wrapped) argv; true when it wrote its report. */
|
|
30
31
|
function runCommand(command, argv) {
|
|
31
32
|
switch (command) {
|
|
32
33
|
case "balance":
|
|
33
|
-
runBalance(argv);
|
|
34
|
-
return;
|
|
34
|
+
return runBalance(argv);
|
|
35
35
|
case "allocate":
|
|
36
36
|
runAllocate(argv);
|
|
37
|
-
return;
|
|
37
|
+
return false;
|
|
38
38
|
default: {
|
|
39
39
|
const answer = answerUnknownCommand(command, renderTopLevelHelp(cliRegistry));
|
|
40
40
|
process.stderr.write(answer.stderr);
|
|
@@ -44,11 +44,11 @@ function runCommand(command, argv) {
|
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
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
|
|
48
|
-
* that would keep a run given to a command that keeps none.
|
|
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.
|
|
49
49
|
*/
|
|
50
50
|
function refuseLeadingFaults(inv) {
|
|
51
|
-
const refusal = inv.refusal ?? modifiersNotTakenRefusal(inv);
|
|
51
|
+
const refusal = inv.refusal ?? modifiersNotTakenRefusal(inv) ?? storedReRenderRefusal(inv);
|
|
52
52
|
if (refusal === undefined)
|
|
53
53
|
return;
|
|
54
54
|
process.stderr.write(refusal + "\n");
|
|
@@ -62,8 +62,8 @@ function main(hostArgv) {
|
|
|
62
62
|
process.stdout.write(renderTopLevelHelp(cliRegistry) + "\n");
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
// No store directive → dispatch the command directly; its output is unchanged.
|
|
66
|
-
if (inv.store === undefined) {
|
|
65
|
+
// No store directive, or a request for help → dispatch the command directly; its output is unchanged.
|
|
66
|
+
if (dispatchesUnstored(inv) || inv.store === undefined) {
|
|
67
67
|
runCommand(command, inv.commandArgs);
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
@@ -83,7 +83,7 @@ function main(hostArgv) {
|
|
|
83
83
|
const spec = { storeRoot: inv.store, target, runId };
|
|
84
84
|
// `mode` is the command's run kind; only `balance` ships today (analyse/migrate are the
|
|
85
85
|
// private engine's, added when it lands).
|
|
86
|
-
// The TOOL's own identity
|
|
86
|
+
// The TOOL's own identity — which spec-controller produced this run, read
|
|
87
87
|
// from the tool's OWN dir (never cwd, which is the target). "unknown" for a null SHA,
|
|
88
88
|
// matching sourceSha's own fallback so run.yaml is internally consistent.
|
|
89
89
|
const toolIdentity = resolveToolIdentity();
|
|
@@ -95,8 +95,9 @@ function main(hostArgv) {
|
|
|
95
95
|
date: new Date().toISOString(),
|
|
96
96
|
};
|
|
97
97
|
const plan = executeKeptRun(spec, meta, (formatSpecs) => runCommand(command, wrapCommandArgv(inv.commandArgs, [...formatSpecs])));
|
|
98
|
-
// The command's
|
|
99
|
-
|
|
98
|
+
// The command's report was routed into the run dir, so tell the operator where it landed.
|
|
99
|
+
if (plan !== undefined)
|
|
100
|
+
process.stdout.write(plan.runDir + "\n");
|
|
100
101
|
}
|
|
101
102
|
main(process.argv.slice(2));
|
|
102
103
|
//# 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;;;;;;;;;;;;;;;;;;;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;
|
|
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,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AM,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,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,8 +9,6 @@
|
|
|
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
|
*/
|
|
15
13
|
import { type CommandSpec, type FlagSpec } from "./cli-registry.js";
|
|
16
14
|
/** A parsed host invocation: leading global options, then the command and its clean args. */
|
|
@@ -25,7 +23,7 @@ export interface HostInvocation {
|
|
|
25
23
|
commandArgs: string[];
|
|
26
24
|
/**
|
|
27
25
|
* 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
|
|
26
|
+
* any command or stored run starts.
|
|
29
27
|
*/
|
|
30
28
|
refusal?: string;
|
|
31
29
|
}
|
|
@@ -37,7 +35,8 @@ export interface HostInvocation {
|
|
|
37
35
|
* --features f` yields the store + `balance` + `[--features, f]`, while `balance --store
|
|
38
36
|
* /s` leaves `--store` in the command's args (a `--store` AFTER the command is the
|
|
39
37
|
* command's own arg, never a host store directive) — the "global before command" contract.
|
|
40
|
-
* A modifier with nothing after it is refused
|
|
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.
|
|
41
40
|
*/
|
|
42
41
|
export declare function parseHostInvocation(argv: readonly string[], globalFlags?: readonly FlagSpec[], commands?: readonly string[]): HostInvocation;
|
|
43
42
|
/**
|
|
@@ -64,9 +63,7 @@ export interface UnknownCommandAnswer {
|
|
|
64
63
|
* help, never the command's args, so no flag after the command can change the answer.
|
|
65
64
|
*
|
|
66
65
|
* 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
|
|
68
|
-
*
|
|
69
|
-
* @SCN-CLI-056 @SCN-CLI-057 — features/cli-balance.feature.
|
|
66
|
+
* (packages/spec-controller/README.md), which `--exit-zero` never masks.
|
|
70
67
|
*/
|
|
71
68
|
export declare function answerUnknownCommand(command: string, help: string): UnknownCommandAnswer;
|
|
72
69
|
/** The refusal for host modifiers given before a command that takes none, else undefined. */
|
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;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;;;;;;;;;;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,6FAA6F;AAC7F,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,cAAc,EACnB,QAAQ,GAAE,SAAS,WAAW,EAAyB,GACtD,MAAM,GAAG,SAAS,CAUpB"}
|
package/dist/host.js
CHANGED
|
@@ -9,8 +9,6 @@
|
|
|
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
|
*/
|
|
15
13
|
import { equalsFormRefusal, givenTwiceRefusal, isEqualsForm, isMissingValue, missingValueRefusal, valueFlagsOf, } from "./cli-args.js";
|
|
16
14
|
import { cliRegistry } from "./cli-registry.js";
|
|
@@ -22,11 +20,27 @@ import { cliRegistry } from "./cli-registry.js";
|
|
|
22
20
|
* --features f` yields the store + `balance` + `[--features, f]`, while `balance --store
|
|
23
21
|
* /s` leaves `--store` in the command's args (a `--store` AFTER the command is the
|
|
24
22
|
* command's own arg, never a host store directive) — the "global before command" contract.
|
|
25
|
-
* A modifier with nothing after it is refused
|
|
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.
|
|
26
25
|
*/
|
|
27
26
|
export function parseHostInvocation(argv, globalFlags = cliRegistry.global, commands = cliRegistry.commands.map((command) => command.name)) {
|
|
28
|
-
|
|
29
|
-
|
|
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.
|
|
34
|
+
*/
|
|
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.
|
|
30
44
|
const modifiers = valueFlagsOf(globalFlags);
|
|
31
45
|
const values = new Map();
|
|
32
46
|
let i = 0;
|
|
@@ -57,10 +71,10 @@ export function parseHostInvocation(argv, globalFlags = cliRegistry.global, comm
|
|
|
57
71
|
}
|
|
58
72
|
/**
|
|
59
73
|
* The refusal a modifier earns where it stands, else undefined; `ahead` is its value and the token
|
|
60
|
-
* after it. Given twice, it is never read as its last value
|
|
61
|
-
* to store under B without a word. Given no value, it is never handed the next 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:
|
|
62
76
|
* `--store --run-id r1` used to store under a directory called `--run-id`. Given the command as its
|
|
63
|
-
* value with no command after it, it has eaten the command
|
|
77
|
+
* value with no command after it, it has eaten the command: `--store balance
|
|
64
78
|
* --features f` used to blame `--features`, and `--store balance` alone answered help at exit 0. A
|
|
65
79
|
* command name followed by the command is still a value: `--store balance balance …` is read.
|
|
66
80
|
*/
|
|
@@ -76,8 +90,8 @@ function modifierRefusal(token, modifier, [value, after], read) {
|
|
|
76
90
|
}
|
|
77
91
|
/**
|
|
78
92
|
* The refusal for host modifiers with nothing after them: every modifier given, in one line, and the
|
|
79
|
-
* fix
|
|
80
|
-
* run nothing, a false green for a CI step that lost its command word
|
|
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
|
|
81
95
|
* modifier is a command here, and a bare `spec-controller` never reaches this.
|
|
82
96
|
*/
|
|
83
97
|
function noCommandRefusal(given) {
|
|
@@ -93,8 +107,8 @@ function commandAsValueRefusal(token, modifier, command) {
|
|
|
93
107
|
}
|
|
94
108
|
/**
|
|
95
109
|
* The refusal a leading token that is no modifier earns, else undefined (it is the command). A
|
|
96
|
-
* modifier written `--store=<root>` is a form that is not read
|
|
97
|
-
* place; any other flag here is out of place, never a command
|
|
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`
|
|
98
112
|
* used to answer `unknown command "--exit-zero"`. The top-level help stays where it was.
|
|
99
113
|
*/
|
|
100
114
|
function leadingFlagRefusal(token, modifiers, globalFlags) {
|
|
@@ -148,9 +162,7 @@ export function peekFlag(argv, name) {
|
|
|
148
162
|
* help, never the command's args, so no flag after the command can change the answer.
|
|
149
163
|
*
|
|
150
164
|
* An unknown command is a usage fault, so it exits 2, the published usage code
|
|
151
|
-
* (packages/spec-controller/README.md), which `--exit-zero` never masks
|
|
152
|
-
*
|
|
153
|
-
* @SCN-CLI-056 @SCN-CLI-057 — features/cli-balance.feature.
|
|
165
|
+
* (packages/spec-controller/README.md), which `--exit-zero` never masks.
|
|
154
166
|
*/
|
|
155
167
|
export function answerUnknownCommand(command, help) {
|
|
156
168
|
return {
|
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,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,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M,UAAU,oBAAoB,CAAC,OAAe,EAAE,IAAY;IAChE,OAAO;QACL,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,qCAAqC,OAAO,SAAS,IAAI,IAAI;KACtE,CAAC;AACJ,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,wBAAwB,CACtC,GAAmB,EACnB,WAAmC,WAAW,CAAC,QAAQ;IAEvD,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC;IACvE,IAAI,KAAK,EAAE,oBAAoB,KAAK,KAAK;QAAE,OAAO,SAAS,CAAC;IAC5D,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"}
|
|
@@ -94,12 +94,16 @@ export interface KeptRunPlan {
|
|
|
94
94
|
readonly reconciliationJsonPath: string;
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
|
-
* Invokes the reconciliation tool with the given `--format <fmt>:<path>` specs
|
|
98
|
-
*
|
|
99
|
-
* `@integration` arm) and holds no opinion on
|
|
100
|
-
* land (the two file-dest paths the runner hands it).
|
|
97
|
+
* Invokes the reconciliation tool with the given `--format <fmt>:<path>` specs, and answers
|
|
98
|
+
* whether it wrote the report those specs name. INJECTED so the scaffold stays the tool's
|
|
99
|
+
* black-box caller (the real CLI subprocess in the `@integration` arm) and holds no opinion on
|
|
100
|
+
* HOW the tool is run — only WHERE its outputs land (the two file-dest paths the runner hands it).
|
|
101
|
+
*
|
|
102
|
+
* The answer is the command's own, and positive: only the command knows it wrote its report. The
|
|
103
|
+
* files' existence afterwards cannot say so, because an earlier run under the same run-id may
|
|
104
|
+
* have left them there.
|
|
101
105
|
*/
|
|
102
|
-
export type RouteOutputs = (formatSpecs: readonly string[]) =>
|
|
106
|
+
export type RouteOutputs = (formatSpecs: readonly string[]) => boolean;
|
|
103
107
|
/**
|
|
104
108
|
* PURE planner: yield the run dir `<storeRoot>/<target>/<runId>/` and the two file-dest
|
|
105
109
|
* paths (`<dir>/spec-reconciliation.md`, `<dir>/spec-reconciliation.json`) from the spec. No
|
|
@@ -143,9 +147,12 @@ export declare function serialiseRunManifest(manifest: RunManifest): string;
|
|
|
143
147
|
/**
|
|
144
148
|
* IMPURE runner: `mkdir -p` the run dir, route the tool's `--format` outputs into the two files
|
|
145
149
|
* via the injected `route` — the document as `md:<documentPath>`, the reconciliation JSON as
|
|
146
|
-
* `json:<reconciliationJsonPath>` — and
|
|
147
|
-
*
|
|
148
|
-
*
|
|
150
|
+
* `json:<reconciliationJsonPath>` — and, only when the route answers that it wrote them, stamp
|
|
151
|
+
* `run.yaml` from the spec + `meta` and return the plan it realised. A route that wrote nothing
|
|
152
|
+
* gets no manifest and no plan back, so nothing names a run that did not happen, and an earlier
|
|
153
|
+
* run's manifest under the same run-id is left as it was. The `mkdir` is load-bearing: the tool's
|
|
154
|
+
* writer creates no directories, so the scaffold creates the one the location-agnostic tool
|
|
155
|
+
* writes into.
|
|
149
156
|
*/
|
|
150
|
-
export declare function executeKeptRun(spec: KeptRunSpec, meta: RunManifestMeta, route: RouteOutputs): KeptRunPlan;
|
|
157
|
+
export declare function executeKeptRun(spec: KeptRunSpec, meta: RunManifestMeta, route: RouteOutputs): KeptRunPlan | undefined;
|
|
151
158
|
//# sourceMappingURL=keptRun.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keptRun.d.ts","sourceRoot":"","sources":["../../src/run-management/keptRun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAE9D,8DAA8D;AAC9D,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,8CAA8C;AAC9C,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,6FAA6F;AAC7F,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,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AQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;CACzC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC;AAEvE;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAO1D;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,mGAAmG;IACnG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAOjE;AAYD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CAmBpE;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAElE;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,YAAY,GAClB,WAAW,GAAG,SAAS,CAYzB"}
|
|
@@ -112,14 +112,18 @@ export function serialiseRunManifest(manifest) {
|
|
|
112
112
|
/**
|
|
113
113
|
* IMPURE runner: `mkdir -p` the run dir, route the tool's `--format` outputs into the two files
|
|
114
114
|
* via the injected `route` — the document as `md:<documentPath>`, the reconciliation JSON as
|
|
115
|
-
* `json:<reconciliationJsonPath>` — and
|
|
116
|
-
*
|
|
117
|
-
*
|
|
115
|
+
* `json:<reconciliationJsonPath>` — and, only when the route answers that it wrote them, stamp
|
|
116
|
+
* `run.yaml` from the spec + `meta` and return the plan it realised. A route that wrote nothing
|
|
117
|
+
* gets no manifest and no plan back, so nothing names a run that did not happen, and an earlier
|
|
118
|
+
* run's manifest under the same run-id is left as it was. The `mkdir` is load-bearing: the tool's
|
|
119
|
+
* writer creates no directories, so the scaffold creates the one the location-agnostic tool
|
|
120
|
+
* writes into.
|
|
118
121
|
*/
|
|
119
122
|
export function executeKeptRun(spec, meta, route) {
|
|
120
123
|
const plan = planKeptRun(spec);
|
|
121
124
|
writeOrRefuse("The stored run's directory could not be created", plan.runDir, () => mkdirSync(plan.runDir, { recursive: true }));
|
|
122
|
-
route([`md:${plan.documentPath}`, `json:${plan.reconciliationJsonPath}`])
|
|
125
|
+
if (!route([`md:${plan.documentPath}`, `json:${plan.reconciliationJsonPath}`]))
|
|
126
|
+
return undefined;
|
|
123
127
|
const manifest = planRunManifest({ runId: spec.runId, target: spec.target, ...meta });
|
|
124
128
|
const manifestPath = join(plan.runDir, RUN_MANIFEST);
|
|
125
129
|
writeOrRefuse("The stored run's run.yaml could not be written", manifestPath, () => writeFileSync(manifestPath, serialiseRunManifest(manifest)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keptRun.js","sourceRoot":"","sources":["../../src/run-management/keptRun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAChE;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAE9D,8DAA8D;AAC9D,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2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;IACjG,MAAM,QAAQ,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACtF,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACrD,aAAa,CAAC,gDAAgD,EAAE,YAAY,EAAE,GAAG,EAAE,CACjF,aAAa,CAAC,YAAY,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAC5D,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the host does with a command before a stored run starts: dispatch it unwrapped, or wrap it
|
|
3
|
+
* in the kept-run scaffold. Pure, so `cli.ts`'s dispatcher reads its answer rather than deciding.
|
|
4
|
+
*/
|
|
5
|
+
import type { HostInvocation } from "./host.js";
|
|
6
|
+
/**
|
|
7
|
+
* True when the host dispatches the command itself, never inside a stored run: no store was asked
|
|
8
|
+
* for, or the command's help was, which is answered before the store is touched.
|
|
9
|
+
*/
|
|
10
|
+
export declare function dispatchesUnstored(inv: HostInvocation): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The refusal for a re-render given a store, else undefined: a re-render writes only to stdout and
|
|
13
|
+
* keeps no run. It is the host's to refuse, not `balance`'s, because a stored run hands `balance` a
|
|
14
|
+
* `--format` for each report file, and `balance` cannot tell that one from a `--format` the operator
|
|
15
|
+
* typed; only the host knows which host modifiers were given.
|
|
16
|
+
*/
|
|
17
|
+
export declare function storedReRenderRefusal(inv: HostInvocation): string | undefined;
|
|
18
|
+
//# sourceMappingURL=storedRun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storedRun.d.ts","sourceRoot":"","sources":["../src/storedRun.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAS7E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the host does with a command before a stored run starts: dispatch it unwrapped, or wrap it
|
|
3
|
+
* in the kept-run scaffold. Pure, so `cli.ts`'s dispatcher reads its answer rather than deciding.
|
|
4
|
+
*/
|
|
5
|
+
import { asksForHelp } from "./cli-args.js";
|
|
6
|
+
/**
|
|
7
|
+
* True when the host dispatches the command itself, never inside a stored run: no store was asked
|
|
8
|
+
* for, or the command's help was, which is answered before the store is touched.
|
|
9
|
+
*/
|
|
10
|
+
export function dispatchesUnstored(inv) {
|
|
11
|
+
return inv.store === undefined || asksForHelp(inv.commandArgs);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The refusal for a re-render given a store, else undefined: a re-render writes only to stdout and
|
|
15
|
+
* keeps no run. It is the host's to refuse, not `balance`'s, because a stored run hands `balance` a
|
|
16
|
+
* `--format` for each report file, and `balance` cannot tell that one from a `--format` the operator
|
|
17
|
+
* typed; only the host knows which host modifiers were given.
|
|
18
|
+
*/
|
|
19
|
+
export function storedReRenderRefusal(inv) {
|
|
20
|
+
if (dispatchesUnstored(inv) || inv.command !== "balance")
|
|
21
|
+
return undefined;
|
|
22
|
+
if (!inv.commandArgs.includes("--render-from-json"))
|
|
23
|
+
return undefined;
|
|
24
|
+
const given = inv.runId === undefined ? ["--store"] : ["--store", "--run-id"];
|
|
25
|
+
return (`spec-controller: usage error — 'balance --render-from-json' re-renders a saved report to stdout and keeps no run, ` +
|
|
26
|
+
`and was given ${given.join(", ")}: a re-render is not stored.\n` +
|
|
27
|
+
`Run 'spec-controller balance --render-from-json <path>' without ${given.length === 1 ? "it" : "them"}.`);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=storedRun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storedRun.js","sourceRoot":"","sources":["../src/storedRun.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAmB;IACpD,OAAO,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAmB;IACvD,IAAI,kBAAkB,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3E,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAAE,OAAO,SAAS,CAAC;IACtE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC9E,OAAO,CACL,oHAAoH;QACpH,iBAAiB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gCAAgC;QACjE,mEAAmE,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CACzG,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-controller",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.34",
|
|
4
4
|
"description": "Reconcile the behaviour your scenarios name against the evidence that actually ran — the deterministic `balance` CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reconciliation",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@cucumber/gherkin": "^41.0.0",
|
|
26
26
|
"@cucumber/messages": "^34.0.1",
|
|
27
27
|
"yaml": "^2.9.0",
|
|
28
|
-
"@3f-consulting/spec-controller-core": "0.1.0-alpha.
|
|
28
|
+
"@3f-consulting/spec-controller-core": "0.1.0-alpha.34"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|