feat(review): tell the finder its comments are verified when the verifier is on

Draft
RA
5d ago
+54-4

What changed

When the AI verifier will run, the finder's system prompt gets one more line:

## Verification
Each comment is checked by a separate verifier before it is posted.
  • finderSystemText (new, in ai-review.ts) builds the system prompt: the core prompt, this note when the verifier will run, then the test-gap instruction when that is on.
  • "Will run" is the same condition that starts the verifier: the verify switch is on and the review has evidence for it to read.
  • A prompt supplied through ALTIMATE_REVIEW_AI_SYSTEM_PROMPT_FILE replaces the core prompt whole, so it gets no note.

Why

The defect-focused finder prompt (AltimateAI/altimate-core-internal#790) asks the model to report every defect and grade it with severity and confidence instead of leaving it out. It used to give the reason in the same sentence: "each comment is checked by a separate verifier before it is posted". A reviewer pointed out that the core library has no verifier and cannot know whether its caller runs one, so that clause was removed from the core prompt. This review does know, so it now says so itself.

The measurements behind the stack (65 and 63 of 198 known bugs caught, against 42 and 46 with the 0.9.0 prompt; 0 wrong among 47 inline comments with the verifier) were taken with that sentence in the prompt. Without this change, a review on the next core release would run the verifier but no longer tell the model about it.

When to merge

Draft on purpose: merge together with the bump of @altimateai/altimate-core to the release that contains #790. The stack pins 0.9.0, whose prompt is the old "when in doubt, stay silent" one. Merged before the bump, this would add the line to that old prompt, which nobody measured.

One difference from the measured prompt remains after the bump: the sentence sits at the end of the prompt under its own heading instead of inside the "What to look for" section. The effect of that move has not been measured.

Testing

  • test/altimate/review-ai-system-prompt.test.ts: four new tests (verifier off, verifier on, override file, order with the test-gap instruction).
  • 308 tests in test/altimate/review-ai* pass; no type errors in the changed files.
  • review-scope-diff.test.ts has one test that fails on my machine (a shallow CI checkout without the target branch > with --head on a branch other than the checkout…). It fails the same way on the base branch and does not touch this code.

Stacked on #1838.

šŸ¤– Generated with Claude Code


Summary by cubic

Tells the finder's model that each comment is verified before posting when the review's verifier will run, restoring context removed from the core prompt.

  • Adds finderSystemText, which appends the note to the core prompt when the verify switch is on and the review has evidence, followed by the test-gap instruction when that is on.
  • A prompt from ALTIMATE_REVIEW_AI_SYSTEM_PROMPT_FILE replaces the core prompt whole and gets no note.

Draft on purpose: merge together with the bump of @altimateai/altimate-core to the release containing the core prompt change that removed this sentence.