fix(review-loop): accept a verdict that closes a summary paragraph - #30
Merged
Merged
Conversation
The prompts and the parser disagreed about where the verdict goes. The prompt
asked the reviewer to "state in the Summary: **Verdict: good to go**"; the
parser required it to be a line of its own. A reviewer that followed the prompt
and ended its summary paragraph with the verdict produced a report that read as
unclean.
That is not hypothetical. An antigravity review closed with "... Finding
counts: High 0, Medium 0, Low 0. **Verdict: good to go**." on the end of the
summary paragraph. test_review_clean never matched, so the loop could not break
early: it ran all five cycles against an already-clean diff, spent eight minutes
re-reviewing work no agent had changed, printed MAX ITERATIONS REACHED, and
wrote a needs-review receipt for bin/review-gate to act on. Every cycle had
reported High 0, Medium 0, Low 0.
The verdict may now open a line or close a sentence at the end of one. Both
guards the anchors were there for survive by construction: quoting prose ("the
report says Verdict: good to go") still fails because "says " is not a sentence
boundary, and hedged prose ("good to go, but ...") still fails because the
trailing anchor allows only an optional "." or "!" after the phrase. The
leading marker class repeats so an "## Verdict" heading counts, which it did
not before.
Both prompts now say where the verdict goes rather than leaving it to the
reviewer, since the loop drives five agent CLIs and none of them can be relied
on to place it. That is defence in depth; the parser is the fix. The
code-review wording is generated, so the edit is in .claude/commands and
tools/generate carried it to prompts/ and the four vendor SKILL.md copies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
prompts/andlib/disagreed about where the verdict goes.The prompt asked the reviewer to "state in the Summary:
**Verdict: good to go**". The parser required a line of its own:A reviewer that follows the prompt and ends its summary paragraph with the verdict produces a report that reads as unclean.
Observed on a real run. An antigravity review closed with:
test_review_cleannever matched, so the loop could not break early. It ran all five cycles against an already-clean diff, spent 7m54s re-reviewing work no agent had touched, printedMAX ITERATIONS REACHED - some issues remain, and wrote aneeds-reviewreceipt forbin/review-gateto act on. Every one of the six passes had reported High 0 / Medium 0 / Low 0.The fix
lib/lib-review-loop— the verdict may now open a line or close a sentence at the end of one. Both guards the anchors existed for survive by construction:saysis not a sentence boundary..or!.The leading marker class also repeats now, so a
## Verdictheading counts; it did not before.Prompts —
code-reviewandcode-review-followupnow say where the verdict goes instead of leaving it to the reviewer. The loop drives five agent CLIs and none can be relied on to place it, so this is defence in depth — the parser is the fix. Thecode-reviewwording is generated, so the edit is in.claude/commands/code-review.md;tools/generatecarried it toprompts/and the four vendorSKILL.mdcopies.Test plan
./test/run→ 182/182 pass (was 181 + 1 stale-generation failure caught mid-work bygenerate --check).test/lib-review-loop.bats: the paragraph-closing verdict that failed, a##heading verdict, and two pinning the guards against hedged and quoted verdicts.agent-code-review.mdfrom the failing run through both regexes — old: no match (confirms root cause); new: clean.