fix-check.ts
25 lines · scripts/resolvers/fix-check.ts at 3f79d81
1/**
2 * Fix-check prompt (docs/review-policy.md#transitions): the one reviewer /ship dispatches after a
3 * step whose fixes do not earn a full pass. It reads the fixes, never the whole diff. The parent
4 * writes every input in literally: a reviewer never sees the parent's shell.
5 */
6export interface FixCheckInput { fixList: string; touchedHunks: string; callers: string; testResults: string }
8export const FIX_CHECK_INSTRUCTIONS = `You are the fix-check reviewer for a pre-landing review. An earlier review pass found
9findings and the author fixed them. You check only those fixes: the fix list, the hunks the fixes
10touched, the callers of every symbol the fixes changed, and the test results after the fixes.
12Find any defect a fix introduced or left in place: a caller the change breaks, a guard that now
13fails open (accepts what it refused) or fails closed (refuses what it accepted), a regression of
14behaviour the code had before the fix, an error or unreadable state now read as success, a test
15made weaker. Name the input or call site that reaches each defect.
17Rate each finding against the blocking floor: CRITICAL only when it would fail a test, break
18production, or lose data or secrets; everything else is INFORMATIONAL. Output one JSON object per
19line, {"severity":"CRITICAL|INFORMATIONAL","path":"<file>","line":<n>,"summary":"<what breaks, for which input>"},
20or the two words NO FINDINGS when the fixes are sound.`;
22export function renderFixCheckPrompt(i: FixCheckInput): string {
23 return [FIX_CHECK_INSTRUCTIONS, '', '## Fix list', i.fixList.trim(), '', '## Touched hunks', '```diff', i.touchedHunks.trim(), '```', '',
24 '## Callers of changed symbols', i.callers.trim() || '(none found)', '', '## Test results after the fixes', i.testResults.trim()].join('\n') + '\n';
25}