bmad-method-test-architecture-enterprise 3.6.1 → 4.0.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/README.md +10 -3
- package/cli/lib/automate-prompt.js +3 -7
- package/cli/lib/framework-setup.js +1 -2
- package/cli/lib/parse-report.js +1 -1
- package/cli/lib/resolve-tea-config.js +76 -10
- package/cli/lib/trace-command.js +12 -4
- package/cli/migrate-customizations.js +678 -71
- package/cli/teach.js +0 -1
- package/cli/test-review.js +1 -1
- package/package.json +3 -2
- package/skills/bmad-tea/SKILL.md +2 -2
- package/skills/bmad-tea-automate/SKILL.md +12 -11
- package/skills/bmad-tea-automate/customize.toml +12 -0
- package/skills/bmad-tea-automate/red/atdd-checklist-template.md +4 -4
- package/skills/bmad-tea-automate/red/checklist.md +1 -0
- package/skills/bmad-tea-automate/red/instructions.md +1 -1
- package/skills/bmad-tea-automate/red/steps-c/step-04a-subagent-api-failing.md +5 -0
- package/skills/bmad-tea-automate/red/steps-c/step-04b-subagent-e2e-failing.md +4 -0
- package/skills/bmad-tea-automate/red/steps-c/step-04c-aggregate.md +3 -2
- package/skills/bmad-tea-automate/red/steps-c/step-05-validate-and-complete.md +5 -4
- package/skills/bmad-tea-automate/red/steps-e/step-02-apply-edit.md +4 -4
- package/skills/bmad-tea-automate/red/steps-v/step-01-validate.md +4 -4
- package/skills/bmad-tea-automate/red/workflow.yaml +0 -1
- package/skills/bmad-tea-automate/resources/test-generation-routing.md +4 -7
- package/skills/bmad-tea-automate/steps-c/step-04-validate-and-summarize.md +4 -4
- package/skills/bmad-tea-automate/steps-e/step-02-apply-edit.md +4 -4
- package/skills/bmad-tea-automate/steps-v/step-01-validate.md +4 -4
- package/skills/bmad-tea-automate/workflow.yaml +0 -1
- package/skills/bmad-tea-evaluate/SKILL.md +1 -1
- package/skills/bmad-tea-framework/SKILL.md +3 -3
- package/skills/bmad-tea-framework/customize.toml +11 -2
- package/skills/bmad-tea-framework/resources/hooks/tea-enforce.cjs +55 -24
- package/skills/bmad-tea-framework/resources/setup-routing.md +6 -6
- package/skills/bmad-tea-framework/steps-c/step-04-docs-and-scripts.md +16 -12
- package/skills/bmad-tea-framework/workflow.yaml +0 -1
- package/skills/bmad-tea-nfr/SKILL.md +2 -2
- package/skills/bmad-tea-nfr/workflow.yaml +0 -1
- package/skills/bmad-tea-teach-me-testing/SKILL.md +2 -2
- package/skills/bmad-tea-test-design/SKILL.md +2 -2
- package/skills/bmad-tea-test-design/workflow.yaml +0 -1
- package/skills/bmad-tea-test-review/SKILL.md +2 -2
- package/skills/bmad-tea-test-review/workflow.yaml +0 -1
- package/skills/bmad-tea-trace/SKILL.md +2 -2
- package/skills/bmad-tea-trace/steps-c/step-04-analyze-gaps.md +1 -0
- package/skills/bmad-tea-trace/steps-c/step-05-gate-decision.md +29 -12
- package/skills/bmad-tea-trace/workflow.yaml +0 -1
- package/skills/bmod-tea/bmod.toml +2 -2
- package/skills/bmod-tea/help/help.md +10 -9
- package/skills/bmod-tea/knowledge/maestro-flows.md +1 -1
- package/skills/bmod-tea/migration-1.toml +7 -7
- package/skills/bmod-tea/migration-3.toml +50 -0
- package/skills/bmod-tea/retired.toml +13 -0
- package/skills/bmad-tea-automate/red/customize.toml +0 -38
- package/skills/bmad-tea-framework/ci/customize.toml +0 -10
|
@@ -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": "
|
|
34
|
+
"version": "4.0.0",
|
|
35
35
|
"author": {
|
|
36
36
|
"name": "Murat K Ozcan (TEA Creator) & Brian (BMad) Madison"
|
|
37
37
|
},
|
package/README.md
CHANGED
|
@@ -46,17 +46,24 @@ To install a tagged release, replace `<version>` with the release number:
|
|
|
46
46
|
npx skills add https://github.com/bmad-code-org/bmad-method-test-architecture-enterprise/tree/v<version>/skills
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
### Upgrading to 4.0
|
|
50
|
+
|
|
51
|
+
TEA 4.0 reads red-mode overrides from `[workflow.red]` in `bmad-tea-automate.toml` and CI overrides from `[workflow.ci]` in `bmad-tea-framework.toml`, including each personal `.user.toml` layer. Personal module settings belong in `_bmad/custom/config.user.toml`.
|
|
52
|
+
Run `bmad migrate tea` to move existing settings, including legacy personal module keys. The 4.x CLI commands below handle customization files and report personal module keys that still need `bmad migrate tea`.
|
|
53
|
+
|
|
49
54
|
### Upgrading to 3.0
|
|
50
55
|
|
|
51
56
|
The eight direct workflow commands now share the `bmad-tea-*` prefix. Replace `bmad-testarch-automate`, `-evaluate`, `-framework`, `-nfr`, `-test-design`, `-test-review`, and `-trace` with the same suffix under `bmad-tea-`. Replace `bmad-teach-me-testing` with `bmad-tea-teach-me-testing`. The 3.0 package does not publish the old slash commands. The `bmad-tea` agent, `bmod-tea` module, menu codes, and `tea-*` CLI executables keep their names.
|
|
52
57
|
|
|
53
|
-
|
|
58
|
+
Use the 4.x migration tool to preview and apply customization changes:
|
|
54
59
|
|
|
55
60
|
```bash
|
|
56
|
-
npx --package=bmad-method-test-architecture-enterprise@
|
|
57
|
-
npx --package=bmad-method-test-architecture-enterprise@
|
|
61
|
+
npx --package=bmad-method-test-architecture-enterprise@4 tea-migrate-customizations --project-root . --check
|
|
62
|
+
npx --package=bmad-method-test-architecture-enterprise@4 tea-migrate-customizations --project-root .
|
|
58
63
|
```
|
|
59
64
|
|
|
65
|
+
Use `--help` for usage. For a directory whose name begins with a dash, pass `--project-root ./-name`; flag-like operands are rejected before the migration reads or writes files.
|
|
66
|
+
|
|
60
67
|
This includes old CI and ATDD customization files and old skill references in custom `bmad-tea` agent menus. The command moves old-only files with their comments and permissions intact. When both old and new filenames exist, it reports both paths and asks for a manual merge so no comments or values are lost. Resolve the reported files, then rerun the command. See the [configuration reference](https://bmad-code-org.github.io/bmad-method-test-architecture-enterprise/reference/configuration/) for details.
|
|
61
68
|
|
|
62
69
|
An existing host may retain the old skill folders after installing 3.0. Check the host's project and global skills folders, back up any edits in the old folders, and move those eight folders out of skill discovery. The [troubleshooting guide](https://bmad-code-org.github.io/bmad-method-test-architecture-enterprise/reference/troubleshooting/#old-slash-commands-still-appear-after-30) lists the exact folders and a safe cleanup sequence. Restart the host so its command list refreshes.
|
|
@@ -27,13 +27,9 @@ function resolveGenerationConfig(projectRoot, checkpointPath, operation, skillRo
|
|
|
27
27
|
};
|
|
28
28
|
if (!['none', 'auto', 'cli', 'mcp'].includes(tea.tea_browser_automation))
|
|
29
29
|
throw new Error('tea_browser_automation must be none, auto, cli or mcp');
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
mode === 'red' && !fs.existsSync(sibling)
|
|
34
|
-
? path.join(skillRoot, 'red', 'customize.toml')
|
|
35
|
-
: path.join(mode === 'red' ? path.dirname(sibling) : skillRoot, 'customize.toml');
|
|
36
|
-
const workflowCustomization = readWorkflowCustomization(configSource(projectRoot), path.dirname(defaultsPath), projectRoot, namespace);
|
|
30
|
+
const workflowCustomization = readWorkflowCustomization(configSource(projectRoot), skillRoot, projectRoot, 'bmad-tea-automate', {
|
|
31
|
+
table: mode === 'red' ? 'red' : undefined,
|
|
32
|
+
});
|
|
37
33
|
if (!workflowCustomization || typeof workflowCustomization !== 'object' || Array.isArray(workflowCustomization))
|
|
38
34
|
throw new Error('selected workflow customization must contain a workflow table');
|
|
39
35
|
const settings = { ...HEALING_DEFAULTS };
|
|
@@ -60,7 +60,6 @@ function protectResultPath(request, resultPath, state = request.before?.data) {
|
|
|
60
60
|
'jsconfig.json',
|
|
61
61
|
request.config.configPath,
|
|
62
62
|
'_bmad/config.toml',
|
|
63
|
-
'_bmad/config.user.toml',
|
|
64
63
|
'_bmad/custom/config.toml',
|
|
65
64
|
'_bmad/custom/config.user.toml',
|
|
66
65
|
];
|
|
@@ -607,7 +606,7 @@ function prepareSetup({ projectRoot, skillRoot, config, options }) {
|
|
|
607
606
|
throw problem('Resume has an uncertain started hook. Record explicit operator recovery in the journal before headless execution.');
|
|
608
607
|
const scope = options.operation === 'resume' ? before.data.setup_scope : options.scope;
|
|
609
608
|
const ciConfig = ['ci', 'both'].includes(scope)
|
|
610
|
-
? resolveTeaConfig({ projectRoot, skillRoot
|
|
609
|
+
? resolveTeaConfig({ projectRoot, skillRoot, skillName: 'bmad-tea-framework', workflowTable: 'ci' })
|
|
611
610
|
: null;
|
|
612
611
|
const requiredHooks = {};
|
|
613
612
|
for (const [phase, settings] of [
|
package/cli/lib/parse-report.js
CHANGED
|
@@ -1586,7 +1586,7 @@ function normalizeReportScore(reportText, parsed) {
|
|
|
1586
1586
|
* @throws {Error} With code REPORT_UNPARSEABLE on any missing/invalid element.
|
|
1587
1587
|
*/
|
|
1588
1588
|
function parseReport(reportText, runContract = {}) {
|
|
1589
|
-
const text = stripFencedCodeBlocks(reportText);
|
|
1589
|
+
const text = stripFencedCodeBlocks(reportText.replace(/^\uFEFF/, ''));
|
|
1590
1590
|
|
|
1591
1591
|
parseFrontmatter(text);
|
|
1592
1592
|
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* Precedence, highest first:
|
|
10
10
|
* 1. An explicit CLI flag (--use-playwright-utils / --no-use-pactjs-utils / ...)
|
|
11
11
|
* 2. The consuming project's `[modules.tea]` table, merged from
|
|
12
|
-
* _bmad/config.toml, _bmad/
|
|
13
|
-
* _bmad/custom/config.user.toml (later files win),
|
|
14
|
-
* writes it. Only when _bmad/config.toml does not exist is a v6
|
|
12
|
+
* _bmad/config.toml, _bmad/custom/config.toml and
|
|
13
|
+
* _bmad/custom/config.user.toml (later files win), the three files
|
|
14
|
+
* BMad core merges, as `bmad setup tea` writes it. Only when _bmad/config.toml does not exist is a v6
|
|
15
15
|
* _bmad/tea/config.yaml read instead, so older installs keep working in CI.
|
|
16
16
|
* 3. The module default declared in skills/bmod-tea/bmod.toml
|
|
17
17
|
*
|
|
@@ -32,15 +32,38 @@ const TOML = require('smol-toml');
|
|
|
32
32
|
const { minimatch } = require('minimatch');
|
|
33
33
|
const { globSync } = require('glob');
|
|
34
34
|
|
|
35
|
-
/** The central config layers, lowest precedence first. Only the first is required. */
|
|
35
|
+
/** The central config layers, lowest precedence first, the three files BMad core merges. Only the first is required. */
|
|
36
36
|
const CONFIG_LAYER_RELATIVE_PATHS = [
|
|
37
37
|
path.join('_bmad', 'config.toml'),
|
|
38
|
-
path.join('_bmad', 'config.user.toml'),
|
|
39
38
|
path.join('_bmad', 'custom', 'config.toml'),
|
|
40
39
|
path.join('_bmad', 'custom', 'config.user.toml'),
|
|
41
40
|
];
|
|
42
41
|
const CONFIG_RELATIVE_PATH = CONFIG_LAYER_RELATIVE_PATHS[0];
|
|
43
42
|
const LEGACY_CONFIG_RELATIVE_PATH = path.join('_bmad', 'tea', 'config.yaml');
|
|
43
|
+
/** A pre-v7 personal layer BMad core no longer merges. TEA warns about keys only it holds and reads none of them. */
|
|
44
|
+
const LEGACY_USER_CONFIG_RELATIVE_PATH = path.join('_bmad', 'config.user.toml');
|
|
45
|
+
const warnedLegacyUserConfig = new Set();
|
|
46
|
+
|
|
47
|
+
/** Tell the user once per process that `[modules.tea]` keys in the legacy personal layer are ignored. */
|
|
48
|
+
function warnLegacyUserConfig(source, tea) {
|
|
49
|
+
const content = source.read(LEGACY_USER_CONFIG_RELATIVE_PATH);
|
|
50
|
+
if (content === null) return;
|
|
51
|
+
const label = source.label(LEGACY_USER_CONFIG_RELATIVE_PATH);
|
|
52
|
+
if (warnedLegacyUserConfig.has(label)) return;
|
|
53
|
+
let legacyTea;
|
|
54
|
+
try {
|
|
55
|
+
legacyTea = TOML.parse(content).modules?.tea;
|
|
56
|
+
} catch {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!isPlainObject(legacyTea)) return;
|
|
60
|
+
const ignored = Object.keys(legacyTea).filter((key) => !Object.hasOwn(tea, key));
|
|
61
|
+
if (ignored.length === 0) return;
|
|
62
|
+
warnedLegacyUserConfig.add(label);
|
|
63
|
+
process.stderr.write(
|
|
64
|
+
`Warning: ${label} is no longer merged. TEA ignores its [modules.tea] keys (${ignored.join(', ')}). Run \`bmad migrate tea\` to move them into _bmad/custom/config.user.toml.\n`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
44
67
|
|
|
45
68
|
const MODULE_DEFAULTS = {
|
|
46
69
|
tea_use_playwright_utils: true,
|
|
@@ -284,8 +307,38 @@ function parseToml(content, label) {
|
|
|
284
307
|
}
|
|
285
308
|
}
|
|
286
309
|
|
|
287
|
-
/**
|
|
288
|
-
|
|
310
|
+
/** Customization surfaces that live as `[workflow.<name>]` tables of the owning skill, and the stems they used to have. */
|
|
311
|
+
const SURFACE_TABLES = {
|
|
312
|
+
'bmad-tea-automate': { table: 'red', retiredStems: ['bmad-tea-atdd', 'bmad-testarch-atdd'] },
|
|
313
|
+
'bmad-tea-framework': { table: 'ci', retiredStems: ['bmad-tea-ci', 'bmad-testarch-ci'] },
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
/** Stop on settings the new layout never reads, so a migration is never skipped silently. */
|
|
317
|
+
function assertNoRetiredSurface(source, skillName, workflow) {
|
|
318
|
+
const surface = SURFACE_TABLES[skillName];
|
|
319
|
+
if (!surface) return;
|
|
320
|
+
for (const stem of surface.retiredStems) {
|
|
321
|
+
for (const suffix of ['.toml', '.user.toml']) {
|
|
322
|
+
const file = path.join('_bmad', 'custom', stem + suffix);
|
|
323
|
+
if (source.read(file) !== null) {
|
|
324
|
+
throw configError(
|
|
325
|
+
`${source.label(file)} is no longer read; its settings now live under [workflow.${surface.table}] in ${skillName}.toml and ${skillName}.user.toml. Run: npx --package=bmad-method-test-architecture-enterprise@4 tea-migrate-customizations --project-root <project>`,
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
if (skillName === 'bmad-tea-framework' && workflow && Object.hasOwn(workflow, 'ci_platform')) {
|
|
331
|
+
throw configError(
|
|
332
|
+
'workflow.ci_platform in bmad-tea-framework.toml or .user.toml is no longer read; set ci_platform under [workflow.ci]. Run: npx --package=bmad-method-test-architecture-enterprise@4 tea-migrate-customizations --project-root <project>',
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Resolve trusted skill defaults and project workflow overrides from the same configuration source.
|
|
339
|
+
* `table` selects a `[workflow.<table>]` surface of the skill (red, ci); without it the surface tables are left out.
|
|
340
|
+
*/
|
|
341
|
+
function readWorkflowCustomization(source, skillRoot, projectRoot, skillName = 'bmad-tea-test-review', { table } = {}) {
|
|
289
342
|
if (!skillRoot) return {};
|
|
290
343
|
const defaultsPath = path.join(skillRoot, 'customize.toml');
|
|
291
344
|
source.recordInput?.(defaultsPath);
|
|
@@ -318,7 +371,17 @@ function readWorkflowCustomization(source, skillRoot, projectRoot, skillName = '
|
|
|
318
371
|
if (merged.workflow !== undefined && !isPlainObject(merged.workflow)) {
|
|
319
372
|
throw configError('Workflow customization must contain a [workflow] table');
|
|
320
373
|
}
|
|
321
|
-
|
|
374
|
+
assertNoRetiredSurface(source, skillName, merged.workflow);
|
|
375
|
+
const surfaces = new Set(Object.values(SURFACE_TABLES).map((surface) => surface.table));
|
|
376
|
+
let workflow = merged.workflow || {};
|
|
377
|
+
if (table === undefined) {
|
|
378
|
+
workflow = Object.fromEntries(Object.entries(workflow).filter(([key]) => !surfaces.has(key) || !isPlainObject(workflow[key])));
|
|
379
|
+
} else {
|
|
380
|
+
if (!surfaces.has(table)) throw configError(`Unknown workflow surface ${table}`);
|
|
381
|
+
const selected = workflow[table];
|
|
382
|
+
if (selected !== undefined && !isPlainObject(selected)) throw configError(`workflow.${table} must be a table`);
|
|
383
|
+
workflow = selected || {};
|
|
384
|
+
}
|
|
322
385
|
if (workflow.persistent_facts !== undefined) {
|
|
323
386
|
if (!Array.isArray(workflow.persistent_facts) || !workflow.persistent_facts.every((fact) => typeof fact === 'string')) {
|
|
324
387
|
throw configError('Workflow persistent_facts must be an array of strings');
|
|
@@ -410,6 +473,7 @@ function readCentralConfig(source) {
|
|
|
410
473
|
if (modules !== undefined && (!isPlainObject(modules) || (modules.tea !== undefined && !isPlainObject(modules.tea)))) {
|
|
411
474
|
throw configError(`[modules.tea] in ${source.label(CONFIG_RELATIVE_PATH)} must be a table of config keys`);
|
|
412
475
|
}
|
|
476
|
+
warnLegacyUserConfig(source, modules?.tea || {});
|
|
413
477
|
if (merged.core !== undefined && !isPlainObject(merged.core)) {
|
|
414
478
|
throw configError(`[core] in ${source.label(CONFIG_RELATIVE_PATH)} must be a table of config keys`);
|
|
415
479
|
}
|
|
@@ -530,6 +594,7 @@ const KEY_TO_INSTALLED_FIELD = {
|
|
|
530
594
|
* @param {string} options.projectRoot - Consuming project root.
|
|
531
595
|
* @param {string} [options.baseRef] - Configuration source ref, pinned before any file read.
|
|
532
596
|
* @param {string} [options.skillRoot] - Trusted skill defaults for workflow customization.
|
|
597
|
+
* @param {string} [options.workflowTable] - `[workflow.<table>]` surface to return (red, ci) in place of the skill's own workflow table.
|
|
533
598
|
* @param {object} [options.flags] - Parsed CLI options; only the keys in
|
|
534
599
|
* FLAG_TO_KEY are read, and only when not undefined.
|
|
535
600
|
* @param {Set<string>} [options.inputPaths] - Receives working-tree inputs, including missing optional layers.
|
|
@@ -539,11 +604,11 @@ const KEY_TO_INSTALLED_FIELD = {
|
|
|
539
604
|
* manifest rather than left to the agent.
|
|
540
605
|
* @throws {Error} With code TEA_CONFIG_INVALID on unusable config content.
|
|
541
606
|
*/
|
|
542
|
-
function resolveTeaConfig({ projectRoot, flags = {}, baseRef, skillRoot, skillName, inputPaths, inputPatterns }) {
|
|
607
|
+
function resolveTeaConfig({ projectRoot, flags = {}, baseRef, skillRoot, skillName, workflowTable, inputPaths, inputPatterns }) {
|
|
543
608
|
const source = configSource(projectRoot, baseRef, inputPaths, inputPatterns);
|
|
544
609
|
inputPaths?.add(path.join(projectRoot, 'package.json'));
|
|
545
610
|
const file = readTeaConfigFile(projectRoot, baseRef, source);
|
|
546
|
-
const workflowCustomization = readWorkflowCustomization(source, skillRoot, projectRoot, skillName);
|
|
611
|
+
const workflowCustomization = readWorkflowCustomization(source, skillRoot, projectRoot, skillName, { table: workflowTable });
|
|
547
612
|
|
|
548
613
|
const values = {};
|
|
549
614
|
const sources = {};
|
|
@@ -610,5 +675,6 @@ module.exports = {
|
|
|
610
675
|
CONFIG_RELATIVE_PATH,
|
|
611
676
|
CONFIG_LAYER_RELATIVE_PATHS,
|
|
612
677
|
LEGACY_CONFIG_RELATIVE_PATH,
|
|
678
|
+
LEGACY_USER_CONFIG_RELATIVE_PATH,
|
|
613
679
|
FLAG_TO_KEY,
|
|
614
680
|
};
|
package/cli/lib/trace-command.js
CHANGED
|
@@ -1415,21 +1415,27 @@ function validateTraceOutputs({
|
|
|
1415
1415
|
const p0 = summary.coverage.priority_breakdown.P0.pct;
|
|
1416
1416
|
const p1 = summary.coverage.priority_breakdown.P1.pct;
|
|
1417
1417
|
const overall = summary.coverage.inventory.pct;
|
|
1418
|
+
// Percentages remain rounded for display; decisions compare the source counts.
|
|
1419
|
+
const meets = (bucket, threshold) => bucket.total === 0 || bucket.covered * 100 >= threshold * bucket.total;
|
|
1420
|
+
const p0Met = meets(summary.coverage.priority_breakdown.P0, 100);
|
|
1421
|
+
const p1TargetMet = meets(summary.coverage.priority_breakdown.P1, 90);
|
|
1422
|
+
const p1MinimumMet = meets(summary.coverage.priority_breakdown.P1, 80);
|
|
1423
|
+
const overallMet = meets(summary.coverage.inventory, 80);
|
|
1418
1424
|
const expectedCriteria = {
|
|
1419
1425
|
p0_coverage_required: '100%',
|
|
1420
1426
|
p0_coverage_actual: `${p0}%`,
|
|
1421
|
-
p0_status:
|
|
1427
|
+
p0_status: p0Met ? 'MET' : 'NOT_MET',
|
|
1422
1428
|
p1_coverage_target: '90%',
|
|
1423
1429
|
p1_coverage_minimum: '80%',
|
|
1424
1430
|
p1_coverage_actual: `${p1}%`,
|
|
1425
|
-
p1_status:
|
|
1431
|
+
p1_status: p1TargetMet ? 'MET' : p1MinimumMet ? 'PARTIAL' : 'NOT_MET',
|
|
1426
1432
|
overall_coverage_minimum: '80%',
|
|
1427
1433
|
overall_coverage_actual: `${overall}%`,
|
|
1428
|
-
overall_status:
|
|
1434
|
+
overall_status: overallMet ? 'MET' : 'NOT_MET',
|
|
1429
1435
|
};
|
|
1430
1436
|
for (const [field, expected] of Object.entries(expectedCriteria))
|
|
1431
1437
|
if (criteria[field] !== expected) throw new Error(`Trace gate ${field} contradicts the coverage inventory or Step 5 thresholds.`);
|
|
1432
|
-
let expectedStatus =
|
|
1438
|
+
let expectedStatus = !p0Met || !overallMet || !p1MinimumMet ? 'FAIL' : p1TargetMet ? 'PASS' : 'CONCERNS';
|
|
1433
1439
|
const liveOnly = summary.live_evidence.requirements_live_only;
|
|
1434
1440
|
if (!Number.isInteger(liveOnly) || liveOnly < 0) throw new Error('Trace summary has invalid live-only coverage metadata.');
|
|
1435
1441
|
const synthetic = summary.oracle.synthetic || ['synthetic_requirements', 'user_journeys'].includes(summary.inventory_basis);
|
|
@@ -1440,6 +1446,8 @@ function validateTraceOutputs({
|
|
|
1440
1446
|
frozenLive?.freshFailed ?? summary.live_evidence.fresh_failed ?? (summary.live_evidence.freshness === 'fresh' ? liveFailed : 0);
|
|
1441
1447
|
if (freshFailed !== undefined && (!Number.isInteger(freshFailed) || freshFailed < 0))
|
|
1442
1448
|
throw new Error('Trace live evidence has invalid fresh_failed count.');
|
|
1449
|
+
if (!frozenLive && summary.live_evidence.freshness === 'fresh' && freshFailed !== liveFailed)
|
|
1450
|
+
throw new Error('Trace fresh live evidence fresh_failed contradicts its failed count.');
|
|
1443
1451
|
const freshFailure = freshFailed > 0;
|
|
1444
1452
|
if (expectedStatus === 'PASS' && ((synthetic && summary.confidence !== 'high') || liveOnly > 0 || freshFailure))
|
|
1445
1453
|
expectedStatus = 'CONCERNS';
|