Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(flakes): reject duplicate original identities [C7,H16]
Corey Olsonc2794f82adbb
diff --git a/src/ci-flakes.js b/src/ci-flakes.jsindex 3cd68861..a22ab12a 100644--- a/src/ci-flakes.js+++ b/src/ci-flakes.js@@ -69,11 +69,12 @@ function ciTests(output, root) {}/**- * Match a rerun to one actual failed test. A located row identifies its own file first. A locationless row can- * stand for a test only when its title occurs once in each report; a skip or another same-title file proves no pass.+ * Match a rerun to one actual failed test. Its original file and title must identify one occurrence. A located row+ * identifies its own file first. A locationless row can stand for a test only when its title occurs once in each+ * report; a skip or another same-title file proves no pass.*/function rerunTest(target, before, after) {- if (target.file === null) return undefined;+ if (target.file === null || before.filter(row => row.name === target.name && row.file === target.file).length !== 1) return undefined;const exact = after.filter(row => row.name === target.name && row.file === target.file);if (exact.length) return exact.length === 1 && !exact[0].skip ? exact[0] : undefined;const sameTitle = after.filter(row => row.name === target.name);diff --git a/test/flakes.test.js b/test/flakes.test.jsindex cdec7864..0460847e 100644--- a/test/flakes.test.js+++ b/test/flakes.test.js@@ -623,3 +623,19 @@ test('a same-title skipped original does not lend its identity to an anonymous Cassert.equal(listed.flakes.length, 0, 'the anonymous pass could be the other original test');assert.deepEqual(listed.unclassified.map(entry => entry.file), ['test/a.test.mjs'], 'the skipped original is not itself recorded as a failure');});++test('a duplicate original CI file and title cannot share one located passing occurrence [C7,H16]', t => {+ const box = flakyProject(t);+ const commit = box.git('rev-parse', 'HEAD');+ const ci = join(box.scratch, 'ci-results');+ const job = { job: 'duplicate original identity', runner: 'private-tap-fixture', node: process.version, commit, run: '888', at: '2026-10-20T12:00:00.000Z' };+ const row = (status, number) => `${status} ${number} - shared title [C7]\n ---\n location: '/home/runner/work/repo/repo/test/shared.test.mjs:3:1'\n ...\n`;+ ciAttempt(ci, 'red', { ...job, attempt: 1, conclusion: 'failure' }, `TAP version 13\n${row('not ok', 1)}${row('not ok', 2)}1..2\n`);+ ciAttempt(ci, 'rerun', { ...job, attempt: 2, conclusion: 'success' }, `TAP version 13\n${row('ok', 1)}1..1\n`);+ const imported = box.cli('flakes', 'import', ci);+ assert.equal(imported.code, 0, JSON.stringify(imported.document));+ const listed = box.cli('flakes').document;+ assert.equal(listed.flakes.length, 0, 'a located pass cannot identify which duplicate original occurrence passed');+ assert.deepEqual(listed.unclassified.map(entry => entry.file), ['test/shared.test.mjs']);+ assertReceipts(box, listed.unclassified[0].observations[0]);+});