Skip to content

fix(analyzer): correct added-line→patch-line mapping for delta re-reviews - #73

Merged
ChonSong merged 1 commit into
mainfrom
ws3-fix-delta-mapping
Aug 7, 2026
Merged

ChonSong merged 1 commit into
mainfrom
ws3-fix-delta-mapping

Conversation

@ChonSong

@ChonSong ChonSong commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Live-test discovery (PR #72 sync path): deterministic re-review on synchronize was silently dropping error-handling findings. The first sync (full diff) flagged Exception silently ignored, but subsequent delta re-reviews reported 0 findings for the same pattern.

Root cause

_check_error_handling maps added lines to patch lines so _is_silently_ignored can inspect the handler body in context. The mapping loop compared patch_lines[patch_idx].lstrip().startswith(add_line) — but patch lines retain their +/' ' diff prefixes, so lstrip() never removes them and the mapping was always empty. The get(i, i) fallback misaligns indices whenever context lines precede a finding (the delta case), so the handler body inspection looked at the wrong line and returned False (not silently ignored) — finding dropped.

Fix

Strip the diff prefix before comparing in the mapping loop.

Verification

  • Real PR chore: drop stale T0 reference in synchronize comment #72 delta a94176c...3628105: 0 findings → 1 finding (correct)
  • Full PR diff regression: still 2 findings (the two fixture empty-excepts)
  • New regression test (delta patch with leading context + docstring shape) — fails under old logic, passes under fix
  • Full suite: 551 passed (was 550), compile gate OK

…iews

The mapping loop compared lstrip()ed patch lines against stripped added
lines, but patch lines retain their '+'/' ' diff prefixes, so lstrip()
never removed them and the mapping was always empty. The get(i, i)
fallback then misaligned indices whenever context lines preceded a
finding — the synchronize re-review (delta) case — silently dropping
error-handling findings on re-sync.

Fix: strip the diff prefix before comparing. Verified against the live
PR #72 delta (0 findings -> 1) and full PR diff (regression: 2 findings).
Regression test added; suite 551 passing.
@riptide-review

riptide-review Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

✨ Review Required

@ChonSong:
⚠️ Exception silently ignored (pass or empty body)

  • 🟡 Exception silently ignored (pass or empty body) (riptide/tests/test_diff_analyzer.py)
    📊 Blast Radius
    2 files, 123 code paths

✨


🤖 Generated by Riptide · deterministic analysis (Phase 1) + ELI5 enrichment (Phase 2) · @riptide-bot companion skip to opt out · @riptide-bot review for deep-think

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@ChonSong, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c6ccc08-462f-41ef-8ffb-0c1095569e68

📥 Commits

Reviewing files that changed from the base of the PR and between 5629911 and eacf738.

📒 Files selected for processing (2)
  • riptide/diff_analyzer.py
  • riptide/tests/test_diff_analyzer.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@riptide-review riptide-review Bot added bot/labeled Bot has applied labels to this item (dedup guard) priority/low Cosmetic, nice to have, P3-equivalent scope/small 10–99 lines changed status/needs-repro Bug report without reproduction steps sweeper:blast-contained Blast radius: contained — one narrow path / opt-in / few users type/bug Something isn't working — fix, bugfix, hotfix labels Aug 7, 2026
@ChonSong
ChonSong merged commit 6130294 into main Aug 7, 2026
4 checks passed
@ChonSong
ChonSong deleted the ws3-fix-delta-mapping branch August 7, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot/labeled Bot has applied labels to this item (dedup guard) priority/low Cosmetic, nice to have, P3-equivalent scope/small 10–99 lines changed status/needs-repro Bug report without reproduction steps sweeper:blast-contained Blast radius: contained — one narrow path / opt-in / few users type/bug Something isn't working — fix, bugfix, hotfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant