Repository navigation
Conversation
…ignored content blocks the reap, allowlisted ignored paths are recorded before removal (#6734)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 7, 2026
Member
Author
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.
Closes #6734
Summary
The worktree-reaper's CLEAN gate never enumerated ignored files, so a worktree whose only non-tracked content was ignored (local state, ignored databases, scratch) classified clean and was reaped —
git worktree removedeleted the ignored content with the tree, unrecorded in the run record, breaking the reaper's "only removes worktrees whose content is proven on origin" invariant (ignored content is by definition never on origin).status_entries()now also returns ignored paths viagit status --ignored=matching(!!entries; probe-verified: ignored files list individually, ignored directories collapse to one trailing-slash entry liketarget/, so records stay compact). Both call sites — the CLEAN gate inevaluate_treeand the re-verification inreap_tree— fail closed on any ignored path beyond the new ignored-dirt allowlist.ignored_allowlisted()mirrorsdirt_allowlistedplus component matching (build output sits at any depth): config keysignored_dirt_names(any path component; seededtarget,node_modules,__pycache__,.direnvin bothDEFAULT_CONFIGand the shippedconfig.json),ignored_dirt_prefixes,ignored_dirt_files. This is the allowlist seed judgment lane code-t's triage delegated to the fix claim: known regenerable build output only — an unlisted ignored path always blocks, never rides along.reap_treerecords every allowlisted ignored path it is about to delete on the run record (ignored_removed) before the removal runs, and allowlisted ignored dirt justifies--forceexactly like allowlisted untracked dirt.Evidence
python3 tests/test_worktree_reaper.py(laptop): 15 passed / 0 failed — the full existing reap matrix plus new coverage:test_05_ignored_gate(ignored-only tree kept withlocal-statenamed in the gate'signored_other; allowlisted-untracked + unlisted-ignored tree kept; allowlisted-ignoredtarget/tree reaped withtarget/in the record'signored_removed),test_ignored_allowlisted(component/prefix/basename matching;target_notes.txtis nottarget/; unlisted ignored content fails closed),test_status_entries_enumerates_ignored(synthetic repo: ignored file + collapsed ignored dir enumerated, untracked/tracked unaffected).status_entriesreturned([], [])for an ignored-only worktree) is on worktree-reaper: CLEAN gate is blind to ignored files — an ignored-only tree reaps as clean and git worktree remove deletes the ignored content unrecorded #6734; the fix implements its routed plan.Merge Danger
Door: two-way — reaper gate logic only, single-commit revert.
Blast Radius: the laptop worktree-reaper's CLEAN decisions. The change only ever keeps more trees (unlisted ignored content now blocks) or records more (allowlisted ignored paths are named before a reap that was already going to happen); no tree that is kept today gets reaped unless its ignored content is entirely within the named build-output allowlist.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.