spec-controller 0.1.0-alpha.44 → 0.1.0-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-allocate/cli.d.ts.map +1 -1
- package/dist/cli-allocate/cli.js +13 -14
- package/dist/cli-allocate/cli.js.map +1 -1
- package/dist/cli-allocate/readHistory.d.ts +0 -14
- package/dist/cli-allocate/readHistory.d.ts.map +1 -1
- package/dist/cli-allocate/readHistory.js +8 -36
- package/dist/cli-allocate/readHistory.js.map +1 -1
- package/dist/cli-allocate/readParts.d.ts +0 -1
- package/dist/cli-allocate/readParts.d.ts.map +1 -1
- package/dist/cli-allocate/readParts.js +0 -6
- package/dist/cli-allocate/readParts.js.map +1 -1
- package/dist/cli-allocate/readTree.d.ts +0 -11
- package/dist/cli-allocate/readTree.d.ts.map +1 -1
- package/dist/cli-allocate/readTree.js +0 -32
- package/dist/cli-allocate/readTree.js.map +1 -1
- package/dist/cli-allocate/refStore.d.ts +0 -1
- package/dist/cli-allocate/refStore.d.ts.map +1 -1
- package/dist/cli-allocate/refStore.js +0 -13
- package/dist/cli-allocate/refStore.js.map +1 -1
- package/dist/cli-allocate/request.d.ts +0 -2
- package/dist/cli-allocate/request.d.ts.map +1 -1
- package/dist/cli-allocate/request.js +0 -7
- package/dist/cli-allocate/request.js.map +1 -1
- package/dist/cli-allocate/stderr.d.ts +0 -7
- package/dist/cli-allocate/stderr.d.ts.map +1 -1
- package/dist/cli-allocate/stderr.js +0 -7
- package/dist/cli-allocate/stderr.js.map +1 -1
- package/dist/cli-allocate/unreadable.d.ts +0 -13
- package/dist/cli-allocate/unreadable.d.ts.map +1 -1
- package/dist/cli-allocate/unreadable.js +0 -13
- package/dist/cli-allocate/unreadable.js.map +1 -1
- package/dist/cli-args.d.ts +0 -113
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +0 -145
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-balance/cli.d.ts +0 -85
- package/dist/cli-balance/cli.d.ts.map +1 -1
- package/dist/cli-balance/cli.js +0 -230
- package/dist/cli-balance/cli.js.map +1 -1
- package/dist/cli-balance/emit/format.d.ts +0 -52
- package/dist/cli-balance/emit/format.d.ts.map +1 -1
- package/dist/cli-balance/emit/format.js +0 -70
- package/dist/cli-balance/emit/format.js.map +1 -1
- package/dist/cli-balance/emit/writer.d.ts +0 -17
- package/dist/cli-balance/emit/writer.d.ts.map +1 -1
- package/dist/cli-balance/emit/writer.js +0 -13
- package/dist/cli-balance/emit/writer.js.map +1 -1
- package/dist/cli-balance/exitStatus.d.ts +0 -1
- package/dist/cli-balance/exitStatus.d.ts.map +1 -1
- package/dist/cli-balance/exitStatus.js +0 -7
- package/dist/cli-balance/exitStatus.js.map +1 -1
- package/dist/cli-balance/inputsRead.d.ts +0 -12
- package/dist/cli-balance/inputsRead.d.ts.map +1 -1
- package/dist/cli-balance/inputsRead.js +0 -12
- package/dist/cli-balance/inputsRead.js.map +1 -1
- package/dist/cli-balance/reRender.d.ts +0 -14
- package/dist/cli-balance/reRender.d.ts.map +1 -1
- package/dist/cli-balance/reRender.js +0 -15
- package/dist/cli-balance/reRender.js.map +1 -1
- package/dist/cli-balance/unreadableInputs.d.ts +0 -21
- package/dist/cli-balance/unreadableInputs.d.ts.map +1 -1
- package/dist/cli-balance/unreadableInputs.js +0 -21
- package/dist/cli-balance/unreadableInputs.js.map +1 -1
- package/dist/cli-registry.d.ts +0 -86
- package/dist/cli-registry.d.ts.map +1 -1
- package/dist/cli-registry.js +0 -70
- package/dist/cli-registry.js.map +1 -1
- package/dist/cli.d.ts +0 -20
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +31 -53
- package/dist/cli.js.map +1 -1
- package/dist/deferralTags.d.ts +0 -14
- package/dist/deferralTags.d.ts.map +1 -1
- package/dist/deferralTags.js +0 -14
- package/dist/deferralTags.js.map +1 -1
- package/dist/host.d.ts +0 -61
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +1 -84
- package/dist/host.js.map +1 -1
- package/dist/ingest/ciSourcePaths.d.ts +0 -38
- package/dist/ingest/ciSourcePaths.d.ts.map +1 -1
- package/dist/ingest/ciSourcePaths.js +0 -38
- package/dist/ingest/ciSourcePaths.js.map +1 -1
- package/dist/ingest/gherkinValidation.d.ts +0 -76
- package/dist/ingest/gherkinValidation.d.ts.map +1 -1
- package/dist/ingest/gherkinValidation.js +0 -76
- package/dist/ingest/gherkinValidation.js.map +1 -1
- package/dist/ingest/ingestQualityChecks.d.ts +0 -81
- package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
- package/dist/ingest/ingestQualityChecks.js +0 -194
- package/dist/ingest/ingestQualityChecks.js.map +1 -1
- package/dist/ingest/ingestScenarios.d.ts +0 -39
- package/dist/ingest/ingestScenarios.d.ts.map +1 -1
- package/dist/ingest/ingestScenarios.js +0 -70
- package/dist/ingest/ingestScenarios.js.map +1 -1
- package/dist/ingest/inputShapes.d.ts +0 -31
- package/dist/ingest/inputShapes.d.ts.map +1 -1
- package/dist/ingest/inputShapes.js +0 -30
- package/dist/ingest/inputShapes.js.map +1 -1
- package/dist/outputLocation.d.ts +0 -48
- package/dist/outputLocation.d.ts.map +1 -1
- package/dist/outputLocation.js +0 -48
- package/dist/outputLocation.js.map +1 -1
- package/dist/run-management/keptRun.d.ts +0 -107
- package/dist/run-management/keptRun.d.ts.map +1 -1
- package/dist/run-management/keptRun.js +0 -75
- package/dist/run-management/keptRun.js.map +1 -1
- package/dist/run-management/resolveRunInputs.d.ts +0 -67
- package/dist/run-management/resolveRunInputs.d.ts.map +1 -1
- package/dist/run-management/resolveRunInputs.js +0 -88
- package/dist/run-management/resolveRunInputs.js.map +1 -1
- package/dist/storedRun.d.ts +0 -21
- package/dist/storedRun.d.ts.map +1 -1
- package/dist/storedRun.js +0 -21
- package/dist/storedRun.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ingest the target's quality-check inputs — the IMPURE reads behind the balance
|
|
3
|
-
* command (split out of the old cli.ts). Reads evidence
|
|
4
|
-
* obligations from the repo's feature files, observed evidence from the Vitest +
|
|
5
|
-
* Cucumber result JSON, and the static-check evidence from the CI config + package.json,
|
|
6
|
-
* turning each into the engine's in-memory model. The orchestration (arg parsing, the
|
|
7
|
-
* output plan/write, main) stays in cli-balance/cli.ts; these are the file reads it calls.
|
|
8
|
-
*
|
|
9
|
-
* Configurable input paths (no adapter registry in v1 — the readers are named, not
|
|
10
|
-
* registered). Missing result files are tolerated: their evidence is simply absent
|
|
11
|
-
* (the scenario reconciles as missing for that level). The static check kind reads
|
|
12
|
-
* `--ci` (a workflow file or a directory of them, default `.github/workflows`) +
|
|
13
|
-
* `package.json` to observe each fitness check the corpus cites.
|
|
14
|
-
*/
|
|
15
1
|
import { readFileSync, existsSync } from "node:fs";
|
|
16
2
|
import { basename } from "node:path";
|
|
17
3
|
import { ciSourcePathsOf } from "./ciSourcePaths.js";
|
|
@@ -22,73 +8,18 @@ import { DEFAULT_DEFERRAL_TAGS } from "../deferralTags.js";
|
|
|
22
8
|
import { evidenceObligations, } from "@3f-consulting/spec-controller-core";
|
|
23
9
|
import { parseVitestEvidenceObservations, } from "@3f-consulting/spec-controller-core";
|
|
24
10
|
import { parseCucumberEvidenceObservations, } from "@3f-consulting/spec-controller-core";
|
|
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
|
-
// `./internal` subpath to assemble the reconciliation itself — which is why an installed
|
|
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; what moved is
|
|
30
|
-
// their CALLER. What is left here is the reads: this edge opens the files and hands the bytes over.
|
|
31
11
|
import { evidenceReconciliationFromSources } from "@3f-consulting/spec-controller-core";
|
|
32
12
|
import { resolveTargetRoot } from "../run-management/resolveRunInputs.js";
|
|
33
|
-
/**
|
|
34
|
-
* The per-input FALLBACK quality-check for each JS-ecosystem result source — the
|
|
35
|
-
* source→quality-check mapping, SET at the CLI edge rather than hardcoded in the core
|
|
36
|
-
* parsers / countRuntimeEvidenceObservationKinds. A second ecosystem (pytest / JUnit) sets its own here (or
|
|
37
|
-
* via an adapter); the core never assumes a mapping. No CLI override flag yet — that
|
|
38
|
-
* earns its place at the second ecosystem, not now.
|
|
39
|
-
*/
|
|
40
13
|
const VITEST_QUALITY_CHECK = "unit";
|
|
41
14
|
const CUCUMBER_QUALITY_CHECK = "integration";
|
|
42
|
-
/**
|
|
43
|
-
* THIS TOOL, RUN TO RECONCILE — the invocation whose step is the
|
|
44
|
-
* reconciler rather than one of the reconciled rows, SET at the CLI edge and injected into the
|
|
45
|
-
* core like the prefixes above and the workflow names below.
|
|
46
|
-
*
|
|
47
|
-
* HOW THIS PRODUCT IS INVOKED IS THIS LAYER'S FACT. `spec-controller` is the `bin` this package
|
|
48
|
-
* publishes and `balance` is the command that reconciles; the engine holds neither, and a core
|
|
49
|
-
* that assumed them would be asserting something about a command line it never sees.
|
|
50
|
-
*
|
|
51
|
-
* BOTH TOKENS, AND THE SECOND IS NOT DECORATION. A step running the same binary for anything but
|
|
52
|
-
* `balance` is an ordinary step of the pipeline being reconciled, so an invocation naming the
|
|
53
|
-
* binary alone would take that step off the books. The comparison is whole, adjacent shell tokens
|
|
54
|
-
* (`parse/commandRuns`), so this names the reconciliation and nothing else the tool can do.
|
|
55
|
-
*/
|
|
56
15
|
const RECONCILER_INVOCATION = "spec-controller balance";
|
|
57
|
-
/** Where the CI workflows are read from when `--ci` is not given. */
|
|
58
16
|
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
17
|
export const DEFAULT_PACKAGE_JSON = "package.json";
|
|
61
|
-
/** Read + JSON-parse a file if present, else return undefined. */
|
|
62
18
|
function readJsonIfPresent(path) {
|
|
63
19
|
if (!path || !existsSync(path))
|
|
64
20
|
return undefined;
|
|
65
21
|
return JSON.parse(readFileSync(path, "utf8"));
|
|
66
22
|
}
|
|
67
|
-
/**
|
|
68
|
-
* THE CORPUS `balance` READS — the shared discovery, with an ABSENT directory read as NO CORPUS.
|
|
69
|
-
* The single place this command opts in.
|
|
70
|
-
*
|
|
71
|
-
* `new-client` is a supported adoption state, not a degraded one, and most targets have no
|
|
72
|
-
* `features/` directory at all — so an absent DEFAULT corpus is the target's honest shape and
|
|
73
|
-
* `balance` reports on it. Left to escape it was a raw `ENOENT` landing on Node's default exit 1,
|
|
74
|
-
* the OUT-OF-BALANCE code, which is exactly the collision the unreadable-input guards closed on every
|
|
75
|
-
* other input, alive on the one path each new consumer is guaranteed to take.
|
|
76
|
-
*
|
|
77
|
-
* ONE HELPER, NOT FIVE CATCHES, and that is the whole reason it exists: five readers each doing
|
|
78
|
-
* this by hand is five chances for one to stay intolerant, and a run that reports on a corpus for
|
|
79
|
-
* four of its readings and throws on the fifth is worse than one that throws. The translation is
|
|
80
|
-
* also why `discoverFeatures` is not the place to be tolerant — see its own note, and
|
|
81
|
-
* `MissingFeatureCorpusError`'s.
|
|
82
|
-
*
|
|
83
|
-
* IT IS `[]`, NOT A VERDICT. Zero rows is what the verdict reads as NOTHING TO RECONCILE, and a
|
|
84
|
-
* corpus-less target that still has uncited credits keeps its suspense row and its exit 1
|
|
85
|
-
* — this reader says what it found, never what the run means.
|
|
86
|
-
*
|
|
87
|
-
* A supplied-but-absent `--features` never arrives here: `checkInputsExist` refuses it at the CLI
|
|
88
|
-
* edge, exit 2. The precedent is `ciSourcePathsOf`, which already answers an absent
|
|
89
|
-
* DEFAULT `.github/workflows` with `[]` for the same reason — the default finding nothing is a fact
|
|
90
|
-
* about the target, not a mistake by its author.
|
|
91
|
-
*/
|
|
92
23
|
function balanceCorpus(featuresDir) {
|
|
93
24
|
try {
|
|
94
25
|
return featuresDir !== undefined ? discoverFeatures(featuresDir) : discoverFeatures();
|
|
@@ -99,49 +30,15 @@ function balanceCorpus(featuresDir) {
|
|
|
99
30
|
throw err;
|
|
100
31
|
}
|
|
101
32
|
}
|
|
102
|
-
/**
|
|
103
|
-
* The discovered feature corpus's SOURCES — read once so the two readings a citing run needs (the
|
|
104
|
-
* obligations, and the corpus hop's `check tag → @SCN`) are taken from the same bytes. Two
|
|
105
|
-
* discoveries could disagree about the corpus, and a citation resolved against a corpus the ledger
|
|
106
|
-
* was not built from is exactly the phantom-row fault.
|
|
107
|
-
*/
|
|
108
33
|
function featureSources(featuresDir) {
|
|
109
34
|
return balanceCorpus(featuresDir).map((f) => readFileSync(f.path, "utf8"));
|
|
110
35
|
}
|
|
111
36
|
function scenariosFromFeatures(featuresDir, deferralTags = DEFAULT_DEFERRAL_TAGS) {
|
|
112
37
|
return featureSources(featuresDir).flatMap((source) => parseScenarios(source, deferralTags));
|
|
113
38
|
}
|
|
114
|
-
/**
|
|
115
|
-
* The feature corpus's UNTAGGED half — the scenarios `parseScenarios`
|
|
116
|
-
* discards because they carry no `@SCN`. They are REAL scenarios: cucumber runs them, so each
|
|
117
|
-
* owns a real Evidence Obligation — but the obligation has no code for an Evidence Observation to
|
|
118
|
-
* link to, so it can never be discharged. `reconcile` gives each its own out-of-balance row
|
|
119
|
-
* (`no-scn-code`); before this read they were invisible to the ledger, and a run whose only fault
|
|
120
|
-
* was an untagged scenario printed "N scenario(s) carry no @SCN tag" and exited 0 BALANCED.
|
|
121
|
-
*
|
|
122
|
-
* Each is handled by its `<feature> : <scenario>` locator — the SAME locator the untagged warning
|
|
123
|
-
* prints — because a bare scenario name is not unique across the corpus, and the row must say
|
|
124
|
-
* where to go.
|
|
125
|
-
*/
|
|
126
39
|
function untaggedScenariosFromFeatures(featuresDir) {
|
|
127
40
|
return balanceCorpus(featuresDir).flatMap((f) => parseUntaggedScenarios(readFileSync(f.path, "utf8")).map((scenario) => `${f.slug}.feature : ${scenario}`));
|
|
128
41
|
}
|
|
129
|
-
/**
|
|
130
|
-
* The feature corpus's INTEGRITY CHECKPOINT — validate every discovered
|
|
131
|
-
* `.feature` with the REAL Gherkin parser and report the files it cannot read.
|
|
132
|
-
*
|
|
133
|
-
* The feature corpus is the ledger's DEBIT side, and it used to be read by a tag-line scan that
|
|
134
|
-
* never consulted a parser — so a malformed tag line silently deleted its scenario, and a corrupt
|
|
135
|
-
* spec could read BALANCED. A file the parser rejects is one cucumber would refuse to run: the
|
|
136
|
-
* CLI halts on it (exit 2) rather than reconciling a corpus that is a fiction.
|
|
137
|
-
*
|
|
138
|
-
* THIS IS NOW THE CATCH SITE, NOT THE CALL SITE. The validation moved
|
|
139
|
-
* into `discoverFeatures`, which REFUSES an unreadable corpus rather than returning one, so every
|
|
140
|
-
* corpus reader inherits the refusal instead of each restating it. What is left here is the
|
|
141
|
-
* translation back into the list this CLI edge already prints — same files, same order, same
|
|
142
|
-
* verbatim parser messages, so `balance`'s behaviour is unchanged. Anything that is not a corpus
|
|
143
|
-
* refusal is not ours to interpret and rethrows.
|
|
144
|
-
*/
|
|
145
42
|
export function featureCorpusParseErrors(featuresDir) {
|
|
146
43
|
try {
|
|
147
44
|
balanceCorpus(featuresDir);
|
|
@@ -153,22 +50,12 @@ export function featureCorpusParseErrors(featuresDir) {
|
|
|
153
50
|
throw err;
|
|
154
51
|
}
|
|
155
52
|
}
|
|
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
53
|
function readFaultOf(err, path) {
|
|
162
54
|
const errno = err;
|
|
163
55
|
if (!(err instanceof Error) || typeof errno.code !== "string")
|
|
164
56
|
return null;
|
|
165
57
|
return { path: errno.path ?? path, reason: err.message };
|
|
166
58
|
}
|
|
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
59
|
export function corpusReadFault(featuresDir) {
|
|
173
60
|
try {
|
|
174
61
|
balanceCorpus(featuresDir);
|
|
@@ -183,7 +70,6 @@ export function corpusReadFault(featuresDir) {
|
|
|
183
70
|
return fault;
|
|
184
71
|
}
|
|
185
72
|
}
|
|
186
|
-
/** The read of a CI workflow that failed, over the same files the reconcile reads, or null when they all read. */
|
|
187
73
|
export function ciReadFault(ciPath) {
|
|
188
74
|
const path = ciPath ?? DEFAULT_CI_PATH;
|
|
189
75
|
try {
|
|
@@ -198,7 +84,6 @@ export function ciReadFault(ciPath) {
|
|
|
198
84
|
return fault;
|
|
199
85
|
}
|
|
200
86
|
}
|
|
201
|
-
/** One workflow file's read, whose failure carries the file's path, which reading a directory gives none of. */
|
|
202
87
|
function readCiSource(source) {
|
|
203
88
|
try {
|
|
204
89
|
readFileSync(source, "utf8");
|
|
@@ -209,18 +94,6 @@ function readCiSource(source) {
|
|
|
209
94
|
throw err;
|
|
210
95
|
}
|
|
211
96
|
}
|
|
212
|
-
/**
|
|
213
|
-
* Read the target's `feature-code → slug` map over the same `discoverFeatures` corpus
|
|
214
|
-
* — each coded feature file's `@<FFF>` header (`featureCode`)
|
|
215
|
-
* mapped to its filename `slug`, the full feature name. This is the mapping
|
|
216
|
-
* `scenariosFromFeatures` discards (it keeps only the parsed scenarios). A sibling read to
|
|
217
|
-
* the balance, threaded to `renderMarkdown` (via `writeOutputs`) as the 5th sibling arg
|
|
218
|
-
* (markdown-only — the by-feature cut is markdown-only, so it is NOT serialised to JSON).
|
|
219
|
-
* Uncoded files (`featureCode === null`) are omitted, so the by-feature emitter falls
|
|
220
|
-
* back to the bare `FFF` for any id whose code no file registers. When two files carry one
|
|
221
|
-
* code the map keeps the last, and that run lists `duplicate-feature-code` under Scenario code
|
|
222
|
-
* errors and fails, so a report whose map is ambiguous never passes.
|
|
223
|
-
*/
|
|
224
97
|
export function readFeatureNames(featuresDir) {
|
|
225
98
|
const map = new Map();
|
|
226
99
|
for (const f of balanceCorpus(featuresDir)) {
|
|
@@ -229,16 +102,6 @@ export function readFeatureNames(featuresDir) {
|
|
|
229
102
|
}
|
|
230
103
|
return map;
|
|
231
104
|
}
|
|
232
|
-
/**
|
|
233
|
-
* Read the scenario-corpus census over the discovered feature files (the same
|
|
234
|
-
* `discoverFeatures` corpus `scenariosFromFeatures` reads): sum the raw @SCN
|
|
235
|
-
* occurrences (`countScnOccurrences`) and the scenario count
|
|
236
|
-
* (`parseScenarios(...).length`) across every file, and build the `EvidenceObligations`
|
|
237
|
-
* sibling. Also collects the UNTAGGED scenarios
|
|
238
|
-
* — `parseUntaggedScenarios` per file, each paired with its feature-file
|
|
239
|
-
* locator, sorted by (feature, scenario). Read alongside the balance in `main()` and
|
|
240
|
-
* threaded to the renderers via `writeOutputs`; `runReconcile` stays unchanged.
|
|
241
|
-
*/
|
|
242
105
|
export function readEvidenceObligations(features) {
|
|
243
106
|
const featureFiles = balanceCorpus(features);
|
|
244
107
|
let raw = 0;
|
|
@@ -257,18 +120,8 @@ export function readEvidenceObligations(features) {
|
|
|
257
120
|
}
|
|
258
121
|
}
|
|
259
122
|
untagged.sort((a, b) => a.feature.localeCompare(b.feature) || a.scenario.localeCompare(b.scenario));
|
|
260
|
-
// The prose-only codes are a CROSS-CORPUS difference (a code tagged in any file isn't
|
|
261
|
-
// dangling), so it reads all sources at once — not per-file like the others.
|
|
262
123
|
return evidenceObligations(raw, scenarioCount, untagged, proseOnlyCodes(sources), sharedScnCodesOf(files));
|
|
263
124
|
}
|
|
264
|
-
/**
|
|
265
|
-
* Parse the target's RUNTIME observations ONCE — the tag-derived, per-tier observation set
|
|
266
|
-
* fed to BOTH the reconciler and the runtime census, so the
|
|
267
|
-
* two can never disagree. Each source's FALLBACK quality-check is set at the CLI edge
|
|
268
|
-
* (vitest⇒unit, cucumber⇒integration); the parsers DERIVE the level from the cited scenario's tier
|
|
269
|
-
* tag, using the fallback only for an untagged scenario. A missing report
|
|
270
|
-
* contributes nothing. Root-relative so a phantom-scenario row's where-to-fix stays portable.
|
|
271
|
-
*/
|
|
272
125
|
function parseRuntimeObservations(opts, root) {
|
|
273
126
|
const out = [];
|
|
274
127
|
const vitestReport = readJsonIfPresent(opts.vitest);
|
|
@@ -280,74 +133,27 @@ function parseRuntimeObservations(opts, root) {
|
|
|
280
133
|
return out;
|
|
281
134
|
}
|
|
282
135
|
export function runReconcile(opts) {
|
|
283
|
-
// Read the target's package.json ONCE — its `specController.*` config supplies the deferral-tag
|
|
284
|
-
// extension and the configured fitness rows, and its `scripts` back the `exists`
|
|
285
|
-
// read. The disk read stays at this impure edge; the engine takes the resolved values as
|
|
286
|
-
// injected params, staying pure.
|
|
287
136
|
const pkgPath = opts.packageJson ?? DEFAULT_PACKAGE_JSON;
|
|
288
137
|
const packageJson = readJsonIfPresent(pkgPath) ?? {};
|
|
289
|
-
// The TARGET repo root — the credit locators are made relative to it, so a phantom-scenario row's
|
|
290
|
-
// where-to-fix (ruling Q5) stays portable in a banked artefact. Resolved ONCE here and threaded,
|
|
291
|
-
// which is also what keeps `execFileSync` and `process.cwd()` out of the engine.
|
|
292
138
|
const root = resolveTargetRoot({ features: opts.features });
|
|
293
|
-
// `--ci` names a workflow FILE or a DIRECTORY of them, and defaults to the directory
|
|
294
|
-
// A pipeline split across files enforces its checks just as one
|
|
295
|
-
// file does, and reading only ci.yml both invents watermelons for named checks enforced
|
|
296
|
-
// elsewhere and drops uncited ones off the books entirely. Path semantics carry the
|
|
297
|
-
// file-vs-directory distinction, so one flag stays one flag and an explicit file is still
|
|
298
|
-
// a narrowing.
|
|
299
139
|
const ciPath = opts.ci ?? DEFAULT_CI_PATH;
|
|
300
|
-
// RESOLVED ONCE, READ TWICE. The engine takes anonymous source strings and holds
|
|
301
|
-
// no filesystem, so the mapping from a step's source index back to the workflow file it came
|
|
302
|
-
// from is made HERE, where the paths are already in hand — `ciSourcePaths.ts` is explicit that
|
|
303
|
-
// keeping the core that way is the point. Resolving the list twice would be two chances for the
|
|
304
|
-
// bytes and the names to fall out of the order they are paired by.
|
|
305
140
|
const ciPaths = ciSourcePathsOf(ciPath);
|
|
306
|
-
// The corpus, discovered and read ONCE: its bytes, and — paired by index — which file each came
|
|
307
|
-
// from and the header code it carries, for the scenario code errors.
|
|
308
141
|
const corpusFiles = balanceCorpus(opts.features).map((f) => ({
|
|
309
142
|
slug: f.slug,
|
|
310
143
|
featureCode: f.featureCode,
|
|
311
144
|
source: readFileSync(f.path, "utf8"),
|
|
312
145
|
}));
|
|
313
146
|
return evidenceReconciliationFromSources({
|
|
314
|
-
// The corpus's bytes, read ONCE at this impure edge. The engine composes the three
|
|
315
|
-
// readings a citing run needs from this one array, so they cannot be assembled from two
|
|
316
|
-
// discoveries that disagree about the corpus.
|
|
317
147
|
featureSources: corpusFiles.map((f) => f.source),
|
|
318
148
|
featureFiles: corpusFiles.map(({ slug, featureCode }) => ({ slug, featureCode })),
|
|
319
|
-
// The untagged half by its `<feature> : <scenario>` locator — parsed here because the locator
|
|
320
|
-
// names the FILE, which the discovery knows and a source string does not.
|
|
321
149
|
untaggedScenarios: untaggedScenariosFromFeatures(opts.features),
|
|
322
150
|
packageJson,
|
|
323
151
|
ciSources: ciPaths.map((path) => readFileSync(path, "utf8")),
|
|
324
|
-
// THE FILE, NOT THE PATH. A `notChecks` entry opens with the workflow's own name — `ci.yml`,
|
|
325
|
-
// `release.yml` — which is what a consumer reads at the head of their run log and the only
|
|
326
|
-
// half of the entry that does not come out of the workflow's own text. The directory it sits
|
|
327
|
-
// in is the caller's `--ci`, not the consumer's subject, so it is not part of what they write.
|
|
328
152
|
ciSourceNames: ciPaths.map((path) => basename(path)),
|
|
329
|
-
// The CONVERTED checks' credit stream, read at this edge like every other report. Absent it is
|
|
330
|
-
// undefined rather than empty, and that distinction reaches the reader: "no
|
|
331
|
-
// record" is a run nobody recorded, "a record holding nothing" is a run that recorded none of
|
|
332
|
-
// these steps, and those are opposite facts.
|
|
333
|
-
// STRUCTURALLY, NOT BY NAME: this module travels in the tarball and reaches core through the PUBLIC barrel alone, and
|
|
334
|
-
// `CiStepRecord` is not on it. The shape is the document's, which is the consumer's, so what is
|
|
335
|
-
// written here is what the file holds rather than a contract owed to anyone.
|
|
336
153
|
ciStepRecord: readJsonIfPresent(opts.ciSteps),
|
|
337
154
|
runtimeObservations: parseRuntimeObservations(opts, root),
|
|
338
|
-
// The two things the engine's resolvers cannot hold, and each for its own reason: the
|
|
339
|
-
// starter deferral set is the application layer's own policy, and how this tool is invoked to
|
|
340
|
-
// reconcile is a fact about this product's command line. THE PREFIX SET USED TO SIT HERE AND IS GONE: the
|
|
341
|
-
// engine no longer decides a check's membership by its name, so there is no convention left
|
|
342
|
-
// for this edge to own.
|
|
343
155
|
deferralTags: DEFAULT_DEFERRAL_TAGS,
|
|
344
156
|
reconcilerInvocation: RECONCILER_INVOCATION,
|
|
345
157
|
});
|
|
346
158
|
}
|
|
347
|
-
// The static-check kind-counts are no longer read as a parallel census:
|
|
348
|
-
// the former `readStaticEvidenceObservationCounts` re-built the static check observations and
|
|
349
|
-
// re-derived the running / uncited split from a second read of the CI config. That counting now
|
|
350
|
-
// FOLDS onto the Ledger the reconciler already produced (`staticObservationTally`, an internal
|
|
351
|
-
// domain fold the renderers apply), so it cannot drift from the verdict — it counts the SAME posted
|
|
352
|
-
// static-check credits `runReconcile` banked. The census read is deleted, not relocated.
|
|
353
159
|
//# sourceMappingURL=ingestQualityChecks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestQualityChecks.js","sourceRoot":"","sources":["../../src/ingest/ingestQualityChecks.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ingestQualityChecks.js","sourceRoot":"","sources":["../../src/ingest/ingestQualityChecks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EA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
|
|
3
|
-
* and reads each file's header code into DiscoveredFeature records (split out of the old
|
|
4
|
-
* spec/featureCodes.ts). The pure header parser (extractFeatureCode) lives here with its sole
|
|
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, in
|
|
7
|
-
* parse/scenarioCodeErrors.ts, and no longer a private check under tests/checks/.
|
|
8
|
-
*
|
|
9
|
-
* NO PER-FILE LIST OF SCENARIO CODES. One used to ride here, read by a copy of the
|
|
10
|
-
* @SCN grammar of its own, and nothing but its own test read it; a scenario's code is read by the
|
|
11
|
-
* engine's scenario walk, which is the reading the ledger's accounts are minted from.
|
|
12
|
-
*
|
|
13
|
-
* The foundation, folded into the @LDG runtime spine.
|
|
14
|
-
*/
|
|
15
|
-
/** A feature file discovered on disk, with its `@<FFF>` header code (if any). */
|
|
16
1
|
export interface DiscoveredFeature {
|
|
17
|
-
/** The feature-file basename without the .feature extension. */
|
|
18
2
|
slug: string;
|
|
19
|
-
/** Absolute path to the feature file. */
|
|
20
3
|
path: string;
|
|
21
4
|
featureCode: string | null;
|
|
22
5
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Read the Feature-level @<FFF> header tag from a feature file's source — the
|
|
25
|
-
* first tag immediately preceding the `Feature:` keyword that is not an @SCN id
|
|
26
|
-
* or a recognised evidence/routing tag. Returns null if absent.
|
|
27
|
-
*/
|
|
28
6
|
export declare function extractFeatureCode(source: string): string | null;
|
|
29
|
-
/**
|
|
30
|
-
* Discover every feature file on disk and its header code — REFUSING a corpus the Gherkin
|
|
31
|
-
* parser rejects.
|
|
32
|
-
*
|
|
33
|
-
* The refusal lives HERE, in the one reader every corpus consumer already goes through, so a
|
|
34
|
-
* consumer INHERITS it rather than restating it. It is not a second parser: it is the existing
|
|
35
|
-
* `parseErrorsIn` — cucumber's own — reached from the shared discovery instead of only from the
|
|
36
|
-
* balance CLI's edge. One answer to "what is a feature file".
|
|
37
|
-
*
|
|
38
|
-
* WHY THE WHOLE CORPUS, NOT THE FIRST BAD FILE. `featureCorpusParseErrors` reports every
|
|
39
|
-
* unreadable file and the balance CLI prints them all. Refusing at the first
|
|
40
|
-
* failure would silently narrow that message, so every file is parsed and the refusal is raised
|
|
41
|
-
* once, carrying the lot in discovery order.
|
|
42
|
-
*
|
|
43
|
-
* And NO PARTIAL CORPUS is ever returned: a caller that could scan the readable half of a
|
|
44
|
-
* rejected tree would be back to reporting a verdict over a corpus it cannot read.
|
|
45
|
-
*/
|
|
46
7
|
export declare function discoverFeatures(dir?: string): DiscoveredFeature[];
|
|
47
8
|
//# sourceMappingURL=ingestScenarios.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestScenarios.d.ts","sourceRoot":"","sources":["../../src/ingest/ingestScenarios.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ingestScenarios.d.ts","sourceRoot":"","sources":["../../src/ingest/ingestScenarios.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKhE;AA0CD,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAsB,GAAG,iBAAiB,EAAE,CAiBjF"}
|
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ingest the target's feature files — the IMPURE reader that walks features/ on disk
|
|
3
|
-
* and reads each file's header code into DiscoveredFeature records (split out of the old
|
|
4
|
-
* spec/featureCodes.ts). The pure header parser (extractFeatureCode) lives here with its sole
|
|
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, in
|
|
7
|
-
* parse/scenarioCodeErrors.ts, and no longer a private check under tests/checks/.
|
|
8
|
-
*
|
|
9
|
-
* NO PER-FILE LIST OF SCENARIO CODES. One used to ride here, read by a copy of the
|
|
10
|
-
* @SCN grammar of its own, and nothing but its own test read it; a scenario's code is read by the
|
|
11
|
-
* engine's scenario walk, which is the reading the ledger's accounts are minted from.
|
|
12
|
-
*
|
|
13
|
-
* The foundation, folded into the @LDG runtime spine.
|
|
14
|
-
*/
|
|
15
1
|
import { readFileSync, readdirSync } from "node:fs";
|
|
16
2
|
import { join } from "node:path";
|
|
17
3
|
import { MissingFeatureCorpusError, UnreadableFeatureCorpusError, parseErrorsIn, } from "./gherkinValidation.js";
|
|
18
|
-
/** A code is valid when it is 2–5 uppercase alphanumerics. */
|
|
19
4
|
const CODE_PATTERN = /^[A-Z0-9]{2,5}$/;
|
|
20
|
-
/**
|
|
21
|
-
* Read the Feature-level @<FFF> header tag from a feature file's source — the
|
|
22
|
-
* first tag immediately preceding the `Feature:` keyword that is not an @SCN id
|
|
23
|
-
* or a recognised evidence/routing tag. Returns null if absent.
|
|
24
|
-
*/
|
|
25
5
|
export function extractFeatureCode(source) {
|
|
26
6
|
const lines = source.split(/\r?\n/);
|
|
27
7
|
const featureLine = lines.findIndex((line) => line.trim().startsWith("Feature:"));
|
|
@@ -29,16 +9,10 @@ export function extractFeatureCode(source) {
|
|
|
29
9
|
return null;
|
|
30
10
|
return headerTagsAbove(lines, featureLine).find(isHeaderCode) ?? null;
|
|
31
11
|
}
|
|
32
|
-
/** The tags a tier or routing concern owns, which are never a file's header code. */
|
|
33
12
|
const NON_CODE_TAGS = ["unit", "integration", "e2e", "performance", "smoke"];
|
|
34
|
-
/** Is this bare tag the file's header code — not an @SCN id, not a tier tag, and code-shaped? */
|
|
35
13
|
function isHeaderCode(bare) {
|
|
36
14
|
return !bare.startsWith("SCN-") && !NON_CODE_TAGS.includes(bare) && CODE_PATTERN.test(bare);
|
|
37
15
|
}
|
|
38
|
-
/**
|
|
39
|
-
* The bare tags on the tag lines directly above the `Feature:` line, nearest line first and each
|
|
40
|
-
* line left to right. Blank lines are passed over; the first line that is not a tag line ends it.
|
|
41
|
-
*/
|
|
42
16
|
function headerTagsAbove(lines, featureLine) {
|
|
43
17
|
const tags = [];
|
|
44
18
|
for (let j = featureLine - 1; j >= 0; j--) {
|
|
@@ -51,32 +25,9 @@ function headerTagsAbove(lines, featureLine) {
|
|
|
51
25
|
}
|
|
52
26
|
return tags;
|
|
53
27
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Locate the default features/ directory — `./features` under the current
|
|
56
|
-
* working directory. This is the target repo's own features dir: the directory
|
|
57
|
-
* a user runs `spec-controller balance` from, and the workspace root when the
|
|
58
|
-
* feature-code lint runs in CI. Callers that reconcile a different tree pass an
|
|
59
|
-
* explicit `--features <dir>`, which overrides this default.
|
|
60
|
-
*/
|
|
61
28
|
function featuresDir() {
|
|
62
29
|
return join(process.cwd(), "features");
|
|
63
30
|
}
|
|
64
|
-
/**
|
|
65
|
-
* List the corpus directory, REFUSING an absent one by name rather than by `ENOENT`.
|
|
66
|
-
*
|
|
67
|
-
* Absence stays a REFUSAL AT THE READER — what changed is that it is typed, so a caller can decide.
|
|
68
|
-
* `balance` opts in to reporting on a target that has no corpus (most targets have no `features/`
|
|
69
|
-
* at all, and `new-client` is a supported adoption state) by catching `MissingFeatureCorpusError` by
|
|
70
|
-
* name. Returning `[]` here instead would make that decision for every caller, and one that
|
|
71
|
-
* certifies a corpus would certify an absent one as empty.
|
|
72
|
-
*
|
|
73
|
-
* ONLY `ENOENT`. A `features` path that exists but is a FILE, or one the process may not read, is
|
|
74
|
-
* a different fault and is not ours to reinterpret — it rethrows.
|
|
75
|
-
*
|
|
76
|
-
* A SUPPLIED `--features` never reaches here absent: `checkInputsExist` refuses it at the CLI edge
|
|
77
|
-
* with exit 2. Supplied-but-absent is the operator mistyping; absent-by-default is
|
|
78
|
-
* the target's honest shape.
|
|
79
|
-
*/
|
|
80
31
|
function corpusFileNames(dir) {
|
|
81
32
|
try {
|
|
82
33
|
return readdirSync(dir);
|
|
@@ -87,10 +38,6 @@ function corpusFileNames(dir) {
|
|
|
87
38
|
throw err;
|
|
88
39
|
}
|
|
89
40
|
}
|
|
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
41
|
function readFeatureSource(path) {
|
|
95
42
|
try {
|
|
96
43
|
return readFileSync(path, "utf8");
|
|
@@ -101,23 +48,6 @@ function readFeatureSource(path) {
|
|
|
101
48
|
throw err;
|
|
102
49
|
}
|
|
103
50
|
}
|
|
104
|
-
/**
|
|
105
|
-
* Discover every feature file on disk and its header code — REFUSING a corpus the Gherkin
|
|
106
|
-
* parser rejects.
|
|
107
|
-
*
|
|
108
|
-
* The refusal lives HERE, in the one reader every corpus consumer already goes through, so a
|
|
109
|
-
* consumer INHERITS it rather than restating it. It is not a second parser: it is the existing
|
|
110
|
-
* `parseErrorsIn` — cucumber's own — reached from the shared discovery instead of only from the
|
|
111
|
-
* balance CLI's edge. One answer to "what is a feature file".
|
|
112
|
-
*
|
|
113
|
-
* WHY THE WHOLE CORPUS, NOT THE FIRST BAD FILE. `featureCorpusParseErrors` reports every
|
|
114
|
-
* unreadable file and the balance CLI prints them all. Refusing at the first
|
|
115
|
-
* failure would silently narrow that message, so every file is parsed and the refusal is raised
|
|
116
|
-
* once, carrying the lot in discovery order.
|
|
117
|
-
*
|
|
118
|
-
* And NO PARTIAL CORPUS is ever returned: a caller that could scan the readable half of a
|
|
119
|
-
* rejected tree would be back to reporting a verdict over a corpus it cannot read.
|
|
120
|
-
*/
|
|
121
51
|
export function discoverFeatures(dir = featuresDir()) {
|
|
122
52
|
const files = corpusFileNames(dir)
|
|
123
53
|
.filter((name) => name.endsWith(".feature"))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestScenarios.js","sourceRoot":"","sources":["../../src/ingest/ingestScenarios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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"}
|
|
@@ -1,13 +1,3 @@
|
|
|
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
1
|
export type Shape = "string" | "number" | "boolean" | "anything" | {
|
|
12
2
|
readonly list: Shape;
|
|
13
3
|
} | {
|
|
@@ -17,31 +7,10 @@ export type Shape = "string" | "number" | "boolean" | "anything" | {
|
|
|
17
7
|
readonly entries: Shape;
|
|
18
8
|
readonly keys?: RegExp;
|
|
19
9
|
};
|
|
20
|
-
/** What the Vitest JSON reporter writes, as far as the Vitest reader reads it. */
|
|
21
10
|
export declare const VITEST_REPORT: Shape;
|
|
22
|
-
/** What the Cucumber JSON formatter writes, as far as the Cucumber reader reads it. */
|
|
23
11
|
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
12
|
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
13
|
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
14
|
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
15
|
export declare function shapeFaultIn(value: unknown, shape: Shape, where?: string): string | null;
|
|
47
16
|
//# sourceMappingURL=inputShapes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputShapes.d.ts","sourceRoot":"","sources":["../../src/ingest/inputShapes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inputShapes.d.ts","sourceRoot":"","sources":["../../src/ingest/inputShapes.ts"],"names":[],"mappings":"AAAA,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,eAAO,MAAM,aAAa,EAAE,KAc3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAe7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAAsD,CAAC;AAEtF,eAAO,MAAM,oBAAoB,EAAE,KAWlC,CAAC;AAkBF,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,SAAK,GAAG,MAAM,GAAG,IAAI,CASpF"}
|
|
@@ -1,13 +1,3 @@
|
|
|
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
1
|
export const VITEST_REPORT = {
|
|
12
2
|
fields: {
|
|
13
3
|
testResults: {
|
|
@@ -23,7 +13,6 @@ export const VITEST_REPORT = {
|
|
|
23
13
|
},
|
|
24
14
|
required: ["testResults"],
|
|
25
15
|
};
|
|
26
|
-
/** What the Cucumber JSON formatter writes, as far as the Cucumber reader reads it. */
|
|
27
16
|
export const CUCUMBER_REPORT = {
|
|
28
17
|
list: {
|
|
29
18
|
fields: {
|
|
@@ -40,26 +29,11 @@ export const CUCUMBER_REPORT = {
|
|
|
40
29
|
},
|
|
41
30
|
},
|
|
42
31
|
};
|
|
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
32
|
export const CI_STEP_RECORD = {
|
|
49
33
|
entries: { fields: { outcome: "string" } },
|
|
50
34
|
keys: /^SCN-[A-Z0-9]{2,5}-\d+$/,
|
|
51
35
|
};
|
|
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
36
|
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
37
|
export const SAVED_RECONCILIATION = {
|
|
64
38
|
fields: {
|
|
65
39
|
runProvenance: { fields: {} },
|
|
@@ -89,10 +63,6 @@ function expectedKindOf(shape) {
|
|
|
89
63
|
function pathOf(where, key) {
|
|
90
64
|
return where === "" ? key : `${where}.${key}`;
|
|
91
65
|
}
|
|
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
66
|
export function shapeFaultIn(value, shape, where = "") {
|
|
97
67
|
if (shape === "anything")
|
|
98
68
|
return null;
|