spec-controller 0.1.0-alpha.36 → 0.1.0-alpha.37
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 +6 -2
- package/dist/cli-balance/cli.d.ts +3 -2
- package/dist/cli-balance/cli.d.ts.map +1 -1
- package/dist/cli-balance/cli.js +36 -13
- package/dist/cli-balance/cli.js.map +1 -1
- 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/ingest/ingestQualityChecks.d.ts +25 -8
- package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
- package/dist/ingest/ingestQualityChecks.js +93 -33
- package/dist/ingest/ingestQualityChecks.js.map +1 -1
- package/dist/ingest/ingestScenarios.d.ts +4 -4
- package/dist/ingest/ingestScenarios.d.ts.map +1 -1
- package/dist/ingest/ingestScenarios.js +21 -8
- 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/package.json +2 -2
package/README.md
CHANGED
|
@@ -79,8 +79,12 @@ The whole report is written before the code is set, so a failing run still tells
|
|
|
79
79
|
**Node's default is never one of these.** A run that cannot reconcile ends on an enumerated code of
|
|
80
80
|
its own rather than falling out of the process — a crash that exits `1` would be indistinguishable,
|
|
81
81
|
by status, from an honest disagreement. **An input the tool cannot read is part of `2`**: a mistyped
|
|
82
|
-
path,
|
|
83
|
-
|
|
82
|
+
path, a path it is not permitted to read, a file where a directory belongs or the reverse, an
|
|
83
|
+
unparseable report, a report that parses but is not in the shape its runner writes, a saved
|
|
84
|
+
reconciliation it cannot render, or a corpus the Gherkin parser rejects are all the invocation
|
|
85
|
+
being wrong, never a verdict about your code. The refusal names the input, the path, and what was
|
|
86
|
+
wrong with it. A well-formed report that holds nothing, such as a Vitest run that matched no test
|
|
87
|
+
file, is read, not refused. **So is an output location it cannot write**: a `--format` path that is
|
|
84
88
|
read-only, a directory, under a regular file or in a directory that does not exist, and a
|
|
85
89
|
`--store` root the run directory cannot be created under, are refused at `2`, naming the location and the operating system's reason, before any report is printed.
|
|
86
90
|
|
|
@@ -62,8 +62,9 @@ export declare function checkInputsExist(args: Record<string, string>, exists: (
|
|
|
62
62
|
* PURE and `@unit`-testable like its sibling guards: reads the parsed args + an injected
|
|
63
63
|
* `read` fn (no fs), returns the FIRST supplied-but-unparseable `(flag, path, failure)` as
|
|
64
64
|
* a typed error naming all three — routed to stderr + exit 2 by `refuseUnreadableInputs` — else null.
|
|
65
|
-
* An omitted flag is not an error, and
|
|
66
|
-
* check)
|
|
65
|
+
* An omitted flag is not an error, and a file that cannot be read at all (a race after the
|
|
66
|
+
* existence check, a permission refused) is refused as one that could not be read, never as JSON
|
|
67
|
+
* that did not parse.
|
|
67
68
|
*/
|
|
68
69
|
export declare function checkInputsParse(args: Record<string, string>, read: (path: string) => string): string | null;
|
|
69
70
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA4DH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAS3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAEjE;AAqBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAChC,MAAM,GAAG,IAAI,CAcf;AAUD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC7B,MAAM,GAAG,IAAI,CAmBf;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC7B,MAAM,GAAG,IAAI,CAcf;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAwGlD"}
|
package/dist/cli-balance/cli.js
CHANGED
|
@@ -16,7 +16,8 @@ import { dirname } from "node:path";
|
|
|
16
16
|
import { runReconcile, readEvidenceObligations, readFeatureNames, featureCorpusParseErrors, } from "../ingest/ingestQualityChecks.js";
|
|
17
17
|
import { planOutput } from "./emit/format.js";
|
|
18
18
|
import { writeOutputs } from "./emit/writer.js";
|
|
19
|
-
import { checkReRenderFlags
|
|
19
|
+
import { checkReRenderFlags } from "./reRender.js";
|
|
20
|
+
import { checkInputPaths, checkInputShapes, checkSavedReconciliation, jsonInputsOf, reRenderOrRefusal, } from "./unreadableInputs.js";
|
|
20
21
|
import { statusFor } from "./exitStatus.js";
|
|
21
22
|
import { verdictCode, } from "@3f-consulting/spec-controller-core";
|
|
22
23
|
import { resolveSourceSha, resolveTargetRoot, resolveToolIdentity } from "../run-management/resolveRunInputs.js";
|
|
@@ -125,10 +126,8 @@ export function checkInputsExist(args, exists) {
|
|
|
125
126
|
return null;
|
|
126
127
|
}
|
|
127
128
|
/**
|
|
128
|
-
* The JSON-BEARING input flags — the ones whose content is `JSON.parse`d
|
|
129
|
-
*
|
|
130
|
-
* read as raw TEXT and scanned for `run:` steps — neither is JSON, neither can crash the
|
|
131
|
-
* process, and on garbage both reconcile normally (verified).
|
|
129
|
+
* The JSON-BEARING input flags — the ones whose content is `JSON.parse`d. `--features` and `--ci`
|
|
130
|
+
* are read as Gherkin and YAML files on disk, and whether they can be read is `checkInputPaths`'s.
|
|
132
131
|
*/
|
|
133
132
|
const JSON_INPUT_FLAGS = [
|
|
134
133
|
"vitest", "cucumber", "package-json", "ci-steps",
|
|
@@ -145,26 +144,35 @@ const JSON_INPUT_FLAGS = [
|
|
|
145
144
|
* PURE and `@unit`-testable like its sibling guards: reads the parsed args + an injected
|
|
146
145
|
* `read` fn (no fs), returns the FIRST supplied-but-unparseable `(flag, path, failure)` as
|
|
147
146
|
* a typed error naming all three — routed to stderr + exit 2 by `refuseUnreadableInputs` — else null.
|
|
148
|
-
* An omitted flag is not an error, and
|
|
149
|
-
* check)
|
|
147
|
+
* An omitted flag is not an error, and a file that cannot be read at all (a race after the
|
|
148
|
+
* existence check, a permission refused) is refused as one that could not be read, never as JSON
|
|
149
|
+
* that did not parse.
|
|
150
150
|
*/
|
|
151
151
|
export function checkInputsParse(args, read) {
|
|
152
152
|
for (const flag of JSON_INPUT_FLAGS) {
|
|
153
153
|
const path = args[flag];
|
|
154
154
|
if (path === undefined)
|
|
155
155
|
continue;
|
|
156
|
+
let text;
|
|
156
157
|
try {
|
|
157
|
-
|
|
158
|
+
text = read(path);
|
|
158
159
|
}
|
|
159
160
|
catch (err) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
return `The --${flag} file could not be read: ${path} (${failureOf(err)})`;
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
JSON.parse(text);
|
|
165
|
+
}
|
|
166
|
+
catch (err) {
|
|
167
|
+
// Anything that escapes this catch lands on Node's default exit 1 — the collision itself.
|
|
168
|
+
return `The --${flag} report is not valid JSON: ${path} (${failureOf(err)})`;
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
171
|
return null;
|
|
167
172
|
}
|
|
173
|
+
function failureOf(err) {
|
|
174
|
+
return err instanceof Error ? err.message : String(err);
|
|
175
|
+
}
|
|
168
176
|
/**
|
|
169
177
|
* Guard the readability of `--render-from-json` at the CLI edge. The
|
|
170
178
|
* render-from-saved-JSON branch RETURNS before the input guards ever run, so it honoured
|
|
@@ -319,7 +327,13 @@ function renderSavedReport(args) {
|
|
|
319
327
|
const rehydratePath = args["render-from-json"];
|
|
320
328
|
if (rehydratePath === undefined)
|
|
321
329
|
return false;
|
|
322
|
-
const
|
|
330
|
+
const savedJson = readFileSync(rehydratePath, "utf8");
|
|
331
|
+
const notSavedError = checkSavedReconciliation(rehydratePath, savedJson);
|
|
332
|
+
if (notSavedError)
|
|
333
|
+
exitUsage(notSavedError);
|
|
334
|
+
const saved = reRenderOrRefusal(rehydratePath, savedJson, args["strict"] !== undefined);
|
|
335
|
+
if (typeof saved === "string")
|
|
336
|
+
exitUsage(saved);
|
|
323
337
|
process.stdout.write(saved.markdown + "\n");
|
|
324
338
|
const code = statusFor(saved.code, args["exit-zero"] !== undefined);
|
|
325
339
|
if (code !== 0)
|
|
@@ -351,6 +365,15 @@ function refuseUnreadableInputs(args) {
|
|
|
351
365
|
const unparseableInputError = checkInputsParse(args, (path) => readFileSync(path, "utf8"));
|
|
352
366
|
if (unparseableInputError)
|
|
353
367
|
exitUsage(unparseableInputError);
|
|
368
|
+
// A corpus or workflow path that is not the kind its flag reads, or may not be read, cannot be read at all.
|
|
369
|
+
const unreadablePathError = checkInputPaths(args);
|
|
370
|
+
if (unreadablePathError)
|
|
371
|
+
exitUsage(unreadablePathError);
|
|
372
|
+
// Parsing is not reading: a report that parses but is not in the shape its reader expects would
|
|
373
|
+
// be read as nothing, or read until it threw, so it is refused here with where its shape is wrong.
|
|
374
|
+
const misshapenInputError = checkInputShapes(jsonInputsOf(args, existsSync), (path) => readFileSync(path, "utf8"));
|
|
375
|
+
if (misshapenInputError)
|
|
376
|
+
exitUsage(misshapenInputError);
|
|
354
377
|
// The FEATURE-CORPUS integrity checkpoint. The feature corpus is an
|
|
355
378
|
// input too — the ledger's DEBIT side — and it was read by a hand-rolled TAG-LINE SCAN that
|
|
356
379
|
// never consulted a parser. So a malformed tag line simply stopped being a tag line and its
|
|
@@ -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,GAEzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,
|
|
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,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,eAAe,EACf,gBAAgB,EACh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QAAc;IAEd,OAAO;QACL,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC;QAC1B,MAAM;QACN,QAAQ;QACR,SAAS,EAAE,gBAAgB,CAAC;YAC1B,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;YAC7B,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;SAClF,CAAC;QACF,oFAAoF;QACpF,+CAA+C;QAC/C,6FAA6F;QAC7F,oFAAoF;QACpF,2CAA2C;QAC3C,IAAI,EAAE,iBAAiB,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"}
|
|
@@ -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,EAA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Reconciliation } from "@3f-consulting/spec-controller-core
|
|
|
19
19
|
* The reconciler's resolved input paths — the CLI options threaded to the readers.
|
|
20
20
|
* Every path is optional; a missing result file is tolerated (its evidence is
|
|
21
21
|
* simply absent). `packageJson` is the EXTERNALLY-SPECIFIED package.json the static
|
|
22
|
-
* static-check reader reads `exists` from (the --package-json seam
|
|
22
|
+
* static-check reader reads `exists` from (the --package-json seam):
|
|
23
23
|
* default the tool's own cwd `package.json`; set it to reconcile ANOTHER repo's
|
|
24
24
|
* static checks — required to render the historical watermelon correctly.
|
|
25
25
|
*/
|
|
@@ -30,7 +30,7 @@ export interface ReconcileOptions {
|
|
|
30
30
|
ci?: string;
|
|
31
31
|
packageJson?: string;
|
|
32
32
|
/**
|
|
33
|
-
* The CI RUN'S OWN RECORD of what each of its steps did
|
|
33
|
+
* The CI RUN'S OWN RECORD of what each of its steps did — the credit
|
|
34
34
|
* side of every CONVERTED fitness check, written by the consumer's own pipeline and by neither
|
|
35
35
|
* party to this reconciliation.
|
|
36
36
|
*
|
|
@@ -43,8 +43,12 @@ export interface ReconcileOptions {
|
|
|
43
43
|
*/
|
|
44
44
|
ciSteps?: string;
|
|
45
45
|
}
|
|
46
|
+
/** Where the CI workflows are read from when `--ci` is not given. */
|
|
47
|
+
export declare const DEFAULT_CI_PATH = ".github/workflows";
|
|
48
|
+
/** The target's manifest when `--package-json` is not given: the one in the directory the run is in. */
|
|
49
|
+
export declare const DEFAULT_PACKAGE_JSON = "package.json";
|
|
46
50
|
/**
|
|
47
|
-
* The feature corpus's INTEGRITY CHECKPOINT
|
|
51
|
+
* The feature corpus's INTEGRITY CHECKPOINT — validate every discovered
|
|
48
52
|
* `.feature` with the REAL Gherkin parser and report the files it cannot read.
|
|
49
53
|
*
|
|
50
54
|
* The feature corpus is the ledger's DEBIT side, and it used to be read by a tag-line scan that
|
|
@@ -52,7 +56,7 @@ export interface ReconcileOptions {
|
|
|
52
56
|
* spec could read BALANCED. A file the parser rejects is one cucumber would refuse to run: the
|
|
53
57
|
* CLI halts on it (exit 2) rather than reconciling a corpus that is a fiction.
|
|
54
58
|
*
|
|
55
|
-
* THIS IS NOW THE CATCH SITE, NOT THE CALL SITE
|
|
59
|
+
* THIS IS NOW THE CATCH SITE, NOT THE CALL SITE. The validation moved
|
|
56
60
|
* into `discoverFeatures`, which REFUSES an unreadable corpus rather than returning one, so every
|
|
57
61
|
* corpus reader inherits the refusal instead of each restating it. What is left here is the
|
|
58
62
|
* translation back into the list this CLI edge already prints — same files, same order, same
|
|
@@ -60,9 +64,22 @@ export interface ReconcileOptions {
|
|
|
60
64
|
* refusal is not ours to interpret and rethrows.
|
|
61
65
|
*/
|
|
62
66
|
export declare function featureCorpusParseErrors(featuresDir: string | undefined): GherkinParseError[];
|
|
67
|
+
/** A read of the feature corpus or the CI workflows that the operating system refused. */
|
|
68
|
+
export interface InputReadFault {
|
|
69
|
+
readonly path: string;
|
|
70
|
+
readonly reason: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The read of the feature corpus that failed, taken by the same discovery the reconcile uses, or
|
|
74
|
+
* null when it reads. A file the Gherkin parser rejects is not this fault: it is reported by
|
|
75
|
+
* `featureCorpusParseErrors`, after this.
|
|
76
|
+
*/
|
|
77
|
+
export declare function corpusReadFault(featuresDir: string | undefined): InputReadFault | null;
|
|
78
|
+
/** The read of a CI workflow that failed, over the same files the reconcile reads, or null when they all read. */
|
|
79
|
+
export declare function ciReadFault(ciPath: string | undefined): InputReadFault | null;
|
|
63
80
|
/**
|
|
64
81
|
* Read the target's `feature-code → slug` map over the same `discoverFeatures` corpus
|
|
65
|
-
*
|
|
82
|
+
* — each coded feature file's `@<FFF>` header (`featureCode`)
|
|
66
83
|
* mapped to its filename `slug`, the full feature name. This is the mapping
|
|
67
84
|
* `scenariosFromFeatures` discards (it keeps only the parsed scenarios). A sibling read to
|
|
68
85
|
* the balance, threaded to `renderMarkdown` (via `writeOutputs`) as the 5th sibling arg
|
|
@@ -70,7 +87,7 @@ export declare function featureCorpusParseErrors(featuresDir: string | undefined
|
|
|
70
87
|
* Uncoded files (`featureCode === null`) are omitted, so the by-feature emitter falls
|
|
71
88
|
* back to the bare `FFF` for any id whose code no file registers. When two files carry one
|
|
72
89
|
* code the map keeps the last, and that run lists `duplicate-feature-code` under Scenario code
|
|
73
|
-
* errors and fails
|
|
90
|
+
* errors and fails, so a report whose map is ambiguous never passes.
|
|
74
91
|
*/
|
|
75
92
|
export declare function readFeatureNames(featuresDir?: string): Map<string, string>;
|
|
76
93
|
/**
|
|
@@ -78,8 +95,8 @@ export declare function readFeatureNames(featuresDir?: string): Map<string, stri
|
|
|
78
95
|
* `discoverFeatures` corpus `scenariosFromFeatures` reads): sum the raw @SCN
|
|
79
96
|
* occurrences (`countScnOccurrences`) and the scenario count
|
|
80
97
|
* (`parseScenarios(...).length`) across every file, and build the `EvidenceObligations`
|
|
81
|
-
* sibling
|
|
82
|
-
*
|
|
98
|
+
* sibling. Also collects the UNTAGGED scenarios
|
|
99
|
+
* — `parseUntaggedScenarios` per file, each paired with its feature-file
|
|
83
100
|
* locator, sorted by (feature, scenario). Read alongside the balance in `main()` and
|
|
84
101
|
* threaded to the renderers via `writeOutputs`; `runReconcile` stays unchanged.
|
|
85
102
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestQualityChecks.d.ts","sourceRoot":"","sources":["../../src/ingest/ingestQualityChecks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAaH,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,qCAAqC,CAAC;AAkB7C,OAAO,KAAK,EAIV,sBAAsB,EACvB,MAAM,qCAAqC,CAAC;AA4B7C;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QA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ED,kHAAkH;AAClH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,IAAI,CAU7E;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAM1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAuB9E;AAyCD,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,sBAAsB,CAoE3E"}
|
|
@@ -22,11 +22,11 @@ import { DEFAULT_DEFERRAL_TAGS } from "../deferralTags.js";
|
|
|
22
22
|
import { evidenceObligations, } from "@3f-consulting/spec-controller-core";
|
|
23
23
|
import { parseVitestEvidenceObservations, } from "@3f-consulting/spec-controller-core";
|
|
24
24
|
import { parseCucumberEvidenceObservations, } from "@3f-consulting/spec-controller-core";
|
|
25
|
-
// THE WHOLE COMPOSITION, THROUGH THE PUBLIC BARREL AND NOTHING ELSE
|
|
26
|
-
// in the tarball, and
|
|
25
|
+
// THE WHOLE COMPOSITION, THROUGH THE PUBLIC BARREL AND NOTHING ELSE. This module travels
|
|
26
|
+
// in the tarball, and it once reached nine core symbols through the UNPUBLISHED
|
|
27
27
|
// `./internal` subpath to assemble the reconciliation itself — which is why an installed
|
|
28
28
|
// `spec-controller balance --help` threw ERR_PACKAGE_PATH_NOT_EXPORTED while every gate in this
|
|
29
|
-
// workspace stayed green. The nine are still internal
|
|
29
|
+
// workspace stayed green. The nine are still internal; what moved is
|
|
30
30
|
// their CALLER. What is left here is the reads: this edge opens the files and hands the bytes over.
|
|
31
31
|
import { evidenceReconciliationFromSources } from "@3f-consulting/spec-controller-core";
|
|
32
32
|
import { resolveTargetRoot } from "../run-management/resolveRunInputs.js";
|
|
@@ -40,7 +40,7 @@ import { resolveTargetRoot } from "../run-management/resolveRunInputs.js";
|
|
|
40
40
|
const VITEST_QUALITY_CHECK = "unit";
|
|
41
41
|
const CUCUMBER_QUALITY_CHECK = "integration";
|
|
42
42
|
/**
|
|
43
|
-
* THIS TOOL, RUN TO RECONCILE
|
|
43
|
+
* THIS TOOL, RUN TO RECONCILE — the invocation whose step is the
|
|
44
44
|
* reconciler rather than one of the reconciled rows, SET at the CLI edge and injected into the
|
|
45
45
|
* core like the prefixes above and the workflow names below.
|
|
46
46
|
*
|
|
@@ -54,6 +54,10 @@ const CUCUMBER_QUALITY_CHECK = "integration";
|
|
|
54
54
|
* (`parse/commandRuns`), so this names the reconciliation and nothing else the tool can do.
|
|
55
55
|
*/
|
|
56
56
|
const RECONCILER_INVOCATION = "spec-controller balance";
|
|
57
|
+
/** Where the CI workflows are read from when `--ci` is not given. */
|
|
58
|
+
export const DEFAULT_CI_PATH = ".github/workflows";
|
|
59
|
+
/** The target's manifest when `--package-json` is not given: the one in the directory the run is in. */
|
|
60
|
+
export const DEFAULT_PACKAGE_JSON = "package.json";
|
|
57
61
|
/** Read + JSON-parse a file if present, else return undefined. */
|
|
58
62
|
function readJsonIfPresent(path) {
|
|
59
63
|
if (!path || !existsSync(path))
|
|
@@ -61,13 +65,13 @@ function readJsonIfPresent(path) {
|
|
|
61
65
|
return JSON.parse(readFileSync(path, "utf8"));
|
|
62
66
|
}
|
|
63
67
|
/**
|
|
64
|
-
* THE CORPUS `balance` READS — the shared discovery, with an ABSENT directory read as NO CORPUS
|
|
65
|
-
*
|
|
68
|
+
* THE CORPUS `balance` READS — the shared discovery, with an ABSENT directory read as NO CORPUS.
|
|
69
|
+
* The single place this command opts in.
|
|
66
70
|
*
|
|
67
71
|
* `new-client` is a supported adoption state, not a degraded one, and most targets have no
|
|
68
72
|
* `features/` directory at all — so an absent DEFAULT corpus is the target's honest shape and
|
|
69
73
|
* `balance` reports on it. Left to escape it was a raw `ENOENT` landing on Node's default exit 1,
|
|
70
|
-
* the OUT-OF-BALANCE code, which is exactly the collision
|
|
74
|
+
* the OUT-OF-BALANCE code, which is exactly the collision the unreadable-input guards closed on every
|
|
71
75
|
* other input, alive on the one path each new consumer is guaranteed to take.
|
|
72
76
|
*
|
|
73
77
|
* ONE HELPER, NOT FIVE CATCHES, and that is the whole reason it exists: five readers each doing
|
|
@@ -76,12 +80,12 @@ function readJsonIfPresent(path) {
|
|
|
76
80
|
* also why `discoverFeatures` is not the place to be tolerant — see its own note, and
|
|
77
81
|
* `MissingFeatureCorpusError`'s.
|
|
78
82
|
*
|
|
79
|
-
* IT IS `[]`, NOT A VERDICT. Zero rows is what
|
|
83
|
+
* IT IS `[]`, NOT A VERDICT. Zero rows is what the verdict reads as NOTHING TO RECONCILE, and a
|
|
80
84
|
* corpus-less target that still has uncited credits keeps its suspense row and its exit 1
|
|
81
|
-
*
|
|
85
|
+
* — this reader says what it found, never what the run means.
|
|
82
86
|
*
|
|
83
87
|
* A supplied-but-absent `--features` never arrives here: `checkInputsExist` refuses it at the CLI
|
|
84
|
-
* edge, exit 2
|
|
88
|
+
* edge, exit 2. The precedent is `ciSourcePathsOf`, which already answers an absent
|
|
85
89
|
* DEFAULT `.github/workflows` with `[]` for the same reason — the default finding nothing is a fact
|
|
86
90
|
* about the target, not a mistake by its author.
|
|
87
91
|
*/
|
|
@@ -99,7 +103,7 @@ function balanceCorpus(featuresDir) {
|
|
|
99
103
|
* The discovered feature corpus's SOURCES — read once so the two readings a citing run needs (the
|
|
100
104
|
* obligations, and the corpus hop's `check tag → @SCN`) are taken from the same bytes. Two
|
|
101
105
|
* discoveries could disagree about the corpus, and a citation resolved against a corpus the ledger
|
|
102
|
-
* was not built from is exactly the phantom-row fault
|
|
106
|
+
* was not built from is exactly the phantom-row fault.
|
|
103
107
|
*/
|
|
104
108
|
function featureSources(featuresDir) {
|
|
105
109
|
return balanceCorpus(featuresDir).map((f) => readFileSync(f.path, "utf8"));
|
|
@@ -108,7 +112,7 @@ function scenariosFromFeatures(featuresDir, deferralTags = DEFAULT_DEFERRAL_TAGS
|
|
|
108
112
|
return featureSources(featuresDir).flatMap((source) => parseScenarios(source, deferralTags));
|
|
109
113
|
}
|
|
110
114
|
/**
|
|
111
|
-
* The feature corpus's UNTAGGED half
|
|
115
|
+
* The feature corpus's UNTAGGED half — the scenarios `parseScenarios`
|
|
112
116
|
* discards because they carry no `@SCN`. They are REAL scenarios: cucumber runs them, so each
|
|
113
117
|
* owns a real Evidence Obligation — but the obligation has no code for an Evidence Observation to
|
|
114
118
|
* link to, so it can never be discharged. `reconcile` gives each its own out-of-balance row
|
|
@@ -123,7 +127,7 @@ function untaggedScenariosFromFeatures(featuresDir) {
|
|
|
123
127
|
return balanceCorpus(featuresDir).flatMap((f) => parseUntaggedScenarios(readFileSync(f.path, "utf8")).map((scenario) => `${f.slug}.feature : ${scenario}`));
|
|
124
128
|
}
|
|
125
129
|
/**
|
|
126
|
-
* The feature corpus's INTEGRITY CHECKPOINT
|
|
130
|
+
* The feature corpus's INTEGRITY CHECKPOINT — validate every discovered
|
|
127
131
|
* `.feature` with the REAL Gherkin parser and report the files it cannot read.
|
|
128
132
|
*
|
|
129
133
|
* The feature corpus is the ledger's DEBIT side, and it used to be read by a tag-line scan that
|
|
@@ -131,7 +135,7 @@ function untaggedScenariosFromFeatures(featuresDir) {
|
|
|
131
135
|
* spec could read BALANCED. A file the parser rejects is one cucumber would refuse to run: the
|
|
132
136
|
* CLI halts on it (exit 2) rather than reconciling a corpus that is a fiction.
|
|
133
137
|
*
|
|
134
|
-
* THIS IS NOW THE CATCH SITE, NOT THE CALL SITE
|
|
138
|
+
* THIS IS NOW THE CATCH SITE, NOT THE CALL SITE. The validation moved
|
|
135
139
|
* into `discoverFeatures`, which REFUSES an unreadable corpus rather than returning one, so every
|
|
136
140
|
* corpus reader inherits the refusal instead of each restating it. What is left here is the
|
|
137
141
|
* translation back into the list this CLI edge already prints — same files, same order, same
|
|
@@ -149,9 +153,65 @@ export function featureCorpusParseErrors(featuresDir) {
|
|
|
149
153
|
throw err;
|
|
150
154
|
}
|
|
151
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* A read the operating system refused, as a fault naming the path; null for anything else. Every
|
|
158
|
+
* refusal is the same fault to the run, whichever it is: a file where a directory is read or the
|
|
159
|
+
* reverse, a path it is not permitted to read, or any other reason the OS gives.
|
|
160
|
+
*/
|
|
161
|
+
function readFaultOf(err, path) {
|
|
162
|
+
const errno = err;
|
|
163
|
+
if (!(err instanceof Error) || typeof errno.code !== "string")
|
|
164
|
+
return null;
|
|
165
|
+
return { path: errno.path ?? path, reason: err.message };
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The read of the feature corpus that failed, taken by the same discovery the reconcile uses, or
|
|
169
|
+
* null when it reads. A file the Gherkin parser rejects is not this fault: it is reported by
|
|
170
|
+
* `featureCorpusParseErrors`, after this.
|
|
171
|
+
*/
|
|
172
|
+
export function corpusReadFault(featuresDir) {
|
|
173
|
+
try {
|
|
174
|
+
balanceCorpus(featuresDir);
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
if (err instanceof UnreadableFeatureCorpusError)
|
|
179
|
+
return null;
|
|
180
|
+
const fault = readFaultOf(err, featuresDir ?? "features");
|
|
181
|
+
if (fault === null)
|
|
182
|
+
throw err;
|
|
183
|
+
return fault;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/** The read of a CI workflow that failed, over the same files the reconcile reads, or null when they all read. */
|
|
187
|
+
export function ciReadFault(ciPath) {
|
|
188
|
+
const path = ciPath ?? DEFAULT_CI_PATH;
|
|
189
|
+
try {
|
|
190
|
+
for (const source of ciSourcePathsOf(path))
|
|
191
|
+
readCiSource(source);
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
catch (err) {
|
|
195
|
+
const fault = readFaultOf(err, path);
|
|
196
|
+
if (fault === null)
|
|
197
|
+
throw err;
|
|
198
|
+
return fault;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** One workflow file's read, whose failure carries the file's path, which reading a directory gives none of. */
|
|
202
|
+
function readCiSource(source) {
|
|
203
|
+
try {
|
|
204
|
+
readFileSync(source, "utf8");
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
const errno = err;
|
|
208
|
+
errno.path ??= source;
|
|
209
|
+
throw err;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
152
212
|
/**
|
|
153
213
|
* Read the target's `feature-code → slug` map over the same `discoverFeatures` corpus
|
|
154
|
-
*
|
|
214
|
+
* — each coded feature file's `@<FFF>` header (`featureCode`)
|
|
155
215
|
* mapped to its filename `slug`, the full feature name. This is the mapping
|
|
156
216
|
* `scenariosFromFeatures` discards (it keeps only the parsed scenarios). A sibling read to
|
|
157
217
|
* the balance, threaded to `renderMarkdown` (via `writeOutputs`) as the 5th sibling arg
|
|
@@ -159,7 +219,7 @@ export function featureCorpusParseErrors(featuresDir) {
|
|
|
159
219
|
* Uncoded files (`featureCode === null`) are omitted, so the by-feature emitter falls
|
|
160
220
|
* back to the bare `FFF` for any id whose code no file registers. When two files carry one
|
|
161
221
|
* code the map keeps the last, and that run lists `duplicate-feature-code` under Scenario code
|
|
162
|
-
* errors and fails
|
|
222
|
+
* errors and fails, so a report whose map is ambiguous never passes.
|
|
163
223
|
*/
|
|
164
224
|
export function readFeatureNames(featuresDir) {
|
|
165
225
|
const map = new Map();
|
|
@@ -174,8 +234,8 @@ export function readFeatureNames(featuresDir) {
|
|
|
174
234
|
* `discoverFeatures` corpus `scenariosFromFeatures` reads): sum the raw @SCN
|
|
175
235
|
* occurrences (`countScnOccurrences`) and the scenario count
|
|
176
236
|
* (`parseScenarios(...).length`) across every file, and build the `EvidenceObligations`
|
|
177
|
-
* sibling
|
|
178
|
-
*
|
|
237
|
+
* sibling. Also collects the UNTAGGED scenarios
|
|
238
|
+
* — `parseUntaggedScenarios` per file, each paired with its feature-file
|
|
179
239
|
* locator, sorted by (feature, scenario). Read alongside the balance in `main()` and
|
|
180
240
|
* threaded to the renderers via `writeOutputs`; `runReconcile` stays unchanged.
|
|
181
241
|
*/
|
|
@@ -203,10 +263,10 @@ export function readEvidenceObligations(features) {
|
|
|
203
263
|
}
|
|
204
264
|
/**
|
|
205
265
|
* Parse the target's RUNTIME observations ONCE — the tag-derived, per-tier observation set
|
|
206
|
-
*
|
|
266
|
+
* fed to BOTH the reconciler and the runtime census, so the
|
|
207
267
|
* two can never disagree. Each source's FALLBACK quality-check is set at the CLI edge
|
|
208
268
|
* (vitest⇒unit, cucumber⇒integration); the parsers DERIVE the level from the cited scenario's tier
|
|
209
|
-
* tag
|
|
269
|
+
* tag, using the fallback only for an untagged scenario. A missing report
|
|
210
270
|
* contributes nothing. Root-relative so a phantom-scenario row's where-to-fix stays portable.
|
|
211
271
|
*/
|
|
212
272
|
function parseRuntimeObservations(opts, root) {
|
|
@@ -221,39 +281,39 @@ function parseRuntimeObservations(opts, root) {
|
|
|
221
281
|
}
|
|
222
282
|
export function runReconcile(opts) {
|
|
223
283
|
// Read the target's package.json ONCE — its `specController.*` config supplies the deferral-tag
|
|
224
|
-
// extension
|
|
284
|
+
// extension and the configured fitness rows, and its `scripts` back the `exists`
|
|
225
285
|
// read. The disk read stays at this impure edge; the engine takes the resolved values as
|
|
226
286
|
// injected params, staying pure.
|
|
227
|
-
const pkgPath = opts.packageJson ??
|
|
287
|
+
const pkgPath = opts.packageJson ?? DEFAULT_PACKAGE_JSON;
|
|
228
288
|
const packageJson = readJsonIfPresent(pkgPath) ?? {};
|
|
229
289
|
// The TARGET repo root — the credit locators are made relative to it, so a phantom-scenario row's
|
|
230
290
|
// where-to-fix (ruling Q5) stays portable in a banked artefact. Resolved ONCE here and threaded,
|
|
231
291
|
// which is also what keeps `execFileSync` and `process.cwd()` out of the engine.
|
|
232
292
|
const root = resolveTargetRoot({ features: opts.features });
|
|
233
293
|
// `--ci` names a workflow FILE or a DIRECTORY of them, and defaults to the directory
|
|
234
|
-
//
|
|
294
|
+
// A pipeline split across files enforces its checks just as one
|
|
235
295
|
// file does, and reading only ci.yml both invents watermelons for named checks enforced
|
|
236
296
|
// elsewhere and drops uncited ones off the books entirely. Path semantics carry the
|
|
237
297
|
// file-vs-directory distinction, so one flag stays one flag and an explicit file is still
|
|
238
|
-
// a narrowing
|
|
239
|
-
const ciPath = opts.ci ??
|
|
240
|
-
// RESOLVED ONCE, READ TWICE
|
|
298
|
+
// a narrowing.
|
|
299
|
+
const ciPath = opts.ci ?? DEFAULT_CI_PATH;
|
|
300
|
+
// RESOLVED ONCE, READ TWICE. The engine takes anonymous source strings and holds
|
|
241
301
|
// no filesystem, so the mapping from a step's source index back to the workflow file it came
|
|
242
302
|
// from is made HERE, where the paths are already in hand — `ciSourcePaths.ts` is explicit that
|
|
243
303
|
// keeping the core that way is the point. Resolving the list twice would be two chances for the
|
|
244
304
|
// bytes and the names to fall out of the order they are paired by.
|
|
245
305
|
const ciPaths = ciSourcePathsOf(ciPath);
|
|
246
306
|
// The corpus, discovered and read ONCE: its bytes, and — paired by index — which file each came
|
|
247
|
-
// from and the header code it carries, for the scenario code errors
|
|
307
|
+
// from and the header code it carries, for the scenario code errors.
|
|
248
308
|
const corpusFiles = balanceCorpus(opts.features).map((f) => ({
|
|
249
309
|
slug: f.slug,
|
|
250
310
|
featureCode: f.featureCode,
|
|
251
311
|
source: readFileSync(f.path, "utf8"),
|
|
252
312
|
}));
|
|
253
313
|
return evidenceReconciliationFromSources({
|
|
254
|
-
// The corpus's bytes, read ONCE at this impure edge
|
|
314
|
+
// The corpus's bytes, read ONCE at this impure edge. The engine composes the three
|
|
255
315
|
// readings a citing run needs from this one array, so they cannot be assembled from two
|
|
256
|
-
// discoveries that disagree about the corpus
|
|
316
|
+
// discoveries that disagree about the corpus.
|
|
257
317
|
featureSources: corpusFiles.map((f) => f.source),
|
|
258
318
|
featureFiles: corpusFiles.map(({ slug, featureCode }) => ({ slug, featureCode })),
|
|
259
319
|
// The untagged half by its `<feature> : <scenario>` locator — parsed here because the locator
|
|
@@ -267,24 +327,24 @@ export function runReconcile(opts) {
|
|
|
267
327
|
// in is the caller's `--ci`, not the consumer's subject, so it is not part of what they write.
|
|
268
328
|
ciSourceNames: ciPaths.map((path) => basename(path)),
|
|
269
329
|
// The CONVERTED checks' credit stream, read at this edge like every other report. Absent it is
|
|
270
|
-
// undefined rather than empty, and that distinction reaches the reader
|
|
330
|
+
// undefined rather than empty, and that distinction reaches the reader: "no
|
|
271
331
|
// record" is a run nobody recorded, "a record holding nothing" is a run that recorded none of
|
|
272
332
|
// these steps, and those are opposite facts.
|
|
273
|
-
// STRUCTURALLY, NOT BY NAME: this module travels in the tarball and reaches core through the PUBLIC barrel alone
|
|
333
|
+
// STRUCTURALLY, NOT BY NAME: this module travels in the tarball and reaches core through the PUBLIC barrel alone, and
|
|
274
334
|
// `CiStepRecord` is not on it. The shape is the document's, which is the consumer's, so what is
|
|
275
335
|
// written here is what the file holds rather than a contract owed to anyone.
|
|
276
336
|
ciStepRecord: readJsonIfPresent(opts.ciSteps),
|
|
277
337
|
runtimeObservations: parseRuntimeObservations(opts, root),
|
|
278
338
|
// The two things the engine's resolvers cannot hold, and each for its own reason: the
|
|
279
339
|
// starter deferral set is the application layer's own policy, and how this tool is invoked to
|
|
280
|
-
// reconcile is a fact about this product's command line. THE PREFIX SET USED TO SIT HERE AND IS GONE
|
|
340
|
+
// reconcile is a fact about this product's command line. THE PREFIX SET USED TO SIT HERE AND IS GONE: the
|
|
281
341
|
// engine no longer decides a check's membership by its name, so there is no convention left
|
|
282
342
|
// for this edge to own.
|
|
283
343
|
deferralTags: DEFAULT_DEFERRAL_TAGS,
|
|
284
344
|
reconcilerInvocation: RECONCILER_INVOCATION,
|
|
285
345
|
});
|
|
286
346
|
}
|
|
287
|
-
// The static-check kind-counts are no longer read as a parallel census
|
|
347
|
+
// The static-check kind-counts are no longer read as a parallel census:
|
|
288
348
|
// the former `readStaticEvidenceObservationCounts` re-built the static check observations and
|
|
289
349
|
// re-derived the running / uncited split from a second read of the CI config. That counting now
|
|
290
350
|
// FOLDS onto the Ledger the reconciler already produced (`staticObservationTally`, an internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestQualityChecks.js","sourceRoot":"","sources":["../../src/ingest/ingestQualityChecks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAA0B,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,yBAAyB,EACzB,4BAA4B,GAE7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,mBAAmB,GAGpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,+BAA+B,GAEhC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,iCAAiC,GAElC,MAAM,qCAAqC,CAAC;AAC7C,
|
|
1
|
+
{"version":3,"file":"ingestQualityChecks.js","sourceRoot":"","sources":["../../src/ingest/ingestQualityChecks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAA0B,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7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EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5D,6FAA6F;QAC7F,2FAA2F;QAC3F,6FAA6F;QAC7F,+FAA+F;QAC/F,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpD,+FAA+F;QAC/F,4EAA4E;QAC5E,8FAA8F;QAC9F,6CAA6C;QAC7C,sHAAsH;QACtH,gGAAgG;QAChG,6EAA6E;QAC7E,YAAY,EAAE,iBAAiB,CAC7B,IAAI,CAAC,OAAO,CACb;QACD,mBAAmB,EAAE,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC;QACzD,sFAAsF;QACtF,8FAA8F;QAC9F,0GAA0G;QAC1G,4FAA4F;QAC5F,wBAAwB;QACxB,YAAY,EAAE,qBAAqB;QACnC,oBAAoB,EAAE,qBAAqB;KAC5C,CAAC,CAAC;AACL,CAAC;AAED,wEAAwE;AACxE,8FAA8F;AAC9F,gGAAgG;AAChG,+FAA+F;AAC/F,oGAAoG;AACpG,yFAAyF"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* and reads each file's header code into DiscoveredFeature records (split out of the old
|
|
4
4
|
* spec/featureCodes.ts). The pure header parser (extractFeatureCode) lives here with its sole
|
|
5
5
|
* consumer; the `scnId → feature-code` grammar helper is engine-side (packages/core/src/lib/
|
|
6
|
-
* featureCode.ts); the duplicate-code lint is engine-side too
|
|
6
|
+
* featureCode.ts); the duplicate-code lint is engine-side too, in
|
|
7
7
|
* parse/scenarioCodeErrors.ts, and no longer a private check under tests/checks/.
|
|
8
8
|
*
|
|
9
|
-
* NO PER-FILE LIST OF SCENARIO CODES
|
|
9
|
+
* NO PER-FILE LIST OF SCENARIO CODES. One used to ride here, read by a copy of the
|
|
10
10
|
* @SCN grammar of its own, and nothing but its own test read it; a scenario's code is read by the
|
|
11
11
|
* engine's scenario walk, which is the reading the ledger's accounts are minted from.
|
|
12
12
|
*
|
|
@@ -28,7 +28,7 @@ export interface DiscoveredFeature {
|
|
|
28
28
|
export declare function extractFeatureCode(source: string): string | null;
|
|
29
29
|
/**
|
|
30
30
|
* Discover every feature file on disk and its header code — REFUSING a corpus the Gherkin
|
|
31
|
-
* parser rejects
|
|
31
|
+
* parser rejects.
|
|
32
32
|
*
|
|
33
33
|
* The refusal lives HERE, in the one reader every corpus consumer already goes through, so a
|
|
34
34
|
* consumer INHERITS it rather than restating it. It is not a second parser: it is the existing
|
|
@@ -36,7 +36,7 @@ export declare function extractFeatureCode(source: string): string | null;
|
|
|
36
36
|
* balance CLI's edge. One answer to "what is a feature file".
|
|
37
37
|
*
|
|
38
38
|
* WHY THE WHOLE CORPUS, NOT THE FIRST BAD FILE. `featureCorpusParseErrors` reports every
|
|
39
|
-
* unreadable file and the balance CLI prints them all
|
|
39
|
+
* unreadable file and the balance CLI prints them all. Refusing at the first
|
|
40
40
|
* failure would silently narrow that message, so every file is parsed and the refusal is raised
|
|
41
41
|
* once, carrying the lot in discovery order.
|
|
42
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestScenarios.d.ts","sourceRoot":"","sources":["../../src/ingest/ingestScenarios.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAeH,iFAAiF;AACjF,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKhE;
|
|
1
|
+
{"version":3,"file":"ingestScenarios.d.ts","sourceRoot":"","sources":["../../src/ingest/ingestScenarios.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAeH,iFAAiF;AACjF,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKhE;AA2ED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAsB,GAAG,iBAAiB,EAAE,CAiBjF"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* and reads each file's header code into DiscoveredFeature records (split out of the old
|
|
4
4
|
* spec/featureCodes.ts). The pure header parser (extractFeatureCode) lives here with its sole
|
|
5
5
|
* consumer; the `scnId → feature-code` grammar helper is engine-side (packages/core/src/lib/
|
|
6
|
-
* featureCode.ts); the duplicate-code lint is engine-side too
|
|
6
|
+
* featureCode.ts); the duplicate-code lint is engine-side too, in
|
|
7
7
|
* parse/scenarioCodeErrors.ts, and no longer a private check under tests/checks/.
|
|
8
8
|
*
|
|
9
|
-
* NO PER-FILE LIST OF SCENARIO CODES
|
|
9
|
+
* NO PER-FILE LIST OF SCENARIO CODES. One used to ride here, read by a copy of the
|
|
10
10
|
* @SCN grammar of its own, and nothing but its own test read it; a scenario's code is read by the
|
|
11
11
|
* engine's scenario walk, which is the reading the ledger's accounts are minted from.
|
|
12
12
|
*
|
|
@@ -62,8 +62,7 @@ function featuresDir() {
|
|
|
62
62
|
return join(process.cwd(), "features");
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* List the corpus directory, REFUSING an absent one by name rather than by `ENOENT
|
|
66
|
-
* 3F-3345).
|
|
65
|
+
* List the corpus directory, REFUSING an absent one by name rather than by `ENOENT`.
|
|
67
66
|
*
|
|
68
67
|
* Absence stays a REFUSAL AT THE READER — what changed is that it is typed, so a caller can decide.
|
|
69
68
|
* `balance` opts in to reporting on a target that has no corpus (most targets have no `features/`
|
|
@@ -75,7 +74,7 @@ function featuresDir() {
|
|
|
75
74
|
* a different fault and is not ours to reinterpret — it rethrows.
|
|
76
75
|
*
|
|
77
76
|
* A SUPPLIED `--features` never reaches here absent: `checkInputsExist` refuses it at the CLI edge
|
|
78
|
-
* with exit 2
|
|
77
|
+
* with exit 2. Supplied-but-absent is the operator mistyping; absent-by-default is
|
|
79
78
|
* the target's honest shape.
|
|
80
79
|
*/
|
|
81
80
|
function corpusFileNames(dir) {
|
|
@@ -88,9 +87,23 @@ function corpusFileNames(dir) {
|
|
|
88
87
|
throw err;
|
|
89
88
|
}
|
|
90
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* A feature file's text. A read the operating system refuses keeps its error, and gains the file's
|
|
92
|
+
* path when it has none: reading a directory fails with no path at all.
|
|
93
|
+
*/
|
|
94
|
+
function readFeatureSource(path) {
|
|
95
|
+
try {
|
|
96
|
+
return readFileSync(path, "utf8");
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
const errno = err;
|
|
100
|
+
errno.path ??= path;
|
|
101
|
+
throw err;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
91
104
|
/**
|
|
92
105
|
* Discover every feature file on disk and its header code — REFUSING a corpus the Gherkin
|
|
93
|
-
* parser rejects
|
|
106
|
+
* parser rejects.
|
|
94
107
|
*
|
|
95
108
|
* The refusal lives HERE, in the one reader every corpus consumer already goes through, so a
|
|
96
109
|
* consumer INHERITS it rather than restating it. It is not a second parser: it is the existing
|
|
@@ -98,7 +111,7 @@ function corpusFileNames(dir) {
|
|
|
98
111
|
* balance CLI's edge. One answer to "what is a feature file".
|
|
99
112
|
*
|
|
100
113
|
* WHY THE WHOLE CORPUS, NOT THE FIRST BAD FILE. `featureCorpusParseErrors` reports every
|
|
101
|
-
* unreadable file and the balance CLI prints them all
|
|
114
|
+
* unreadable file and the balance CLI prints them all. Refusing at the first
|
|
102
115
|
* failure would silently narrow that message, so every file is parsed and the refusal is raised
|
|
103
116
|
* once, carrying the lot in discovery order.
|
|
104
117
|
*
|
|
@@ -111,7 +124,7 @@ export function discoverFeatures(dir = featuresDir()) {
|
|
|
111
124
|
.sort()
|
|
112
125
|
.map((name) => {
|
|
113
126
|
const path = join(dir, name);
|
|
114
|
-
return { name, path, source:
|
|
127
|
+
return { name, path, source: readFeatureSource(path) };
|
|
115
128
|
});
|
|
116
129
|
const parseErrors = files.flatMap(({ path, source }) => parseErrorsIn(path, source));
|
|
117
130
|
if (parseErrors.length > 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestScenarios.js","sourceRoot":"","sources":["../../src/ingest/ingestScenarios.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EAAW,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,8DAA8D;AAC9D,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAWvC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAClF,IAAI,WAAW,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACjC,OAAO,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC;AACxE,CAAC;AAED,qFAAqF;AACrF,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,aAAa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AG,CAAC;SAC/B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;SAC3C,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;IAEL,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACrF,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,4BAA4B,CAAC,WAAW,CAAC,CAAC;IAEhF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5C,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;QACpC,IAAI;QACJ,WAAW,EAAE,kBAAkB,CAAC,MAAM,CAAC;KACxC,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape each JSON input `balance` reads must have before its reader is handed it: the fields
|
|
3
|
+
* that reader goes on to read, and nothing more. A report is its producer's document, so a field
|
|
4
|
+
* the reader never touches is never checked, and a well-formed empty report is still a report.
|
|
5
|
+
*
|
|
6
|
+
* A document that is not this shape is an input the tool cannot read. Read anyway, it either
|
|
7
|
+
* throws part-way or is read as nothing and reaches a verdict about evidence it discarded, and
|
|
8
|
+
* both of those end on the out-of-balance code.
|
|
9
|
+
*/
|
|
10
|
+
/** A leaf kind, a list of one shape, a record of named fields, or a map whose entries share one. */
|
|
11
|
+
export type Shape = "string" | "number" | "boolean" | "anything" | {
|
|
12
|
+
readonly list: Shape;
|
|
13
|
+
} | {
|
|
14
|
+
readonly fields: Readonly<Record<string, Shape>>;
|
|
15
|
+
readonly required?: readonly string[];
|
|
16
|
+
} | {
|
|
17
|
+
readonly entries: Shape;
|
|
18
|
+
readonly keys?: RegExp;
|
|
19
|
+
};
|
|
20
|
+
/** What the Vitest JSON reporter writes, as far as the Vitest reader reads it. */
|
|
21
|
+
export declare const VITEST_REPORT: Shape;
|
|
22
|
+
/** What the Cucumber JSON formatter writes, as far as the Cucumber reader reads it. */
|
|
23
|
+
export declare const CUCUMBER_REPORT: Shape;
|
|
24
|
+
/**
|
|
25
|
+
* A CI run's step record, as far as the step-record reader reads it: an object of steps keyed by
|
|
26
|
+
* step id, of which it credits only those keyed by a scenario code, reading each one's `outcome`.
|
|
27
|
+
* The key grammar is the reader's own, so a step it never credits is never checked.
|
|
28
|
+
*/
|
|
29
|
+
export declare const CI_STEP_RECORD: Shape;
|
|
30
|
+
/**
|
|
31
|
+
* A package.json, as far as the run reads it outside the `specController` block: an object whose
|
|
32
|
+
* `scripts` are a map of commands. The `specController` block is left to its own resolvers, which
|
|
33
|
+
* read a value they cannot use as absent rather than refuse the run over it.
|
|
34
|
+
*/
|
|
35
|
+
export declare const PACKAGE_MANIFEST: Shape;
|
|
36
|
+
/**
|
|
37
|
+
* A reconciliation this tool saved, at its top: the sections every one carries, and the optional
|
|
38
|
+
* ones in their kind. Below the top the renderer is the reader, and a document it cannot render
|
|
39
|
+
* is refused where it renders.
|
|
40
|
+
*/
|
|
41
|
+
export declare const SAVED_RECONCILIATION: Shape;
|
|
42
|
+
/**
|
|
43
|
+
* The first place `value` is not `shape`, said as the path to it and what was found there, or null
|
|
44
|
+
* when the whole value is that shape. `where` is the path so far; the top level has none.
|
|
45
|
+
*/
|
|
46
|
+
export declare function shapeFaultIn(value: unknown, shape: Shape, where?: string): string | null;
|
|
47
|
+
//# sourceMappingURL=inputShapes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputShapes.d.ts","sourceRoot":"","sources":["../../src/ingest/inputShapes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oGAAoG;AACpG,MAAM,MAAM,KAAK,GACb,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,GACxB;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC3F;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAKxD,kFAAkF;AAClF,eAAO,MAAM,aAAa,EAAE,KAc3B,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,eAAe,EAAE,KAe7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,KAG5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAsD,CAAC;AAEtF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAWlC,CAAC;AAkBF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,SAAK,GAAG,MAAM,GAAG,IAAI,CASpF"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape each JSON input `balance` reads must have before its reader is handed it: the fields
|
|
3
|
+
* that reader goes on to read, and nothing more. A report is its producer's document, so a field
|
|
4
|
+
* the reader never touches is never checked, and a well-formed empty report is still a report.
|
|
5
|
+
*
|
|
6
|
+
* A document that is not this shape is an input the tool cannot read. Read anyway, it either
|
|
7
|
+
* throws part-way or is read as nothing and reaches a verdict about evidence it discarded, and
|
|
8
|
+
* both of those end on the out-of-balance code.
|
|
9
|
+
*/
|
|
10
|
+
/** What the Vitest JSON reporter writes, as far as the Vitest reader reads it. */
|
|
11
|
+
export const VITEST_REPORT = {
|
|
12
|
+
fields: {
|
|
13
|
+
testResults: {
|
|
14
|
+
list: {
|
|
15
|
+
fields: {
|
|
16
|
+
name: "string",
|
|
17
|
+
status: "string",
|
|
18
|
+
message: "string",
|
|
19
|
+
assertionResults: { list: { fields: { fullName: "string", title: "string", status: "string" } } },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
required: ["testResults"],
|
|
25
|
+
};
|
|
26
|
+
/** What the Cucumber JSON formatter writes, as far as the Cucumber reader reads it. */
|
|
27
|
+
export const CUCUMBER_REPORT = {
|
|
28
|
+
list: {
|
|
29
|
+
fields: {
|
|
30
|
+
uri: "string",
|
|
31
|
+
name: "string",
|
|
32
|
+
elements: {
|
|
33
|
+
list: {
|
|
34
|
+
fields: {
|
|
35
|
+
tags: { list: { fields: { name: "string" } } },
|
|
36
|
+
steps: { list: { fields: { keyword: "string", name: "string", result: { fields: { status: "string" } } } } },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* A CI run's step record, as far as the step-record reader reads it: an object of steps keyed by
|
|
45
|
+
* step id, of which it credits only those keyed by a scenario code, reading each one's `outcome`.
|
|
46
|
+
* The key grammar is the reader's own, so a step it never credits is never checked.
|
|
47
|
+
*/
|
|
48
|
+
export const CI_STEP_RECORD = {
|
|
49
|
+
entries: { fields: { outcome: "string" } },
|
|
50
|
+
keys: /^SCN-[A-Z0-9]{2,5}-\d+$/,
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* A package.json, as far as the run reads it outside the `specController` block: an object whose
|
|
54
|
+
* `scripts` are a map of commands. The `specController` block is left to its own resolvers, which
|
|
55
|
+
* read a value they cannot use as absent rather than refuse the run over it.
|
|
56
|
+
*/
|
|
57
|
+
export const PACKAGE_MANIFEST = { fields: { scripts: { entries: "string" } } };
|
|
58
|
+
/**
|
|
59
|
+
* A reconciliation this tool saved, at its top: the sections every one carries, and the optional
|
|
60
|
+
* ones in their kind. Below the top the renderer is the reader, and a document it cannot render
|
|
61
|
+
* is refused where it renders.
|
|
62
|
+
*/
|
|
63
|
+
export const SAVED_RECONCILIATION = {
|
|
64
|
+
fields: {
|
|
65
|
+
runProvenance: { fields: {} },
|
|
66
|
+
summary: { fields: {} },
|
|
67
|
+
ledger: { fields: { scenarioReconciliations: { list: "anything" } }, required: ["scenarioReconciliations"] },
|
|
68
|
+
scenarioCodeErrors: { list: "anything" },
|
|
69
|
+
scenarioCodePopulation: { fields: {} },
|
|
70
|
+
evidenceObligations: { fields: {} },
|
|
71
|
+
metadata: { fields: {} },
|
|
72
|
+
},
|
|
73
|
+
required: ["runProvenance", "summary", "ledger"],
|
|
74
|
+
};
|
|
75
|
+
function kindOf(value) {
|
|
76
|
+
if (value === null)
|
|
77
|
+
return "null";
|
|
78
|
+
if (Array.isArray(value))
|
|
79
|
+
return "a list";
|
|
80
|
+
if (typeof value === "object")
|
|
81
|
+
return "an object";
|
|
82
|
+
return `a ${typeof value}`;
|
|
83
|
+
}
|
|
84
|
+
function expectedKindOf(shape) {
|
|
85
|
+
if (typeof shape === "string")
|
|
86
|
+
return `a ${shape}`;
|
|
87
|
+
return "list" in shape ? "a list" : "an object";
|
|
88
|
+
}
|
|
89
|
+
function pathOf(where, key) {
|
|
90
|
+
return where === "" ? key : `${where}.${key}`;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The first place `value` is not `shape`, said as the path to it and what was found there, or null
|
|
94
|
+
* when the whole value is that shape. `where` is the path so far; the top level has none.
|
|
95
|
+
*/
|
|
96
|
+
export function shapeFaultIn(value, shape, where = "") {
|
|
97
|
+
if (shape === "anything")
|
|
98
|
+
return null;
|
|
99
|
+
const found = kindOf(value);
|
|
100
|
+
const expected = expectedKindOf(shape);
|
|
101
|
+
if (found !== expected)
|
|
102
|
+
return `${where === "" ? "the top level" : where} is ${found}, not ${expected}`;
|
|
103
|
+
if (typeof shape === "string")
|
|
104
|
+
return null;
|
|
105
|
+
if ("list" in shape)
|
|
106
|
+
return listFault(value, shape.list, where);
|
|
107
|
+
if ("entries" in shape)
|
|
108
|
+
return entriesFault(value, shape, where);
|
|
109
|
+
return fieldsFault(value, shape, where);
|
|
110
|
+
}
|
|
111
|
+
function listFault(items, item, where) {
|
|
112
|
+
for (const [index, value] of items.entries()) {
|
|
113
|
+
const fault = shapeFaultIn(value, item, `${where}[${index}]`);
|
|
114
|
+
if (fault !== null)
|
|
115
|
+
return fault;
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
function fieldsFault(record, shape, where) {
|
|
120
|
+
for (const [key, field] of Object.entries(shape.fields)) {
|
|
121
|
+
const path = pathOf(where, key);
|
|
122
|
+
if (record[key] === undefined) {
|
|
123
|
+
if (shape.required?.includes(key) === true)
|
|
124
|
+
return `${path} is missing`;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const fault = shapeFaultIn(record[key], field, path);
|
|
128
|
+
if (fault !== null)
|
|
129
|
+
return fault;
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
function entriesFault(record, shape, where) {
|
|
134
|
+
for (const [key, value] of Object.entries(record)) {
|
|
135
|
+
if (shape.keys !== undefined && !shape.keys.test(key))
|
|
136
|
+
continue;
|
|
137
|
+
const fault = shapeFaultIn(value, shape.entries, pathOf(where, key));
|
|
138
|
+
if (fault !== null)
|
|
139
|
+
return fault;
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=inputShapes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0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.37",
|
|
4
4
|
"description": "Reconcile the behaviour your scenarios name against the evidence that actually ran — the deterministic `balance` CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reconciliation",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@cucumber/gherkin": "^41.0.0",
|
|
26
26
|
"@cucumber/messages": "^34.0.1",
|
|
27
27
|
"yaml": "^2.9.0",
|
|
28
|
-
"@3f-consulting/spec-controller-core": "0.1.0-alpha.
|
|
28
|
+
"@3f-consulting/spec-controller-core": "0.1.0-alpha.37"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|