bmad-method-test-architecture-enterprise 4.1.0 → 4.3.0
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/.claude-plugin/marketplace.json +1 -1
- package/cli/lib/evaluate/ci.js +42 -1
- package/cli/lib/evaluate/compare.js +2 -1
- package/cli/lib/evaluate/run.js +13 -1
- package/cli/lib/evaluate/score-inputs.js +66 -4
- package/cli/lib/evaluate/score.js +29 -6
- package/package.json +2 -2
- package/skills/bmad-tea-evaluate/references/gaps.md +1 -1
- package/skills/bmod-tea/bmod.toml +1 -1
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"name": "bmad-method-test-architecture-enterprise",
|
|
32
32
|
"source": "./",
|
|
33
33
|
"description": "Master Test Architect module for quality strategy, test generation in red and expand modes with automatic run-and-heal, combined framework and CI setup, CI/CD quality gates, and structured testing education. Existing CI and ATDD customizations can be migrated to the new skill names. Part of the BMad Method ecosystem.",
|
|
34
|
-
"version": "4.
|
|
34
|
+
"version": "4.3.0",
|
|
35
35
|
"author": {
|
|
36
36
|
"name": "Murat K Ozcan (TEA Creator) & Brian (BMad) Madison"
|
|
37
37
|
},
|
package/cli/lib/evaluate/ci.js
CHANGED
|
@@ -98,7 +98,7 @@ const { textNeutralizer } = require('./recorded-paths');
|
|
|
98
98
|
const { RunDirectory, RunDirectoryError } = require('./run-directory');
|
|
99
99
|
const { runRunCommand } = require('./run');
|
|
100
100
|
const { runScoreCommand } = require('./score');
|
|
101
|
-
const { regularFileBytes } = require('./score-inputs');
|
|
101
|
+
const { regularFileBytes, scoringInstant } = require('./score-inputs');
|
|
102
102
|
const {
|
|
103
103
|
cleanUpOnSignal,
|
|
104
104
|
heldPrivateRoot,
|
|
@@ -1119,6 +1119,46 @@ function recordedDesignations(baseline) {
|
|
|
1119
1119
|
return designations;
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
1122
|
+
/**
|
|
1123
|
+
* The instant the baseline was scored at: the `--scored-at` argument its accepted score invocation handed every probe's call, read
|
|
1124
|
+
* from the call records the way `recordedDesignations` reads a designation. A replay scored at that instant tests each contract
|
|
1125
|
+
* waiver's `expiresAt` where the baseline did, so a waiver that has expired since does not read as drift. Null when no record names
|
|
1126
|
+
* one, which is a baseline scored before TeA passed `--scored-at`: the replay then scores it as it was scored, with no `--scored-at`
|
|
1127
|
+
* and the system clock. Null as well when the records disagree or the value is not a timestamp the engine accepts; the replay's call
|
|
1128
|
+
* records then differ from the baseline's, and that difference is evidence drift.
|
|
1129
|
+
*
|
|
1130
|
+
* @returns {Promise<string | null>}
|
|
1131
|
+
*/
|
|
1132
|
+
async function recordedScoringInstant(baseline) {
|
|
1133
|
+
const directory = path.join(baseline.directory, 'scores', baseline.manifest.scoreInvocationId);
|
|
1134
|
+
let entries;
|
|
1135
|
+
try {
|
|
1136
|
+
entries = fs.readdirSync(directory, { withFileTypes: true });
|
|
1137
|
+
} catch {
|
|
1138
|
+
return null;
|
|
1139
|
+
}
|
|
1140
|
+
const instants = new Set();
|
|
1141
|
+
for (const entry of entries.filter((candidate) => candidate.isDirectory())) {
|
|
1142
|
+
try {
|
|
1143
|
+
const { argv } = JSON.parse(regularFileBytes(path.join(directory, entry.name, 'score.json')).toString('utf8'));
|
|
1144
|
+
const at = Array.isArray(argv) ? argv.indexOf('--scored-at') : -1;
|
|
1145
|
+
instants.add(at !== -1 && typeof argv[at + 1] === 'string' ? argv[at + 1] : null);
|
|
1146
|
+
} catch {
|
|
1147
|
+
instants.add(null);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
if (instants.size !== 1) return null;
|
|
1151
|
+
const [instant] = instants;
|
|
1152
|
+
if (instant === null) return null;
|
|
1153
|
+
try {
|
|
1154
|
+
return await scoringInstant(instant);
|
|
1155
|
+
} catch (error) {
|
|
1156
|
+
// The engine refused the recorded value; an engine that is unavailable is reported as such.
|
|
1157
|
+
if (!(error instanceof TypeError)) throw error;
|
|
1158
|
+
return null;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1122
1162
|
/**
|
|
1123
1163
|
* `score` over the placed baseline in the scratch copy; every file it wrote is copied to `replay/scores/`. The produced
|
|
1124
1164
|
* subtree is the one `scores/` entry that is new after the call, so no entry already there (the accepted one, or a
|
|
@@ -1131,6 +1171,7 @@ function replayScore(context, baseline) {
|
|
|
1131
1171
|
const before = new Set(scoreInvocations(scratch.runDirectory) ?? []);
|
|
1132
1172
|
const outcome = await runScoreCommand(scratch.folder, {
|
|
1133
1173
|
designations: recordedDesignations(baseline),
|
|
1174
|
+
scoredAt: await recordedScoringInstant(baseline),
|
|
1134
1175
|
run: scratch.acceptedRun,
|
|
1135
1176
|
env: context.env,
|
|
1136
1177
|
stagingRoot: scratch.stagingRoot,
|
|
@@ -848,7 +848,8 @@ async function scoreInputFindings({ folder, runDirectory, index, record, engine
|
|
|
848
848
|
finding(TRIAL_SETS_NAME, 'schema', message),
|
|
849
849
|
);
|
|
850
850
|
}
|
|
851
|
-
|
|
851
|
+
// Only the input checks run here and no score call is made, so no scoring instant is read.
|
|
852
|
+
const held = holdRunInputs({ folder, runDirectory, index, record, engine, scoredAt: null });
|
|
852
853
|
const found = await inputFindings({ folder, runDirectory, index, record, engine, held });
|
|
853
854
|
if (found.length === 0) {
|
|
854
855
|
try {
|
package/cli/lib/evaluate/run.js
CHANGED
|
@@ -127,7 +127,14 @@ const { CREDENTIALS_FILE, textNeutralizer } = require('./recorded-paths');
|
|
|
127
127
|
const { mountRefusal, mountsOutsideAllowlist } = require('./isolation-allowlist');
|
|
128
128
|
const { EngineStageError, runEngineStage } = require('./engine-cli');
|
|
129
129
|
const { heldRefusal, stagedArtifact } = require('./held-refusal');
|
|
130
|
-
const {
|
|
130
|
+
const {
|
|
131
|
+
AttemptInputError,
|
|
132
|
+
RUN_FILES,
|
|
133
|
+
attemptProbeFile,
|
|
134
|
+
holdAttemptInputs,
|
|
135
|
+
scoringClockAdapters,
|
|
136
|
+
scoringInstant,
|
|
137
|
+
} = require('./score-inputs');
|
|
131
138
|
const { gitAccessOf, makeScratchDirectory, releaseScratchDirectory } = require('./workspace');
|
|
132
139
|
|
|
133
140
|
const Ajv = AjvModule.default ?? AjvModule;
|
|
@@ -294,6 +301,9 @@ function runRunCommand(
|
|
|
294
301
|
});
|
|
295
302
|
}
|
|
296
303
|
const conditionsFile = path.join(folder, ...CONDITIONS_PATH.split('/'));
|
|
304
|
+
// Every score the run makes is pinned to an instant, so an engine that cannot pin one is refused before calibration, a
|
|
305
|
+
// qualification attempt or a trial spends anything.
|
|
306
|
+
await scoringClockAdapters();
|
|
297
307
|
let layer;
|
|
298
308
|
try {
|
|
299
309
|
layer = readEvaluatorLayer({
|
|
@@ -1760,6 +1770,8 @@ async function scoreAttempt(context, { probe, directory, set, corpusDigest, desi
|
|
|
1760
1770
|
probeId: probe.probeId,
|
|
1761
1771
|
set,
|
|
1762
1772
|
designate,
|
|
1773
|
+
// Read once per attempt: the call's `--scored-at` and the in-process re-score test waivers against this one instant.
|
|
1774
|
+
scoredAt: await scoringInstant(),
|
|
1763
1775
|
});
|
|
1764
1776
|
} catch (error) {
|
|
1765
1777
|
if (!(error instanceof AttemptInputError)) throw error;
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
* - `changedSince` reads every input again after an engine call and names the
|
|
17
17
|
* first one that changed, stopped being a regular file or appeared (a
|
|
18
18
|
* manifest absent at the check and present afterwards counts).
|
|
19
|
+
* - `scoringInstant` reads the instant a contract waiver's `expiresAt` is
|
|
20
|
+
* tested against once, and the held inputs hand that one instant to the CLI
|
|
21
|
+
* call (`--scored-at`) and to the in-process score (a fixed clock), so a
|
|
22
|
+
* waiver expiring between two clock reads cannot make them disagree.
|
|
19
23
|
* - `reproduce` scores the held bytes in process, the way the CLI scores a
|
|
20
24
|
* probe, and returns what the CLI should have done with them: the artifact
|
|
21
25
|
* bytes it stages (null when none), the exit it takes and the diagnostic
|
|
@@ -35,6 +39,7 @@
|
|
|
35
39
|
const fs = require('node:fs');
|
|
36
40
|
const path = require('node:path');
|
|
37
41
|
|
|
42
|
+
const { EngineUnavailableError, loadAdapters } = require('./engine');
|
|
38
43
|
const { BEHAVIOR_ID, named, oraclesListed, sameOracles } = require('./partition');
|
|
39
44
|
|
|
40
45
|
/** The exits `eval-quality score` takes outside a verdict: a structural failure, a runtime fault and a usage error. */
|
|
@@ -124,6 +129,42 @@ function scoreInputList({ runDirectory, index, record }) {
|
|
|
124
129
|
return inputs;
|
|
125
130
|
}
|
|
126
131
|
|
|
132
|
+
/**
|
|
133
|
+
* The engine's adapters, refused as unavailable when the engine predates `score --scored-at` and `createFixedClockAdapter`
|
|
134
|
+
* (eval-quality 10.1.0). Every path that scores asks this first, pinned or not, so an older engine is refused before any
|
|
135
|
+
* call or evaluator trial runs.
|
|
136
|
+
*
|
|
137
|
+
* @returns {Promise<Record<string, unknown>>}
|
|
138
|
+
*/
|
|
139
|
+
async function scoringClockAdapters() {
|
|
140
|
+
const adapters = await loadAdapters();
|
|
141
|
+
if (typeof adapters.createFixedClockAdapter !== 'function') {
|
|
142
|
+
throw new EngineUnavailableError(
|
|
143
|
+
new Error('the installed eval-quality has no createFixedClockAdapter, so its score takes no --scored-at (added in 10.1.0)'),
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
return adapters;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The scoring instant of one `score` command: `given` when the caller names one (a replay scores at the instant its
|
|
151
|
+
* baseline recorded), otherwise the engine's system clock, read once.
|
|
152
|
+
*
|
|
153
|
+
* @param {string | null} [given] an RFC 3339 UTC timestamp
|
|
154
|
+
* @returns {Promise<string>}
|
|
155
|
+
* @throws {TypeError} when `given` is not a timestamp the engine accepts
|
|
156
|
+
*/
|
|
157
|
+
async function scoringInstant(given = null) {
|
|
158
|
+
const adapters = await scoringClockAdapters();
|
|
159
|
+
if (given !== null) {
|
|
160
|
+
// The engine's own check: a value it would refuse as `--scored-at` is refused here.
|
|
161
|
+
adapters.createFixedClockAdapter(given);
|
|
162
|
+
return given;
|
|
163
|
+
}
|
|
164
|
+
const { now } = await adapters.createSystemClockAdapter().read({}, new AbortController().signal);
|
|
165
|
+
return now;
|
|
166
|
+
}
|
|
167
|
+
|
|
127
168
|
/** What `designate` answers when a probe asks the engine for no oracle of its own. */
|
|
128
169
|
const NO_DESIGNATION = Object.freeze({ oracleId: null, problem: null });
|
|
129
170
|
|
|
@@ -133,6 +174,7 @@ class HeldInputs {
|
|
|
133
174
|
#read;
|
|
134
175
|
#accepted;
|
|
135
176
|
#designate;
|
|
177
|
+
#clock;
|
|
136
178
|
|
|
137
179
|
/**
|
|
138
180
|
* @param {object} options
|
|
@@ -144,6 +186,9 @@ class HeldInputs {
|
|
|
144
186
|
* `eval-quality score --designated-oracle` for (Story 1.110): `partition.js` `bothViewDesignation`, which names an oracle only for
|
|
145
187
|
* a probe of a both run under a `partitionPlan` whose behavior the both view lists with several. The CLI call's arguments and the
|
|
146
188
|
* in-process score both read it through `designation`, so they cannot disagree.
|
|
189
|
+
* @param {string | null} options.scoredAt the scoring instant (`scoringInstant`) a contract waiver's `expiresAt` is tested against: the
|
|
190
|
+
* CLI call gets it as `--scored-at` and the in-process score as a fixed clock, so the two score at one instant. Null is a replay of a
|
|
191
|
+
* baseline whose calls were handed no instant: the call gets no `--scored-at` and each side reads the system clock, as it was scored.
|
|
147
192
|
*/
|
|
148
193
|
constructor({
|
|
149
194
|
engine,
|
|
@@ -152,8 +197,13 @@ class HeldInputs {
|
|
|
152
197
|
read = null,
|
|
153
198
|
accepted = 'the regular file the input check accepted',
|
|
154
199
|
designate = () => NO_DESIGNATION,
|
|
200
|
+
scoredAt,
|
|
155
201
|
}) {
|
|
202
|
+
if (scoredAt !== null && typeof scoredAt !== 'string') {
|
|
203
|
+
throw new TypeError('HeldInputs needs the scoring instant of its score command (scoredAt), or null for an unpinned replay');
|
|
204
|
+
}
|
|
156
205
|
this.#engine = engine;
|
|
206
|
+
this.scoredAt = scoredAt;
|
|
157
207
|
this.#read = read;
|
|
158
208
|
this.#accepted = accepted;
|
|
159
209
|
this.#designate = designate;
|
|
@@ -264,6 +314,7 @@ class HeldInputs {
|
|
|
264
314
|
args.push('--evaluator-configuration', pathOf(this.index.evaluatorConfiguration));
|
|
265
315
|
const { oracleId } = this.designation(set);
|
|
266
316
|
if (oracleId !== null) args.push('--designated-oracle', oracleId);
|
|
317
|
+
if (this.scoredAt !== null) args.push('--scored-at', this.scoredAt);
|
|
267
318
|
args.push('--out', out);
|
|
268
319
|
return args;
|
|
269
320
|
}
|
|
@@ -342,6 +393,11 @@ class HeldInputs {
|
|
|
342
393
|
return { artifact: null, exitCode: USAGE_EXIT, lines: null };
|
|
343
394
|
}
|
|
344
395
|
const { oracleId } = this.designation(set);
|
|
396
|
+
// The CLI scores at `--scored-at`, so the re-score reads the same instant through the engine's fixed clock, made once; an
|
|
397
|
+
// unpinned replay reads the system clock as its CLI call does. An engine whose adapters cannot load is unavailable, not a fault
|
|
398
|
+
// of the held bytes, so it throws past the catch.
|
|
399
|
+
const adapters = this.#clock === undefined ? await scoringClockAdapters() : null;
|
|
400
|
+
this.#clock ??= this.scoredAt === null ? adapters.createSystemClockAdapter() : adapters.createFixedClockAdapter(this.scoredAt);
|
|
345
401
|
try {
|
|
346
402
|
const { artifact, ladder, qualification } = await this.#engine.runScore({
|
|
347
403
|
record: records,
|
|
@@ -356,6 +412,8 @@ class HeldInputs {
|
|
|
356
412
|
corpusDigest: this.index.corpusDigest,
|
|
357
413
|
...(oracleId === null ? {} : { designatedOracleId: oracleId }),
|
|
358
414
|
port: undefined,
|
|
415
|
+
// The instant a contract waiver's `expiresAt` is tested against: the one the CLI call was handed as `--scored-at`.
|
|
416
|
+
clock: this.#clock,
|
|
359
417
|
signal: new AbortController().signal,
|
|
360
418
|
});
|
|
361
419
|
const lines = qualification.failures.map(
|
|
@@ -407,9 +465,10 @@ class HeldInputs {
|
|
|
407
465
|
* @param {object} options.record the parsed `run.json`
|
|
408
466
|
* @param {{ digestBytes: (bytes: Buffer) => string }} options.engine
|
|
409
467
|
* @param {(probe: object) => { oracleId: string|null, problem: string|null, listed?: string[]|null }} [options.designate] see `HeldInputs`
|
|
468
|
+
* @param {string} options.scoredAt see `HeldInputs`
|
|
410
469
|
* @returns {HeldInputs}
|
|
411
470
|
*/
|
|
412
|
-
function holdScoreInputs({ runDirectory, index, record, engine, designate }) {
|
|
471
|
+
function holdScoreInputs({ runDirectory, index, record, engine, designate, scoredAt }) {
|
|
413
472
|
const entries = scoreInputList({ runDirectory, index, record }).map((input) => {
|
|
414
473
|
try {
|
|
415
474
|
const bytes = regularFileBytes(input.file);
|
|
@@ -420,7 +479,7 @@ function holdScoreInputs({ runDirectory, index, record, engine, designate }) {
|
|
|
420
479
|
return { ...input, exists: error.code !== 'ENOENT', bytes: null, error: error.message, digest: null };
|
|
421
480
|
}
|
|
422
481
|
});
|
|
423
|
-
return new HeldInputs({ engine, index, entries, designate });
|
|
482
|
+
return new HeldInputs({ engine, index, entries, designate, scoredAt });
|
|
424
483
|
}
|
|
425
484
|
|
|
426
485
|
/**
|
|
@@ -438,10 +497,11 @@ function holdScoreInputs({ runDirectory, index, record, engine, designate }) {
|
|
|
438
497
|
* @param {string} options.probeId
|
|
439
498
|
* @param {{ records: string[], manifestFile: string }} options.set the attempt's sealed set: its record files and isolation manifest, run-relative
|
|
440
499
|
* @param {(probe: object) => { oracleId: string|null, problem: string|null, listed?: string[]|null }} [options.designate] see `HeldInputs`
|
|
500
|
+
* @param {string} options.scoredAt see `HeldInputs`
|
|
441
501
|
* @returns {HeldInputs}
|
|
442
502
|
* @throws {AttemptInputError} naming the first input that is not what the runtime wrote
|
|
443
503
|
*/
|
|
444
|
-
function holdAttemptInputs({ read, engine, corpusDigest, probeId, set, designate }) {
|
|
504
|
+
function holdAttemptInputs({ read, engine, corpusDigest, probeId, set, designate, scoredAt }) {
|
|
445
505
|
const index = {
|
|
446
506
|
...RUN_FILES,
|
|
447
507
|
corpusDigest,
|
|
@@ -456,7 +516,7 @@ function holdAttemptInputs({ read, engine, corpusDigest, probeId, set, designate
|
|
|
456
516
|
}
|
|
457
517
|
return { ...input, exists: true, bytes, error: null, digest: engine.digestBytes(bytes) };
|
|
458
518
|
});
|
|
459
|
-
return new HeldInputs({ engine, index, entries, read, accepted: 'the file the runtime wrote', designate });
|
|
519
|
+
return new HeldInputs({ engine, index, entries, read, accepted: 'the file the runtime wrote', designate, scoredAt });
|
|
460
520
|
}
|
|
461
521
|
|
|
462
522
|
/** The probe file a run writes for `probeId`. */
|
|
@@ -474,4 +534,6 @@ module.exports = {
|
|
|
474
534
|
holdScoreInputs,
|
|
475
535
|
regularFileBytes,
|
|
476
536
|
scoreInputList,
|
|
537
|
+
scoringClockAdapters,
|
|
538
|
+
scoringInstant,
|
|
477
539
|
};
|
|
@@ -128,7 +128,7 @@ const { createArtifactValidator } = require('./records');
|
|
|
128
128
|
const { RunDirectory, RunDirectoryError } = require('./run-directory');
|
|
129
129
|
const { TRIAL_SETS_NAME } = require('./run');
|
|
130
130
|
const { heldRefusal, stagedArtifact } = require('./held-refusal');
|
|
131
|
-
const { DIAGNOSTIC_PREFIX, holdScoreInputs, regularFileBytes } = require('./score-inputs');
|
|
131
|
+
const { DIAGNOSTIC_PREFIX, holdScoreInputs, regularFileBytes, scoringClockAdapters, scoringInstant } = require('./score-inputs');
|
|
132
132
|
const {
|
|
133
133
|
WorkspaceRefusal,
|
|
134
134
|
cleanUpOnSignal,
|
|
@@ -283,13 +283,13 @@ function phaseSnapshotProblems(run, contract) {
|
|
|
283
283
|
* through this one function, so the call's arguments and the in-process check hold the same designation. A designation that cannot be
|
|
284
284
|
* derived is a finding of the input check, and no score call runs.
|
|
285
285
|
*/
|
|
286
|
-
function holdRunInputs({ folder, runDirectory, index, record, engine, designations = null }) {
|
|
286
|
+
function holdRunInputs({ folder, runDirectory, index, record, engine, scoredAt, designations = null }) {
|
|
287
287
|
let designate;
|
|
288
288
|
if (designations !== null) {
|
|
289
289
|
// A replay reproduces a baseline: each probe is scored under the oracle the baseline's own call record handed it, and the folder is
|
|
290
290
|
// not read, so a folder that changed since is the stale-baseline rule's to report and no designation finding is.
|
|
291
291
|
designate = (probe) => ({ oracleId: designations.get(probe?.probeId) ?? null, problem: null, listed: undefined });
|
|
292
|
-
return holdScoreInputs({ runDirectory, index, record, engine, designate });
|
|
292
|
+
return holdScoreInputs({ runDirectory, index, record, engine, designate, scoredAt });
|
|
293
293
|
}
|
|
294
294
|
try {
|
|
295
295
|
designate = loadBothViewDesignation({ folder, partition: record?.partition, heldOutProbes: record?.heldOutProbes });
|
|
@@ -297,7 +297,7 @@ function holdRunInputs({ folder, runDirectory, index, record, engine, designatio
|
|
|
297
297
|
if (!(error instanceof PartitionPlanError)) throw error;
|
|
298
298
|
designate = () => ({ oracleId: null, problem: error.message });
|
|
299
299
|
}
|
|
300
|
-
return holdScoreInputs({ runDirectory, index, record, engine, designate });
|
|
300
|
+
return holdScoreInputs({ runDirectory, index, record, engine, designate, scoredAt });
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
/** Every finding in the held inputs of the run directory, before any engine call. */
|
|
@@ -502,9 +502,17 @@ async function inputFindings({ folder, runDirectory, index, record, engine, held
|
|
|
502
502
|
* caller that removes that directory itself however it ends (`tea-evaluate ci`'s replay, whose directory sits beneath its
|
|
503
503
|
* own private parent); the call then makes no private parent of its own. A call without one makes its parent beneath the
|
|
504
504
|
* user's private root (`workspace.js` `makePrivateParent`) and removes it at its end
|
|
505
|
+
* @param {Map<string, string> | null} [options.designations] the oracle each probe is scored under, by probe ID, for a replay
|
|
506
|
+
* @param {string | null} [options.scoredAt] the RFC 3339 UTC instant every probe's waivers are tested against (`eval-quality score
|
|
507
|
+
* --scored-at`), for a replay that scores at the instant its baseline recorded. Null is a replay of a baseline whose calls were
|
|
508
|
+
* handed no instant, scored the way it was: no `--scored-at`, and the system clock. Absent, the engine's system clock is read once
|
|
509
|
+
* and that instant is used for every probe of the invocation
|
|
505
510
|
* @returns {Promise<ScoreOutcome>}
|
|
506
511
|
*/
|
|
507
|
-
async function runScoreCommand(
|
|
512
|
+
async function runScoreCommand(
|
|
513
|
+
folder,
|
|
514
|
+
{ run: invocationId, env = process.env, log = () => {}, stagingRoot, designations = null, scoredAt: givenInstant } = {},
|
|
515
|
+
) {
|
|
508
516
|
const located = runDirectoryFor(folder, invocationId);
|
|
509
517
|
if (located.wiring !== undefined)
|
|
510
518
|
return new ScoreOutcome({ exitCode: WIRING, message: located.wiring, runDirectory: located.directory ?? null });
|
|
@@ -541,7 +549,21 @@ async function runScoreCommand(folder, { run: invocationId, env = process.env, l
|
|
|
541
549
|
}
|
|
542
550
|
|
|
543
551
|
const engine = await loadEngine();
|
|
544
|
-
|
|
552
|
+
// One instant for the whole invocation, read before any call: every probe's CLI call and in-process re-score test waivers against it.
|
|
553
|
+
// An engine that predates `--scored-at` is refused here, pinned or not, before any call.
|
|
554
|
+
await scoringClockAdapters();
|
|
555
|
+
let scoredAt = null;
|
|
556
|
+
try {
|
|
557
|
+
if (givenInstant !== null) scoredAt = await scoringInstant(givenInstant ?? null);
|
|
558
|
+
} catch (error) {
|
|
559
|
+
if (!(error instanceof TypeError)) throw error;
|
|
560
|
+
return new ScoreOutcome({
|
|
561
|
+
exitCode: AUTHORING,
|
|
562
|
+
runDirectory,
|
|
563
|
+
message: `the scoring instant ${JSON.stringify(givenInstant)} is not an RFC 3339 UTC timestamp eval-quality accepts; no score call ran`,
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
const held = holdRunInputs({ folder, runDirectory, index, record: located.record, engine, scoredAt, designations });
|
|
545
567
|
const findings = await inputFindings({ folder, runDirectory, index, record: located.record, engine, held });
|
|
546
568
|
if (findings.length === 0) {
|
|
547
569
|
const contract = held.json(index.contract);
|
|
@@ -1120,6 +1142,7 @@ async function scoreProbes({
|
|
|
1120
1142
|
writer.writeJson(`${scoreRelative}/score.json`, {
|
|
1121
1143
|
invocationId: scoreInvocationId,
|
|
1122
1144
|
run: index.invocationId,
|
|
1145
|
+
scoredAt: held.scoredAt,
|
|
1123
1146
|
exitCode,
|
|
1124
1147
|
scores,
|
|
1125
1148
|
strengthAggregate,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "bmad-method-test-architecture-enterprise",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.3.0",
|
|
5
5
|
"description": "Master Test Architect for quality strategy, test automation, and release gates",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"bmad",
|
|
@@ -386,7 +386,7 @@
|
|
|
386
386
|
"zod-to-json-schema": "3.25.1"
|
|
387
387
|
},
|
|
388
388
|
"peerDependencies": {
|
|
389
|
-
"eval-quality": ">=
|
|
389
|
+
"eval-quality": ">=10.1.0"
|
|
390
390
|
},
|
|
391
391
|
"peerDependenciesMeta": {
|
|
392
392
|
"eval-quality": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Gaps
|
|
2
2
|
|
|
3
|
-
Read the scored development evidence artifact for CONCERNS, FAIL, Invalid or a weak strength vector. Name the first unsatisfied engine rule, failed preflight check, missing evidence, or loose oracle. For a development `score` exit 3 with no evidence artifact, read the persisted `runs/<invocationId>/scores/<scoreInvocationId>/<probeId>/score.json` record and its stdout and stderr diagnostics. Treat the exit as a routing fact and read engine evidence for the quality judgment. Read development `interpretation.json` for citations and phase; eval-quality remains the only verdict and strength authority. For a held-out score failure, read only its `gap-view.json` row. An `outcome: null` leaves the held-out cause undisclosed. Hold the held-out loop, author a development probe of the same class, and diagnose its development evidence or score diagnostics; record a blocked gap if the fault cannot be reproduced there.
|
|
3
|
+
Read the scored development evidence artifact for CONCERNS, FAIL, Invalid or a weak strength vector. Name the first unsatisfied engine rule no contract waiver covers (a `coverageGaps` entry whose `waiverId` is `null`), failed preflight check, missing evidence, or loose oracle. For a development `score` exit 3 with no evidence artifact, read the persisted `runs/<invocationId>/scores/<scoreInvocationId>/<probeId>/score.json` record and its stdout and stderr diagnostics. Treat the exit as a routing fact and read engine evidence for the quality judgment. Read development `interpretation.json` for citations and phase; eval-quality remains the only verdict and strength authority. For a held-out score failure, read only its `gap-view.json` row. An `outcome: null` leaves the held-out cause undisclosed. Hold the held-out loop, author a development probe of the same class, and diagnose its development evidence or score diagnostics; record a blocked gap if the fault cannot be reproduced there.
|
|
4
4
|
|
|
5
5
|
## Read the strength vector
|
|
6
6
|
|