fix(review-pr): add verification checklist for multi-line suggestions#1608
Merged
fix(review-pr): add verification checklist for multi-line suggestions#1608
Conversation
The bot was generating suggestion blocks with over-wide line ranges, silently deleting correct code when applied. Root cause: the existing "minimize the range" instruction was too vague — the bot didn't verify that every line in the range was accounted for in the replacement. Adds concrete pre-posting checks: read the exact lines, verify no silent deletions, cap range at ~10 lines, and avoid spanning markdown fences. Fixes #1607 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Root cause analysis
Investigated all three known cases:
start_line: 18, line: 22— 5-line range replaced with fewer lines, deleting thegit-wtfallback branchstart_line: 289, line: 291— range included a closing```fence that GitHub consumed as the suggestion's own delimiterstart_line: 93, line: 127— 35-line range replaced with a shorter rewrite, deleting thegh issue viewcode blockCommon thread: the bot sets a line range covering more content than it intends to replace. The replacement text is shorter, so the surplus lines are silently deleted. The existing instruction ("minimize the range") didn't give the bot a way to verify correctness.
Fix
The new checklist requires the bot to:
Test plan
🤖 Generated with Claude Code