Repository navigation
fix(code-review): keep findings outside the diff - #315
Merged
Merged
Conversation
PLN-2214 PR 1 (ISS-12737): the validator keeps and tags out_of_diff findings instead of discarding them; verify-prepare always verifies them; cache, post-comments, presenters and prompts handle them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
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.
Campaign chunk C1 of 3 (sequential): keep findings outside the diff.
Implements PLN-2214 · PR 1 for ISS-12737 (plan).
code-review3.10.5 → 3.11.0.What changes
The validator used to discard every finding on a file outside the diff (
DISCARD_FILE_NOT_CHANGED) before verification, at any priority. Code outside the diff is often exactly what a change breaks. In 34 local review runs, this discarded 6 findings that were all caused by their diff, three of them P1 ("stale mocks crash every BranchesPage test").out_of_diff. It goes through the normal 0.5 confidence floor, not the 0.80 out-of-hunk floor. A diff-scope finding with no file is now discarded asDISCARD_MISSING_FILE.out_of_difffinding is verified. It bypasses the verify cache and does not use the 50 in-diff verification slots. The verifier searches the whole patch for the change that caused it, and rejects with the newrejection_class: not_caused_by_diffif there is none.evidence[]cites, or under every file of their partition. They are dropped on a cache hit once their own file is in the diff.out_of_difffinding is posted inline at the diff line itsevidence[]cites. Otherwise it appears in the summary only. It is labelled "caused by this change" only when the verifier upheld it, and "causation unconfirmed" otherwise.evidence[]. The shared prompt spells out that shape.SCHEMA.mddocumentsout_of_diff,kept_out_of_diff,not_caused_by_diffand the previously missingevidence_contradicted.discarded_file_not_changedis removed; it had no consumers.Acceptance ledger
30 criteria: 27 met, 3 met differently, 0 not met.
Deviations from the plan
post-commentsis only given--findings, so it has no diff data. To place anout_of_difffinding inline, it reads the PR's files from GitHub, and only when the run has such a finding. PR 2's deleted-side (side=LEFT) posting should reuse this lookup.out_of_hunk_keptwas never incode_review_schema.py, so both it andout_of_diffwere added there as optional booleans.Review
Two
/code-review:deeppasses, both proven against this worktree's commits:evidence[]shape; partial patch reads; a duplicated regex; a stalestart.mdnote.partitions.jsonparsing, which already existed before this PR.not_caused_by_diffthrough escalation, which changes a contract shared by every rejection class; the label fix covers the visible harm.CLAUDE_PLUGIN_ROOTwas empty.HEADrather than a commit. That is a pre-existing plugin bug, not part of this PR.Verification
uv run pytest plugins/code-review/tools/python/ -q: pass (1,418 after the fixes).uv run ruff check .: pass.uv run pyright: 0 errors.code_review_helpers.py; every new test went red under its mutation.validateover 31 local review runs: exactly the 6 findings from ISS-12737 flip from discarded to kept, and nothing else changes.Still owed by later chunks