spec-controller 0.1.65 → 0.1.67
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-balance/cli.d.ts +2 -1
- package/dist/cli-balance/cli.d.ts.map +1 -1
- package/dist/cli-balance/cli.js +31 -80
- package/dist/cli-balance/cli.js.map +1 -1
- package/dist/cli-balance/corpusDir.d.ts +1 -1
- package/dist/cli-balance/corpusDir.d.ts.map +1 -1
- package/dist/cli-balance/evidenceInputs.d.ts +136 -0
- package/dist/cli-balance/evidenceInputs.d.ts.map +1 -0
- package/dist/cli-balance/evidenceInputs.js +125 -0
- package/dist/cli-balance/evidenceInputs.js.map +1 -0
- package/dist/cli-balance/reRender.d.ts +1 -1
- package/dist/cli-balance/reRender.d.ts.map +1 -1
- package/dist/cli-balance/reRender.js +4 -3
- package/dist/cli-balance/reRender.js.map +1 -1
- package/dist/cli-balance/unreadableInputs.d.ts +41 -13
- package/dist/cli-balance/unreadableInputs.d.ts.map +1 -1
- package/dist/cli-balance/unreadableInputs.js +48 -108
- package/dist/cli-balance/unreadableInputs.js.map +1 -1
- package/dist/cli-registry.d.ts.map +1 -1
- package/dist/cli-registry.js +2 -50
- package/dist/cli-registry.js.map +1 -1
- package/dist/ingest/ingestQualityChecks.d.ts +20 -27
- package/dist/ingest/ingestQualityChecks.d.ts.map +1 -1
- package/dist/ingest/ingestQualityChecks.js +31 -79
- package/dist/ingest/ingestQualityChecks.js.map +1 -1
- package/dist/ingest/inputReading.d.ts +12 -0
- package/dist/ingest/inputReading.d.ts.map +1 -0
- package/dist/ingest/inputReading.js +28 -0
- package/dist/ingest/inputReading.js.map +1 -0
- package/dist/ingest/reportReading.d.ts +20 -0
- package/dist/ingest/reportReading.d.ts.map +1 -0
- package/dist/ingest/reportReading.js +28 -0
- package/dist/ingest/reportReading.js.map +1 -0
- package/dist/messages.d.ts +1 -0
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type ReportsReading } from "./unreadableInputs.js";
|
|
1
2
|
export declare function checkLegacyJson(args: Record<string, string>): string | null;
|
|
2
3
|
export declare function sourceTarget(args: Record<string, string>): string;
|
|
3
4
|
export declare function checkInputsExist(args: Record<string, string>, exists: (path: string) => boolean): string | null;
|
|
4
|
-
export declare function checkInputsParse(
|
|
5
|
+
export declare function checkInputsParse(reports: ReportsReading): string | null;
|
|
5
6
|
export declare function runBalance(argv: string[], ownRunDir?: string): boolean;
|
|
6
7
|
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAkBA,OAAO,EAWL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AA2B/B,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAK3E;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAEjE;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAChC,MAAM,GAAG,IAAI,CAQf;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAOvE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAEtE"}
|
package/dist/cli-balance/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { existsSync
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
2
|
import { dirname } from "node:path";
|
|
3
3
|
import { runReconcile, readCorpus, readWorkflows, featureNamesOf, evidenceObligationsOf, } from "../ingest/ingestQualityChecks.js";
|
|
4
|
+
import { EVIDENCE_INPUTS, inputPathsOf, runInputsOf } from "./evidenceInputs.js";
|
|
4
5
|
import { planOutput } from "./emit/format.js";
|
|
5
6
|
import { writeOutputs } from "./emit/writer.js";
|
|
6
7
|
import { namesStdout, refuse, settlingRefusal, stdoutIdentity } from "../outputLocation.js";
|
|
@@ -8,7 +9,8 @@ import { identifiedInputs, inputsReadBy, NODE_INPUT_READER } from "./inputsRead.
|
|
|
8
9
|
import { DEFAULT_FEATURES_DIR } from "../defaultCorpus.js";
|
|
9
10
|
import { corpusDirOf } from "./corpusDir.js";
|
|
10
11
|
import { checkReRenderFlags } from "./reRender.js";
|
|
11
|
-
import { checkInputPaths, checkWorkflowsParse, checkInputShapes, corpusDirRefusal, checkSavedReconciliation, jsonInputsOf,
|
|
12
|
+
import { checkInputPaths, checkWorkflowsParse, checkInputShapes, corpusDirRefusal, checkSavedReconciliation, jsonInputsOf, readReports, reportRefusal, reRenderOrRefusal, savedReportRefusal, } from "./unreadableInputs.js";
|
|
13
|
+
import { readDocument } from "../ingest/reportReading.js";
|
|
12
14
|
import { statusFor } from "./exitStatus.js";
|
|
13
15
|
import { verdictCode, } from "@3f-consulting/spec-controller-core";
|
|
14
16
|
import { resolveSourceSha, resolveTargetOrigin, resolveTargetRoot, resolveToolIdentity } from "../run-management/resolveRunInputs.js";
|
|
@@ -20,9 +22,6 @@ function collectFormatSpecs(argv) {
|
|
|
20
22
|
// checkMissingValues has already refused a --format given no value.
|
|
21
23
|
return argv.flatMap((token, i) => (token === "--format" ? [argv[i + 1]] : []));
|
|
22
24
|
}
|
|
23
|
-
function readText(path) {
|
|
24
|
-
return readFileSync(path, "utf8");
|
|
25
|
-
}
|
|
26
25
|
export function checkLegacyJson(args) {
|
|
27
26
|
if (args["json"] !== undefined) {
|
|
28
27
|
return APP_MESSAGES[AppMessage.LegacyJsonRemoved]();
|
|
@@ -32,25 +31,8 @@ export function checkLegacyJson(args) {
|
|
|
32
31
|
export function sourceTarget(args) {
|
|
33
32
|
return args["target"] ?? "unknown-target";
|
|
34
33
|
}
|
|
35
|
-
function reconcileInputsOf(args) {
|
|
36
|
-
return {
|
|
37
|
-
features: args["features"],
|
|
38
|
-
vitest: args["vitest"],
|
|
39
|
-
pytest: args["pytest"],
|
|
40
|
-
jest: args["jest"],
|
|
41
|
-
junit: args["junit"],
|
|
42
|
-
rspec: args["rspec"],
|
|
43
|
-
cucumber: args["cucumber"],
|
|
44
|
-
ci: args["ci"],
|
|
45
|
-
packageJson: args["package-json"],
|
|
46
|
-
ciSteps: args["ci-steps"],
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
34
|
export function checkInputsExist(args, exists) {
|
|
50
|
-
const
|
|
51
|
-
"vitest", "pytest", "jest", "junit", "rspec", "cucumber", "features", "ci", "package-json", "ci-steps",
|
|
52
|
-
];
|
|
53
|
-
for (const flag of flags) {
|
|
35
|
+
for (const { flag } of EVIDENCE_INPUTS) {
|
|
54
36
|
const path = args[flag];
|
|
55
37
|
if (path !== undefined && !exists(path)) {
|
|
56
38
|
return APP_MESSAGES[AppMessage.InputPathMissing](`--${flag}`, path);
|
|
@@ -58,39 +40,13 @@ export function checkInputsExist(args, exists) {
|
|
|
58
40
|
}
|
|
59
41
|
return null;
|
|
60
42
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
for (const flag of JSON_INPUT_FLAGS) {
|
|
66
|
-
const path = args[flag];
|
|
67
|
-
if (path === undefined)
|
|
43
|
+
export function checkInputsParse(reports) {
|
|
44
|
+
for (const file of reports.files) {
|
|
45
|
+
const { reading } = file;
|
|
46
|
+
if (!file.flagged || file.report.format !== "json")
|
|
68
47
|
continue;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
text = read(path);
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
return APP_MESSAGES[AppMessage.CouldNotBeReadAt](APP_MESSAGES[AppMessage.FlaggedFile](`--${flag}`), path, reasonOf(err));
|
|
75
|
-
}
|
|
76
|
-
try {
|
|
77
|
-
JSON.parse(text);
|
|
78
|
-
}
|
|
79
|
-
catch (err) {
|
|
80
|
-
return APP_MESSAGES[AppMessage.NotValidJson](APP_MESSAGES[AppMessage.FlaggedReport](`--${flag}`), path, reasonOf(err));
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
function checkRenderFromJson(args, read) {
|
|
86
|
-
const path = args["render-from-json"];
|
|
87
|
-
if (path === undefined)
|
|
88
|
-
return null;
|
|
89
|
-
try {
|
|
90
|
-
JSON.parse(read(path));
|
|
91
|
-
}
|
|
92
|
-
catch (err) {
|
|
93
|
-
return APP_MESSAGES[AppMessage.CouldNotBeReadAt](APP_MESSAGES[AppMessage.FlaggedSavedReport]("--render-from-json"), path, reasonOf(err));
|
|
48
|
+
if (reading.kind === "read-fault" || reading.kind === "unparseable")
|
|
49
|
+
return reportRefusal({ ...file, reading });
|
|
94
50
|
}
|
|
95
51
|
return null;
|
|
96
52
|
}
|
|
@@ -126,10 +82,10 @@ function reconcile(argv, ownRunDir) {
|
|
|
126
82
|
refuse(missingValueError);
|
|
127
83
|
if (renderSavedReport(args))
|
|
128
84
|
return true;
|
|
129
|
-
const { corpus, workflows } = refuseUnreadableInputs(args);
|
|
130
|
-
const inputs =
|
|
85
|
+
const { corpus, workflows, reports } = refuseUnreadableInputs(args);
|
|
86
|
+
const inputs = inputPathsOf(args);
|
|
131
87
|
const root = resolveTargetRoot({ features: inputs.features });
|
|
132
|
-
const balance = runReconcile(
|
|
88
|
+
const balance = runReconcile(reports, root, corpus, workflows);
|
|
133
89
|
const ctx = runContextOf(args, inputs, runStart, root);
|
|
134
90
|
const planResult = planOutput(collectFormatSpecs(argv), namesStdout);
|
|
135
91
|
if (!planResult.ok)
|
|
@@ -145,17 +101,16 @@ function renderSavedReport(args) {
|
|
|
145
101
|
const ignoredFlagError = checkReRenderFlags(args);
|
|
146
102
|
if (ignoredFlagError)
|
|
147
103
|
refuse(ignoredFlagError);
|
|
148
|
-
const unreadableSavedReportError = checkRenderFromJson(args, readText);
|
|
149
|
-
if (unreadableSavedReportError)
|
|
150
|
-
refuse(unreadableSavedReportError);
|
|
151
104
|
const rehydratePath = args["render-from-json"];
|
|
152
105
|
if (rehydratePath === undefined)
|
|
153
106
|
return false;
|
|
154
|
-
const
|
|
155
|
-
|
|
107
|
+
const savedReading = readDocument(rehydratePath, "json");
|
|
108
|
+
if (savedReading.kind !== "parsed")
|
|
109
|
+
refuse(savedReportRefusal(rehydratePath, savedReading));
|
|
110
|
+
const notSavedError = checkSavedReconciliation(rehydratePath, savedReading.document);
|
|
156
111
|
if (notSavedError)
|
|
157
112
|
refuse(notSavedError);
|
|
158
|
-
const saved = reRenderOrRefusal(rehydratePath,
|
|
113
|
+
const saved = reRenderOrRefusal(rehydratePath, savedReading.document, args["strict"] !== undefined);
|
|
159
114
|
if (typeof saved === "string")
|
|
160
115
|
refuse(saved);
|
|
161
116
|
process.stdout.write(saved.markdown + "\n");
|
|
@@ -167,7 +122,8 @@ function refuseUnreadableInputs(args) {
|
|
|
167
122
|
const missingInputError = checkInputsExist(args, existsSync);
|
|
168
123
|
if (missingInputError)
|
|
169
124
|
refuse(missingInputError);
|
|
170
|
-
const
|
|
125
|
+
const reportsReading = readReports(jsonInputsOf(args, existsSync));
|
|
126
|
+
const unparseableInputError = checkInputsParse(reportsReading);
|
|
171
127
|
if (unparseableInputError)
|
|
172
128
|
refuse(unparseableInputError);
|
|
173
129
|
const corpusDir = corpusDirOf(args);
|
|
@@ -175,25 +131,20 @@ function refuseUnreadableInputs(args) {
|
|
|
175
131
|
refuse(corpusDirRefusal(corpusDir));
|
|
176
132
|
const corpusReading = readCorpus(corpusDir);
|
|
177
133
|
const workflowReading = readWorkflows(args["ci"]);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
refuse(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
refuse(misshapenInputError);
|
|
134
|
+
if (corpusReading.kind === "read-fault")
|
|
135
|
+
refuse(checkInputPaths(args, corpusReading, workflowReading));
|
|
136
|
+
if (workflowReading.kind === "read-fault")
|
|
137
|
+
refuse(checkInputPaths(args, corpusReading, workflowReading));
|
|
138
|
+
if (workflowReading.kind === "unparseable")
|
|
139
|
+
refuse(checkWorkflowsParse(args, workflowReading));
|
|
140
|
+
if (reportsReading.kind === "faulty")
|
|
141
|
+
refuse(checkInputShapes(reportsReading));
|
|
187
142
|
if (corpusReading.kind === "unparseable") {
|
|
188
143
|
refuse(corpusReading.faults
|
|
189
144
|
.map(({ file, message }) => APP_MESSAGES[AppMessage.CorpusFileUnparseable](APP_MESSAGES[AppMessage.FlaggedCorpus]("--features"), file, message))
|
|
190
145
|
.join("\n"));
|
|
191
146
|
}
|
|
192
|
-
|
|
193
|
-
return {
|
|
194
|
-
corpus: corpusReading.kind === "read" ? corpusReading.corpus : [],
|
|
195
|
-
workflows: workflowReading.kind === "read" ? workflowReading.workflows : [],
|
|
196
|
-
};
|
|
147
|
+
return { corpus: corpusReading.corpus, workflows: workflowReading.workflows, reports: reportsReading.reports };
|
|
197
148
|
}
|
|
198
149
|
function runContextOf(args, inputs, runStart, root) {
|
|
199
150
|
const targetDir = args["features"] !== undefined ? dirname(args["features"]) : undefined;
|
|
@@ -201,7 +152,7 @@ function runContextOf(args, inputs, runStart, root) {
|
|
|
201
152
|
return {
|
|
202
153
|
target: sourceTarget(args),
|
|
203
154
|
...(targetOrigin !== null ? { targetOrigin } : {}),
|
|
204
|
-
inputs:
|
|
155
|
+
inputs: runInputsOf(inputs),
|
|
205
156
|
corpus: args["features"] ?? DEFAULT_FEATURES_DIR,
|
|
206
157
|
runStart,
|
|
207
158
|
sourceSha: resolveSourceSha({ sourceSha: args["source-sha"], targetDir }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli-balance/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,qBAAqB,GAEtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAmB,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,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I,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzF,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1F,OAAO;QACL,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC;QAC1B,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;QAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,oBAAoB;QAChD,QAAQ;QACR,SAAS,EAAE,gBAAgB,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC;QACzE,IAAI;QACJ,GAAG,mBAAmB,EAAE;QACxB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,SAAS;KACrC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { InputReadFault } from "../ingest/
|
|
1
|
+
import type { InputReadFault } from "../ingest/inputReading.js";
|
|
2
2
|
export declare function corpusDirOf(args: Record<string, string>): string | InputReadFault;
|
|
3
3
|
//# sourceMappingURL=corpusDir.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpusDir.d.ts","sourceRoot":"","sources":["../../src/cli-balance/corpusDir.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"corpusDir.d.ts","sourceRoot":"","sources":["../../src/cli-balance/corpusDir.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,cAAc,CAQjF"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { AppMessage, type PlainAppMessage } from "../messages.js";
|
|
2
|
+
import { type Shape } from "../ingest/inputShapes.js";
|
|
3
|
+
import type { EvidenceReader } from "../ingest/ingestQualityChecks.js";
|
|
4
|
+
import type { ReportFormat } from "../ingest/reportReading.js";
|
|
5
|
+
import type { RunInput, RunInputName } from "@3f-consulting/spec-controller-core";
|
|
6
|
+
export interface ReportInput {
|
|
7
|
+
readonly reader: EvidenceReader;
|
|
8
|
+
readonly format: ReportFormat;
|
|
9
|
+
readonly shape: Shape;
|
|
10
|
+
readonly subject: AppMessage.FlaggedReport | AppMessage.FlaggedRecord | AppMessage.FlaggedManifest;
|
|
11
|
+
readonly writer: PlainAppMessage;
|
|
12
|
+
readonly takesADirectory?: true;
|
|
13
|
+
}
|
|
14
|
+
export interface EvidenceInput {
|
|
15
|
+
readonly flag: string;
|
|
16
|
+
readonly key: string;
|
|
17
|
+
readonly arg: string;
|
|
18
|
+
readonly description: PlainAppMessage;
|
|
19
|
+
readonly report?: ReportInput;
|
|
20
|
+
}
|
|
21
|
+
declare const DECLARED: readonly [{
|
|
22
|
+
readonly flag: "features";
|
|
23
|
+
readonly key: "features";
|
|
24
|
+
readonly arg: "<dir>";
|
|
25
|
+
readonly description: AppMessage.FeaturesFlag;
|
|
26
|
+
}, {
|
|
27
|
+
readonly flag: "vitest";
|
|
28
|
+
readonly key: "vitest";
|
|
29
|
+
readonly arg: "<report.json>";
|
|
30
|
+
readonly description: AppMessage.VitestFlag;
|
|
31
|
+
readonly report: {
|
|
32
|
+
readonly reader: "vitest";
|
|
33
|
+
readonly format: "json";
|
|
34
|
+
readonly shape: Shape;
|
|
35
|
+
readonly subject: AppMessage.FlaggedReport;
|
|
36
|
+
readonly writer: AppMessage.VitestReportShape;
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
readonly flag: "pytest";
|
|
40
|
+
readonly key: "pytest";
|
|
41
|
+
readonly arg: "<report.xml>";
|
|
42
|
+
readonly description: AppMessage.PytestFlag;
|
|
43
|
+
readonly report: {
|
|
44
|
+
readonly reader: "pytest";
|
|
45
|
+
readonly format: "junit-xml";
|
|
46
|
+
readonly shape: Shape;
|
|
47
|
+
readonly subject: AppMessage.FlaggedReport;
|
|
48
|
+
readonly writer: AppMessage.JunitReportShape;
|
|
49
|
+
};
|
|
50
|
+
}, {
|
|
51
|
+
readonly flag: "jest";
|
|
52
|
+
readonly key: "jest";
|
|
53
|
+
readonly arg: "<report.json>";
|
|
54
|
+
readonly description: AppMessage.JestFlag;
|
|
55
|
+
readonly report: {
|
|
56
|
+
readonly reader: "jest";
|
|
57
|
+
readonly format: "json-naming-its-shape";
|
|
58
|
+
readonly shape: Shape;
|
|
59
|
+
readonly subject: AppMessage.FlaggedReport;
|
|
60
|
+
readonly writer: AppMessage.JestReportShape;
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
readonly flag: "junit";
|
|
64
|
+
readonly key: "junit";
|
|
65
|
+
readonly arg: "<report.xml>";
|
|
66
|
+
readonly description: AppMessage.JunitFlag;
|
|
67
|
+
readonly report: {
|
|
68
|
+
readonly reader: "junit";
|
|
69
|
+
readonly format: "junit-xml-or-one-suite";
|
|
70
|
+
readonly shape: Shape;
|
|
71
|
+
readonly subject: AppMessage.FlaggedReport;
|
|
72
|
+
readonly writer: AppMessage.JunitXmlReportShape;
|
|
73
|
+
readonly takesADirectory: true;
|
|
74
|
+
};
|
|
75
|
+
}, {
|
|
76
|
+
readonly flag: "rspec";
|
|
77
|
+
readonly key: "rspec";
|
|
78
|
+
readonly arg: "<report.json>";
|
|
79
|
+
readonly description: AppMessage.RspecFlag;
|
|
80
|
+
readonly report: {
|
|
81
|
+
readonly reader: "rspec";
|
|
82
|
+
readonly format: "json-naming-its-shape";
|
|
83
|
+
readonly shape: Shape;
|
|
84
|
+
readonly subject: AppMessage.FlaggedReport;
|
|
85
|
+
readonly writer: AppMessage.RspecReportShape;
|
|
86
|
+
};
|
|
87
|
+
}, {
|
|
88
|
+
readonly flag: "cucumber";
|
|
89
|
+
readonly key: "cucumber";
|
|
90
|
+
readonly arg: "<report.json>";
|
|
91
|
+
readonly description: AppMessage.CucumberFlag;
|
|
92
|
+
readonly report: {
|
|
93
|
+
readonly reader: "cucumber";
|
|
94
|
+
readonly format: "json";
|
|
95
|
+
readonly shape: Shape;
|
|
96
|
+
readonly subject: AppMessage.FlaggedReport;
|
|
97
|
+
readonly writer: AppMessage.CucumberReportShape;
|
|
98
|
+
};
|
|
99
|
+
}, {
|
|
100
|
+
readonly flag: "ci";
|
|
101
|
+
readonly key: "ci";
|
|
102
|
+
readonly arg: "<ci.yml>";
|
|
103
|
+
readonly description: AppMessage.CiFlag;
|
|
104
|
+
}, {
|
|
105
|
+
readonly flag: "package-json";
|
|
106
|
+
readonly key: "packageJson";
|
|
107
|
+
readonly arg: "<path>";
|
|
108
|
+
readonly description: AppMessage.PackageJsonFlag;
|
|
109
|
+
readonly report: {
|
|
110
|
+
readonly reader: "package-manifest";
|
|
111
|
+
readonly format: "json";
|
|
112
|
+
readonly shape: Shape;
|
|
113
|
+
readonly subject: AppMessage.FlaggedManifest;
|
|
114
|
+
readonly writer: AppMessage.PackageManifestShape;
|
|
115
|
+
};
|
|
116
|
+
}, {
|
|
117
|
+
readonly flag: "ci-steps";
|
|
118
|
+
readonly key: "ciSteps";
|
|
119
|
+
readonly arg: "<record.json>";
|
|
120
|
+
readonly description: AppMessage.CiStepsFlag;
|
|
121
|
+
readonly report: {
|
|
122
|
+
readonly reader: "ci-step-record";
|
|
123
|
+
readonly format: "json";
|
|
124
|
+
readonly shape: Shape;
|
|
125
|
+
readonly subject: AppMessage.FlaggedRecord;
|
|
126
|
+
readonly writer: AppMessage.CiStepRecordShape;
|
|
127
|
+
};
|
|
128
|
+
}];
|
|
129
|
+
export declare const EVIDENCE_INPUTS: readonly EvidenceInput[];
|
|
130
|
+
type InputKey = (typeof DECLARED)[number]["key"];
|
|
131
|
+
export type InputPaths = Readonly<Partial<Record<InputKey, string>>>;
|
|
132
|
+
export declare function inputPathsOf(args: Readonly<Record<string, string>>): InputPaths;
|
|
133
|
+
export declare const INPUT_NAMES: readonly RunInputName[];
|
|
134
|
+
export declare function runInputsOf(paths: InputPaths): RunInput[];
|
|
135
|
+
export {};
|
|
136
|
+
//# sourceMappingURL=evidenceInputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidenceInputs.d.ts","sourceRoot":"","sources":["../../src/cli-balance/evidenceInputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAOL,KAAK,KAAK,EACX,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAElF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,GAAG,UAAU,CAAC,eAAe,CAAC;IACnG,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAID,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4G+B,CAAC;AAE9C,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAAa,CAAC;AAElE,KAAK,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAErE,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAE/E;AAED,eAAO,MAAM,WAAW,EAAE,SAAS,YAAY,EAA+E,CAAC;AAE/H,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,EAAE,CAKzD"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { AppMessage } from "../messages.js";
|
|
2
|
+
import { CI_STEP_RECORD, CUCUMBER_REPORT, JUNIT_REPORT, PACKAGE_MANIFEST, RSPEC_REPORT, VITEST_REPORT, } from "../ingest/inputShapes.js";
|
|
3
|
+
// The order is the canonical order: the help lists the flags in it, the pre-checks take the inputs in it,
|
|
4
|
+
// and the run provenance names them in it.
|
|
5
|
+
const DECLARED = [
|
|
6
|
+
{ flag: "features", key: "features", arg: "<dir>", description: AppMessage.FeaturesFlag },
|
|
7
|
+
{
|
|
8
|
+
flag: "vitest",
|
|
9
|
+
key: "vitest",
|
|
10
|
+
arg: "<report.json>",
|
|
11
|
+
description: AppMessage.VitestFlag,
|
|
12
|
+
report: {
|
|
13
|
+
reader: "vitest",
|
|
14
|
+
format: "json",
|
|
15
|
+
shape: VITEST_REPORT,
|
|
16
|
+
subject: AppMessage.FlaggedReport,
|
|
17
|
+
writer: AppMessage.VitestReportShape,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
flag: "pytest",
|
|
22
|
+
key: "pytest",
|
|
23
|
+
arg: "<report.xml>",
|
|
24
|
+
description: AppMessage.PytestFlag,
|
|
25
|
+
report: {
|
|
26
|
+
reader: "pytest",
|
|
27
|
+
format: "junit-xml",
|
|
28
|
+
shape: JUNIT_REPORT,
|
|
29
|
+
subject: AppMessage.FlaggedReport,
|
|
30
|
+
writer: AppMessage.JunitReportShape,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
flag: "jest",
|
|
35
|
+
key: "jest",
|
|
36
|
+
arg: "<report.json>",
|
|
37
|
+
description: AppMessage.JestFlag,
|
|
38
|
+
report: {
|
|
39
|
+
reader: "jest",
|
|
40
|
+
format: "json-naming-its-shape",
|
|
41
|
+
shape: VITEST_REPORT,
|
|
42
|
+
subject: AppMessage.FlaggedReport,
|
|
43
|
+
writer: AppMessage.JestReportShape,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
flag: "junit",
|
|
48
|
+
key: "junit",
|
|
49
|
+
arg: "<report.xml>",
|
|
50
|
+
description: AppMessage.JunitFlag,
|
|
51
|
+
report: {
|
|
52
|
+
reader: "junit",
|
|
53
|
+
format: "junit-xml-or-one-suite",
|
|
54
|
+
shape: JUNIT_REPORT,
|
|
55
|
+
subject: AppMessage.FlaggedReport,
|
|
56
|
+
writer: AppMessage.JunitXmlReportShape,
|
|
57
|
+
takesADirectory: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
flag: "rspec",
|
|
62
|
+
key: "rspec",
|
|
63
|
+
arg: "<report.json>",
|
|
64
|
+
description: AppMessage.RspecFlag,
|
|
65
|
+
report: {
|
|
66
|
+
reader: "rspec",
|
|
67
|
+
format: "json-naming-its-shape",
|
|
68
|
+
shape: RSPEC_REPORT,
|
|
69
|
+
subject: AppMessage.FlaggedReport,
|
|
70
|
+
writer: AppMessage.RspecReportShape,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
flag: "cucumber",
|
|
75
|
+
key: "cucumber",
|
|
76
|
+
arg: "<report.json>",
|
|
77
|
+
description: AppMessage.CucumberFlag,
|
|
78
|
+
report: {
|
|
79
|
+
reader: "cucumber",
|
|
80
|
+
format: "json",
|
|
81
|
+
shape: CUCUMBER_REPORT,
|
|
82
|
+
subject: AppMessage.FlaggedReport,
|
|
83
|
+
writer: AppMessage.CucumberReportShape,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{ flag: "ci", key: "ci", arg: "<ci.yml>", description: AppMessage.CiFlag },
|
|
87
|
+
{
|
|
88
|
+
flag: "package-json",
|
|
89
|
+
key: "packageJson",
|
|
90
|
+
arg: "<path>",
|
|
91
|
+
description: AppMessage.PackageJsonFlag,
|
|
92
|
+
report: {
|
|
93
|
+
reader: "package-manifest",
|
|
94
|
+
format: "json",
|
|
95
|
+
shape: PACKAGE_MANIFEST,
|
|
96
|
+
subject: AppMessage.FlaggedManifest,
|
|
97
|
+
writer: AppMessage.PackageManifestShape,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
flag: "ci-steps",
|
|
102
|
+
key: "ciSteps",
|
|
103
|
+
arg: "<record.json>",
|
|
104
|
+
description: AppMessage.CiStepsFlag,
|
|
105
|
+
report: {
|
|
106
|
+
reader: "ci-step-record",
|
|
107
|
+
format: "json",
|
|
108
|
+
shape: CI_STEP_RECORD,
|
|
109
|
+
subject: AppMessage.FlaggedRecord,
|
|
110
|
+
writer: AppMessage.CiStepRecordShape,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
export const EVIDENCE_INPUTS = DECLARED;
|
|
115
|
+
export function inputPathsOf(args) {
|
|
116
|
+
return Object.fromEntries(EVIDENCE_INPUTS.map(({ flag, key }) => [key, args[flag]]));
|
|
117
|
+
}
|
|
118
|
+
export const INPUT_NAMES = EVIDENCE_INPUTS.map(({ flag, key }) => ({ name: key, flag: `--${flag}` }));
|
|
119
|
+
export function runInputsOf(paths) {
|
|
120
|
+
return INPUT_NAMES.map((input) => {
|
|
121
|
+
const path = paths[input.name];
|
|
122
|
+
return path === undefined ? input : { ...input, path };
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=evidenceInputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidenceInputs.js","sourceRoot":"","sources":["../../src/cli-balance/evidenceInputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EACL,cAAc,EACd,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,GAEd,MAAM,0BAA0B,CAAC;AAuBlC,0GAA0G;AAC1G,2CAA2C;AAC3C,MAAM,QAAQ,GAAG;IACf,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC,YAAY,EAAE;IACzF;QACE,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,eAAe;QACpB,WAAW,EAAE,UAAU,CAAC,UAAU;QAClC,MAAM,EAAE;YACN,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,UAAU,CAAC,aAAa;YACjC,MAAM,EAAE,UAAU,CAAC,iBAAiB;SACrC;KACF;IACD;QACE,IAAI,EAAE,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,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AAE/H,MAAM,UAAU,WAAW,CAAC,KAAiB;IAC3C,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC/B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAgB,CAAC,CAAC;QAC3C,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -3,6 +3,6 @@ export interface ReRendered {
|
|
|
3
3
|
readonly markdown: string;
|
|
4
4
|
readonly code: VerdictCode;
|
|
5
5
|
}
|
|
6
|
-
export declare function reRender(
|
|
6
|
+
export declare function reRender(document: unknown, strictGiven: boolean): ReRendered;
|
|
7
7
|
export declare function checkReRenderFlags(args: Record<string, string>): string | null;
|
|
8
8
|
//# sourceMappingURL=reRender.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reRender.d.ts","sourceRoot":"","sources":["../../src/cli-balance/reRender.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"reRender.d.ts","sourceRoot":"","sources":["../../src/cli-balance/reRender.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAIpF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,UAAU,CAQ5E;AAID,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAK9E"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { renderReport, verdictCode } from "@3f-consulting/spec-controller-core";
|
|
2
2
|
import { APP_MESSAGES, AppMessage } from "../messages.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { INPUT_NAMES } from "./evidenceInputs.js";
|
|
4
|
+
export function reRender(document, strictGiven) {
|
|
5
|
+
const saved = document;
|
|
5
6
|
const strict = saved.runProvenance.strict === true || strictGiven;
|
|
6
7
|
const report = { ...saved, runProvenance: { ...saved.runProvenance, strict } };
|
|
7
8
|
return {
|
|
8
|
-
markdown: renderReport(report),
|
|
9
|
+
markdown: renderReport(report, INPUT_NAMES),
|
|
9
10
|
code: verdictCode({ ledger: report.ledger, scenarioCodeErrors: report.scenarioCodeErrors, strict }),
|
|
10
11
|
};
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reRender.js","sourceRoot":"","sources":["../../src/cli-balance/reRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"reRender.js","sourceRoot":"","sources":["../../src/cli-balance/reRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOlD,MAAM,UAAU,QAAQ,CAAC,QAAiB,EAAE,WAAoB;IAC9D,MAAM,KAAK,GAAG,QAA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