Repository navigation
fix: review deleted files diff-first instead of leaving them UNREVIEWED - #338
Open
rembradtech wants to merge 3 commits into
Open
rembradtech wants to merge 3 commits into
rembradtech wants to merge 3 commits into
Conversation
added 3 commits
October 9, 2026 15:02
Since #180 every file a PR removes was marked UNREVIEWED ("deleted file requires diff-first review"), so any PR with a deletion was INCOMPLETE and exited 2 forever: no amount of fixing could complete its review. Loops that gate merges on a complete review held every such PR for a human. A deleted file is now reviewed from its patch: the removed lines, numbered by their base-file line. Its changedRanges stay empty, so findings land in the review summary instead of inline: GitHub anchors inline comments on the head side, where a deleted file has no lines. It stays UNREVIEWED when GitHub sent no patch, when its path is denied, or when it exceeds the byte budget. Claude-Session: https://claude.ai/code/session_01CgEWGPjo2rnCHc8C2wfRay
This branch has not been deployed
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.
Problem
Since #180,
loadScmTargetsmarks every file a PR removes asUNREVIEWED(deleted file requires diff-first review). A review with any unreviewed file isINCOMPLETEand exits2, so any PR that deletes a file can never get a complete review — fixing findings doesn't help, the deletion is still in the diff.Seen live on NoxCodeSolutions/design-system#5 (harness loop): after the Windows spawn fixes, the review ran 34/34 lenses with 0 failures, yet stayed
INCOMPLETEsolely because ofapps/fixture-next/src/index.ts(deleted). The harness holds such a PR for a human after two incomplete reviews.The local
git-diffsource has always skipped deletions; only the SCM source marks them unreviewed.Fix
Do what the reason string asks: review the deletion diff-first.
[deleted] …), numbered by base-file line.changedRanges: []→ findings are notinDiff, so they go to the summary's "Findings outside the diff" instead of inline. GitHub anchors inline comments on the head side (line), where a deleted file has no lines; an inline anchor there would make GitHub reject the whole review.UNREVIEWED: no patch from GitHub (too large / binary), a denied path (checked first, so e.g. a deleted.envnever reaches the prompt), or over the byte budget (counted like any projected file).This keeps #180's intent (a deletion is not silently ignored) while letting a PR with deletions complete.
Tests
test/sources-deleted-files.test.mjs: deletion reviewed from patch with base-file numbering and no inline anchors; no-patch and denied deletions stayUNREVIEWED(denied carries no content); mixed delete + edit reviews both.campaign-preflight.test.mjs: the PR-6 fixture that asserts an unreviewed file blocks a campaign now deletes a file without a patch, the case that stays unreviewed.packaged campaign command keeps stdout machine-readable when output cannot be writtenfails identically onmainwithout this change (Windows-specific). The full suite did not finish locally within 20 min, so CI is the authority here.https://claude.ai/code/session_01CgEWGPjo2rnCHc8C2wfRay