valent-pipeline 0.19.63 → 0.19.64
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/bin/cli.js +2 -0
- package/package.json +1 -1
- package/src/commands/trace.js +29 -4
package/bin/cli.js
CHANGED
|
@@ -760,6 +760,7 @@ traceCmd
|
|
|
760
760
|
.option('--reqs-manifest <path>', 'AC manifest (defaults to stories/<id>/output/reqs-brief.manifest.json)')
|
|
761
761
|
.option('--spec-manifest <path>', 'Spec manifest (defaults to stories/<id>/output/qa-test-spec.manifest.json)')
|
|
762
762
|
.option('--label <name>', 'Evidence-run label whose junit results prove execution (default qa-b-tests)')
|
|
763
|
+
.option('--run <runId>', 'Bind to an exact evidence run id (overrides label resolution — use when several suites multiplex one label)')
|
|
763
764
|
.action(async (options) => {
|
|
764
765
|
const { traceCheckCmd } = await import('../src/commands/trace.js');
|
|
765
766
|
await traceCheckCmd(options);
|
|
@@ -773,6 +774,7 @@ traceCmd
|
|
|
773
774
|
.option('--reqs-manifest <path>', 'AC manifest path override')
|
|
774
775
|
.option('--spec-manifest <path>', 'Spec manifest path override')
|
|
775
776
|
.option('--label <name>', 'Evidence-run label for junit results (default qa-b-tests)')
|
|
777
|
+
.option('--run <runId>', 'Bind to an exact evidence run id (overrides label resolution — use when several suites multiplex one label)')
|
|
776
778
|
.option('--out <path>', 'Output path (defaults to stories/<id>/output/traceability-matrix.generated.md)')
|
|
777
779
|
.action(async (options) => {
|
|
778
780
|
const { traceMatrixCmd } = await import('../src/commands/trace.js');
|
package/package.json
CHANGED
package/src/commands/trace.js
CHANGED
|
@@ -9,9 +9,21 @@
|
|
|
9
9
|
import { readFileSync, existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
10
10
|
import { join, isAbsolute, dirname } from 'path';
|
|
11
11
|
import { traceCheck, traceMatrix } from '../lib/trace.js';
|
|
12
|
-
import { evidenceDir,
|
|
12
|
+
import { evidenceDir, resolveRunForAssert, requiredCaseIdsForRun, resolveRoot } from '../lib/evidence.js';
|
|
13
13
|
import { parseJunit } from '../lib/junit.js';
|
|
14
14
|
|
|
15
|
+
/** Load an exact evidence run by id (for `--run`), or null if absent/unreadable. */
|
|
16
|
+
function loadRunById(evDir, runId) {
|
|
17
|
+
const dir = join(evDir, 'runs', runId);
|
|
18
|
+
const recPath = join(dir, 'evidence.json');
|
|
19
|
+
if (!existsSync(recPath)) return null;
|
|
20
|
+
try {
|
|
21
|
+
return { runId, dir, record: JSON.parse(readFileSync(recPath, 'utf-8')) };
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
15
27
|
function readJson(path, what) {
|
|
16
28
|
try {
|
|
17
29
|
return JSON.parse(readFileSync(path, 'utf-8'));
|
|
@@ -41,11 +53,24 @@ function loadInputs(options) {
|
|
|
41
53
|
return { noop: 'spec manifest predates the per-case `ac` field — skipping (no-op pass). Re-run QA-A to gain mechanical AC coverage.' };
|
|
42
54
|
}
|
|
43
55
|
|
|
44
|
-
// Executed testcases from the
|
|
45
|
-
//
|
|
56
|
+
// Executed testcases from the evidence run that ACTUALLY carries this story's required acceptance
|
|
57
|
+
// cases — NOT merely the newest same-label run. A REVALIDATE (and any multi-suite cycle) re-runs the
|
|
58
|
+
// full npm suite under the `qa-b-tests` label ALONGSIDE the acceptance run; binding to the newest by
|
|
59
|
+
// label alone globs the full suite (which carries ZERO of the story's required cases) and false-fails
|
|
60
|
+
// every required case as "unexecuted" — label-multiplexing, the M-11/.45/.60 class, of which the
|
|
61
|
+
// trace-check was the last unfixed surface (the `evidence assert` + verdict-crosscheck paths already
|
|
62
|
+
// resolve this way). resolveRunForAssert binds to the same-SHA sibling carrying a required case id and
|
|
63
|
+
// preserves the #5 crash-loud invariant (a report-less newest is never silently skipped). An explicit
|
|
64
|
+
// --run pins exactly, for the operator who wants to override resolution. (junit re-parsed from the
|
|
65
|
+
// frozen copies — never from a transcription.)
|
|
46
66
|
let junitCases = null;
|
|
47
67
|
let runId = null;
|
|
48
|
-
const
|
|
68
|
+
const evDir = evidenceDir(root, story);
|
|
69
|
+
const label = options.label || 'qa-b-tests';
|
|
70
|
+
const requiredCaseIds = requiredCaseIdsForRun(cases);
|
|
71
|
+
const run = options.run
|
|
72
|
+
? loadRunById(evDir, options.run)
|
|
73
|
+
: resolveRunForAssert(evDir, { label, requiredCaseIds });
|
|
49
74
|
if (run) {
|
|
50
75
|
runId = run.runId;
|
|
51
76
|
junitCases = [];
|