Skip to content

fix(review-pr): add verification checklist for multi-line suggestions#1608

Merged
max-sixty merged 1 commit intomainfrom
fix/suggestion-verification-1607
Mar 18, 2026
Merged

fix(review-pr): add verification checklist for multi-line suggestions#1608
max-sixty merged 1 commit intomainfrom
fix/suggestion-verification-1607

Conversation

@worktrunk-bot
Copy link
Copy Markdown
Collaborator

Summary

Root cause analysis

Investigated all three known cases:

  1. pr-review: multi-line suggestion removes correct code along with the bug #1310 (PR Adds simplified install scripts #1309): start_line: 18, line: 22 — 5-line range replaced with fewer lines, deleting the git-wt fallback branch
  2. pr-review: suggestion block eats code fence markers when target range includes backtick lines #1326 (PR fix(skill): add retry guard to prevent intra-run duplicate reviews #1322): start_line: 289, line: 291 — range included a closing ``` fence that GitHub consumed as the suggestion's own delimiter
  3. fix: add confidence gates and evidence accumulation to review-reviewers #1598: start_line: 93, line: 127 — 35-line range replaced with a shorter rewrite, deleting the gh issue view code block

Common 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:

  1. Read the exact lines in the range before posting
  2. Verify no silent deletions — every line must appear in the replacement or be intentionally removed
  3. Cap range at ~10 lines — larger suggestions should be split or pushed as commits
  4. Avoid spanning markdown fences — prevents delimiter collision

Test plan

  • Review a PR with a multi-line suggestion opportunity and verify the bot follows the checklist
  • Verify the bot splits or commits changes larger than ~10 lines instead of using a suggestion

🤖 Generated with Claude Code

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>
@max-sixty max-sixty enabled auto-merge (squash) March 18, 2026 20:09
@max-sixty max-sixty merged commit c5d62b3 into main Mar 18, 2026
23 checks passed
@max-sixty max-sixty deleted the fix/suggestion-verification-1607 branch March 18, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants