test(eng-batching): read the report target as a field, not a spelling

The next targeted rerun (Claude Code 2.1.284) again asked eleven separate
native questions and again counted zero: its briefs named no plan and its
report declared '- **Review target (fixed):** `/abs/PLAN.md`' under
'# Eng Review — PLAN.md: <plan>'. An unsourced brief now inherits the one
current target field that names a PLAN.md file, whatever its list or
emphasis markup; its ledger record still supplies the cited finding and
must reproduce the brief exactly. A brief that names its plan must still
match the report title. Replays of all three captures count 9, 9 and 3;
controls reject a foreign, duplicate or missing target and an archived
title.
This commit is contained in:
garrytan committed 2026-09-29 20:12:02 +00:00
1 parent e758fbe96d
commit 475667ff5d
3 files changed
+405 -11

No files matched your search

+32
View File
@@ -6,6 +6,7 @@ import * as path from 'node:path';
import { createEngBatchingIssueCounter, isEngBatchingIssueAUQ } from './helpers/eng-seeded-coverage';
import { engSetupAUQ, hasCompletePlanReport, nativePlanCallFingerprint } from './helpers/claude-pty-runner';
import batchingCapture from './fixtures/eng-batching-unsourced-brief-36606688266.json';
import bulletTargetCapture from './fixtures/eng-batching-bullet-target-rerun.json';
function question(call: NativePlanQuestionCall, text: string) {
const answer = call.answers![call.questions[0]!.question]!;
@@ -160,3 +161,34 @@ describe('batching replay of run 36606688266 (unsourced native briefs)', () => {
}
});
});
describe('batching replay of a 2.1.284 rerun (bullet target, unnamed plan)', () => {
// Eleven separate native questions; the briefs name no plan and the report
// declares '- **Review target (fixed):** `/abs/PLAN.md`' under '# Eng Review — PLAN.md: <plan>'.
const calls = bulletTargetCapture.calls as unknown as NativePlanQuestionCall[];
const count = (plan: string) => {
const counter = createEngBatchingIssueCounter(() => plan, engSetupAUQ);
calls.forEach((call, index) => counter.isReviewAUQ(nativePlanCallFingerprint(call, 0, true), calls.slice(0, index)));
return counter.trace.map(entry => entry.issue);
};
test('the recorded verdict counted none of the separate decisions', () => {
expect(bulletTargetCapture.recordedOutcome).toMatchObject({ reviewCount: 0 });
expect(calls.length).toBe(11);
});
test('ledger-bound decisions count once each through the report target field', () => {
expect(count(bulletTargetCapture.plan).length).toBe(9);
});
for (const [name, change] of [
['a foreign target file', (plan: string) => plan.replace(/(Review target \(fixed\):\*\* `[^`]*\/)PLAN\.md`/, '$1OTHER.md`')],
['a second target declaration', (plan: string) => plan.replace('- **Review target (fixed):**', '- **Review target (fixed):** `OTHER.md`\n- **Review target (fixed):**')],
['no target declaration', (plan: string) => plan.replace('- **Review target (fixed):**', '- **Report scope:**')],
['an archived report title', (plan: string) => plan.replace('# Eng Review —', '# Archived Eng Review —')],
] as const) test(`the bullet target route rejects ${name}`, () => {
const plan = change(bulletTargetCapture.plan);
expect(plan).not.toBe(bulletTargetCapture.plan);
expect(count(plan)).toEqual([]);
});
});