Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

test(benchmarks): count unattributed diagnostics across all rounds

momoyeyuff7521e4c7a8
diff --git a/test/repair-rounds.test.mjs b/test/repair-rounds.test.mjs
index 5d5ea3cf..993b9f9c 100644
--- a/test/repair-rounds.test.mjs
+++ b/test/repair-rounds.test.mjs
@@ -155,14 +155,16 @@ test('reports diagnostics the manifest cannot attribute to an injected defect',
const result = run(['run', '--manifest', file, '--command', 'validate']);
assert.equal(result.status, 0, result.stderr || result.stdout);
const receipt = JSON.parse(result.stdout.split('\n')[0]);
- assert.ok(receipt.rounds[0].unattributed.length >= 1);
- assert.equal(receipt.rounds[0].unattributed[0].code, 'layout/constraint');
+ assert.deepEqual(receipt.rounds[0].unattributed.map((d) => d.code),
+ ['architecture/unknown-endpoint', 'layout/constraint']);
const resultsFile = path.join(tmp, 'unattributed-results.jsonl');
fs.writeFileSync(resultsFile, `${JSON.stringify(receipt)}\n`);
const report = run(['report', '--results', resultsFile]);
assert.equal(report.status, 0, report.stderr || report.stdout);
const summary = JSON.parse(report.stdout);
- assert.equal(summary.overall.diagnostics.unattributed, receipt.rounds[0].unattributed.length);
+ const expectedUnattributed = receipt.rounds
+ .reduce((total, round) => total + (round.unattributed || []).length, 0);
+ assert.equal(summary.overall.diagnostics.unattributed, expectedUnattributed);
});
test('a staged second defect surfaces only after the first is repaired', () => {