spec-controller 0.1.0-alpha.4 → 0.1.0-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -6
- package/dist/cli-allocate/cli.d.ts +2 -0
- package/dist/cli-allocate/cli.d.ts.map +1 -0
- package/dist/cli-allocate/cli.js +57 -0
- package/dist/cli-allocate/cli.js.map +1 -0
- package/dist/cli-allocate/readHistory.d.ts +29 -0
- package/dist/cli-allocate/readHistory.d.ts.map +1 -0
- package/dist/cli-allocate/readHistory.js +136 -0
- package/dist/cli-allocate/readHistory.js.map +1 -0
- package/dist/cli-allocate/readParts.d.ts +3 -0
- package/dist/cli-allocate/readParts.d.ts.map +1 -0
- package/dist/cli-allocate/readParts.js +28 -0
- package/dist/cli-allocate/readParts.js.map +1 -0
- package/dist/cli-allocate/readTree.d.ts +16 -0
- package/dist/cli-allocate/readTree.d.ts.map +1 -0
- package/dist/cli-allocate/readTree.js +106 -0
- package/dist/cli-allocate/readTree.js.map +1 -0
- package/dist/cli-allocate/refStore.d.ts +3 -0
- package/dist/cli-allocate/refStore.d.ts.map +1 -0
- package/dist/cli-allocate/refStore.js +47 -0
- package/dist/cli-allocate/refStore.js.map +1 -0
- package/dist/cli-allocate/request.d.ts +11 -0
- package/dist/cli-allocate/request.d.ts.map +1 -0
- package/dist/cli-allocate/request.js +29 -0
- package/dist/cli-allocate/request.js.map +1 -0
- package/dist/cli-allocate/stderr.d.ts +14 -0
- package/dist/cli-allocate/stderr.d.ts.map +1 -0
- package/dist/cli-allocate/stderr.js +33 -0
- package/dist/cli-allocate/stderr.js.map +1 -0
- package/dist/cli-allocate/unreadable.d.ts +24 -0
- package/dist/cli-allocate/unreadable.d.ts.map +1 -0
- package/dist/cli-allocate/unreadable.js +43 -0
- package/dist/cli-allocate/unreadable.js.map +1 -0
- package/dist/cli-args.d.ts +73 -18
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +244 -22
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-balance/cli.d.ts +31 -13
- package/dist/cli-balance/cli.d.ts.map +1 -1
- package/dist/cli-balance/cli.js +206 -251
- package/dist/cli-balance/cli.js.map +1 -1
- package/dist/cli-balance/emit/format.d.ts +18 -1
- package/dist/cli-balance/emit/format.d.ts.map +1 -1
- package/dist/cli-balance/emit/format.js +27 -2
- package/dist/cli-balance/emit/format.js.map +1 -1
- package/dist/cli-balance/emit/writer.d.ts +11 -25
- package/dist/cli-balance/emit/writer.d.ts.map +1 -1
- package/dist/cli-balance/emit/writer.js +58 -33
- package/dist/cli-balance/emit/writer.js.map +1 -1
- package/dist/cli-balance/exitStatus.d.ts +3 -0
- package/dist/cli-balance/exitStatus.d.ts.map +1 -0
- package/dist/cli-balance/exitStatus.js +12 -0
- package/dist/cli-balance/exitStatus.js.map +1 -0
- package/dist/cli-balance/reRender.d.ts +22 -0
- package/dist/cli-balance/reRender.d.ts.map +1 -0
- package/dist/cli-balance/reRender.js +36 -0
- package/dist/cli-balance/reRender.js.map +1 -0
- package/dist/cli-balance/unreadableInputs.d.ts +35 -0
- package/dist/cli-balance/unreadableInputs.d.ts.map +1 -0
- package/dist/cli-balance/unreadableInputs.js +101 -0
- package/dist/cli-balance/unreadableInputs.js.map +1 -0
- package/dist/cli-registry.d.ts +28 -0
- package/dist/cli-registry.d.ts.map +1 -1
- package/dist/cli-registry.js +40 -35
- package/dist/cli-registry.js.map +1 -1
- package/dist/cli.d.ts +4 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +38 -22
- package/dist/cli.js.map +1 -1
- package/dist/host.d.ts +33 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +153 -17
- package/dist/host.js.map +1 -1
- package/dist/ingest/gherkinValidation.d.ts +3 -7
- package/dist/ingest/gherkinValidation.d.ts.map +1 -1
- package/dist/ingest/gherkinValidation.js +3 -7
- package/dist/ingest/gherkinValidation.js.map +1 -1
- package/dist/ingest/ingestQualityChecks.d.ts +25 -54
- package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
- package/dist/ingest/ingestQualityChecks.js +112 -145
- package/dist/ingest/ingestQualityChecks.js.map +1 -1
- package/dist/ingest/ingestScenarios.d.ts +11 -17
- package/dist/ingest/ingestScenarios.d.ts.map +1 -1
- package/dist/ingest/ingestScenarios.js +52 -62
- package/dist/ingest/ingestScenarios.js.map +1 -1
- package/dist/ingest/inputShapes.d.ts +47 -0
- package/dist/ingest/inputShapes.d.ts.map +1 -0
- package/dist/ingest/inputShapes.js +143 -0
- package/dist/ingest/inputShapes.js.map +1 -0
- package/dist/outputLocation.d.ts +48 -0
- package/dist/outputLocation.d.ts.map +1 -0
- package/dist/outputLocation.js +140 -0
- package/dist/outputLocation.js.map +1 -0
- package/dist/run-management/keptRun.d.ts +29 -25
- package/dist/run-management/keptRun.d.ts.map +1 -1
- package/dist/run-management/keptRun.js +25 -21
- package/dist/run-management/keptRun.js.map +1 -1
- package/dist/storedRun.d.ts +27 -0
- package/dist/storedRun.d.ts.map +1 -0
- package/dist/storedRun.js +49 -0
- package/dist/storedRun.js.map +1 -0
- package/package.json +2 -2
- package/dist/corpus/cli.d.ts +0 -34
- package/dist/corpus/cli.d.ts.map +0 -1
- package/dist/corpus/cli.js +0 -128
- package/dist/corpus/cli.js.map +0 -1
- package/dist/mutation-ratchet/index.d.ts +0 -51
- package/dist/mutation-ratchet/index.d.ts.map +0 -1
- package/dist/mutation-ratchet/index.js +0 -51
- package/dist/mutation-ratchet/index.js.map +0 -1
- package/dist/mutation-ratchet/record.d.ts +0 -178
- package/dist/mutation-ratchet/record.d.ts.map +0 -1
- package/dist/mutation-ratchet/record.js +0 -314
- package/dist/mutation-ratchet/record.js.map +0 -1
- package/dist/mutation-ratchet/report.d.ts +0 -109
- package/dist/mutation-ratchet/report.d.ts.map +0 -1
- package/dist/mutation-ratchet/report.js +0 -156
- package/dist/mutation-ratchet/report.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,GAEzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,WAAW,GACZ,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACpE,oFAAoF;AACpF,6FAA6F;AAC7F,sFAAsF;AACtF,OAAO,EACL,WAAW,EACX,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB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B,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;QACtD,2DAA2D;QAC3D,sFAAsF;QACtF,oFAAoF;QACpF,yBAAyB;QACzB,GAAG,mBAAmB,EAAE;QACxB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,SAAS;KACrC,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,mFAAmF;AACnF,mEAAmE;AACnE,MAAM,eAAe,GACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACnF,IAAI,eAAe;IAAE,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -56,5 +56,22 @@ export type PlanResult = {
|
|
|
56
56
|
* plans the same. Each planned output is markdown bound for stdout — the default human
|
|
57
57
|
* report, like vitest/cucumber.
|
|
58
58
|
*/
|
|
59
|
-
export declare function planOutput(formatSpecs: readonly string[]): PlanResult;
|
|
59
|
+
export declare function planOutput(formatSpecs: readonly string[], namesStdout?: (path: string) => boolean): PlanResult;
|
|
60
|
+
/** The operating system's identity for a regular file: its device and inode, exact beyond 2^53. */
|
|
61
|
+
export interface FileIdentity {
|
|
62
|
+
readonly dev: bigint;
|
|
63
|
+
readonly ino: bigint;
|
|
64
|
+
}
|
|
65
|
+
/** A planned output beside the identity of the regular file it lands on, when it lands on one. */
|
|
66
|
+
export interface IdentifiedOutput {
|
|
67
|
+
readonly output: PlannedOutput;
|
|
68
|
+
readonly identity: FileIdentity | undefined;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The refusal for the first two outputs that land on one regular file, or undefined when none do.
|
|
72
|
+
* The file is known by its identity rather than its spelling, so a link, a `..`, a case the volume
|
|
73
|
+
* folds or the file standard output is redirected into all count. An output with no identity is
|
|
74
|
+
* not on a regular file, and writing such a destination twice loses nothing, so it is never compared.
|
|
75
|
+
*/
|
|
76
|
+
export declare function sharedFileRefusal(outputs: readonly IdentifiedOutput[]): string | undefined;
|
|
60
77
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/cli-balance/emit/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,CAAC;AAczC,+EAA+E;AAC/E,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED,mEAAmE;AACnE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;CAC5C;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD;;;;;;GAMG;AACH,wBAAgB,UAAU,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/cli-balance/emit/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,iFAAiF;AACjF,MAAM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AG,MAAM,GAAG,SAAS,CAY1F"}
|
|
@@ -36,7 +36,7 @@ function isSupportedFormat(fmt) {
|
|
|
36
36
|
* plans the same. Each planned output is markdown bound for stdout — the default human
|
|
37
37
|
* report, like vitest/cucumber.
|
|
38
38
|
*/
|
|
39
|
-
export function planOutput(formatSpecs) {
|
|
39
|
+
export function planOutput(formatSpecs, namesStdout = () => false) {
|
|
40
40
|
// No --format flag defaults to a single "md" spec — the default human report.
|
|
41
41
|
const specs = formatSpecs.length === 0 ? ["md"] : formatSpecs;
|
|
42
42
|
const outputs = specs.map((spec) => {
|
|
@@ -75,7 +75,9 @@ export function planOutput(formatSpecs) {
|
|
|
75
75
|
// check would wrongly pass the former. Rejected with a typed error on the shared
|
|
76
76
|
// PlanResult surface (the same surface FMT-006/007 raise), carrying the hint to give one
|
|
77
77
|
// of the colliding outputs a `:<path>` so it writes to a file instead.
|
|
78
|
-
|
|
78
|
+
// A path that names standard output itself (/dev/stdout, /dev/fd/1) routes there as surely as a
|
|
79
|
+
// bare format does, so it is counted with the outputs bound for stdout.
|
|
80
|
+
const stdoutBound = outputs.filter((o) => o.dest.kind === "stdout" || namesStdout(o.dest.path));
|
|
79
81
|
if (stdoutBound.length > 1) {
|
|
80
82
|
const fmts = stdoutBound.map((o) => o.fmt).join(", ");
|
|
81
83
|
return {
|
|
@@ -87,4 +89,27 @@ export function planOutput(formatSpecs) {
|
|
|
87
89
|
}
|
|
88
90
|
return { ok: true, plan: { outputs } };
|
|
89
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* The refusal for the first two outputs that land on one regular file, or undefined when none do.
|
|
94
|
+
* The file is known by its identity rather than its spelling, so a link, a `..`, a case the volume
|
|
95
|
+
* folds or the file standard output is redirected into all count. An output with no identity is
|
|
96
|
+
* not on a regular file, and writing such a destination twice loses nothing, so it is never compared.
|
|
97
|
+
*/
|
|
98
|
+
export function sharedFileRefusal(outputs) {
|
|
99
|
+
const onFiles = outputs.filter((o) => o.identity !== undefined);
|
|
100
|
+
for (const [index, first] of onFiles.entries()) {
|
|
101
|
+
const second = onFiles.slice(index + 1).find((o) => sameFile(o.identity, first.identity));
|
|
102
|
+
if (second !== undefined) {
|
|
103
|
+
return (`Two outputs name the same file: ${asGiven(first.output)} and ${asGiven(second.output)}. ` +
|
|
104
|
+
`Give each output a file of its own.`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
function sameFile(a, b) {
|
|
110
|
+
return a.dev === b.dev && a.ino === b.ino;
|
|
111
|
+
}
|
|
112
|
+
function asGiven(output) {
|
|
113
|
+
return output.dest.kind === "stdout" ? `${output.fmt} on standard output` : `${output.fmt}:${output.dest.path}`;
|
|
114
|
+
}
|
|
90
115
|
//# sourceMappingURL=format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/cli-balance/emit/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH;;;;GAIG;AACH,MAAM,iBAAiB,GAA4B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAElE,oFAAoF;AACpF,SAAS,iBAAiB,CAAC,GAAW;IACpC,OAAQ,iBAAuC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAChE,CAAC;AA2BD;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/cli-balance/emit/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH;;;;GAIG;AACH,MAAM,iBAAiB,GAA4B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAElE,oFAAoF;AACpF,SAAS,iBAAiB,CAAC,GAAW;IACpC,OAAQ,iBAAuC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAChE,CAAC;AA2BD;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAC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AC,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC1F,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,CACL,mCAAmC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI;gBAC1F,qCAAqC,CACtC,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,QAAQ,CAAC,CAAe,EAAE,CAAe;IAChD,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;AAC5C,CAAC;AAED,SAAS,OAAO,CAAC,MAAqB;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AAClH,CAAC"}
|
|
@@ -1,33 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The output
|
|
3
|
-
*
|
|
4
|
-
* the payload via the PURE renderers (`renderMarkdown` / `renderJson` in `src/render/`)
|
|
5
|
-
* and performs the IO: stdout, or a file.
|
|
6
|
-
*
|
|
7
|
-
* This is the ONLY layer that performs IO — the renderers stay pure (`model → string`)
|
|
8
|
-
* and `planOutput` stays pure (parse+validate). So the writer carries the `@integration`
|
|
9
|
-
* evidence: its real stdout/file effect is asserted directly (the anti-watermelon rule),
|
|
10
|
-
* never a re-run of the `planOutput` `@unit`.
|
|
11
|
-
*
|
|
12
|
-
* FMT-001 (`@SCN-FMT-001`) writes markdown to stdout. The `json` format (FMT-002) and the
|
|
13
|
-
* file destination (FMT-002/003) are wired on the same `render` + `dest` switch below as
|
|
14
|
-
* later sub-issues plan them.
|
|
15
|
-
*
|
|
16
|
-
* Parent: @SCN-FMT-001 — the output-dispatch rework.
|
|
2
|
+
* The output writer: renders each planned output through the pure renderers and performs the only
|
|
3
|
+
* IO in the pipeline, to stdout or to a file.
|
|
17
4
|
*/
|
|
18
5
|
import type { FeatureNames } from "@3f-consulting/spec-controller-core";
|
|
19
|
-
import type
|
|
6
|
+
import { type FileIdentity, type OutputPlan } from "./format.js";
|
|
20
7
|
import type { RunContext } from "@3f-consulting/spec-controller-core";
|
|
21
8
|
import type { EvidenceObligations } from "@3f-consulting/spec-controller-core";
|
|
22
9
|
import type { EvidenceReconciliation } from "@3f-consulting/spec-controller-core";
|
|
23
10
|
/**
|
|
24
11
|
* The reconciliation payloads the writer renders — the balance plus its sibling reads
|
|
25
|
-
* (ctx / evidenceObligations / featureNames), exactly the arguments the pure renderers take.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the Static checks cut): the renderers fold BOTH off the Ledger themselves (3F-2103 / 3F-2118 —
|
|
29
|
-
* the parallel censuses are retired), so the writer threads only whether each axis is in play,
|
|
30
|
-
* never a census object.
|
|
12
|
+
* (ctx / evidenceObligations / featureNames), exactly the arguments the pure renderers take.
|
|
13
|
+
* `withRuntimeObservations` and `withStaticChecks` gate the two observation axes; the renderers
|
|
14
|
+
* fold both off the Ledger themselves, so the writer threads only whether each axis is in play.
|
|
31
15
|
*/
|
|
32
16
|
export interface OutputPayloads {
|
|
33
17
|
readonly balance: EvidenceReconciliation;
|
|
@@ -38,8 +22,10 @@ export interface OutputPayloads {
|
|
|
38
22
|
readonly featureNames?: FeatureNames;
|
|
39
23
|
}
|
|
40
24
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
25
|
+
* Every destination is vetted before any output is emitted, so a refused run never leaves a report
|
|
26
|
+
* behind, on stdout or in a file, whose headline names an exit the process does not take. Writing
|
|
27
|
+
* files first and stdout last would not do: an earlier file would still be written. The vetting
|
|
28
|
+
* refuses a destination that cannot be written, and two outputs that land on one regular file.
|
|
43
29
|
*/
|
|
44
|
-
export declare function writeOutputs(plan: OutputPlan, payloads: OutputPayloads): void;
|
|
30
|
+
export declare function writeOutputs(plan: OutputPlan, payloads: OutputPayloads, stdoutFile?: () => FileIdentity | undefined): void;
|
|
45
31
|
//# sourceMappingURL=writer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/cli-balance/emit/writer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/cli-balance/emit/writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAqB,KAAK,YAAY,EAA4C,KAAK,UAAU,EAAsB,MAAM,aAAa,CAAC;AAClJ,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAGlF;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IACnD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACtC;AAQD;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,cAAc,EACxB,UAAU,GAAE,MAAM,YAAY,GAAG,SAA0B,GAC1D,IAAI,CAKN"}
|
|
@@ -1,48 +1,73 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The output
|
|
3
|
-
*
|
|
4
|
-
* the payload via the PURE renderers (`renderMarkdown` / `renderJson` in `src/render/`)
|
|
5
|
-
* and performs the IO: stdout, or a file.
|
|
6
|
-
*
|
|
7
|
-
* This is the ONLY layer that performs IO — the renderers stay pure (`model → string`)
|
|
8
|
-
* and `planOutput` stays pure (parse+validate). So the writer carries the `@integration`
|
|
9
|
-
* evidence: its real stdout/file effect is asserted directly (the anti-watermelon rule),
|
|
10
|
-
* never a re-run of the `planOutput` `@unit`.
|
|
11
|
-
*
|
|
12
|
-
* FMT-001 (`@SCN-FMT-001`) writes markdown to stdout. The `json` format (FMT-002) and the
|
|
13
|
-
* file destination (FMT-002/003) are wired on the same `render` + `dest` switch below as
|
|
14
|
-
* later sub-issues plan them.
|
|
15
|
-
*
|
|
16
|
-
* Parent: @SCN-FMT-001 — the output-dispatch rework.
|
|
2
|
+
* The output writer: renders each planned output through the pure renderers and performs the only
|
|
3
|
+
* IO in the pipeline, to stdout or to a file.
|
|
17
4
|
*/
|
|
18
|
-
import { writeFileSync } from "node:fs";
|
|
5
|
+
import { unlinkSync, writeFileSync } from "node:fs";
|
|
19
6
|
import { renderMarkdown } from "@3f-consulting/spec-controller-core";
|
|
20
7
|
import { renderJson } from "@3f-consulting/spec-controller-core";
|
|
21
|
-
|
|
8
|
+
import { sharedFileRefusal } from "./format.js";
|
|
9
|
+
import { probeDestination, refuse, stdoutIdentity, unwritableRefusal, writeOrRefuse } from "../../outputLocation.js";
|
|
22
10
|
function render(fmt, p) {
|
|
23
|
-
// The axis gates moved onto the concept's factory (3F-2233) — by the time a payload reaches a
|
|
24
|
-
// renderer the totals are already folded, so there is nothing left here to switch on.
|
|
25
11
|
return fmt === "json"
|
|
26
12
|
? renderJson(p.balance, p.ctx, p.evidenceObligations, p.featureNames)
|
|
27
13
|
: renderMarkdown(p.balance, p.ctx, p.evidenceObligations, p.featureNames);
|
|
28
14
|
}
|
|
29
15
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
16
|
+
* Every destination is vetted before any output is emitted, so a refused run never leaves a report
|
|
17
|
+
* behind, on stdout or in a file, whose headline names an exit the process does not take. Writing
|
|
18
|
+
* files first and stdout last would not do: an earlier file would still be written. The vetting
|
|
19
|
+
* refuses a destination that cannot be written, and two outputs that land on one regular file.
|
|
32
20
|
*/
|
|
33
|
-
export function writeOutputs(plan, payloads) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
export function writeOutputs(plan, payloads, stdoutFile = stdoutIdentity) {
|
|
22
|
+
const emissions = plan.outputs.map((output) => ({ output, text: render(output.fmt, payloads) + "\n" }));
|
|
23
|
+
const refusal = vetDestinations(plan.outputs, stdoutFile);
|
|
24
|
+
if (refusal !== undefined)
|
|
25
|
+
refuse(refusal);
|
|
26
|
+
for (const { output, text } of emissions)
|
|
27
|
+
emit(output, text);
|
|
28
|
+
}
|
|
29
|
+
/** The refusal the destinations earn, if any. Every file the vetting had to create is removed again first. */
|
|
30
|
+
function vetDestinations(outputs, stdoutFile) {
|
|
31
|
+
const created = [];
|
|
32
|
+
try {
|
|
33
|
+
const identified = [];
|
|
34
|
+
for (const output of outputs) {
|
|
35
|
+
const probe = identify(output, stdoutFile, created);
|
|
36
|
+
if (typeof probe === "string")
|
|
37
|
+
return probe;
|
|
38
|
+
identified.push({ output, identity: probe });
|
|
45
39
|
}
|
|
40
|
+
return sharedFileRefusal(identified);
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
for (const path of created)
|
|
44
|
+
unlinkSync(path);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** The regular file an output lands on, or the refusal naming why its destination cannot be written. */
|
|
48
|
+
function identify(output, stdoutFile, created) {
|
|
49
|
+
const dest = output.dest;
|
|
50
|
+
if (dest.kind === "stdout")
|
|
51
|
+
return stdoutFile();
|
|
52
|
+
try {
|
|
53
|
+
const probed = probeDestination(dest.path);
|
|
54
|
+
if (probed.created !== undefined)
|
|
55
|
+
created.push(probed.created);
|
|
56
|
+
return probed.identity;
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
return unwritableRefusal(refusalSubject(output), dest.path, err);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function refusalSubject(output) {
|
|
63
|
+
return `The ${output.fmt} report could not be written`;
|
|
64
|
+
}
|
|
65
|
+
function emit(output, text) {
|
|
66
|
+
const dest = output.dest;
|
|
67
|
+
if (dest.kind === "stdout") {
|
|
68
|
+
process.stdout.write(text);
|
|
69
|
+
return;
|
|
46
70
|
}
|
|
71
|
+
writeOrRefuse(refusalSubject(output), dest.path, () => writeFileSync(dest.path, text, "utf8"));
|
|
47
72
|
}
|
|
48
73
|
//# sourceMappingURL=writer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../../src/cli-balance/emit/writer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../../src/cli-balance/emit/writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAoG,MAAM,aAAa,CAAC;AAIlJ,OAAO,EAAE,gBAAgB,EAA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C,IAAI,CAAC,CAAC;QAC3B,OAAO;IACT,CAAC;IACD,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AACjG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exitStatus.d.ts","sourceRoot":"","sources":["../../src/cli-balance/exitStatus.ts"],"names":[],"mappings":"AAQA,4GAA4G;AAC5G,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAEjE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The codes `--exit-zero` moves to 0: the two VERDICTS on the target —
|
|
3
|
+
* out-of-balance and pending-under-`--strict`. Enumerated rather than "anything non-zero", because
|
|
4
|
+
* unsound (4) and nothing-to-reconcile (5) are not verdicts but the absence of a trustworthy one,
|
|
5
|
+
* and suppressing a verdict never suppresses that. Usage (2) exits before the ladder is reached.
|
|
6
|
+
*/
|
|
7
|
+
const VERDICT_CODES = new Set([1, 3]);
|
|
8
|
+
/** The status the process leaves for a verdict code, live or re-rendered, with or without `--exit-zero`. */
|
|
9
|
+
export function statusFor(code, exitZero) {
|
|
10
|
+
return exitZero && VERDICT_CODES.has(code) ? 0 : code;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=exitStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exitStatus.js","sourceRoot":"","sources":["../../src/cli-balance/exitStatus.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE3D,4GAA4G;AAC5G,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,QAAiB;IACvD,OAAO,QAAQ,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-rendering a saved Evidence Reconciliation: the markdown the saved report renders to, and the
|
|
3
|
+
* verdict it carries. Pure over the saved bytes; the CLI does the reading and the writing.
|
|
4
|
+
*/
|
|
5
|
+
import type { VerdictCode } from "@3f-consulting/spec-controller-core";
|
|
6
|
+
export interface ReRendered {
|
|
7
|
+
readonly markdown: string;
|
|
8
|
+
readonly code: VerdictCode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* `strictGiven` is `--strict` on the re-render. The run is strict when the saved run was or the
|
|
12
|
+
* re-render asks, and that one value is written onto the report before it renders, so the headline
|
|
13
|
+
* names the same code the re-render exits.
|
|
14
|
+
*/
|
|
15
|
+
export declare function reRender(savedJson: string, strictGiven: boolean): ReRendered;
|
|
16
|
+
/**
|
|
17
|
+
* The first flag given beside `--render-from-json` that a re-render would silently ignore, as the
|
|
18
|
+
* usage message that refuses it; null when there is none, or no re-render was asked for. Any flag
|
|
19
|
+
* outside the three it reads is refused, so one added to balance later is refused by default.
|
|
20
|
+
*/
|
|
21
|
+
export declare function checkReRenderFlags(args: Record<string, string>): string | null;
|
|
22
|
+
//# sourceMappingURL=reRender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reRender.d.ts","sourceRoot":"","sources":["../../src/cli-balance/reRender.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEpF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,UAAU,CAQ5E;AAKD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAQ9E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-rendering a saved Evidence Reconciliation: the markdown the saved report renders to, and the
|
|
3
|
+
* verdict it carries. Pure over the saved bytes; the CLI does the reading and the writing.
|
|
4
|
+
*/
|
|
5
|
+
import { renderReport, verdictCode } from "@3f-consulting/spec-controller-core";
|
|
6
|
+
/**
|
|
7
|
+
* `strictGiven` is `--strict` on the re-render. The run is strict when the saved run was or the
|
|
8
|
+
* re-render asks, and that one value is written onto the report before it renders, so the headline
|
|
9
|
+
* names the same code the re-render exits.
|
|
10
|
+
*/
|
|
11
|
+
export function reRender(savedJson, strictGiven) {
|
|
12
|
+
const saved = JSON.parse(savedJson);
|
|
13
|
+
const strict = saved.runProvenance.strict === true || strictGiven;
|
|
14
|
+
const report = { ...saved, runProvenance: { ...saved.runProvenance, strict } };
|
|
15
|
+
return {
|
|
16
|
+
markdown: renderReport(report),
|
|
17
|
+
code: verdictCode({ ledger: report.ledger, scenarioCodeErrors: report.scenarioCodeErrors, strict }),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** The flags a re-render reads; `--help` answers before any of this runs. */
|
|
21
|
+
const READ_BY_A_RE_RENDER = new Set(["render-from-json", "strict", "exit-zero"]);
|
|
22
|
+
/**
|
|
23
|
+
* The first flag given beside `--render-from-json` that a re-render would silently ignore, as the
|
|
24
|
+
* usage message that refuses it; null when there is none, or no re-render was asked for. Any flag
|
|
25
|
+
* outside the three it reads is refused, so one added to balance later is refused by default.
|
|
26
|
+
*/
|
|
27
|
+
export function checkReRenderFlags(args) {
|
|
28
|
+
if (args["render-from-json"] === undefined)
|
|
29
|
+
return null;
|
|
30
|
+
const ignored = Object.keys(args).find((key) => !READ_BY_A_RE_RENDER.has(key));
|
|
31
|
+
if (ignored === undefined)
|
|
32
|
+
return null;
|
|
33
|
+
return (`--render-from-json re-renders a saved report and reads only --strict and --exit-zero beside it; ` +
|
|
34
|
+
`--${ignored} would be ignored. Remove it, or run balance without --render-from-json.`);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=reRender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reRender.js","sourceRoot":"","sources":["../../src/cli-balance/reRender.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAQhF;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,SAAiB,EAAE,WAAoB;IAC9D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAgB,CAAC;IACnD,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,KAAK,IAAI,IAAI,WAAW,CAAC;IAClE,MAAM,MAAM,GAAgB,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,EAAE,GAAG,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC5F,OAAO;QACL,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC;QAC9B,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC;KACpG,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAEtG;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAA4B;IAC7D,IAAI,IAAI,CAAC,kBAAkB,CAAC,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACxD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/E,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,CACL,kGAAkG;QAClG,KAAK,OAAO,0EAA0E,CACvF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The input guards that decide, before anything is reconciled, whether the run can read what it
|
|
3
|
+
* was handed. Each returns the refusal to print or null, and `refuseUnreadableInputs` in ./cli.ts
|
|
4
|
+
* turns a refusal into exit 2: an input the tool cannot read is a usage error, never a verdict.
|
|
5
|
+
*/
|
|
6
|
+
import { type Shape } from "../ingest/inputShapes.js";
|
|
7
|
+
import { type ReRendered } from "./reRender.js";
|
|
8
|
+
/** One JSON input the run will read: how a refusal names it, where it is, and the shape it must have. */
|
|
9
|
+
export interface JsonInput {
|
|
10
|
+
readonly subject: string;
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly shape: Shape;
|
|
13
|
+
readonly writer: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The JSON inputs this invocation hands the readers, in flag order: each one given, and the
|
|
17
|
+
* package.json the run reads by default when none is given and there is one to read.
|
|
18
|
+
*/
|
|
19
|
+
export declare function jsonInputsOf(args: Record<string, string>, exists: (path: string) => boolean): JsonInput[];
|
|
20
|
+
/** The first input that cannot be read in the shape its reader expects, as the refusal; else null. */
|
|
21
|
+
export declare function checkInputShapes(inputs: readonly JsonInput[], read: (path: string) => string): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* The feature corpus or CI workflow path the run cannot read, as the refusal: a path that is not
|
|
24
|
+
* the kind its flag reads, or one the operating system will not let it read. Else null. Both are
|
|
25
|
+
* read here by the same discovery the reconcile reads them by.
|
|
26
|
+
*/
|
|
27
|
+
export declare function checkInputPaths(args: Record<string, string>): string | null;
|
|
28
|
+
/** The saved file given to `--render-from-json`, refused when it is not a saved reconciliation at its top; else null. */
|
|
29
|
+
export declare function checkSavedReconciliation(path: string, savedJson: string): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* The re-render of a saved reconciliation, or the refusal naming the file when the renderer cannot
|
|
32
|
+
* read it. The file is this path's only input, so a render that fails is a file the tool cannot read.
|
|
33
|
+
*/
|
|
34
|
+
export declare function reRenderOrRefusal(path: string, savedJson: string, strict: boolean): ReRendered | string;
|
|
35
|
+
//# sourceMappingURL=unreadableInputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreadableInputs.d.ts","sourceRoot":"","sources":["../../src/cli-balance/unreadableInputs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAOL,KAAK,KAAK,EACX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAE1D,yGAAyG;AACzG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAgBD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,EAAE,CASzG;AAwBD,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,GAAG,IAAI,CAM5G;AAMD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAQ3E;AAED,yHAAyH;AACzH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIvF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,CAMvG"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The input guards that decide, before anything is reconciled, whether the run can read what it
|
|
3
|
+
* was handed. Each returns the refusal to print or null, and `refuseUnreadableInputs` in ./cli.ts
|
|
4
|
+
* turns a refusal into exit 2: an input the tool cannot read is a usage error, never a verdict.
|
|
5
|
+
*/
|
|
6
|
+
import { ciReadFault, corpusReadFault, DEFAULT_PACKAGE_JSON, } from "../ingest/ingestQualityChecks.js";
|
|
7
|
+
import { CI_STEP_RECORD, CUCUMBER_REPORT, PACKAGE_MANIFEST, SAVED_RECONCILIATION, shapeFaultIn, VITEST_REPORT, } from "../ingest/inputShapes.js";
|
|
8
|
+
import { reRender } from "./reRender.js";
|
|
9
|
+
/** Each JSON-bearing flag whose reader expects a shape, keyed by the flag without its dashes. */
|
|
10
|
+
const READ_SHAPES = {
|
|
11
|
+
vitest: { noun: "report", writer: "the Vitest JSON reporter writes", shape: VITEST_REPORT },
|
|
12
|
+
cucumber: { noun: "report", writer: "the Cucumber JSON formatter writes", shape: CUCUMBER_REPORT },
|
|
13
|
+
"ci-steps": { noun: "record", writer: "of a CI run's record of its steps", shape: CI_STEP_RECORD },
|
|
14
|
+
"package-json": { noun: "manifest", writer: "of a package.json manifest", shape: PACKAGE_MANIFEST },
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The JSON inputs this invocation hands the readers, in flag order: each one given, and the
|
|
18
|
+
* package.json the run reads by default when none is given and there is one to read.
|
|
19
|
+
*/
|
|
20
|
+
export function jsonInputsOf(args, exists) {
|
|
21
|
+
const given = Object.entries(READ_SHAPES).flatMap(([flag, read]) => {
|
|
22
|
+
const path = args[flag];
|
|
23
|
+
if (path === undefined)
|
|
24
|
+
return [];
|
|
25
|
+
return [{ subject: `The --${flag} ${read.noun}`, path, shape: read.shape, writer: read.writer }];
|
|
26
|
+
});
|
|
27
|
+
if (args["package-json"] !== undefined || !exists(DEFAULT_PACKAGE_JSON))
|
|
28
|
+
return given;
|
|
29
|
+
const { shape, writer } = READ_SHAPES["package-json"];
|
|
30
|
+
return [...given, { subject: "The package.json read by default", path: DEFAULT_PACKAGE_JSON, shape, writer }];
|
|
31
|
+
}
|
|
32
|
+
function reasonOf(err) {
|
|
33
|
+
return err instanceof Error ? err.message : String(err);
|
|
34
|
+
}
|
|
35
|
+
function jsonInputFault(input, read) {
|
|
36
|
+
let text;
|
|
37
|
+
try {
|
|
38
|
+
text = read(input.path);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
return `${input.subject} could not be read: ${input.path} (${reasonOf(err)})`;
|
|
42
|
+
}
|
|
43
|
+
let document;
|
|
44
|
+
try {
|
|
45
|
+
document = JSON.parse(text);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
return `${input.subject} is not valid JSON: ${input.path} (${reasonOf(err)})`;
|
|
49
|
+
}
|
|
50
|
+
const fault = shapeFaultIn(document, input.shape);
|
|
51
|
+
if (fault === null)
|
|
52
|
+
return null;
|
|
53
|
+
return `${input.subject} is not in the shape ${input.writer}: ${input.path} (${fault})`;
|
|
54
|
+
}
|
|
55
|
+
/** The first input that cannot be read in the shape its reader expects, as the refusal; else null. */
|
|
56
|
+
export function checkInputShapes(inputs, read) {
|
|
57
|
+
for (const input of inputs) {
|
|
58
|
+
const fault = jsonInputFault(input, read);
|
|
59
|
+
if (fault !== null)
|
|
60
|
+
return fault;
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
function pathRefusal(subject, fault) {
|
|
65
|
+
return `${subject} could not be read: ${fault.path} (${fault.reason})`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The feature corpus or CI workflow path the run cannot read, as the refusal: a path that is not
|
|
69
|
+
* the kind its flag reads, or one the operating system will not let it read. Else null. Both are
|
|
70
|
+
* read here by the same discovery the reconcile reads them by.
|
|
71
|
+
*/
|
|
72
|
+
export function checkInputPaths(args) {
|
|
73
|
+
const corpus = corpusReadFault(args["features"]);
|
|
74
|
+
if (corpus !== null) {
|
|
75
|
+
return pathRefusal(args["features"] === undefined ? "The feature corpus read by default" : "The --features corpus", corpus);
|
|
76
|
+
}
|
|
77
|
+
const ci = ciReadFault(args["ci"]);
|
|
78
|
+
if (ci !== null)
|
|
79
|
+
return pathRefusal(args["ci"] === undefined ? "The CI workflows read by default" : "The --ci workflows", ci);
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
/** The saved file given to `--render-from-json`, refused when it is not a saved reconciliation at its top; else null. */
|
|
83
|
+
export function checkSavedReconciliation(path, savedJson) {
|
|
84
|
+
const fault = shapeFaultIn(JSON.parse(savedJson), SAVED_RECONCILIATION);
|
|
85
|
+
if (fault === null)
|
|
86
|
+
return null;
|
|
87
|
+
return `The --render-from-json file is not a saved reconciliation: ${path} (${fault})`;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The re-render of a saved reconciliation, or the refusal naming the file when the renderer cannot
|
|
91
|
+
* read it. The file is this path's only input, so a render that fails is a file the tool cannot read.
|
|
92
|
+
*/
|
|
93
|
+
export function reRenderOrRefusal(path, savedJson, strict) {
|
|
94
|
+
try {
|
|
95
|
+
return reRender(savedJson, strict);
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
return `The --render-from-json file could not be rendered as a saved reconciliation: ${path} (${reasonOf(err)})`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=unreadableInputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreadableInputs.js","sourceRoot":"","sources":["../../src/cli-balance/unreadableInputs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,WAAW,EACX,eAAe,EACf,oBAAoB,GAErB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,aAAa,GAEd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAmB,MAAM,eAAe,CAAC;AAgB1D,iGAAiG;AACjG,MAAM,WAAW,GAAwC;IACvD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,iCAAiC,EAAE,KAAK,EAAE,aAAa,EAAE;IAC3F,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,oCAAoC,EAAE,KAAK,EAAE,eAAe,EAAE;IAClG,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,mCAAmC,EAAE,KAAK,EAAE,cAAc,EAAE;IAClG,cAAc,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,4BAA4B,EAAE,KAAK,EAAE,gBAAgB,EAAE;CACpG,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAA4B,EAAE,MAAiC;IAC1F,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;QACjE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,EAAE,CAAC;QAClC,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,IAAI,IAAI,IAAI,CAAC,IAAI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