spec-controller 0.1.257 → 0.1.259
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -6
- package/dist/cli.js +168 -705
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -87,43 +87,26 @@ var messages_en_default;
|
|
|
87
87
|
var init_messages_en = __esm({
|
|
88
88
|
"src/messages.en.json"() {
|
|
89
89
|
messages_en_default = {
|
|
90
|
-
"
|
|
91
|
-
"stored-run-reads-its-manifest": "A file this stored run reads is its own {manifestPath}: {inputPath} is {inputSubject}. Give the store a root outside the files the run reads.",
|
|
92
|
-
"see-commands-and-modifiers": "Run 'spec-controller --help' to see the commands and host modifiers this version accepts.",
|
|
93
|
-
"see-modifiers": "Run 'spec-controller --help' to see the host modifiers this version accepts.",
|
|
90
|
+
"see-commands": "Run 'spec-controller --help' to see the commands this version accepts.",
|
|
94
91
|
"see-flags": "Run ''{scope} --help' to see the flags this version accepts.",
|
|
95
92
|
"see-flags-and-values": "Run ''{scope} --help' to see the flags this version accepts and the values they take.",
|
|
96
93
|
"see-arguments": "Run ''{scope} --help' to see what this version accepts.",
|
|
97
|
-
"
|
|
98
|
-
"modifier-took-command": "The {modifier} host modifier took ''{command}'', a command, as its value, and left no command to run.",
|
|
99
|
-
"give-modifier-its-own-value": "Give {modifier} its own value, as in 'spec-controller {modifier} {arg} {command} \u2026'.",
|
|
100
|
-
"flag-before-command": "The {flag} flag was given before the command. Before the command, spec-controller takes only its host modifiers ({modifiers}); a command's own flags go after it, as in 'spec-controller <command> {flag}''.",
|
|
94
|
+
"flag-before-command": "The {flag} flag was given before the command. A command's own flags go after it, as in 'spec-controller <command> {flag}''.",
|
|
101
95
|
"unknown-command": 'unknown command "{command}".',
|
|
102
|
-
"modifiers-not-taken": "''{command}'' takes no host modifier, and was given {modifiers}: it answers a query and keeps no run.",
|
|
103
|
-
"run-without-modifiers": "Run 'spec-controller {command} \u2026' without them.",
|
|
104
96
|
"missing-value": "The {flag} flag of ''{scope}'' needs a value \u2014 {flag} {arg} \u2014 and was given none.",
|
|
105
97
|
"given-twice": "The {flag} flag of ''{scope}'' was given more than once, and is read once: give it once.",
|
|
106
98
|
"equals-form": "The {token} form is not read by ''{scope}'': a flag and its value are two arguments, as in ''{spelling}''.",
|
|
107
99
|
"takes-no-value": "The {flag} flag of ''{scope}'' takes no value, and was given one: ''{value}''.",
|
|
108
100
|
"extra-argument": "The argument ''{token}'' is more than ''{scope}'' takes: it takes {takes} once, and its flags.",
|
|
109
101
|
"not-a-flag": "The argument ''{token}'' is not a flag, nor the value of the flag before it: ''{scope}'' takes only flags and their values.",
|
|
110
|
-
"misplaced-modifier": "The {modifier} flag is a host modifier: it goes before the command, as in 'spec-controller {modifier} <value> {command} \u2026', never after it.",
|
|
111
102
|
"unknown-flag": "Unknown flag {flag} for ''{scope}'' \u2014 this is spec-controller {toolVersion}, and that flag is not in its {command} scope.",
|
|
112
103
|
"pin-drifted": "If this version is pinned, the pin and the tree it is reading have drifted apart: bump the pin to a version whose ''{command}'' accepts {flag}.",
|
|
113
104
|
"otherwise-see-flags": "Otherwise run ''{scope} --help' to see the flags this version accepts.",
|
|
114
|
-
"retired-flag": "Retired flag {flag} for ''{scope}'' \u2014 retired in spec-controller {retiredIn}, and no later version accepts it (this is spec-controller {toolVersion}).",
|
|
115
|
-
"do-not-pin-retired": "Do not pin an earlier version to get it back: that restores the route it was retired with.",
|
|
116
|
-
"re-render-not-stored": "'balance --render-from-json' re-renders a saved report to stdout and keeps no run, and was given {modifiers}: a re-render is not stored.",
|
|
117
|
-
"re-render-without": "{count, plural, one {Run 'spec-controller balance --render-from-json <path>' without it.} other {Run 'spec-controller balance --render-from-json <path>' without them.}}",
|
|
118
|
-
"run-id-without-store": "--run-id names a stored run, and was given ''{runId}'' with no --store, so no run is kept under it.",
|
|
119
|
-
"keep-run-under-name": "To keep the run under that name, give --store <root> as well; otherwise run ''{command}'' without --run-id.",
|
|
120
105
|
"legacy-json-removed": "The --json <path> flag has been removed. Use --format json:<path> to write the JSON report to a file (e.g. --format json:spec-reconciliation.json).",
|
|
121
|
-
"re-render-reads-only": "--render-from-json re-renders a saved report and reads only --strict and --exit-zero beside it; {ignored} would be ignored. Remove it, or run balance without --render-from-json.",
|
|
122
106
|
"unknown-format": "Unknown --format {formats}. Supported formats are {supported} (e.g. --format md, --format json:report.json).",
|
|
123
107
|
"more-than-one-to-stdout": "More than one output routes to stdout ({formats}); at most one may. Give one of them a :<path> to write it to a file instead (e.g. --format json:report.json).",
|
|
124
108
|
"outputs-share-file": "Two outputs name the same file: {first} and {second}. Give each output a file of its own.",
|
|
125
109
|
"output-overwrites-input": "An output would overwrite a file this run reads: {output} is {subject}, {path}. Give the report a file of its own.",
|
|
126
|
-
"output-overwrites-stored-run": "A --format output names {path}, a file of the earlier stored run in {runDir}. Give the report a path outside that run's directory.",
|
|
127
110
|
"unknown-part-refused": "unknown part \u2014 no feature file's header carries {part}.\nThe parts this corpus's feature files carry: {parts}.",
|
|
128
111
|
"no-parts-carried": "none",
|
|
129
112
|
"no-feature-part-given": "no feature part was given: 'spec-controller allocate <FFF>' takes one, a feature file's header code.",
|
|
@@ -148,13 +131,10 @@ var init_messages_en = __esm({
|
|
|
148
131
|
"could-not-be-read": "{subject} could not be read: {path} ({reason})",
|
|
149
132
|
"git-exited": "git {command} exited {status}: {said}",
|
|
150
133
|
"feature-corpus-directory-missing": "The feature corpus directory does not exist: {directory}",
|
|
151
|
-
"stored-run-directory-not-created": "The stored run's directory could not be created: {path} ({reason})",
|
|
152
134
|
"input-path-missing": "The {flag} path does not exist: {path}",
|
|
153
|
-
"flagged-file": "The {flag} file",
|
|
154
135
|
"flagged-report": "The {flag} report",
|
|
155
136
|
"flagged-record": "The {flag} record",
|
|
156
137
|
"flagged-manifest": "The {flag} manifest",
|
|
157
|
-
"flagged-saved-report": "The {flag} saved report",
|
|
158
138
|
"flagged-corpus": "The {flag} corpus",
|
|
159
139
|
"flagged-workflows": "The {flag} workflows",
|
|
160
140
|
"default-package-json": "The package.json read by default",
|
|
@@ -173,8 +153,6 @@ var init_messages_en = __esm({
|
|
|
173
153
|
"not-valid-xml": "{subject} is not valid XML, so not in the shape {shape}: {path} ({reason})",
|
|
174
154
|
"xml-fault-at-line": "{fault} at line {line}",
|
|
175
155
|
"not-in-shape": "{subject} is not in the shape {shape}: {path} ({fault})",
|
|
176
|
-
"not-a-saved-reconciliation": "{subject} is not a saved reconciliation: {path} ({fault}). Run balance again to save one.",
|
|
177
|
-
"not-renderable-as-saved": "{subject} could not be rendered as a saved reconciliation: {path} ({reason})",
|
|
178
156
|
"corpus-file-unparseable": "{corpus} contains a feature file that could not be parsed: {file}\n{message}",
|
|
179
157
|
"workflow-not-yaml": "{workflows} contain a workflow that is not valid YAML: {file}\n{message}",
|
|
180
158
|
"report-not-written": "The {format} report could not be written: {path} ({reason})",
|
|
@@ -189,13 +167,10 @@ var init_messages_en = __esm({
|
|
|
189
167
|
"help-title": "spec-controller \u2014 reconcile scenarios against observed evidence",
|
|
190
168
|
"help-usage": "Usage:",
|
|
191
169
|
"help-commands": "Commands:",
|
|
192
|
-
"help-host-modifiers": "Host modifiers (before the command):",
|
|
193
170
|
"help-options": "Options:",
|
|
194
171
|
"help-arguments": "Arguments:",
|
|
195
172
|
"help-pointer": "Full flags, examples, and CI wiring: docs/user-guide.md.",
|
|
196
173
|
"help-flag": "Show this help and exit.",
|
|
197
|
-
"store-modifier": "Store the run: write <root>/<target>/<run-id>/ with the reconciliation outputs + a run.yaml manifest. Required to store; there is no default (a default would write inside the repo).",
|
|
198
|
-
"run-id-modifier": "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.",
|
|
199
174
|
"balance-summary": "Reconcile Gherkin scenarios against test/CI evidence and emit the Evidence Reconciliation (Markdown to stdout by default).",
|
|
200
175
|
"features-flag": "Directory of Gherkin .feature files \u2014 the scenarios, and the `@`-tags naming what each must prove (@unit, @integration, @fitness, \u2026).",
|
|
201
176
|
"vitest-flag": "A Vitest JSON report \u2014 runtime test evidence.",
|
|
@@ -210,14 +185,12 @@ var init_messages_en = __esm({
|
|
|
210
185
|
"target-flag": "A name recorded verbatim in the report's provenance (which project this run reconciled).",
|
|
211
186
|
"source-sha-flag": "Override the git commit SHA recorded in provenance (defaults to the resolved HEAD).",
|
|
212
187
|
"format-flag": "Where to send output (md or json, optionally :<path> to write to a file). Repeatable.",
|
|
213
|
-
"render-from-json-flag": "Re-render Markdown from a previously saved Evidence Reconciliation JSON \u2014 no reconcile, no live inputs.",
|
|
214
188
|
"strict-flag": "Fail the run (exit 3) when it carries Pending Items \u2014 the opt-in that escalates otherwise-run-neutral deferred obligations.",
|
|
215
189
|
"exit-zero-flag": "Print the same report but exit 0 on an out-of-balance or claim-code-error (1) or --strict pending (3) verdict \u2014 the on-ramp before gating. Usage (2), unsound (4) and nothing-to-reconcile (5) still fail.",
|
|
216
190
|
"configuration-heading": "Configuration (in the target repo's package.json):",
|
|
217
191
|
"deferral-tags-key": "specController.deferralTags: string[]",
|
|
218
192
|
"deferral-tags-explanation": "Extra recognised deferral tags. A scenario carrying one defers every obligation it\nnames to a Pending Item, extending (never replacing) the built-in set.",
|
|
219
193
|
"built-in-deferral-tags": "Built-in deferral tags: {tags}",
|
|
220
|
-
"measurements-replacement": "A fitness function's evidence observation is the outcome of its own CI step: put the check's claim code on that step's `id:` and hand balance the run's step record with --ci-steps.",
|
|
221
194
|
"allocate-summary": "Print the next claim code for a feature part: one past the highest the repository has ever carried, the code alone on stdout.",
|
|
222
195
|
"feature-part-argument": "The feature part: a feature file's header code, two to five of A-Z and 0-9.",
|
|
223
196
|
"new-flag": "Start a part no feature file's header carries yet: its first code, or one past any number the repository already carries for it.",
|
|
@@ -229,7 +202,7 @@ var init_messages_en = __esm({
|
|
|
229
202
|
"highest-seen-in-tree": "highest seen: {code}, {path}:{line}",
|
|
230
203
|
"highest-seen-in-commit": "highest seen: {code}, {path}:{line} in {commit}",
|
|
231
204
|
"part-already-headed": "note: a feature file's header already carries {part}, so --new was not needed",
|
|
232
|
-
"help-usage-line": "spec-controller
|
|
205
|
+
"help-usage-line": "spec-controller <command> [command-args]",
|
|
233
206
|
"help-command-title": "spec-controller {command} \u2014 {summary}",
|
|
234
207
|
"help-command-usage-line": "spec-controller {command} {arguments} [options]"
|
|
235
208
|
};
|
|
@@ -383,7 +356,7 @@ function readFaultOf(err, path) {
|
|
|
383
356
|
if (!(err instanceof Error) || typeof errno.code !== "string") return null;
|
|
384
357
|
return { path: errno.path ?? path, reason: err.message };
|
|
385
358
|
}
|
|
386
|
-
function readingOf(path, read,
|
|
359
|
+
function readingOf(path, read, parse4) {
|
|
387
360
|
let sources;
|
|
388
361
|
try {
|
|
389
362
|
sources = read();
|
|
@@ -392,7 +365,7 @@ function readingOf(path, read, parse5) {
|
|
|
392
365
|
if (fault === null) throw err;
|
|
393
366
|
return { kind: "read-fault", fault };
|
|
394
367
|
}
|
|
395
|
-
return
|
|
368
|
+
return parse4(sources);
|
|
396
369
|
}
|
|
397
370
|
function readUtf8(path) {
|
|
398
371
|
return readFileSync(path, "utf8");
|
|
@@ -11678,12 +11651,12 @@ var init_scenarioObligations = __esm({
|
|
|
11678
11651
|
});
|
|
11679
11652
|
|
|
11680
11653
|
// ../core/dist/parse/sourceParse.js
|
|
11681
|
-
function parseSources(sources,
|
|
11654
|
+
function parseSources(sources, parse4, read) {
|
|
11682
11655
|
const documents = [];
|
|
11683
11656
|
const faults = [];
|
|
11684
11657
|
for (const { file, source } of sources) {
|
|
11685
11658
|
try {
|
|
11686
|
-
documents.push({ file, source, document:
|
|
11659
|
+
documents.push({ file, source, document: parse4(source) });
|
|
11687
11660
|
} catch (err) {
|
|
11688
11661
|
faults.push({ file, message: err instanceof Error ? err.message : String(err) });
|
|
11689
11662
|
}
|
|
@@ -11995,10 +11968,10 @@ function reconciliationsByQualityCheckKind(observations, answering) {
|
|
|
11995
11968
|
}
|
|
11996
11969
|
return [...groups].map(([qualityCheckKind, group]) => makeQualityCheckReconciliation({ qualityCheckKind, evidenceObservations: linesFor(group, answering) }));
|
|
11997
11970
|
}
|
|
11998
|
-
function
|
|
11971
|
+
function notAskedForReconciliationsOf(claimCode, postedObservations, evidenceObligationPairs) {
|
|
11999
11972
|
return reconciliationsByQualityCheckKind(postedObservations.filter((o) => !evidenceObligationPairs.has(evidenceObligationPairKey(claimCode, o.qualityCheckKind))), "scenario");
|
|
12000
11973
|
}
|
|
12001
|
-
function
|
|
11974
|
+
function citesUnknownClaimReconciliationsOf(observations) {
|
|
12002
11975
|
return reconciliationsByQualityCheckKind(observations, "phantom-claim");
|
|
12003
11976
|
}
|
|
12004
11977
|
function unnamedClaimReconciliationsOf(observations) {
|
|
@@ -12024,7 +11997,7 @@ function duplicateClaimCodeReconciliationsOf(obligations, scenario) {
|
|
|
12024
11997
|
...naming
|
|
12025
11998
|
}));
|
|
12026
11999
|
}
|
|
12027
|
-
function
|
|
12000
|
+
function noQualityCheckReconciliation() {
|
|
12028
12001
|
return makeQualityCheckReconciliation({ outcome: "no-quality-check" });
|
|
12029
12002
|
}
|
|
12030
12003
|
var OUTCOME_SIDE_PROFILE, OUT_OF_BALANCE_OUTCOMES, OBLIGATION_LINE_OUTCOMES, UNOBLIGED_OUTCOME;
|
|
@@ -12138,9 +12111,9 @@ function stepsAt(row, qualityCheckKind, stepsByQualityCheckKind) {
|
|
|
12138
12111
|
function ciStepsOf(row, stepsByQualityCheckKind) {
|
|
12139
12112
|
return [...new Set(QUALITY_CHECK_KINDS.flatMap((qualityCheckKind) => stepsAt(row, qualityCheckKind, stepsByQualityCheckKind)))];
|
|
12140
12113
|
}
|
|
12141
|
-
function qualityCheckReconciliationsOf(reconciledEvidenceObligations,
|
|
12142
|
-
const rows = [...reconciledEvidenceObligations, ...
|
|
12143
|
-
return rows.length === 0 && pendingItems.length === 0 ? [
|
|
12114
|
+
function qualityCheckReconciliationsOf(reconciledEvidenceObligations, notAskedForItems, pendingItems) {
|
|
12115
|
+
const rows = [...reconciledEvidenceObligations, ...notAskedForItems];
|
|
12116
|
+
return rows.length === 0 && pendingItems.length === 0 ? [noQualityCheckReconciliation()] : rows;
|
|
12144
12117
|
}
|
|
12145
12118
|
var UNNAMED_CLAIM_ID;
|
|
12146
12119
|
var init_claimReconciliation = __esm({
|
|
@@ -12159,13 +12132,13 @@ function isBalanced(ledger) {
|
|
|
12159
12132
|
function hasPendingItems(ledger) {
|
|
12160
12133
|
return ledger.claimReconciliations.some((row) => row.pendingItems.length > 0);
|
|
12161
12134
|
}
|
|
12162
|
-
function
|
|
12163
|
-
return
|
|
12135
|
+
function hasNeverRanEvidence(ledger) {
|
|
12136
|
+
return neverRanItemsOf(ledger).length > 0;
|
|
12164
12137
|
}
|
|
12165
12138
|
function hasNothingToReconcile(ledger) {
|
|
12166
12139
|
return ledger.claimReconciliations.length === 0;
|
|
12167
12140
|
}
|
|
12168
|
-
function
|
|
12141
|
+
function neverRanItemsOf(ledger) {
|
|
12169
12142
|
return ledger.claimReconciliations.flatMap((row) => reconcilingItemsOf(row).filter((item) => item.outcome === "never-ran"));
|
|
12170
12143
|
}
|
|
12171
12144
|
function ledgerTally(ledger) {
|
|
@@ -12375,8 +12348,8 @@ function routeObservations(evidenceObservations, carriedClaimCodes, sharedClaimC
|
|
|
12375
12348
|
function scenarioRow(d, evidenceObservations, citations, evidenceObligationPairs) {
|
|
12376
12349
|
const pendingItems = pendingItemsOf(d);
|
|
12377
12350
|
const reconciledEvidenceObligations = evidenceObligationsOf(d.evidenceObligations).map((obligation) => reconcileEvidenceObligation(d.claimCode, obligation, evidenceObservations));
|
|
12378
|
-
const
|
|
12379
|
-
const qualityCheckReconciliations = qualityCheckReconciliationsOf(reconciledEvidenceObligations,
|
|
12351
|
+
const notAskedForItems = notAskedForReconciliationsOf(d.claimCode, citations.observationsFor(d.claimCode), evidenceObligationPairs);
|
|
12352
|
+
const qualityCheckReconciliations = qualityCheckReconciliationsOf(reconciledEvidenceObligations, notAskedForItems, pendingItems);
|
|
12380
12353
|
return {
|
|
12381
12354
|
claim: d.claimCode,
|
|
12382
12355
|
kind: "scenario",
|
|
@@ -12411,7 +12384,7 @@ function phantomClaimRows(citations) {
|
|
|
12411
12384
|
const rows = [];
|
|
12412
12385
|
for (const claimCode of citations.phantomClaimCodes) {
|
|
12413
12386
|
const observations = citations.observationsFor(claimCode);
|
|
12414
|
-
const items =
|
|
12387
|
+
const items = citesUnknownClaimReconciliationsOf(observations);
|
|
12415
12388
|
rows.push({
|
|
12416
12389
|
claim: claimCode,
|
|
12417
12390
|
kind: "phantom-claim",
|
|
@@ -12805,7 +12778,7 @@ function loadErrorsOf(report, layer, root) {
|
|
|
12805
12778
|
if (count === 0)
|
|
12806
12779
|
return [];
|
|
12807
12780
|
const evidence = evidenceOfRunResult("never-reached-its-assertions");
|
|
12808
|
-
const
|
|
12781
|
+
const neverRan = [];
|
|
12809
12782
|
const unnamed = [];
|
|
12810
12783
|
for (const message2 of report.messages ?? []) {
|
|
12811
12784
|
const file = LOADED_FILE.exec(message2);
|
|
@@ -12813,12 +12786,12 @@ function loadErrorsOf(report, layer, root) {
|
|
|
12813
12786
|
if (path === void 0)
|
|
12814
12787
|
unnamed.push(message2);
|
|
12815
12788
|
else
|
|
12816
|
-
|
|
12789
|
+
neverRan.push({ qualityCheckKind: layer, claimCode: null, status: evidence.status, locator: locatorOf(path, root), neverRan: evidence.neverRan, message: message2 });
|
|
12817
12790
|
}
|
|
12818
|
-
if (count >
|
|
12819
|
-
|
|
12791
|
+
if (count > neverRan.length) {
|
|
12792
|
+
neverRan.push({ qualityCheckKind: layer, claimCode: null, status: evidence.status, neverRan: evidence.neverRan, message: unnamed.length > 0 ? unnamed.join("\n") : void 0 });
|
|
12820
12793
|
}
|
|
12821
|
-
return
|
|
12794
|
+
return neverRan;
|
|
12822
12795
|
}
|
|
12823
12796
|
function locatorOf(filePath, root) {
|
|
12824
12797
|
return relativizeToRoot(filePath.replace(/^\.\//, ""), root);
|
|
@@ -15607,11 +15580,11 @@ var init_lexer = __esm({
|
|
|
15607
15580
|
// followed by ")" also terminates the body, resuming at the ")" — bash treats
|
|
15608
15581
|
// the substitution's closing paren as end-of-file for its heredocs.
|
|
15609
15582
|
// `join` crosses `\`+newline pairs, which an unquoted delimiter may straddle.
|
|
15610
|
-
matchHereDocDelimiter(delimiter, lineStart, end,
|
|
15583
|
+
matchHereDocDelimiter(delimiter, lineStart, end, join10) {
|
|
15611
15584
|
const src = this.src;
|
|
15612
15585
|
let pos = lineStart;
|
|
15613
15586
|
for (let i = 0; i < delimiter.length; ) {
|
|
15614
|
-
if (
|
|
15587
|
+
if (join10 && src.charCodeAt(pos) === CH_BACKSLASH && pos + 1 < end && src.charCodeAt(pos + 1) === CH_NL) {
|
|
15615
15588
|
pos += 2;
|
|
15616
15589
|
continue;
|
|
15617
15590
|
}
|
|
@@ -15623,11 +15596,11 @@ var init_lexer = __esm({
|
|
|
15623
15596
|
return pos;
|
|
15624
15597
|
}
|
|
15625
15598
|
// A `\` consumes the next character, so `\`+newline continues the line and `\\` does not.
|
|
15626
|
-
logicalLineEnd(from, end,
|
|
15599
|
+
logicalLineEnd(from, end, join10) {
|
|
15627
15600
|
const src = this.src;
|
|
15628
15601
|
let lineEnd = src.indexOf("\n", from);
|
|
15629
15602
|
while (lineEnd !== -1 && lineEnd < end) {
|
|
15630
|
-
if (!
|
|
15603
|
+
if (!join10)
|
|
15631
15604
|
return lineEnd;
|
|
15632
15605
|
let backslashes = lineEnd;
|
|
15633
15606
|
while (backslashes > from && src.charCodeAt(backslashes - 1) === CH_BACKSLASH)
|
|
@@ -21697,7 +21670,7 @@ var require_stringify = __commonJS({
|
|
|
21697
21670
|
props.push(doc.directives.tagString(tag));
|
|
21698
21671
|
return props.join(" ");
|
|
21699
21672
|
}
|
|
21700
|
-
function
|
|
21673
|
+
function stringify(item, ctx, onComment, onChompKeep) {
|
|
21701
21674
|
if (identity.isPair(item))
|
|
21702
21675
|
return item.toString(ctx, onComment, onChompKeep);
|
|
21703
21676
|
if (identity.isAlias(item)) {
|
|
@@ -21726,7 +21699,7 @@ var require_stringify = __commonJS({
|
|
|
21726
21699
|
${ctx.indent}${str}`;
|
|
21727
21700
|
}
|
|
21728
21701
|
exports2.createStringifyContext = createStringifyContext;
|
|
21729
|
-
exports2.stringify =
|
|
21702
|
+
exports2.stringify = stringify;
|
|
21730
21703
|
}
|
|
21731
21704
|
});
|
|
21732
21705
|
|
|
@@ -21736,7 +21709,7 @@ var require_stringifyPair = __commonJS({
|
|
|
21736
21709
|
"use strict";
|
|
21737
21710
|
var identity = require_identity();
|
|
21738
21711
|
var Scalar = require_Scalar();
|
|
21739
|
-
var
|
|
21712
|
+
var stringify = require_stringify();
|
|
21740
21713
|
var stringifyComment = require_stringifyComment();
|
|
21741
21714
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
21742
21715
|
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
@@ -21758,7 +21731,7 @@ var require_stringifyPair = __commonJS({
|
|
|
21758
21731
|
});
|
|
21759
21732
|
let keyCommentDone = false;
|
|
21760
21733
|
let chompKeep = false;
|
|
21761
|
-
let str =
|
|
21734
|
+
let str = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
|
21762
21735
|
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
|
|
21763
21736
|
if (simpleKeys)
|
|
21764
21737
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
@@ -21810,7 +21783,7 @@ ${indent}:`;
|
|
|
21810
21783
|
ctx.indent = ctx.indent.substring(2);
|
|
21811
21784
|
}
|
|
21812
21785
|
let valueCommentDone = false;
|
|
21813
|
-
const valueStr =
|
|
21786
|
+
const valueStr = stringify.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
|
|
21814
21787
|
let ws = " ";
|
|
21815
21788
|
if (keyComment || vsb || vcb) {
|
|
21816
21789
|
ws = vsb ? "\n" : "";
|
|
@@ -21951,7 +21924,7 @@ var require_addPairToJSMap = __commonJS({
|
|
|
21951
21924
|
"use strict";
|
|
21952
21925
|
var log = require_log();
|
|
21953
21926
|
var merge = require_merge();
|
|
21954
|
-
var
|
|
21927
|
+
var stringify = require_stringify();
|
|
21955
21928
|
var identity = require_identity();
|
|
21956
21929
|
var toJS = require_toJS();
|
|
21957
21930
|
function addPairToJSMap(ctx, map, { key, value }) {
|
|
@@ -21987,7 +21960,7 @@ var require_addPairToJSMap = __commonJS({
|
|
|
21987
21960
|
if (typeof jsKey !== "object")
|
|
21988
21961
|
return String(jsKey);
|
|
21989
21962
|
if (identity.isNode(key) && ctx?.doc) {
|
|
21990
|
-
const strCtx =
|
|
21963
|
+
const strCtx = stringify.createStringifyContext(ctx.doc, {});
|
|
21991
21964
|
strCtx.anchors = /* @__PURE__ */ new Set();
|
|
21992
21965
|
for (const node of ctx.anchors.keys())
|
|
21993
21966
|
strCtx.anchors.add(node.anchor);
|
|
@@ -22054,12 +22027,12 @@ var require_stringifyCollection = __commonJS({
|
|
|
22054
22027
|
"../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js"(exports2) {
|
|
22055
22028
|
"use strict";
|
|
22056
22029
|
var identity = require_identity();
|
|
22057
|
-
var
|
|
22030
|
+
var stringify = require_stringify();
|
|
22058
22031
|
var stringifyComment = require_stringifyComment();
|
|
22059
22032
|
function stringifyCollection(collection, ctx, options) {
|
|
22060
22033
|
const flow = ctx.inFlow ?? collection.flow;
|
|
22061
|
-
const
|
|
22062
|
-
return
|
|
22034
|
+
const stringify2 = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
22035
|
+
return stringify2(collection, ctx, options);
|
|
22063
22036
|
}
|
|
22064
22037
|
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
22065
22038
|
const { indent, options: { commentString } } = ctx;
|
|
@@ -22084,7 +22057,7 @@ var require_stringifyCollection = __commonJS({
|
|
|
22084
22057
|
}
|
|
22085
22058
|
}
|
|
22086
22059
|
chompKeep = false;
|
|
22087
|
-
let str2 =
|
|
22060
|
+
let str2 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
|
|
22088
22061
|
if (comment2)
|
|
22089
22062
|
str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
|
|
22090
22063
|
if (chompKeep && comment2)
|
|
@@ -22151,7 +22124,7 @@ ${indent}${line}` : "\n";
|
|
|
22151
22124
|
}
|
|
22152
22125
|
if (comment)
|
|
22153
22126
|
reqNewline = true;
|
|
22154
|
-
let str =
|
|
22127
|
+
let str = stringify.stringify(item, itemCtx, () => comment = null);
|
|
22155
22128
|
reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
|
|
22156
22129
|
if (i < items.length - 1) {
|
|
22157
22130
|
str += ",";
|
|
@@ -23512,7 +23485,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
23512
23485
|
"../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js"(exports2) {
|
|
23513
23486
|
"use strict";
|
|
23514
23487
|
var identity = require_identity();
|
|
23515
|
-
var
|
|
23488
|
+
var stringify = require_stringify();
|
|
23516
23489
|
var stringifyComment = require_stringifyComment();
|
|
23517
23490
|
function stringifyDocument(doc, options) {
|
|
23518
23491
|
const lines = [];
|
|
@@ -23527,7 +23500,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
23527
23500
|
}
|
|
23528
23501
|
if (hasDirectives)
|
|
23529
23502
|
lines.push("---");
|
|
23530
|
-
const ctx =
|
|
23503
|
+
const ctx = stringify.createStringifyContext(doc, options);
|
|
23531
23504
|
const { commentString } = ctx.options;
|
|
23532
23505
|
if (doc.commentBefore) {
|
|
23533
23506
|
if (lines.length !== 1)
|
|
@@ -23549,7 +23522,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
23549
23522
|
contentComment = doc.contents.comment;
|
|
23550
23523
|
}
|
|
23551
23524
|
const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
|
|
23552
|
-
let body =
|
|
23525
|
+
let body = stringify.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
|
|
23553
23526
|
if (contentComment)
|
|
23554
23527
|
body += stringifyComment.lineComment(body, "", commentString(contentComment));
|
|
23555
23528
|
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
|
|
@@ -23557,7 +23530,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
23557
23530
|
} else
|
|
23558
23531
|
lines.push(body);
|
|
23559
23532
|
} else {
|
|
23560
|
-
lines.push(
|
|
23533
|
+
lines.push(stringify.stringify(doc.contents, ctx));
|
|
23561
23534
|
}
|
|
23562
23535
|
if (doc.directives?.docEnd) {
|
|
23563
23536
|
if (doc.comment) {
|
|
@@ -25692,7 +25665,7 @@ var require_cst_scalar = __commonJS({
|
|
|
25692
25665
|
var require_cst_stringify = __commonJS({
|
|
25693
25666
|
"../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js"(exports2) {
|
|
25694
25667
|
"use strict";
|
|
25695
|
-
var
|
|
25668
|
+
var stringify = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
|
|
25696
25669
|
function stringifyToken(token) {
|
|
25697
25670
|
switch (token.type) {
|
|
25698
25671
|
case "block-scalar": {
|
|
@@ -25745,7 +25718,7 @@ var require_cst_stringify = __commonJS({
|
|
|
25745
25718
|
res += stringifyToken(value);
|
|
25746
25719
|
return res;
|
|
25747
25720
|
}
|
|
25748
|
-
exports2.stringify =
|
|
25721
|
+
exports2.stringify = stringify;
|
|
25749
25722
|
}
|
|
25750
25723
|
});
|
|
25751
25724
|
|
|
@@ -27456,7 +27429,7 @@ var require_public_api = __commonJS({
|
|
|
27456
27429
|
}
|
|
27457
27430
|
return doc;
|
|
27458
27431
|
}
|
|
27459
|
-
function
|
|
27432
|
+
function parse4(src, reviver, options) {
|
|
27460
27433
|
let _reviver = void 0;
|
|
27461
27434
|
if (typeof reviver === "function") {
|
|
27462
27435
|
_reviver = reviver;
|
|
@@ -27475,7 +27448,7 @@ var require_public_api = __commonJS({
|
|
|
27475
27448
|
}
|
|
27476
27449
|
return doc.toJS(Object.assign({ reviver: _reviver }, options));
|
|
27477
27450
|
}
|
|
27478
|
-
function
|
|
27451
|
+
function stringify(value, replacer, options) {
|
|
27479
27452
|
let _replacer = null;
|
|
27480
27453
|
if (typeof replacer === "function" || Array.isArray(replacer)) {
|
|
27481
27454
|
_replacer = replacer;
|
|
@@ -27497,10 +27470,10 @@ var require_public_api = __commonJS({
|
|
|
27497
27470
|
return value.toString(options);
|
|
27498
27471
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
27499
27472
|
}
|
|
27500
|
-
exports2.parse =
|
|
27473
|
+
exports2.parse = parse4;
|
|
27501
27474
|
exports2.parseAllDocuments = parseAllDocuments;
|
|
27502
27475
|
exports2.parseDocument = parseDocument;
|
|
27503
|
-
exports2.stringify =
|
|
27476
|
+
exports2.stringify = stringify;
|
|
27504
27477
|
}
|
|
27505
27478
|
});
|
|
27506
27479
|
|
|
@@ -27997,7 +27970,7 @@ var init_renderInput = __esm({
|
|
|
27997
27970
|
function runVerdict(run3) {
|
|
27998
27971
|
if (hasNothingToReconcile(run3.ledger))
|
|
27999
27972
|
return "nothing-to-reconcile";
|
|
28000
|
-
if (
|
|
27973
|
+
if (hasNeverRanEvidence(run3.ledger))
|
|
28001
27974
|
return "unsound";
|
|
28002
27975
|
if (hasClaimCodeErrors(run3))
|
|
28003
27976
|
return "claim-code-errors";
|
|
@@ -28373,26 +28346,6 @@ var init_evidenceReconciliationFromSources = __esm({
|
|
|
28373
28346
|
}
|
|
28374
28347
|
});
|
|
28375
28348
|
|
|
28376
|
-
// ../core/dist/assemble/savedReport.js
|
|
28377
|
-
function assembleSavedReport(saved, strictGiven) {
|
|
28378
|
-
const strict = saved.runProvenance.strict === true || strictGiven;
|
|
28379
|
-
return {
|
|
28380
|
-
...saved,
|
|
28381
|
-
runProvenance: { ...saved.runProvenance, strict },
|
|
28382
|
-
summary: concludedSummary(saved.summary, {
|
|
28383
|
-
ledger: { claimReconciliations: saved.claimReconciliations },
|
|
28384
|
-
claimCodeErrors: saved.errorsInTheInputs?.claimCodeErrors,
|
|
28385
|
-
strict
|
|
28386
|
-
})
|
|
28387
|
-
};
|
|
28388
|
-
}
|
|
28389
|
-
var init_savedReport = __esm({
|
|
28390
|
-
"../core/dist/assemble/savedReport.js"() {
|
|
28391
|
-
"use strict";
|
|
28392
|
-
init_renderInput2();
|
|
28393
|
-
}
|
|
28394
|
-
});
|
|
28395
|
-
|
|
28396
28349
|
// ../core/dist/model.js
|
|
28397
28350
|
var init_model = __esm({
|
|
28398
28351
|
"../core/dist/model.js"() {
|
|
@@ -28456,9 +28409,9 @@ var init_messages_en2 = __esm({
|
|
|
28456
28409
|
"provenance-tool-version": "Tool version: {version}",
|
|
28457
28410
|
"run-integrity-heading": "Run integrity: unsound",
|
|
28458
28411
|
"run-unsound": `**This run is unsound.** {proofs} A proof that never ran sits on the row of the claim it names, as every Evidence Observation does. On a scenario's row, an Evidence Obligation of its kind of quality check that no other proof answers reads "Evidence Observation is missing", though its test may already be written. A proof that never ran on the row of a phantom claim or of the unnamed claim may be the proof behind any item of its kind of quality check that reads "Evidence Observation is missing", on any row. Fix what stopped each proof listed below from running, such as its test, the code it loads, its step definitions, its runner or the CI job that runs it. Then run them again and regenerate this report.`,
|
|
28459
|
-
"
|
|
28460
|
-
"
|
|
28461
|
-
"
|
|
28412
|
+
"never-ran-evidence-not-named": "(evidence not named by the runner)",
|
|
28413
|
+
"never-ran-evidence-what-broke": "{locator} \u2014 what broke:",
|
|
28414
|
+
"never-ran-evidence-no-message": "(no message reported by the runner)",
|
|
28462
28415
|
"summary-heading": "Summary",
|
|
28463
28416
|
"run-verdict-heading": "Run verdict",
|
|
28464
28417
|
"verdict-exit": "exit {code}",
|
|
@@ -28540,7 +28493,7 @@ var init_messages_en2 = __esm({
|
|
|
28540
28493
|
"reconciling-items-column": "Reconciling items",
|
|
28541
28494
|
"ci-steps-column": "CI steps",
|
|
28542
28495
|
"evidence-cell-key": "Key: each evidence cell reads *obligation*/*observations*.\n- The letter says the scenario's tags raise an Evidence Obligation of that kind: (F)itness, (U)nit, (I)ntegration, (E)2e, (P)erformance. `-` means they raise none of that kind, as a pending tag raises none unless the scenario shares its claim code with another.\n- The number counts the scenario's Evidence Observations of that kind that ran. `-` means none.\n- For example, `U/2` is a unit obligation answered by two unit tests; `U/-` is a unit obligation that no unit test answered; `-/1` is one unit test citing a scenario that raises no unit obligation, which puts the row out of balance even where its unit evidence is pending.\n- A blank cell means no obligation and no Evidence Observation that ran; `\u2014` marks the row of a phantom claim or of the unnamed claim.\n- A row named `feature file : scenario title` is a scenario that carries no claim code. The run reads none of its tags, so its evidence cells are blank, and its reconciling item says that no Evidence Observation can link to it.\n- In Reconciling items, `\u2014` means the row has no reconciling item, and *untagged* means a scenario that carries a claim code and no tag that raises an Evidence Obligation.\n- On the unnamed claim's row, the counts after an item, such as `1 ran, 1 passed, 0 failed`, are of that item's own tests, and a fitness item counts its CI steps; a never-ran item stands alone, outside those counts.\n- CI steps names the steps the Evidence observations table gives for each kind of quality check other than fitness that the row obligates or observes, whether or not an Evidence Observation of that kind ran for the row, and the step each of the row's fitness Evidence Observations names: `U/-` beside a step names the step that runs unit tests, none of which answered this row. A blank CI steps cell means no such step is known.",
|
|
28543
|
-
"
|
|
28496
|
+
"cannot-fail-item-key": "- Where a row's item says its CI step or its job sets `continue-on-error`, the name in parentheses after it is its fitness function. Remove `continue-on-error` from its CI step and from its job, or set it to false, and the check's red fails the CI run.",
|
|
28544
28497
|
"pending-item": "pending",
|
|
28545
28498
|
"pending-item-for": "pending: {qualityCheckKind}",
|
|
28546
28499
|
"check-step-no-outcome": "{claimCode}: the CI run's record carries no outcome for this check's step \u2014 so the check did not run.",
|
|
@@ -28551,14 +28504,14 @@ var init_messages_en2 = __esm({
|
|
|
28551
28504
|
"outcome-satisfied": "Evidence Observation satisfies its Evidence Obligation",
|
|
28552
28505
|
"outcome-missing": "Evidence Observation is missing",
|
|
28553
28506
|
"outcome-failing": "Evidence Observation is failing",
|
|
28554
|
-
"outcome-
|
|
28507
|
+
"outcome-cannot-fail": "Evidence Observation is passing, but its CI step or its job sets `continue-on-error`, so its red might not fail the build",
|
|
28555
28508
|
"outcome-no-claim-code": "Evidence Obligation has no claim code for an Evidence Observation to link to",
|
|
28556
28509
|
"outcome-duplicate-claim-code": "Evidence Obligation's claim code is carried by another Scenario",
|
|
28557
|
-
"outcome-cites-unknown-
|
|
28558
|
-
"outcome-cites-no-
|
|
28559
|
-
"outcome-
|
|
28560
|
-
"outcome-
|
|
28561
|
-
"outcome-
|
|
28510
|
+
"outcome-cites-unknown-claim": "Evidence Observation cites a claim code no executable claim carries: a phantom claim",
|
|
28511
|
+
"outcome-cites-no-claim": "Evidence Observation cites no single claim",
|
|
28512
|
+
"outcome-not-asked-for": "Evidence Observation is of a kind of quality check its claim did not ask for",
|
|
28513
|
+
"outcome-never-ran": "Evidence Observation never ran: its check never reached its assertions",
|
|
28514
|
+
"outcome-no-quality-check": "Executable claim asks for no quality check: it carries a claim code and no kind-of-check tag, and nothing cites it",
|
|
28562
28515
|
"observation-passed": "passed",
|
|
28563
28516
|
"observation-failed": "failed",
|
|
28564
28517
|
"unnamed-claim-group-counts": "{ran} ran, {passed} passed, {failed} failed",
|
|
@@ -31423,9 +31376,9 @@ var init_messages4 = __esm({
|
|
|
31423
31376
|
CoreMessage2["ProvenanceToolVersion"] = "provenance-tool-version";
|
|
31424
31377
|
CoreMessage2["RunIntegrityHeading"] = "run-integrity-heading";
|
|
31425
31378
|
CoreMessage2["RunUnsound"] = "run-unsound";
|
|
31426
|
-
CoreMessage2["
|
|
31427
|
-
CoreMessage2["
|
|
31428
|
-
CoreMessage2["
|
|
31379
|
+
CoreMessage2["NeverRanEvidenceNotNamed"] = "never-ran-evidence-not-named";
|
|
31380
|
+
CoreMessage2["NeverRanEvidenceWhatBroke"] = "never-ran-evidence-what-broke";
|
|
31381
|
+
CoreMessage2["NeverRanEvidenceNoMessage"] = "never-ran-evidence-no-message";
|
|
31429
31382
|
CoreMessage2["SummaryHeading"] = "summary-heading";
|
|
31430
31383
|
CoreMessage2["RunVerdictHeading"] = "run-verdict-heading";
|
|
31431
31384
|
CoreMessage2["VerdictExit"] = "verdict-exit";
|
|
@@ -31507,7 +31460,7 @@ var init_messages4 = __esm({
|
|
|
31507
31460
|
CoreMessage2["ReconcilingItemsColumn"] = "reconciling-items-column";
|
|
31508
31461
|
CoreMessage2["CiStepsColumn"] = "ci-steps-column";
|
|
31509
31462
|
CoreMessage2["EvidenceCellKey"] = "evidence-cell-key";
|
|
31510
|
-
CoreMessage2["
|
|
31463
|
+
CoreMessage2["CannotFailItemKey"] = "cannot-fail-item-key";
|
|
31511
31464
|
CoreMessage2["PendingItem"] = "pending-item";
|
|
31512
31465
|
CoreMessage2["PendingItemFor"] = "pending-item-for";
|
|
31513
31466
|
CoreMessage2["CheckStepNoOutcome"] = "check-step-no-outcome";
|
|
@@ -31518,14 +31471,14 @@ var init_messages4 = __esm({
|
|
|
31518
31471
|
CoreMessage2["OutcomeSatisfied"] = "outcome-satisfied";
|
|
31519
31472
|
CoreMessage2["OutcomeMissing"] = "outcome-missing";
|
|
31520
31473
|
CoreMessage2["OutcomeFailing"] = "outcome-failing";
|
|
31521
|
-
CoreMessage2["
|
|
31474
|
+
CoreMessage2["OutcomeCannotFail"] = "outcome-cannot-fail";
|
|
31522
31475
|
CoreMessage2["OutcomeNoClaimCode"] = "outcome-no-claim-code";
|
|
31523
31476
|
CoreMessage2["OutcomeDuplicateClaimCode"] = "outcome-duplicate-claim-code";
|
|
31524
|
-
CoreMessage2["
|
|
31525
|
-
CoreMessage2["
|
|
31526
|
-
CoreMessage2["
|
|
31527
|
-
CoreMessage2["
|
|
31528
|
-
CoreMessage2["
|
|
31477
|
+
CoreMessage2["OutcomeCitesUnknownClaim"] = "outcome-cites-unknown-claim";
|
|
31478
|
+
CoreMessage2["OutcomeCitesNoClaim"] = "outcome-cites-no-claim";
|
|
31479
|
+
CoreMessage2["OutcomeNotAskedFor"] = "outcome-not-asked-for";
|
|
31480
|
+
CoreMessage2["OutcomeNeverRan"] = "outcome-never-ran";
|
|
31481
|
+
CoreMessage2["OutcomeNoQualityCheck"] = "outcome-no-quality-check";
|
|
31529
31482
|
CoreMessage2["ObservationPassed"] = "observation-passed";
|
|
31530
31483
|
CoreMessage2["ObservationFailed"] = "observation-failed";
|
|
31531
31484
|
CoreMessage2["UnnamedClaimGroupCounts"] = "unnamed-claim-group-counts";
|
|
@@ -31561,14 +31514,14 @@ var init_outcomeDescription = __esm({
|
|
|
31561
31514
|
satisfied: CoreMessage.OutcomeSatisfied,
|
|
31562
31515
|
missing: CoreMessage.OutcomeMissing,
|
|
31563
31516
|
failing: CoreMessage.OutcomeFailing,
|
|
31564
|
-
"cannot-fail": CoreMessage.
|
|
31517
|
+
"cannot-fail": CoreMessage.OutcomeCannotFail,
|
|
31565
31518
|
"no-claim-code": CoreMessage.OutcomeNoClaimCode,
|
|
31566
31519
|
"duplicate-claim-code": CoreMessage.OutcomeDuplicateClaimCode,
|
|
31567
|
-
"cites-unknown-claim": CoreMessage.
|
|
31568
|
-
"cites-no-claim": CoreMessage.
|
|
31569
|
-
"not-asked-for": CoreMessage.
|
|
31570
|
-
"never-ran": CoreMessage.
|
|
31571
|
-
"no-quality-check": CoreMessage.
|
|
31520
|
+
"cites-unknown-claim": CoreMessage.OutcomeCitesUnknownClaim,
|
|
31521
|
+
"cites-no-claim": CoreMessage.OutcomeCitesNoClaim,
|
|
31522
|
+
"not-asked-for": CoreMessage.OutcomeNotAskedFor,
|
|
31523
|
+
"never-ran": CoreMessage.OutcomeNeverRan,
|
|
31524
|
+
"no-quality-check": CoreMessage.OutcomeNoQualityCheck
|
|
31572
31525
|
};
|
|
31573
31526
|
outcomeDescription = (outcome) => coreMessage(OUTCOME_DESCRIPTION[outcome]);
|
|
31574
31527
|
}
|
|
@@ -32233,7 +32186,7 @@ var init_remarkWords = __esm({
|
|
|
32233
32186
|
});
|
|
32234
32187
|
|
|
32235
32188
|
// ../core/dist/domain/unnamedClaimGroups.js
|
|
32236
|
-
function
|
|
32189
|
+
function citingNoClaim(lines) {
|
|
32237
32190
|
return lines.filter((line) => line.outcome === "cites-no-claim").flatMap((line) => line.evidenceObservation ?? []);
|
|
32238
32191
|
}
|
|
32239
32192
|
function sharedClaimCodeOf(observation) {
|
|
@@ -32271,7 +32224,7 @@ function stepsGroupsOf(observations) {
|
|
|
32271
32224
|
return [...byCode].map(([code, names]) => code === null ? { names } : { names, sharedClaimCode: code });
|
|
32272
32225
|
}
|
|
32273
32226
|
function unnamedClaimGroupsOf(lines) {
|
|
32274
|
-
const observations =
|
|
32227
|
+
const observations = citingNoClaim(lines);
|
|
32275
32228
|
const byFile = /* @__PURE__ */ new Map();
|
|
32276
32229
|
for (const o of observations) {
|
|
32277
32230
|
if (isFitnessObservation(o))
|
|
@@ -32301,7 +32254,7 @@ function renderLine(line) {
|
|
|
32301
32254
|
return head;
|
|
32302
32255
|
if (!isObservationOnly(line.outcome))
|
|
32303
32256
|
return `${head}${namedSuffix(observation)}`;
|
|
32304
|
-
return `${head}${line.outcome === "never-ran" ?
|
|
32257
|
+
return `${head}${line.outcome === "never-ran" ? neverRanSuffix(observation) : observationSuffix(observation)}`;
|
|
32305
32258
|
}
|
|
32306
32259
|
function quotedSuffix(parts) {
|
|
32307
32260
|
const where = parts.flatMap((part) => part?.trim() || []).join(": ");
|
|
@@ -32313,7 +32266,7 @@ function namedSuffix(o) {
|
|
|
32313
32266
|
function scenarioClauseOf({ scenario }) {
|
|
32314
32267
|
return scenario === void 0 ? "" : ` \u2014 ${coreMessage(CoreMessage.SharedClaimCodeScenario, { feature: reportedName(scenario.feature), title: reportedName(scenario.title) })}`;
|
|
32315
32268
|
}
|
|
32316
|
-
function
|
|
32269
|
+
function neverRanSuffix(o) {
|
|
32317
32270
|
return quotedSuffix([reported(o.locator), remarkHeadlineOf(o, reportedName)]);
|
|
32318
32271
|
}
|
|
32319
32272
|
function observationSuffix(o) {
|
|
@@ -32355,8 +32308,8 @@ function renderUnnamedClaimGroup(group) {
|
|
|
32355
32308
|
return `fitness: ${outcomeDescription("cites-no-claim")}${remark} \u2014 ${steps}`;
|
|
32356
32309
|
}
|
|
32357
32310
|
function renderUnnamedClaimItems(lines) {
|
|
32358
|
-
const
|
|
32359
|
-
return [...
|
|
32311
|
+
const neverRan = lines.filter((line) => line.outcome === "never-ran");
|
|
32312
|
+
return [...neverRan.map(renderLine), ...unnamedClaimGroupsOf(lines).map(renderUnnamedClaimGroup)];
|
|
32360
32313
|
}
|
|
32361
32314
|
function renderRowExceptions(s) {
|
|
32362
32315
|
const items = isUnnamedClaim(s) ? renderUnnamedClaimItems(reconcilingItemsOf(s)) : reconcilingItemsOf(s).map(renderLine);
|
|
@@ -32365,11 +32318,11 @@ function renderRowExceptions(s) {
|
|
|
32365
32318
|
const groups = [reconciling, pending].filter((g) => g.length > 0);
|
|
32366
32319
|
return groups.length === 0 ? "\u2014" : groups.join("; ");
|
|
32367
32320
|
}
|
|
32368
|
-
function
|
|
32321
|
+
function neverRanEvidenceNameOf({ locator }) {
|
|
32369
32322
|
return locator?.trim() ? { kind: "named", locator } : { kind: "unnamed" };
|
|
32370
32323
|
}
|
|
32371
|
-
function
|
|
32372
|
-
return name.kind === "named" ? name.locator : coreMessage(CoreMessage.
|
|
32324
|
+
function neverRanEvidenceNameWords(name) {
|
|
32325
|
+
return name.kind === "named" ? name.locator : coreMessage(CoreMessage.NeverRanEvidenceNotNamed);
|
|
32373
32326
|
}
|
|
32374
32327
|
function pendingTally(pending) {
|
|
32375
32328
|
return pending > 0 ? ["", coreMessage(CoreMessage.PendingTally, { pending })] : [];
|
|
@@ -32409,7 +32362,7 @@ function ungroupedTail(ungrouped) {
|
|
|
32409
32362
|
function evidenceKeyLines(columns) {
|
|
32410
32363
|
if (columns.length === 0)
|
|
32411
32364
|
return [];
|
|
32412
|
-
return [...coreMessage(CoreMessage.EvidenceCellKey).split("\n"), coreMessage(CoreMessage.
|
|
32365
|
+
return [...coreMessage(CoreMessage.EvidenceCellKey).split("\n"), coreMessage(CoreMessage.CannotFailItemKey), ""];
|
|
32413
32366
|
}
|
|
32414
32367
|
function ledgerTallyLines(totals) {
|
|
32415
32368
|
const lines = [
|
|
@@ -32485,21 +32438,21 @@ var init_markdown = __esm({
|
|
|
32485
32438
|
};
|
|
32486
32439
|
titleSection = () => [markdownHeading(1, coreMessage(CoreMessage.ReportTitle)), ""];
|
|
32487
32440
|
runIntegritySection = (report) => {
|
|
32488
|
-
if (!
|
|
32441
|
+
if (!hasNeverRanEvidence(report))
|
|
32489
32442
|
return [];
|
|
32490
|
-
const
|
|
32491
|
-
const proofs = coreMessage(CoreMessage.ProofsNeverRan, { count:
|
|
32443
|
+
const neverRanObservations = neverRanItemsOf(report).flatMap((line) => line.evidenceObservation ?? []);
|
|
32444
|
+
const proofs = coreMessage(CoreMessage.ProofsNeverRan, { count: neverRanObservations.length });
|
|
32492
32445
|
const lines = [
|
|
32493
32446
|
markdownHeading(2, coreMessage(CoreMessage.RunIntegrityHeading)),
|
|
32494
32447
|
"",
|
|
32495
32448
|
coreMessage(CoreMessage.RunUnsound, { proofs }),
|
|
32496
32449
|
""
|
|
32497
32450
|
];
|
|
32498
|
-
for (const item of
|
|
32499
|
-
const locator =
|
|
32500
|
-
lines.push(`- ${coreMessage(CoreMessage.
|
|
32451
|
+
for (const item of neverRanObservations) {
|
|
32452
|
+
const locator = neverRanEvidenceNameWords(neverRanEvidenceNameOf(item));
|
|
32453
|
+
lines.push(`- ${coreMessage(CoreMessage.NeverRanEvidenceWhatBroke, { locator: `\`${locator}\`` })}`);
|
|
32501
32454
|
lines.push("");
|
|
32502
|
-
lines.push(...fencedBlockLines("text", remarkWordsOf(item) ?? coreMessage(CoreMessage.
|
|
32455
|
+
lines.push(...fencedBlockLines("text", remarkWordsOf(item) ?? coreMessage(CoreMessage.NeverRanEvidenceNoMessage)));
|
|
32503
32456
|
lines.push("");
|
|
32504
32457
|
}
|
|
32505
32458
|
return lines;
|
|
@@ -32631,7 +32584,6 @@ var init_composers = __esm({
|
|
|
32631
32584
|
"../core/dist/assemble/composers.js"() {
|
|
32632
32585
|
"use strict";
|
|
32633
32586
|
init_renderInput2();
|
|
32634
|
-
init_savedReport();
|
|
32635
32587
|
init_markdown();
|
|
32636
32588
|
init_provenanceFacts();
|
|
32637
32589
|
init_provenance();
|
|
@@ -32659,7 +32611,6 @@ var init_dist3 = __esm({
|
|
|
32659
32611
|
init_renderInput2();
|
|
32660
32612
|
init_evidenceReconciliationFromSources();
|
|
32661
32613
|
init_composers();
|
|
32662
|
-
init_savedReport();
|
|
32663
32614
|
init_markdown();
|
|
32664
32615
|
init_provenance();
|
|
32665
32616
|
init_provenanceFacts();
|
|
@@ -32755,11 +32706,11 @@ function sourcesOf(featuresDir) {
|
|
|
32755
32706
|
}
|
|
32756
32707
|
}
|
|
32757
32708
|
function parsedCorpusOf(featuresDir, files) {
|
|
32758
|
-
const
|
|
32759
|
-
if (
|
|
32709
|
+
const parse4 = parseFeatureCorpus(files.map(({ relativePath, source }) => ({ file: relativePath, source })));
|
|
32710
|
+
if (parse4.kind === "parsed") return { kind: "read", corpus: parse4.parsed };
|
|
32760
32711
|
return {
|
|
32761
32712
|
kind: "unparseable",
|
|
32762
|
-
faults:
|
|
32713
|
+
faults: parse4.faults.map(({ file, message: message2 }) => ({ file: corpusPathOf(featuresDir, file), message: message2 }))
|
|
32763
32714
|
};
|
|
32764
32715
|
}
|
|
32765
32716
|
function readCorpus(featuresDir) {
|
|
@@ -32779,10 +32730,10 @@ function workflowSourcesOf(path, read) {
|
|
|
32779
32730
|
return { paths, sources: paths.map((source) => readWorkflowSource(source, read)) };
|
|
32780
32731
|
}
|
|
32781
32732
|
function parsedWorkflowsOf({ paths, sources }) {
|
|
32782
|
-
const
|
|
32783
|
-
if (
|
|
32733
|
+
const parse4 = parseWorkflows(sources);
|
|
32734
|
+
if (parse4.kind === "parsed") return { kind: "read", workflows: parse4.parsed };
|
|
32784
32735
|
const pathOf3 = new Map(paths.map((read) => [basename(read), read]));
|
|
32785
|
-
return { kind: "unparseable", faults:
|
|
32736
|
+
return { kind: "unparseable", faults: parse4.faults.map(({ file, message: message2 }) => ({ file: pathOf3.get(file) ?? file, message: message2 })) };
|
|
32786
32737
|
}
|
|
32787
32738
|
function readWorkflows(ciPath, read = readUtf8) {
|
|
32788
32739
|
const path = ciPath ?? DEFAULT_CI_PATH;
|
|
@@ -32876,7 +32827,6 @@ function shapeFaultIn(value, shape) {
|
|
|
32876
32827
|
return faultAt(value, shape, TOP);
|
|
32877
32828
|
}
|
|
32878
32829
|
function faultAt(value, shape, where) {
|
|
32879
|
-
if (shape === "anything") return null;
|
|
32880
32830
|
const found = kindOf2(value);
|
|
32881
32831
|
const expected = expectedKindOf(shape);
|
|
32882
32832
|
if (found !== expected)
|
|
@@ -32894,9 +32844,6 @@ function listFault(items, item, where) {
|
|
|
32894
32844
|
return null;
|
|
32895
32845
|
}
|
|
32896
32846
|
function fieldsFault(record, shape, where) {
|
|
32897
|
-
for (const [old, replacement] of Object.entries(shape.retired ?? {}))
|
|
32898
|
-
if (record[old] !== void 0 && record[replacement] === void 0)
|
|
32899
|
-
return message("shape-field-missing" /* ShapeFieldMissing */, { path: fieldOf(where, replacement).path });
|
|
32900
32847
|
for (const [key, field] of Object.entries(shape.fields)) {
|
|
32901
32848
|
const position = fieldOf(where, key);
|
|
32902
32849
|
if (record[key] === void 0) {
|
|
@@ -32916,7 +32863,7 @@ function entriesFault(record, shape, where) {
|
|
|
32916
32863
|
}
|
|
32917
32864
|
return null;
|
|
32918
32865
|
}
|
|
32919
|
-
var VITEST_REPORT, JUNIT_REPORT, RSPEC_REPORT, CUCUMBER_REPORT, CI_STEP_RECORD, PACKAGE_MANIFEST,
|
|
32866
|
+
var VITEST_REPORT, JUNIT_REPORT, RSPEC_REPORT, CUCUMBER_REPORT, CI_STEP_RECORD, PACKAGE_MANIFEST, TOP;
|
|
32920
32867
|
var init_inputShapes = __esm({
|
|
32921
32868
|
"src/ingest/inputShapes.ts"() {
|
|
32922
32869
|
"use strict";
|
|
@@ -32979,60 +32926,6 @@ var init_inputShapes = __esm({
|
|
|
32979
32926
|
keys: (key) => featureCodeOf(key) !== null
|
|
32980
32927
|
};
|
|
32981
32928
|
PACKAGE_MANIFEST = { fields: { scripts: { entries: "string" } } };
|
|
32982
|
-
SCENARIO_NAME = { fields: { title: "string" }, required: ["title"] };
|
|
32983
|
-
SAVED_RECONCILIATION = {
|
|
32984
|
-
fields: {
|
|
32985
|
-
runProvenance: { fields: { corpus: "string" }, required: ["corpus"] },
|
|
32986
|
-
summary: {
|
|
32987
|
-
fields: {
|
|
32988
|
-
reconciliationTotals: {
|
|
32989
|
-
fields: {
|
|
32990
|
-
reconciliationLines: {
|
|
32991
|
-
fields: {
|
|
32992
|
-
missingByQualityCheckKind: { list: { fields: { qualityCheckKind: "string" }, required: ["qualityCheckKind"] } }
|
|
32993
|
-
}
|
|
32994
|
-
}
|
|
32995
|
-
}
|
|
32996
|
-
},
|
|
32997
|
-
evidenceObservations: { fields: {} },
|
|
32998
|
-
claimCodes: {
|
|
32999
|
-
fields: {
|
|
33000
|
-
untaggedScenarios: { list: SCENARIO_NAME },
|
|
33001
|
-
sharedClaimCodes: { list: { fields: { scenarios: { list: SCENARIO_NAME } } } }
|
|
33002
|
-
}
|
|
33003
|
-
}
|
|
33004
|
-
},
|
|
33005
|
-
required: ["reconciliationTotals", "evidenceObservations", "claimCodes"]
|
|
33006
|
-
},
|
|
33007
|
-
claimReconciliations: {
|
|
33008
|
-
list: {
|
|
33009
|
-
fields: {
|
|
33010
|
-
qualityCheckReconciliations: {
|
|
33011
|
-
list: { fields: { evidenceObligation: { fields: { qualityCheckKind: "anything" }, required: ["qualityCheckKind"] } } }
|
|
33012
|
-
},
|
|
33013
|
-
pendingItems: { list: { fields: { qualityCheckKind: "anything" }, required: ["qualityCheckKind"] } }
|
|
33014
|
-
}
|
|
33015
|
-
}
|
|
33016
|
-
},
|
|
33017
|
-
errorsInTheInputs: {
|
|
33018
|
-
fields: {
|
|
33019
|
-
claimCodeErrors: { list: "anything" },
|
|
33020
|
-
configurationNotRead: {
|
|
33021
|
-
fields: {
|
|
33022
|
-
keysNotRead: { list: "anything" },
|
|
33023
|
-
ofWrongKind: { list: "anything" },
|
|
33024
|
-
runnerKeysNotALayer: { list: "anything" },
|
|
33025
|
-
nonChecksMatchingNoStep: { list: "anything" },
|
|
33026
|
-
nonChecksNotAStepName: { list: "anything" }
|
|
33027
|
-
}
|
|
33028
|
-
}
|
|
33029
|
-
},
|
|
33030
|
-
retired: { configuration: "configurationNotRead" }
|
|
33031
|
-
}
|
|
33032
|
-
},
|
|
33033
|
-
required: ["runProvenance", "summary", "claimReconciliations"],
|
|
33034
|
-
retired: { errors: "errorsInTheInputs" }
|
|
33035
|
-
};
|
|
33036
32929
|
TOP = { kind: "top" };
|
|
33037
32930
|
}
|
|
33038
32931
|
});
|
|
@@ -33261,11 +33154,11 @@ var init_format = __esm({
|
|
|
33261
33154
|
});
|
|
33262
33155
|
|
|
33263
33156
|
// src/outputLocation.ts
|
|
33264
|
-
import { closeSync, constants, fstatSync, lstatSync, openSync, readlinkSync, realpathSync, statSync as statSync2
|
|
33157
|
+
import { closeSync, constants, fstatSync, lstatSync, openSync, readlinkSync, realpathSync, statSync as statSync2 } from "node:fs";
|
|
33265
33158
|
import { dirname, resolve, sep } from "node:path";
|
|
33266
33159
|
function unwritableRefusal(what, path, err) {
|
|
33267
33160
|
const reason = err instanceof Error ? err.message : String(err);
|
|
33268
|
-
return
|
|
33161
|
+
return refusal("report-not-written" /* ReportNotWritten */, { format: what.format, path, reason });
|
|
33269
33162
|
}
|
|
33270
33163
|
function writeOrRefuse(what, path, write) {
|
|
33271
33164
|
try {
|
|
@@ -33296,28 +33189,6 @@ function probeDestination(path) {
|
|
|
33296
33189
|
const identity = identityOf2(openSync(path, constants.O_WRONLY | constants.O_CREAT));
|
|
33297
33190
|
return { identity, created: realpathSync(path) };
|
|
33298
33191
|
}
|
|
33299
|
-
function firstSharingFile(file, others) {
|
|
33300
|
-
const created = [];
|
|
33301
|
-
try {
|
|
33302
|
-
const identity = identityOrNone(file, created);
|
|
33303
|
-
if (identity === void 0) return void 0;
|
|
33304
|
-
return others.find((other) => sameIdentity(identityOrNone(other, created), identity));
|
|
33305
|
-
} finally {
|
|
33306
|
-
for (const path of created) unlinkSync(path);
|
|
33307
|
-
}
|
|
33308
|
-
}
|
|
33309
|
-
function identityOrNone(path, created) {
|
|
33310
|
-
try {
|
|
33311
|
-
const probed = probeDestination(path);
|
|
33312
|
-
if (probed.created !== void 0) created.push(probed.created);
|
|
33313
|
-
return probed.identity;
|
|
33314
|
-
} catch {
|
|
33315
|
-
}
|
|
33316
|
-
return void 0;
|
|
33317
|
-
}
|
|
33318
|
-
function sameIdentity(a, b) {
|
|
33319
|
-
return a !== void 0 && a.dev === b.dev && a.ino === b.ino;
|
|
33320
|
-
}
|
|
33321
33192
|
function regularFileIdentity(path) {
|
|
33322
33193
|
try {
|
|
33323
33194
|
return regularIdentity(statSync2(path, { bigint: true }));
|
|
@@ -33325,11 +33196,6 @@ function regularFileIdentity(path) {
|
|
|
33325
33196
|
}
|
|
33326
33197
|
return void 0;
|
|
33327
33198
|
}
|
|
33328
|
-
function inputAt(path, inputs) {
|
|
33329
|
-
const identity = regularFileIdentity(path);
|
|
33330
|
-
if (identity === void 0) return void 0;
|
|
33331
|
-
return inputs.find((input) => sameIdentity(regularFileIdentity(input.path), identity));
|
|
33332
|
-
}
|
|
33333
33199
|
function stdoutIdentity() {
|
|
33334
33200
|
try {
|
|
33335
33201
|
return regularIdentity(fstatSync(1, { bigint: true }));
|
|
@@ -33415,13 +33281,13 @@ var init_exitStatus = __esm({
|
|
|
33415
33281
|
});
|
|
33416
33282
|
|
|
33417
33283
|
// src/cli-balance/emit/writer.ts
|
|
33418
|
-
import { unlinkSync
|
|
33284
|
+
import { unlinkSync, writeFileSync } from "node:fs";
|
|
33419
33285
|
function render(fmt, p) {
|
|
33420
33286
|
return fmt === "json" ? renderJson(p.balance, p.ctx, p.evidenceObligations, p.featureNames) : renderMarkdown(p.balance, p.ctx, reportedExitCodeOf, p.evidenceObligations, p.featureNames);
|
|
33421
33287
|
}
|
|
33422
|
-
function writeOutputs(plan, payloads, stdoutFile, inputs
|
|
33288
|
+
function writeOutputs(plan, payloads, stdoutFile, inputs) {
|
|
33423
33289
|
const emissions = plan.outputs.map((output) => ({ output, text: render(output.fmt, payloads) + "\n" }));
|
|
33424
|
-
const refused = vetDestinations(plan.outputs, stdoutFile, inputs)
|
|
33290
|
+
const refused = vetDestinations(plan.outputs, stdoutFile, inputs);
|
|
33425
33291
|
if (refused !== void 0) refuse(refused);
|
|
33426
33292
|
for (const { output, text } of emissions) emit(output, text);
|
|
33427
33293
|
}
|
|
@@ -33436,16 +33302,8 @@ function vetDestinations(outputs, stdoutFile, inputs) {
|
|
|
33436
33302
|
}
|
|
33437
33303
|
return sharedFileRefusal(identified) ?? inputOverwriteRefusal(identified, inputs);
|
|
33438
33304
|
} finally {
|
|
33439
|
-
for (const path of created)
|
|
33440
|
-
}
|
|
33441
|
-
}
|
|
33442
|
-
function earlierStoredRunRefusal(outputs, earlierStoredRunDirOf2) {
|
|
33443
|
-
for (const { dest } of outputs) {
|
|
33444
|
-
if (dest.kind === "stdout") continue;
|
|
33445
|
-
const runDir = earlierStoredRunDirOf2(dest.path);
|
|
33446
|
-
if (runDir !== void 0) return refusal("output-overwrites-stored-run" /* OutputOverwritesStoredRun */, { path: dest.path, runDir });
|
|
33305
|
+
for (const path of created) unlinkSync(path);
|
|
33447
33306
|
}
|
|
33448
|
-
return void 0;
|
|
33449
33307
|
}
|
|
33450
33308
|
function identify(output, stdoutFile, created) {
|
|
33451
33309
|
const dest = output.dest;
|
|
@@ -33476,8 +33334,6 @@ var init_writer = __esm({
|
|
|
33476
33334
|
init_dist3();
|
|
33477
33335
|
init_format();
|
|
33478
33336
|
init_outputLocation();
|
|
33479
|
-
init_messages();
|
|
33480
|
-
init_refusal();
|
|
33481
33337
|
init_exitStatus();
|
|
33482
33338
|
}
|
|
33483
33339
|
});
|
|
@@ -37861,9 +37717,9 @@ var init_junitXml = __esm({
|
|
|
37861
37717
|
});
|
|
37862
37718
|
|
|
37863
37719
|
// src/ingest/reportReading.ts
|
|
37864
|
-
function documentOf(text,
|
|
37720
|
+
function documentOf(text, parse4) {
|
|
37865
37721
|
try {
|
|
37866
|
-
return { kind: "parsed", document:
|
|
37722
|
+
return { kind: "parsed", document: parse4(text) };
|
|
37867
37723
|
} catch (err) {
|
|
37868
37724
|
return { kind: "unparseable", reason: reasonOf(err) };
|
|
37869
37725
|
}
|
|
@@ -37893,33 +37749,6 @@ var init_reportReading = __esm({
|
|
|
37893
37749
|
}
|
|
37894
37750
|
});
|
|
37895
37751
|
|
|
37896
|
-
// src/cli-balance/reRender.ts
|
|
37897
|
-
function reRender(document, strictGiven) {
|
|
37898
|
-
const report = assembleSavedReport(document, strictGiven);
|
|
37899
|
-
return {
|
|
37900
|
-
markdown: renderReport(report, INPUT_NAMES, reportedExitCodeOf),
|
|
37901
|
-
verdict: report.summary.runVerdict
|
|
37902
|
-
};
|
|
37903
|
-
}
|
|
37904
|
-
function checkReRenderFlags(args) {
|
|
37905
|
-
if (args["render-from-json"] === void 0) return null;
|
|
37906
|
-
const ignored = Object.keys(args).find((key) => !READ_BY_A_RE_RENDER.has(key));
|
|
37907
|
-
if (ignored === void 0) return null;
|
|
37908
|
-
return refusal("re-render-reads-only" /* ReRenderReadsOnly */, { ignored: `--${ignored}` });
|
|
37909
|
-
}
|
|
37910
|
-
var READ_BY_A_RE_RENDER;
|
|
37911
|
-
var init_reRender = __esm({
|
|
37912
|
-
"src/cli-balance/reRender.ts"() {
|
|
37913
|
-
"use strict";
|
|
37914
|
-
init_dist3();
|
|
37915
|
-
init_messages();
|
|
37916
|
-
init_refusal();
|
|
37917
|
-
init_exitStatus();
|
|
37918
|
-
init_evidenceInputs();
|
|
37919
|
-
READ_BY_A_RE_RENDER = /* @__PURE__ */ new Set(["render-from-json", "strict", "exit-zero"]);
|
|
37920
|
-
}
|
|
37921
|
-
});
|
|
37922
|
-
|
|
37923
37752
|
// src/cli-balance/unreadableInputs.ts
|
|
37924
37753
|
import { statSync as statSync3 } from "node:fs";
|
|
37925
37754
|
function jsonInputsOf(args, exists) {
|
|
@@ -37993,33 +37822,6 @@ function checkInputPaths(args, corpusReading, workflowReading) {
|
|
|
37993
37822
|
}
|
|
37994
37823
|
return null;
|
|
37995
37824
|
}
|
|
37996
|
-
function savedReportRefusal(path, reading) {
|
|
37997
|
-
return refusal("could-not-be-read" /* CouldNotBeRead */, {
|
|
37998
|
-
subject: message("flagged-saved-report" /* FlaggedSavedReport */, { flag: "--render-from-json" }),
|
|
37999
|
-
path,
|
|
38000
|
-
reason: reading.kind === "read-fault" ? reading.fault.reason : reading.reason
|
|
38001
|
-
});
|
|
38002
|
-
}
|
|
38003
|
-
function checkSavedReconciliation(path, saved) {
|
|
38004
|
-
const fault = shapeFaultIn(saved, SAVED_RECONCILIATION);
|
|
38005
|
-
if (fault === null) return null;
|
|
38006
|
-
return refusal("not-a-saved-reconciliation" /* NotASavedReconciliation */, {
|
|
38007
|
-
subject: message("flagged-file" /* FlaggedFile */, { flag: "--render-from-json" }),
|
|
38008
|
-
path,
|
|
38009
|
-
fault
|
|
38010
|
-
});
|
|
38011
|
-
}
|
|
38012
|
-
function reRenderOrRefusal(path, saved, strict) {
|
|
38013
|
-
try {
|
|
38014
|
-
return reRender(saved, strict);
|
|
38015
|
-
} catch (err) {
|
|
38016
|
-
return refusal("not-renderable-as-saved" /* NotRenderableAsSaved */, {
|
|
38017
|
-
subject: message("flagged-file" /* FlaggedFile */, { flag: "--render-from-json" }),
|
|
38018
|
-
path,
|
|
38019
|
-
reason: reasonOf(err)
|
|
38020
|
-
});
|
|
38021
|
-
}
|
|
38022
|
-
}
|
|
38023
37825
|
function workflowsSubjectOf(args) {
|
|
38024
37826
|
return args["ci"] === void 0 ? message("default-ci-workflows" /* DefaultCiWorkflows */) : message("flagged-workflows" /* FlaggedWorkflows */, { flag: "--ci" });
|
|
38025
37827
|
}
|
|
@@ -38038,10 +37840,8 @@ var init_unreadableInputs = __esm({
|
|
|
38038
37840
|
"use strict";
|
|
38039
37841
|
init_ingestQualityChecks();
|
|
38040
37842
|
init_inputReading();
|
|
38041
|
-
init_inputShapes();
|
|
38042
37843
|
init_junitReportPaths();
|
|
38043
37844
|
init_reportReading();
|
|
38044
|
-
init_reRender();
|
|
38045
37845
|
init_messages();
|
|
38046
37846
|
init_appText();
|
|
38047
37847
|
init_refusal();
|
|
@@ -38248,103 +38048,6 @@ var init_resolveRunInputs = __esm({
|
|
|
38248
38048
|
}
|
|
38249
38049
|
});
|
|
38250
38050
|
|
|
38251
|
-
// src/run-management/keptRun.ts
|
|
38252
|
-
import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync4, realpathSync as realpathSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
38253
|
-
import { dirname as dirname3, join as join6 } from "node:path";
|
|
38254
|
-
function earlierStoredRunDirOf(path, ownRunDir) {
|
|
38255
|
-
const dir = existsSync3(path) ? dirname3(realpathSync2(path)) : realpathSync2(dirname3(path));
|
|
38256
|
-
if (ownRunDir !== void 0 && dir === realpathSync2(ownRunDir)) return void 0;
|
|
38257
|
-
return holdsRunManifest(dir) ? dir : void 0;
|
|
38258
|
-
}
|
|
38259
|
-
function holdsRunManifest(dir) {
|
|
38260
|
-
return readsAsRunManifest(runManifestDocumentIn(dir));
|
|
38261
|
-
}
|
|
38262
|
-
function runManifestDocumentIn(dir) {
|
|
38263
|
-
try {
|
|
38264
|
-
return (0, import_yaml2.parse)(readFileSync4(join6(dir, RUN_MANIFEST), "utf8"));
|
|
38265
|
-
} catch {
|
|
38266
|
-
}
|
|
38267
|
-
return void 0;
|
|
38268
|
-
}
|
|
38269
|
-
function readsAsRunManifest(document) {
|
|
38270
|
-
if (typeof document !== "object" || document === null) return false;
|
|
38271
|
-
const fields = document;
|
|
38272
|
-
return fields["schema_version"] !== void 0 && fields["run_id"] !== void 0 && typeof fields["artefacts"] === "object" && fields["artefacts"] !== null;
|
|
38273
|
-
}
|
|
38274
|
-
function planKeptRun(spec) {
|
|
38275
|
-
const runDir = join6(spec.storeRoot, spec.target, spec.runId);
|
|
38276
|
-
return {
|
|
38277
|
-
runDir,
|
|
38278
|
-
documentPath: join6(runDir, RECONCILIATION_DOCUMENT),
|
|
38279
|
-
reconciliationJsonPath: join6(runDir, RECONCILIATION_JSON)
|
|
38280
|
-
};
|
|
38281
|
-
}
|
|
38282
|
-
function resolveRunId(options) {
|
|
38283
|
-
if (options.runId !== void 0) {
|
|
38284
|
-
return options.runId;
|
|
38285
|
-
}
|
|
38286
|
-
return formatRunTimestamp(options.now);
|
|
38287
|
-
}
|
|
38288
|
-
function formatRunTimestamp(instant) {
|
|
38289
|
-
return instant.toISOString().replace(/\.\d+Z/, "Z").replace(/:/g, "-");
|
|
38290
|
-
}
|
|
38291
|
-
function planRunManifest(input) {
|
|
38292
|
-
return {
|
|
38293
|
-
schema_version: RUN_MANIFEST_SCHEMA_VERSION,
|
|
38294
|
-
run_id: input.runId,
|
|
38295
|
-
target: input.target,
|
|
38296
|
-
source_sha: input.sourceSha,
|
|
38297
|
-
tool_sha: input.toolSha,
|
|
38298
|
-
tool_version: input.toolVersion,
|
|
38299
|
-
mode: input.mode,
|
|
38300
|
-
date: input.date,
|
|
38301
|
-
purpose: [],
|
|
38302
|
-
links: [],
|
|
38303
|
-
artefacts: {
|
|
38304
|
-
document: RECONCILIATION_DOCUMENT,
|
|
38305
|
-
reconciliation: RECONCILIATION_JSON
|
|
38306
|
-
}
|
|
38307
|
-
};
|
|
38308
|
-
}
|
|
38309
|
-
function serialiseRunManifest(manifest) {
|
|
38310
|
-
return (0, import_yaml2.stringify)(manifest);
|
|
38311
|
-
}
|
|
38312
|
-
function executeKeptRun(spec, meta, route) {
|
|
38313
|
-
const plan = planKeptRun(spec);
|
|
38314
|
-
writeOrRefuse(
|
|
38315
|
-
{ kind: "stored-run-directory" },
|
|
38316
|
-
plan.runDir,
|
|
38317
|
-
() => mkdirSync(plan.runDir, { recursive: true })
|
|
38318
|
-
);
|
|
38319
|
-
const manifestPath = join6(plan.runDir, RUN_MANIFEST);
|
|
38320
|
-
const sharesManifest = firstSharingFile(manifestPath, spec.formatPaths ?? []);
|
|
38321
|
-
if (sharesManifest !== void 0) {
|
|
38322
|
-
refuse(refusal("format-names-stored-run-manifest" /* FormatNamesStoredRunManifest */, { formatPath: sharesManifest, manifestPath, runDir: plan.runDir }));
|
|
38323
|
-
}
|
|
38324
|
-
const readManifest = inputAt(manifestPath, spec.inputs ?? []);
|
|
38325
|
-
if (readManifest !== void 0) {
|
|
38326
|
-
refuse(refusal("stored-run-reads-its-manifest" /* StoredRunReadsItsManifest */, { manifestPath, inputPath: readManifest.path, inputSubject: readManifest.subject }));
|
|
38327
|
-
}
|
|
38328
|
-
if (!route([`md:${plan.documentPath}`, `json:${plan.reconciliationJsonPath}`], plan.runDir)) return void 0;
|
|
38329
|
-
const manifest = planRunManifest({ runId: spec.runId, target: spec.target, ...meta });
|
|
38330
|
-
writeFileSync2(manifestPath, serialiseRunManifest(manifest));
|
|
38331
|
-
return plan;
|
|
38332
|
-
}
|
|
38333
|
-
var import_yaml2, RECONCILIATION_DOCUMENT, RECONCILIATION_JSON, RUN_MANIFEST, RUN_MANIFEST_SCHEMA_VERSION;
|
|
38334
|
-
var init_keptRun = __esm({
|
|
38335
|
-
"src/run-management/keptRun.ts"() {
|
|
38336
|
-
"use strict";
|
|
38337
|
-
import_yaml2 = __toESM(require_dist(), 1);
|
|
38338
|
-
init_messages();
|
|
38339
|
-
init_refusal();
|
|
38340
|
-
init_outputLocation();
|
|
38341
|
-
RECONCILIATION_DOCUMENT = "spec-reconciliation.md";
|
|
38342
|
-
RECONCILIATION_JSON = "spec-reconciliation.json";
|
|
38343
|
-
RUN_MANIFEST = "run.yaml";
|
|
38344
|
-
RUN_MANIFEST_SCHEMA_VERSION = 2;
|
|
38345
|
-
}
|
|
38346
|
-
});
|
|
38347
|
-
|
|
38348
38051
|
// src/cliRegistry.ts
|
|
38349
38052
|
function explainingLines(entry) {
|
|
38350
38053
|
return entry.split("\n").map((line) => ` ${line}`);
|
|
@@ -38387,28 +38090,19 @@ function renderTopLevelHelp(registry) {
|
|
|
38387
38090
|
const commandLines = registry.commands.map(
|
|
38388
38091
|
(command) => ` ${command.name.padEnd(commandWidth + commandGutter)}${command.summary}`
|
|
38389
38092
|
);
|
|
38390
|
-
const modifierGutter = 3;
|
|
38391
|
-
const modifierWidth = Math.max(0, ...registry.global.map((f) => flagLabel(f).length));
|
|
38392
|
-
const modifierLines = registry.global.map(
|
|
38393
|
-
(flag) => ` ${flagLabel(flag).padEnd(modifierWidth + modifierGutter)}${flag.description}`
|
|
38394
|
-
);
|
|
38395
|
-
const modifierUsage = registry.global.map((flag) => `[${flagLabel(flag)}]`).join(" ");
|
|
38396
38093
|
return [
|
|
38397
38094
|
message("help-title" /* HelpTitle */),
|
|
38398
38095
|
"",
|
|
38399
38096
|
message("help-usage" /* HelpUsage */),
|
|
38400
|
-
` ${message("help-usage-line" /* HelpUsageLine
|
|
38097
|
+
` ${message("help-usage-line" /* HelpUsageLine */)}`,
|
|
38401
38098
|
"",
|
|
38402
38099
|
message("help-commands" /* HelpCommands */),
|
|
38403
38100
|
...commandLines,
|
|
38404
38101
|
"",
|
|
38405
|
-
message("help-host-modifiers" /* HelpHostModifiers */),
|
|
38406
|
-
...modifierLines,
|
|
38407
|
-
"",
|
|
38408
38102
|
message("help-pointer" /* HelpPointer */)
|
|
38409
38103
|
].join("\n");
|
|
38410
38104
|
}
|
|
38411
|
-
var balanceFlags, balanceConfigHelp,
|
|
38105
|
+
var balanceFlags, balanceConfigHelp, balanceCommand, allocateCommand, cliRegistry;
|
|
38412
38106
|
var init_cliRegistry = __esm({
|
|
38413
38107
|
"src/cliRegistry.ts"() {
|
|
38414
38108
|
"use strict";
|
|
@@ -38434,11 +38128,6 @@ var init_cliRegistry = __esm({
|
|
|
38434
38128
|
repeatable: true,
|
|
38435
38129
|
description: message("format-flag" /* FormatFlag */)
|
|
38436
38130
|
},
|
|
38437
|
-
{
|
|
38438
|
-
name: "--render-from-json",
|
|
38439
|
-
arg: "<path>",
|
|
38440
|
-
description: message("render-from-json-flag" /* RenderFromJsonFlag */)
|
|
38441
|
-
},
|
|
38442
38131
|
{
|
|
38443
38132
|
name: "--strict",
|
|
38444
38133
|
description: message("strict-flag" /* StrictFlag */)
|
|
@@ -38459,36 +38148,15 @@ var init_cliRegistry = __esm({
|
|
|
38459
38148
|
...explainingLines(message("deferral-tags-explanation" /* DeferralTagsExplanation */)),
|
|
38460
38149
|
...explainingLines(message("built-in-deferral-tags" /* BuiltInDeferralTags */, { tags: BUILT_IN_DEFERRAL_TAGS.map((tag) => `@${tag}`).join(", ") }))
|
|
38461
38150
|
];
|
|
38462
|
-
balanceRetiredFlags = [
|
|
38463
|
-
{
|
|
38464
|
-
name: "--measurements",
|
|
38465
|
-
retiredIn: "0.1.0-alpha.5",
|
|
38466
|
-
replacement: message("measurements-replacement" /* MeasurementsReplacement */)
|
|
38467
|
-
}
|
|
38468
|
-
];
|
|
38469
|
-
globalFlags = [
|
|
38470
|
-
{
|
|
38471
|
-
name: "--store",
|
|
38472
|
-
arg: "<root>",
|
|
38473
|
-
description: message("store-modifier" /* StoreModifier */)
|
|
38474
|
-
},
|
|
38475
|
-
{
|
|
38476
|
-
name: "--run-id",
|
|
38477
|
-
arg: "<id>",
|
|
38478
|
-
description: message("run-id-modifier" /* RunIdModifier */)
|
|
38479
|
-
}
|
|
38480
|
-
];
|
|
38481
38151
|
balanceCommand = {
|
|
38482
38152
|
name: "balance",
|
|
38483
38153
|
summary: message("balance-summary" /* BalanceSummary */),
|
|
38484
38154
|
flags: balanceFlags,
|
|
38485
|
-
configHelp: balanceConfigHelp
|
|
38486
|
-
retiredFlags: balanceRetiredFlags
|
|
38155
|
+
configHelp: balanceConfigHelp
|
|
38487
38156
|
};
|
|
38488
38157
|
allocateCommand = {
|
|
38489
38158
|
name: "allocate",
|
|
38490
38159
|
summary: message("allocate-summary" /* AllocateSummary */),
|
|
38491
|
-
acceptsHostModifiers: false,
|
|
38492
38160
|
positionals: [
|
|
38493
38161
|
{ name: "<FFF>", description: message("feature-part-argument" /* FeaturePartArgument */) }
|
|
38494
38162
|
],
|
|
@@ -38501,7 +38169,6 @@ var init_cliRegistry = __esm({
|
|
|
38501
38169
|
]
|
|
38502
38170
|
};
|
|
38503
38171
|
cliRegistry = {
|
|
38504
|
-
global: globalFlags,
|
|
38505
38172
|
commands: [balanceCommand, allocateCommand]
|
|
38506
38173
|
};
|
|
38507
38174
|
}
|
|
@@ -38659,12 +38326,6 @@ function notAFlagRefusal(token, command) {
|
|
|
38659
38326
|
const scope = `spec-controller ${command}`;
|
|
38660
38327
|
return refusal("not-a-flag" /* NotAFlag */, { token, scope }, [message("see-flags" /* SeeFlags */, { scope })]);
|
|
38661
38328
|
}
|
|
38662
|
-
function checkMisplacedHostModifiers(args, registry, command) {
|
|
38663
|
-
const modifiers = new Set(registry.global.map((flag) => bareName(flag.name)));
|
|
38664
|
-
const key = Object.keys(args).find((k) => modifiers.has(k));
|
|
38665
|
-
if (key === void 0) return null;
|
|
38666
|
-
return refusal("misplaced-modifier" /* MisplacedModifier */, { modifier: `--${key}`, command }, [message("see-modifiers" /* SeeModifiers */)]);
|
|
38667
|
-
}
|
|
38668
38329
|
function checkUnknownFlags(args, registry, command, toolVersion) {
|
|
38669
38330
|
const entry = commandEntry(registry, command);
|
|
38670
38331
|
const accepted = /* @__PURE__ */ new Set();
|
|
@@ -38674,7 +38335,7 @@ function checkUnknownFlags(args, registry, command, toolVersion) {
|
|
|
38674
38335
|
}
|
|
38675
38336
|
for (const key of Object.keys(args)) {
|
|
38676
38337
|
if (!accepted.has(key)) {
|
|
38677
|
-
return
|
|
38338
|
+
return unknownFlagRefusal(`--${key}`, command, toolVersion);
|
|
38678
38339
|
}
|
|
38679
38340
|
}
|
|
38680
38341
|
return null;
|
|
@@ -38686,15 +38347,6 @@ function unknownFlagRefusal(flag, command, toolVersion) {
|
|
|
38686
38347
|
message("otherwise-see-flags" /* OtherwiseSeeFlags */, { scope })
|
|
38687
38348
|
]);
|
|
38688
38349
|
}
|
|
38689
|
-
function retiredFlagRefusal(entry, key, command, toolVersion) {
|
|
38690
|
-
const retired = entry.retiredFlags?.find((flag) => bareName(flag.name) === key);
|
|
38691
|
-
if (retired === void 0) return void 0;
|
|
38692
|
-
const scope = `spec-controller ${command}`;
|
|
38693
|
-
return refusal("retired-flag" /* RetiredFlag */, { flag: retired.name, scope, retiredIn: retired.retiredIn, toolVersion }, [
|
|
38694
|
-
`${message("do-not-pin-retired" /* DoNotPinRetired */)} ${retired.replacement}`,
|
|
38695
|
-
message("see-flags" /* SeeFlags */, { scope })
|
|
38696
|
-
]);
|
|
38697
|
-
}
|
|
38698
38350
|
var argumentsOf;
|
|
38699
38351
|
var init_cliArgs = __esm({
|
|
38700
38352
|
"src/cliArgs.ts"() {
|
|
@@ -38711,8 +38363,8 @@ var init_cliArgs = __esm({
|
|
|
38711
38363
|
});
|
|
38712
38364
|
|
|
38713
38365
|
// src/cli-balance/cli.ts
|
|
38714
|
-
import { existsSync as
|
|
38715
|
-
import { dirname as
|
|
38366
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
38367
|
+
import { dirname as dirname3 } from "node:path";
|
|
38716
38368
|
function collectFormatSpecs(argv) {
|
|
38717
38369
|
return argv.flatMap((token, i) => token === "--format" ? [argv[i + 1]] : []);
|
|
38718
38370
|
}
|
|
@@ -38742,28 +38394,25 @@ function checkInputsParse(reports) {
|
|
|
38742
38394
|
}
|
|
38743
38395
|
return null;
|
|
38744
38396
|
}
|
|
38745
|
-
function runBalance(argv
|
|
38746
|
-
return settlingRefusal(() => balance(argv
|
|
38397
|
+
function runBalance(argv) {
|
|
38398
|
+
return settlingRefusal(() => balance(argv), false);
|
|
38747
38399
|
}
|
|
38748
|
-
function balance(argv
|
|
38400
|
+
function balance(argv) {
|
|
38749
38401
|
const helped = asksForHelp(argv);
|
|
38750
38402
|
if (helped) process.stdout.write(renderCommandHelp(balanceCommand) + "\n");
|
|
38751
|
-
return !helped && reconcile2(argv
|
|
38403
|
+
return !helped && reconcile2(argv);
|
|
38752
38404
|
}
|
|
38753
|
-
function reconcile2(argv
|
|
38405
|
+
function reconcile2(argv) {
|
|
38754
38406
|
const runStart = /* @__PURE__ */ new Date();
|
|
38755
38407
|
const args = parseArgs(argv);
|
|
38756
38408
|
const legacyJsonError = checkLegacyJson(args);
|
|
38757
38409
|
if (legacyJsonError) refuse(legacyJsonError);
|
|
38758
|
-
const misplacedModifierError = checkMisplacedHostModifiers(args, cliRegistry, "balance");
|
|
38759
|
-
if (misplacedModifierError) refuse(misplacedModifierError);
|
|
38760
38410
|
const shapeError = checkArgvShape(argv, cliRegistry, "balance");
|
|
38761
38411
|
if (shapeError) refuse(shapeError);
|
|
38762
38412
|
const unknownFlagError = checkUnknownFlags(args, cliRegistry, "balance", resolveToolIdentity().toolVersion);
|
|
38763
38413
|
if (unknownFlagError) refuse(unknownFlagError);
|
|
38764
38414
|
const missingValueError = checkMissingValues(argv, cliRegistry, "balance");
|
|
38765
38415
|
if (missingValueError) refuse(missingValueError);
|
|
38766
|
-
if (renderSavedReport(args)) return true;
|
|
38767
38416
|
const { corpus, workflows, reports } = refuseUnreadableInputs(args);
|
|
38768
38417
|
const inputs = inputPathsOf(args);
|
|
38769
38418
|
const root = resolveTargetRoot({ features: inputs.features });
|
|
@@ -38776,32 +38425,16 @@ function reconcile2(argv, ownRunDir) {
|
|
|
38776
38425
|
planResult.plan,
|
|
38777
38426
|
payloads,
|
|
38778
38427
|
stdoutIdentity,
|
|
38779
|
-
identifiedInputs(inputsReadBy(args, NODE_INPUT_READER))
|
|
38780
|
-
(path) => earlierStoredRunDirOf(path, ownRunDir)
|
|
38428
|
+
identifiedInputs(inputsReadBy(args, NODE_INPUT_READER))
|
|
38781
38429
|
);
|
|
38782
38430
|
const verdict = assembleRenderInput(balance2, ctx).summary.runVerdict;
|
|
38783
38431
|
endRunOn({ kind: "verdict", code: exitCodeOf(verdict, args["exit-zero"] !== void 0) });
|
|
38784
38432
|
return true;
|
|
38785
38433
|
}
|
|
38786
|
-
function renderSavedReport(args) {
|
|
38787
|
-
const ignoredFlagError = checkReRenderFlags(args);
|
|
38788
|
-
if (ignoredFlagError) refuse(ignoredFlagError);
|
|
38789
|
-
const rehydratePath = args["render-from-json"];
|
|
38790
|
-
if (rehydratePath === void 0) return false;
|
|
38791
|
-
const savedReading = readDocument(rehydratePath, "json");
|
|
38792
|
-
if (savedReading.kind !== "parsed") refuse(savedReportRefusal(rehydratePath, savedReading));
|
|
38793
|
-
const notSavedError = checkSavedReconciliation(rehydratePath, savedReading.document);
|
|
38794
|
-
if (notSavedError) refuse(notSavedError);
|
|
38795
|
-
const saved = reRenderOrRefusal(rehydratePath, savedReading.document, args["strict"] !== void 0);
|
|
38796
|
-
if ("code" in saved) refuse(saved);
|
|
38797
|
-
process.stdout.write(saved.markdown + "\n");
|
|
38798
|
-
endRunOn({ kind: "verdict", code: exitCodeOf(saved.verdict, args["exit-zero"] !== void 0) });
|
|
38799
|
-
return true;
|
|
38800
|
-
}
|
|
38801
38434
|
function refuseUnreadableInputs(args) {
|
|
38802
|
-
const missingInputError = checkInputsExist(args,
|
|
38435
|
+
const missingInputError = checkInputsExist(args, existsSync3);
|
|
38803
38436
|
if (missingInputError) refuse(missingInputError);
|
|
38804
|
-
const reportsReading = readReports(jsonInputsOf(args,
|
|
38437
|
+
const reportsReading = readReports(jsonInputsOf(args, existsSync3));
|
|
38805
38438
|
const unparseableInputError = checkInputsParse(reportsReading);
|
|
38806
38439
|
if (unparseableInputError) refuse(unparseableInputError);
|
|
38807
38440
|
const corpusDir = corpusDirOf(args);
|
|
@@ -38816,7 +38449,7 @@ function refuseUnreadableInputs(args) {
|
|
|
38816
38449
|
return { corpus: corpusReading.corpus, workflows: workflowReading.workflows, reports: reportsReading.reports };
|
|
38817
38450
|
}
|
|
38818
38451
|
function runContextOf(args, inputs, runStart, root) {
|
|
38819
|
-
const targetDir = args["features"] !== void 0 ?
|
|
38452
|
+
const targetDir = args["features"] !== void 0 ? dirname3(args["features"]) : void 0;
|
|
38820
38453
|
const targetOrigin = args["target"] === void 0 ? resolveTargetOrigin(targetDir) : null;
|
|
38821
38454
|
return {
|
|
38822
38455
|
target: sourceTarget(args),
|
|
@@ -38841,14 +38474,11 @@ var init_cli = __esm({
|
|
|
38841
38474
|
init_inputsRead();
|
|
38842
38475
|
init_defaultCorpus();
|
|
38843
38476
|
init_corpusDir();
|
|
38844
|
-
init_reRender();
|
|
38845
38477
|
init_unreadableInputs();
|
|
38846
|
-
init_reportReading();
|
|
38847
38478
|
init_exitStatus();
|
|
38848
38479
|
init_exitCode();
|
|
38849
38480
|
init_dist3();
|
|
38850
38481
|
init_resolveRunInputs();
|
|
38851
|
-
init_keptRun();
|
|
38852
38482
|
init_cliRegistry();
|
|
38853
38483
|
init_cliArgs();
|
|
38854
38484
|
init_messages();
|
|
@@ -38923,15 +38553,15 @@ var init_unreadable = __esm({
|
|
|
38923
38553
|
});
|
|
38924
38554
|
|
|
38925
38555
|
// src/cli-allocate/readParts.ts
|
|
38926
|
-
import { readFileSync as
|
|
38556
|
+
import { readFileSync as readFileSync4 } from "node:fs";
|
|
38927
38557
|
function readHeaderCodes(featuresDir) {
|
|
38928
38558
|
const sources = featureFilesIn(featuresDir).map(({ path }) => ({
|
|
38929
38559
|
file: path,
|
|
38930
|
-
source: readOrRefuse("feature-file" /* FeatureFile */, path, () =>
|
|
38560
|
+
source: readOrRefuse("feature-file" /* FeatureFile */, path, () => readFileSync4(path, "utf8"))
|
|
38931
38561
|
}));
|
|
38932
|
-
const
|
|
38933
|
-
if (
|
|
38934
|
-
return
|
|
38562
|
+
const parse4 = parseFeatureCorpus(sources);
|
|
38563
|
+
if (parse4.kind === "unparseable") throw new UnparseableFeatureFiles(parse4.faults);
|
|
38564
|
+
return parse4.parsed.flatMap(({ featureCode }) => featureCode === null ? [] : [featureCode]);
|
|
38935
38565
|
}
|
|
38936
38566
|
function featureFilesIn(dir) {
|
|
38937
38567
|
try {
|
|
@@ -38959,7 +38589,7 @@ function readRequest(argv, registry, toolVersion) {
|
|
|
38959
38589
|
}
|
|
38960
38590
|
function argvRefusal(argv, registry, toolVersion) {
|
|
38961
38591
|
const args = parseArgs(argv);
|
|
38962
|
-
return
|
|
38592
|
+
return checkArgvShape(argv, registry, "allocate") ?? checkUnknownFlags(args, registry, "allocate", toolVersion);
|
|
38963
38593
|
}
|
|
38964
38594
|
function partRefusal(part) {
|
|
38965
38595
|
if (part === void 0) return refusal("no-feature-part-given" /* NoFeaturePartGiven */, {});
|
|
@@ -38978,11 +38608,11 @@ var init_request = __esm({
|
|
|
38978
38608
|
|
|
38979
38609
|
// src/cli-allocate/refStore.ts
|
|
38980
38610
|
import { spawnSync } from "node:child_process";
|
|
38981
|
-
import { lstatSync as lstatSync2, readdirSync as readdirSync3, readFileSync as
|
|
38982
|
-
import { join as
|
|
38611
|
+
import { lstatSync as lstatSync2, readdirSync as readdirSync3, readFileSync as readFileSync5 } from "node:fs";
|
|
38612
|
+
import { join as join6 } from "node:path";
|
|
38983
38613
|
function proveRefsReadable(cwd) {
|
|
38984
38614
|
for (const gitDir of gitDirsOf(cwd)) {
|
|
38985
|
-
for (const store of REF_STORES) readEveryEntry(
|
|
38615
|
+
for (const store of REF_STORES) readEveryEntry(join6(gitDir, store));
|
|
38986
38616
|
}
|
|
38987
38617
|
}
|
|
38988
38618
|
function gitDirsOf(cwd) {
|
|
@@ -38998,9 +38628,9 @@ function readEveryEntry(path) {
|
|
|
38998
38628
|
if (kind === void 0) return;
|
|
38999
38629
|
if (kind.isDirectory()) {
|
|
39000
38630
|
const names = readOrRefuse("history" /* History */, path, () => readdirSync3(path));
|
|
39001
|
-
for (const name of names) readEveryEntry(
|
|
38631
|
+
for (const name of names) readEveryEntry(join6(path, name));
|
|
39002
38632
|
} else if (kind.isFile()) {
|
|
39003
|
-
readOrRefuse("history" /* History */, path, () =>
|
|
38633
|
+
readOrRefuse("history" /* History */, path, () => readFileSync5(path));
|
|
39004
38634
|
}
|
|
39005
38635
|
}
|
|
39006
38636
|
var REF_STORES;
|
|
@@ -39015,8 +38645,8 @@ var init_refStore = __esm({
|
|
|
39015
38645
|
|
|
39016
38646
|
// src/cli-allocate/readHistory.ts
|
|
39017
38647
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
39018
|
-
import { lstatSync as lstatSync3, readFileSync as
|
|
39019
|
-
import { dirname as
|
|
38648
|
+
import { lstatSync as lstatSync3, readFileSync as readFileSync6 } from "node:fs";
|
|
38649
|
+
import { dirname as dirname4, join as join7 } from "node:path";
|
|
39020
38650
|
function readHistory(cwd, part) {
|
|
39021
38651
|
proveRefsReadable(cwd);
|
|
39022
38652
|
const args = ["log", "--all", "-p", "-U0", "--no-color", "--no-ext-diff", "--format=%x01%h", "-G", `(${ALLOCATION_COUNTED_PREFIXES.join("|")})-${part}-`];
|
|
@@ -39040,10 +38670,10 @@ function repositoryTop(cwd) {
|
|
|
39040
38670
|
throw new UnreadableInput("repository" /* Repository */, gitEntry, gitExited(args, result.status, result.stderr));
|
|
39041
38671
|
}
|
|
39042
38672
|
function gitEntryAtOrAbove(dir) {
|
|
39043
|
-
for (let at2 = dir; ; at2 =
|
|
39044
|
-
const entry =
|
|
38673
|
+
for (let at2 = dir; ; at2 = dirname4(at2)) {
|
|
38674
|
+
const entry = join7(at2, ".git");
|
|
39045
38675
|
if (lstatSync3(entry, { throwIfNoEntry: false }) !== void 0) return entry;
|
|
39046
|
-
if (
|
|
38676
|
+
if (dirname4(at2) === at2) return null;
|
|
39047
38677
|
}
|
|
39048
38678
|
}
|
|
39049
38679
|
function isGitRepository(cwd) {
|
|
@@ -39056,7 +38686,7 @@ function historyBoundaryOf(cwd) {
|
|
|
39056
38686
|
}
|
|
39057
38687
|
function shallowBoundaryOf(cwd) {
|
|
39058
38688
|
const shallowPath = shallowRecordPath(cwd);
|
|
39059
|
-
const record = readOrRefuse("history" /* History */, shallowPath, () =>
|
|
38689
|
+
const record = readOrRefuse("history" /* History */, shallowPath, () => readFileSync6(shallowPath, "utf8"));
|
|
39060
38690
|
const edge = record.split("\n")[0] ?? "";
|
|
39061
38691
|
return { kind: "shallow", before: gitAnswer(cwd, ["rev-parse", "--short", edge]) ?? edge };
|
|
39062
38692
|
}
|
|
@@ -39116,8 +38746,8 @@ var init_readHistory = __esm({
|
|
|
39116
38746
|
|
|
39117
38747
|
// src/cli-allocate/readTree.ts
|
|
39118
38748
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
39119
|
-
import { accessSync, constants as constants2, lstatSync as lstatSync4, readdirSync as readdirSync4, readFileSync as
|
|
39120
|
-
import { join as
|
|
38749
|
+
import { accessSync, constants as constants2, lstatSync as lstatSync4, readdirSync as readdirSync4, readFileSync as readFileSync7 } from "node:fs";
|
|
38750
|
+
import { join as join8, relative as relative2, sep as sep4 } from "node:path";
|
|
39121
38751
|
function readTree(top, part) {
|
|
39122
38752
|
const listed = gitListing(top, ["ls-files", "-z", "--cached", "--others", "--exclude-standard"]);
|
|
39123
38753
|
const ignored = gitListing(top, ["ls-files", "-z", "--others", "--ignored", "--exclude-standard", "--directory"]);
|
|
@@ -39136,7 +38766,7 @@ function isDirectoryEntry(entry) {
|
|
|
39136
38766
|
return entry.endsWith("/");
|
|
39137
38767
|
}
|
|
39138
38768
|
function proveListable(top, dir, ignored) {
|
|
39139
|
-
const path =
|
|
38769
|
+
const path = join8(top, dir);
|
|
39140
38770
|
const entries = readOrRefuse("tree-directory" /* TreeDirectory */, path, () => listedAndEntered(path));
|
|
39141
38771
|
if (dir !== "" && entries.some((entry) => entry.name === ".git")) return;
|
|
39142
38772
|
for (const entry of entries) {
|
|
@@ -39152,10 +38782,10 @@ function needlesFor(part) {
|
|
|
39152
38782
|
return ALLOCATION_COUNTED_PREFIXES.map((prefix) => `${prefix}-${part}-`);
|
|
39153
38783
|
}
|
|
39154
38784
|
function occurrencesInListed(top, path, needles) {
|
|
39155
|
-
const file =
|
|
38785
|
+
const file = join8(top, path);
|
|
39156
38786
|
const kind = readOrRefuse("tree-file" /* TreeFile */, file, () => lstatSync4(file, { throwIfNoEntry: false }));
|
|
39157
38787
|
if (kind === void 0 || !kind.isFile()) return [];
|
|
39158
|
-
return linesCarrying(path, readOrRefuse("tree-file" /* TreeFile */, file, () =>
|
|
38788
|
+
return linesCarrying(path, readOrRefuse("tree-file" /* TreeFile */, file, () => readFileSync7(file)), needles);
|
|
39159
38789
|
}
|
|
39160
38790
|
function linesCarrying(path, content, needles) {
|
|
39161
38791
|
if (content.subarray(0, BINARY_PROBE_BYTES).includes(0)) return [];
|
|
@@ -39166,14 +38796,14 @@ function isWalkedDirectory(name) {
|
|
|
39166
38796
|
}
|
|
39167
38797
|
function walkTree(root, part) {
|
|
39168
38798
|
return filesUnder(root).flatMap((file) => {
|
|
39169
|
-
const content = readOrRefuse("tree-file" /* TreeFile */, file, () =>
|
|
38799
|
+
const content = readOrRefuse("tree-file" /* TreeFile */, file, () => readFileSync7(file));
|
|
39170
38800
|
return linesCarrying(relative2(root, file).split(sep4).join("/"), content, needlesFor(part));
|
|
39171
38801
|
});
|
|
39172
38802
|
}
|
|
39173
38803
|
function filesUnder(dir) {
|
|
39174
38804
|
const entries = readOrRefuse("tree-directory" /* TreeDirectory */, dir, () => readdirSync4(dir, { withFileTypes: true }));
|
|
39175
38805
|
return entries.flatMap((entry) => {
|
|
39176
|
-
const path =
|
|
38806
|
+
const path = join8(dir, entry.name);
|
|
39177
38807
|
if (entry.isDirectory()) return isWalkedDirectory(entry.name) ? filesUnder(path) : [];
|
|
39178
38808
|
return entry.isFile() ? [path] : [];
|
|
39179
38809
|
});
|
|
@@ -39242,7 +38872,7 @@ var init_stderr = __esm({
|
|
|
39242
38872
|
});
|
|
39243
38873
|
|
|
39244
38874
|
// src/cli-allocate/cli.ts
|
|
39245
|
-
import { join as
|
|
38875
|
+
import { join as join9 } from "node:path";
|
|
39246
38876
|
function shown() {
|
|
39247
38877
|
return standardError(process.stderr, "allocate");
|
|
39248
38878
|
}
|
|
@@ -39275,7 +38905,7 @@ function refuseUsage(error) {
|
|
|
39275
38905
|
function answerRequest({ part, isNew }) {
|
|
39276
38906
|
const cwd = readOrRefuse("working-directory" /* WorkingDirectory */, "", () => process.cwd());
|
|
39277
38907
|
const top = repositoryTop(cwd);
|
|
39278
|
-
const headerCodes = readHeaderCodes(
|
|
38908
|
+
const headerCodes = readHeaderCodes(join9(top ?? cwd, DEFAULT_FEATURES_DIR));
|
|
39279
38909
|
const answer = nextClaimCode({ part, headerCodes, isNew }, occurrencesFrom(cwd, part, top));
|
|
39280
38910
|
if (answer.kind === "unknown-part") {
|
|
39281
38911
|
refuseUsage(unknownPartRefusal(answer));
|
|
@@ -39312,81 +38942,24 @@ var init_cli2 = __esm({
|
|
|
39312
38942
|
});
|
|
39313
38943
|
|
|
39314
38944
|
// src/host.ts
|
|
39315
|
-
function parseHostInvocation(argv
|
|
39316
|
-
const
|
|
39317
|
-
|
|
39318
|
-
|
|
39319
|
-
}
|
|
39320
|
-
|
|
39321
|
-
|
|
39322
|
-
|
|
39323
|
-
|
|
39324
|
-
|
|
39325
|
-
|
|
39326
|
-
const values = /* @__PURE__ */ new Map();
|
|
39327
|
-
let i = 0;
|
|
39328
|
-
for (; i < argv.length; i++) {
|
|
39329
|
-
const token = argv[i] ?? "";
|
|
39330
|
-
const modifier = modifiers.get(token);
|
|
39331
|
-
if (modifier === void 0) {
|
|
39332
|
-
const refusal2 = leadingFlagRefusal(token, modifiers, globalFlags2);
|
|
39333
|
-
if (refusal2 !== void 0) return { commandArgs: [], refusal: refusal2 };
|
|
39334
|
-
break;
|
|
39335
|
-
}
|
|
39336
|
-
const read = readModifier(token, modifier, argv.slice(i + 1, i + 3), { values, commands });
|
|
39337
|
-
if ("refusal" in read) return { commandArgs: [], refusal: read.refusal };
|
|
39338
|
-
values.set(modifier.name, read.value);
|
|
39339
|
-
i++;
|
|
39340
|
-
}
|
|
39341
|
-
if (i === argv.length && values.size > 0) return { commandArgs: [], refusal: noCommandRefusal([...values.keys()]) };
|
|
39342
|
-
return {
|
|
39343
|
-
store: values.get("--store"),
|
|
39344
|
-
runId: values.get("--run-id"),
|
|
39345
|
-
command: argv[i],
|
|
39346
|
-
commandArgs: argv.slice(i + 1)
|
|
39347
|
-
};
|
|
39348
|
-
}
|
|
39349
|
-
function readModifier(token, modifier, [next, after], read) {
|
|
39350
|
-
if (read.values.has(modifier.name)) return { refusal: givenTwiceRefusal(token, "spec-controller") };
|
|
39351
|
-
const value = givenValue(next);
|
|
39352
|
-
if (value === void 0) return { refusal: missingValueRefusal(token, modifier, "spec-controller") };
|
|
39353
|
-
if (read.commands.includes(value) && (after === void 0 || after.startsWith("-"))) {
|
|
39354
|
-
return { refusal: commandAsValueRefusal(token, modifier, value) };
|
|
39355
|
-
}
|
|
39356
|
-
return { value };
|
|
39357
|
-
}
|
|
39358
|
-
function noCommandRefusal(given) {
|
|
39359
|
-
return refusal("no-command-after-modifiers" /* NoCommandAfterModifiers */, { modifiers: given.join(", ") }, [message("see-commands-and-modifiers" /* SeeCommandsAndModifiers */)]);
|
|
39360
|
-
}
|
|
39361
|
-
function commandAsValueRefusal(token, modifier, command) {
|
|
39362
|
-
return refusal("modifier-took-command" /* ModifierTookCommand */, { modifier: token, command }, [
|
|
39363
|
-
`${message("give-modifier-its-own-value" /* GiveModifierItsOwnValue */, { modifier: token, arg: modifier.arg, command })} ` + message("see-commands-and-modifiers" /* SeeCommandsAndModifiers */)
|
|
39364
|
-
]);
|
|
39365
|
-
}
|
|
39366
|
-
function leadingFlagRefusal(token, modifiers, globalFlags2) {
|
|
39367
|
-
if (isEqualsForm(token)) return equalsFormRefusal(token, modifiers, "spec-controller");
|
|
39368
|
-
if (isFlagOutOfPlace(token)) return flagBeforeCommandRefusal(token, globalFlags2);
|
|
38945
|
+
function parseHostInvocation(argv) {
|
|
38946
|
+
const [first, ...rest] = argv;
|
|
38947
|
+
if (first === void 0) return { commandArgs: [] };
|
|
38948
|
+
const refusal2 = leadingFlagRefusal(first);
|
|
38949
|
+
if (refusal2 === void 0) return { command: first, commandArgs: rest };
|
|
38950
|
+
const help = argv.find((token) => TOP_LEVEL_HELP.has(token));
|
|
38951
|
+
return help === void 0 ? { commandArgs: [], refusal: refusal2 } : { command: help, commandArgs: [] };
|
|
38952
|
+
}
|
|
38953
|
+
function leadingFlagRefusal(token) {
|
|
38954
|
+
if (isEqualsForm(token)) return equalsFormRefusal(token, /* @__PURE__ */ new Map(), "spec-controller");
|
|
38955
|
+
if (isFlagOutOfPlace(token)) return flagBeforeCommandRefusal(token);
|
|
39369
38956
|
return void 0;
|
|
39370
38957
|
}
|
|
39371
38958
|
function isFlagOutOfPlace(token) {
|
|
39372
38959
|
return token.length > 1 && token.startsWith("-") && !TOP_LEVEL_HELP.has(token);
|
|
39373
38960
|
}
|
|
39374
|
-
function flagBeforeCommandRefusal(flag
|
|
39375
|
-
|
|
39376
|
-
return refusal("flag-before-command" /* FlagBeforeCommand */, { flag, modifiers }, [message("see-commands-and-modifiers" /* SeeCommandsAndModifiers */)]);
|
|
39377
|
-
}
|
|
39378
|
-
function wrapCommandArgv(commandArgs, formatSpecs) {
|
|
39379
|
-
return [...commandArgs, ...formatSpecs.flatMap((spec) => ["--format", spec])];
|
|
39380
|
-
}
|
|
39381
|
-
function peekFlag(argv, name) {
|
|
39382
|
-
const flag = `--${name}`;
|
|
39383
|
-
for (let i = 0; i < argv.length; i++) {
|
|
39384
|
-
if (argv[i] === flag) {
|
|
39385
|
-
const value = argv[i + 1];
|
|
39386
|
-
return value !== void 0 && !value.startsWith("--") ? value : void 0;
|
|
39387
|
-
}
|
|
39388
|
-
}
|
|
39389
|
-
return void 0;
|
|
38961
|
+
function flagBeforeCommandRefusal(flag) {
|
|
38962
|
+
return refusal("flag-before-command" /* FlagBeforeCommand */, { flag }, [message("see-commands" /* SeeCommands */)]);
|
|
39390
38963
|
}
|
|
39391
38964
|
function answerUnknownCommand(command, help) {
|
|
39392
38965
|
return {
|
|
@@ -39394,33 +38967,11 @@ function answerUnknownCommand(command, help) {
|
|
|
39394
38967
|
refusal: refusal("unknown-command" /* UnknownCommand */, { command }, ["", help])
|
|
39395
38968
|
};
|
|
39396
38969
|
}
|
|
39397
|
-
function modifiersNotTakenRefusal(inv, commands = cliRegistry.commands) {
|
|
39398
|
-
const entry = commands.find((command) => command.name === inv.command);
|
|
39399
|
-
if (entry?.acceptsHostModifiers !== false || asksForHelp(inv.commandArgs)) return void 0;
|
|
39400
|
-
const given = [inv.store === void 0 ? [] : ["--store"], inv.runId === void 0 ? [] : ["--run-id"]].flat();
|
|
39401
|
-
if (given.length === 0) return void 0;
|
|
39402
|
-
return refusal(
|
|
39403
|
-
"modifiers-not-taken" /* ModifiersNotTaken */,
|
|
39404
|
-
{ command: entry.name, modifiers: given.join(", ") },
|
|
39405
|
-
[message("run-without-modifiers" /* RunWithoutModifiers */, { command: entry.name })]
|
|
39406
|
-
);
|
|
39407
|
-
}
|
|
39408
|
-
function formatFilePaths(argv) {
|
|
39409
|
-
const paths = [];
|
|
39410
|
-
argv.forEach((token, index) => {
|
|
39411
|
-
const value = argv[index + 1];
|
|
39412
|
-
if (token !== "--format" || value === void 0) return;
|
|
39413
|
-
const colon = value.indexOf(":");
|
|
39414
|
-
if (colon !== -1) paths.push(value.slice(colon + 1));
|
|
39415
|
-
});
|
|
39416
|
-
return paths;
|
|
39417
|
-
}
|
|
39418
38970
|
var TOP_LEVEL_HELP;
|
|
39419
38971
|
var init_host = __esm({
|
|
39420
38972
|
"src/host.ts"() {
|
|
39421
38973
|
"use strict";
|
|
39422
38974
|
init_cliArgs();
|
|
39423
|
-
init_cliRegistry();
|
|
39424
38975
|
init_messages();
|
|
39425
38976
|
init_appText();
|
|
39426
38977
|
init_refusal();
|
|
@@ -39429,52 +38980,15 @@ var init_host = __esm({
|
|
|
39429
38980
|
}
|
|
39430
38981
|
});
|
|
39431
38982
|
|
|
39432
|
-
// src/storedRun.ts
|
|
39433
|
-
function dispatchesUnstored(inv) {
|
|
39434
|
-
return inv.store === void 0 || asksForHelp(inv.commandArgs);
|
|
39435
|
-
}
|
|
39436
|
-
function storedReRenderRefusal(inv) {
|
|
39437
|
-
if (inv.command !== "balance" || asksForHelp(inv.commandArgs)) return void 0;
|
|
39438
|
-
if (!inv.commandArgs.includes("--render-from-json")) return void 0;
|
|
39439
|
-
const given = [inv.store === void 0 ? [] : ["--store"], inv.runId === void 0 ? [] : ["--run-id"]].flat();
|
|
39440
|
-
if (given.length === 0) return void 0;
|
|
39441
|
-
return refusal(
|
|
39442
|
-
"re-render-not-stored" /* ReRenderNotStored */,
|
|
39443
|
-
{ modifiers: given.join(", ") },
|
|
39444
|
-
[message("re-render-without" /* ReRenderWithout */, { count: given.length })]
|
|
39445
|
-
);
|
|
39446
|
-
}
|
|
39447
|
-
function unstoredRunIdRefusal(inv, commands = cliRegistry.commands) {
|
|
39448
|
-
if (inv.runId === void 0 || inv.store !== void 0 || asksForHelp(inv.commandArgs)) return void 0;
|
|
39449
|
-
const entry = commands.find((command) => command.name === inv.command);
|
|
39450
|
-
if (entry === void 0 || entry.acceptsHostModifiers === false) return void 0;
|
|
39451
|
-
return refusal(
|
|
39452
|
-
"run-id-without-store" /* RunIdWithoutStore */,
|
|
39453
|
-
{ runId: inv.runId },
|
|
39454
|
-
[message("keep-run-under-name" /* KeepRunUnderName */, { command: entry.name })]
|
|
39455
|
-
);
|
|
39456
|
-
}
|
|
39457
|
-
var init_storedRun = __esm({
|
|
39458
|
-
"src/storedRun.ts"() {
|
|
39459
|
-
"use strict";
|
|
39460
|
-
init_cliArgs();
|
|
39461
|
-
init_cliRegistry();
|
|
39462
|
-
init_messages();
|
|
39463
|
-
init_appText();
|
|
39464
|
-
init_refusal();
|
|
39465
|
-
}
|
|
39466
|
-
});
|
|
39467
|
-
|
|
39468
38983
|
// src/main.ts
|
|
39469
38984
|
var main_exports = {};
|
|
39470
38985
|
__export(main_exports, {
|
|
39471
38986
|
main: () => main
|
|
39472
38987
|
});
|
|
39473
|
-
|
|
39474
|
-
function runCommand(command, argv, ownRunDir) {
|
|
38988
|
+
function runCommand(command, argv) {
|
|
39475
38989
|
switch (command) {
|
|
39476
38990
|
case "balance":
|
|
39477
|
-
return runBalance(argv
|
|
38991
|
+
return runBalance(argv);
|
|
39478
38992
|
case "allocate":
|
|
39479
38993
|
runAllocate(argv);
|
|
39480
38994
|
return false;
|
|
@@ -39487,15 +39001,11 @@ function runCommand(command, argv, ownRunDir) {
|
|
|
39487
39001
|
}
|
|
39488
39002
|
}
|
|
39489
39003
|
function refuseLeadingFaults(inv) {
|
|
39490
|
-
|
|
39491
|
-
|
|
39492
|
-
standardError(process.stderr).error(refusal2);
|
|
39004
|
+
if (inv.refusal === void 0) return false;
|
|
39005
|
+
standardError(process.stderr).error(inv.refusal);
|
|
39493
39006
|
endRunOn(USAGE_REFUSAL);
|
|
39494
39007
|
return true;
|
|
39495
39008
|
}
|
|
39496
|
-
function leadingRefusal(inv) {
|
|
39497
|
-
return inv.refusal ?? modifiersNotTakenRefusal(inv) ?? storedReRenderRefusal(inv) ?? unstoredRunIdRefusal(inv);
|
|
39498
|
-
}
|
|
39499
39009
|
function main(hostArgv) {
|
|
39500
39010
|
beginRun();
|
|
39501
39011
|
try {
|
|
@@ -39512,65 +39022,18 @@ function run2(hostArgv) {
|
|
|
39512
39022
|
process.stdout.write(renderTopLevelHelp(cliRegistry) + "\n");
|
|
39513
39023
|
return;
|
|
39514
39024
|
}
|
|
39515
|
-
|
|
39025
|
+
if (runCommand(command, inv.commandArgs)) markRunFinished();
|
|
39516
39026
|
}
|
|
39517
39027
|
function asksForHelp3(command) {
|
|
39518
39028
|
return command === "help" || command === "--help" || command === "-h";
|
|
39519
39029
|
}
|
|
39520
|
-
function dispatch(inv, command) {
|
|
39521
|
-
if (dispatchesUnstored(inv) || inv.store === void 0) {
|
|
39522
|
-
if (runCommand(command, inv.commandArgs)) markRunFinished();
|
|
39523
|
-
return;
|
|
39524
|
-
}
|
|
39525
|
-
runKept(inv, command, inv.store);
|
|
39526
|
-
}
|
|
39527
|
-
function runKept(inv, command, storeRoot) {
|
|
39528
|
-
const runId = resolveRunId({ runId: inv.runId, now: /* @__PURE__ */ new Date() });
|
|
39529
|
-
const target = peekFlag(inv.commandArgs, "target") ?? "unknown-target";
|
|
39530
|
-
const sourceSha = sourceShaOf(inv.commandArgs);
|
|
39531
|
-
const spec = {
|
|
39532
|
-
storeRoot,
|
|
39533
|
-
target,
|
|
39534
|
-
runId,
|
|
39535
|
-
formatPaths: formatFilePaths(inv.commandArgs),
|
|
39536
|
-
inputs: inputsReadBy(parseArgs(inv.commandArgs), NODE_INPUT_READER)
|
|
39537
|
-
};
|
|
39538
|
-
const meta = manifestMeta(sourceSha);
|
|
39539
|
-
const route = (formatSpecs, runDir) => runCommand(command, wrapCommandArgv(inv.commandArgs, [...formatSpecs]), runDir);
|
|
39540
|
-
const plan = settlingRefusal(() => executeKeptRun(spec, meta, route), void 0);
|
|
39541
|
-
if (plan === void 0) return;
|
|
39542
|
-
markRunFinished();
|
|
39543
|
-
process.stdout.write(plan.runDir + "\n");
|
|
39544
|
-
}
|
|
39545
|
-
function sourceShaOf(commandArgs) {
|
|
39546
|
-
const features = peekFlag(commandArgs, "features");
|
|
39547
|
-
return resolveSourceSha({
|
|
39548
|
-
sourceSha: peekFlag(commandArgs, "source-sha"),
|
|
39549
|
-
targetDir: features !== void 0 ? dirname6(features) : void 0
|
|
39550
|
-
}) ?? "unknown";
|
|
39551
|
-
}
|
|
39552
|
-
function manifestMeta(sourceSha) {
|
|
39553
|
-
const toolIdentity = resolveToolIdentity();
|
|
39554
|
-
return {
|
|
39555
|
-
sourceSha,
|
|
39556
|
-
toolSha: toolIdentity.toolSha ?? "unknown",
|
|
39557
|
-
toolVersion: toolIdentity.toolVersion,
|
|
39558
|
-
mode: "balance",
|
|
39559
|
-
date: (/* @__PURE__ */ new Date()).toISOString()
|
|
39560
|
-
};
|
|
39561
|
-
}
|
|
39562
39030
|
var init_main = __esm({
|
|
39563
39031
|
"src/main.ts"() {
|
|
39564
39032
|
"use strict";
|
|
39565
39033
|
init_cli();
|
|
39566
|
-
init_inputsRead();
|
|
39567
|
-
init_cliArgs();
|
|
39568
39034
|
init_cli2();
|
|
39569
|
-
init_resolveRunInputs();
|
|
39570
|
-
init_keptRun();
|
|
39571
39035
|
init_host();
|
|
39572
39036
|
init_cliRegistry();
|
|
39573
|
-
init_storedRun();
|
|
39574
39037
|
init_outputLocation();
|
|
39575
39038
|
init_crashGuards();
|
|
39576
39039
|
init_exitCode();
|