fix(ai-review): scope the incoherent-diff bail to mechanical breakage and reclassify evidence-bearing bails - #8796
Merged
Merged
Conversation
… and reclassify evidence-bearing bails (#8789) Confirmed live 2026-07-26 (PR #8735): the bail instruction's "does not cohere with the PR title/description" clause made the reviewer bail on a VALID diff whose title merely undersold it — the model's own rationale named the exact production change it had just read — collapsing a reviewable PR into an inconclusive manual hold once the fallback also failed. - Prompt: the bail now fires only on a BROKEN diff (empty, truncated, garbled, or contradicting the PR's own file list). A readable diff whose scope differs from the description is explicitly NOT a bail — review it and note the mismatch in the assessment. - Parse: a bail that arrives WITH a substantive valueAssessment rationale (valid magnitude, >= 40 trimmed chars — the model demonstrably read the diff) reclassifies to a usable scope-observation review with a fixed public-safe assessment (SCOPE_MISMATCH_ASSESSMENT); model text travels only through the existing valueAssessment channel. A bare bail stays null. - isIncoherentDiffBail mirrors the reclassification (including toValueAssessment's magnitude validation) so the retry-loop break can never disagree with what parseModelReview actually did — its documented contract.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 43c8379 | Commit Preview URL Branch Preview URL |
Jul 26 2026, 06:28 AM |
Contributor
Logic backtestReplayed 0 historical case(s) for Backtest comparison:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8796 +/- ##
==========================================
- Coverage 93.81% 92.26% -1.55%
==========================================
Files 797 797
Lines 79584 79596 +12
Branches 24118 24122 +4
==========================================
- Hits 74662 73441 -1221
- Misses 3556 5090 +1534
+ Partials 1366 1065 -301
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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
The root-cause fix for the recurring inconclusive-review incident (PRs #8735/#8737; siblings #8794 and #8795 fixed the fallback and copy/classification layers). The bail instruction's "does not cohere with the PR title/description" clause triggered on a valid diff whose title undersold it — title-vs-diff scope mismatch is a reviewable quality signal, not evidence of a stale diff.
Changes
valueAssessmentrationale (valid magnitude + ≥40 trimmed chars; the confirmed live case carried ~300 chars naming exact call sites) reclassifies into a usable review whose assessment is the fixed public-safeSCOPE_MISMATCH_ASSESSMENT— model text travels only through the existing valueAssessment channel. A bare bail staysnulland keeps the deliberate-bail retry break (fix(review): short-circuit the retry loop on a deliberate INCOHERENT_DIFF_ASSESSMENT bail #7518 behavior pinned by the existing #ops-review-burst tests, untouched).isIncoherentDiffBailmirrors the reclassification exactly, includingtoValueAssessment's magnitude validation, honoring its documented "can never disagree with parseModelReview" contract — with a test pinning agreement on the invalid-magnitude edge.Test plan
npm run typecheck— cleanCloses #8789