Skip to content

Review pull requests that only delete files - #34

Merged
TorstenDittmann merged 2 commits into
mainfrom
claude/project-thread-nkya4x
Nov 4, 2026
Merged

TorstenDittmann merged 2 commits into
mainfrom
claude/project-thread-nkya4x

Conversation

@TorstenDittmann

Copy link
Copy Markdown
Contributor

Requested by Torsten · project thread

Why

filterFiles excluded every deleted file, so a pull request that only deletes files ended with no included files and runReview skipped it as "No reviewable changes". Such PRs (e.g. the Dependabot-config removals) never got a review, and so never an approval. hansi.codes has the same behaviour.

What changes

  • Filters before content (filters.ts): path filters and default ignores are checked first, so deleted now marks only a removal the review would otherwise cover. Deleting a lockfile or a filtered path still reads as ignored by default / path filter and still skips.
  • Deletion-only PRs are reviewed (review.ts): when nothing is included but reviewable files were removed, the review runs. The removed lines go into the prompt (within the diff budget), and the prompt tells the reviewer to grep for code, config, workflows, scripts and docs that still depend on what was deleted.
  • Findings still gate approval: removed lines cannot carry an inline comment, so findings in a deletion-only review are placement misses, listed in the summary as before. If those would have stopped approval under decideVerdict (blocking severity or a bug finding), approval is withheld with a reason, so Hansi never approves a deletion it found a problem with.

Tests

Added in core.test.ts: filter reasons for removals, a deletion-only review that approves with the removed lines in the prompt, and one that withholds approval for an unplaceable bug finding. bun run lint, bun run check and bun run test (364 pass) are green.


Generated by Claude Code

A pull request whose only changes are file deletions was skipped as having no
reviewable changes, so it never got a review or an approval. It is now reviewed:
the removed lines are shown to the reviewer, which is told to search for what
still depends on them. Findings there cannot sit on a changed line, so they are
listed in the summary and withhold approval when they would have blocked it.

A deletion of a path the filters or default ignores exclude still skips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3M7tsPz9Z383BKxKBMttQ
Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
@TorstenDittmann TorstenDittmann self-assigned this Nov 4, 2026
@hansi-codes

hansi-codes Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

This PR lets reviews proceed when a pull request only removes reviewable files: filtering happens before deleted files are classified, and the removed diff is included in the reviewer prompt within the diff budget. It adds guidance to look for remaining references, makes qualifying unplaceable findings and truncated deletion diffs withhold approval, and applies path-specific instructions to removed files. Tests cover filtering, deletion-only approvals, unplaceable findings, path instructions, and diff-budget truncation.

Latest changes: The newest commits apply path instructions to removed files and ensure unplaced findings below minSeverity do not withhold approval, while a deletion whose diff does not fit the prompt still cannot be approved.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 4
File Change
packages/engine/src/core.test.ts Adds tests for deletion-only reviews, filtering, approval gating, path instructions, and removed diffs that exceed the prompt budget.
packages/engine/src/filters.ts Applies path and default filters before classifying deleted files.
packages/engine/src/prompts.ts Adds reviewer instructions for checking what deleted files may still be referenced.
packages/engine/src/review.ts Includes reviewable deleted-file diffs in deletion-only reviews, applies path instructions to shown removals, and gates approval on truncation and qualifying unplaceable findings.

Reviewed the commits since e9f0595 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Tier B · 1 blocking finding to address. Summary

Comment thread packages/engine/src/review.ts Resolved
Comment thread packages/engine/src/review.ts Resolved
Comment thread packages/engine/src/review.ts Resolved

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Tier B · 1 blocking finding to address. Summary

Comment thread packages/engine/src/review.ts Resolved
Comment thread packages/engine/src/review.ts Resolved
Comment thread packages/engine/src/review.ts Resolved
Withhold approval when removed lines did not fit in the prompt, apply
minSeverity to unplaced findings before they block approval, and match
per-path instructions against removed files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3M7tsPz9Z383BKxKBMttQ
Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@TorstenDittmann
TorstenDittmann merged commit 8e9c1ba into main Nov 4, 2026
7 checks passed
@TorstenDittmann
TorstenDittmann deleted the claude/project-thread-nkya4x branch November 4, 2026 11:49
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