Skip to content

Remove a Worktree Holding a Saved Submodule in Cleanup - #4593

Merged
ptr727 merged 22 commits into
developfrom
feature/4583-cleanup-populated-submodule
Dec 1, 2026
Merged

ptr727 merged 22 commits into
developfrom
feature/4583-cleanup-populated-submodule

Conversation

@ptr727

@ptr727 ptr727 commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

cleanup used to keep every worktree that git's own worktree remove refuses for holding a submodule. So a drive in a repository with an initialized submodule ended at next=maintainer.

cleanup now removes such a worktree once it proves nothing in it is lost. The proof covers every submodule repository under the worktree's modules, nested ones included. It refuses outright whatever it cannot show cheaply, the maintainer's choice of a strict design.

  • scripts/pr_cleanup_reach.py proves a repository's commits and state:
    • It refuses a stash, a paused operation (a sequencer included), a linked worktree of its own, a shallow repository, and any tag no remote holds.
    • It reads the commits the repository holds before fetching: its refs, its HEAD, and its HEAD reflog.
    • It fetches each remote's branches by an explicit refspec, without recursing.
    • None of those commits may sit outside a remote-tracking ref or a tag.
  • scripts/pr_cleanup_modules.py checks each populated tree, and scripts/pr_cleanup_clear.py clears it. It must be clean, untracked files included, with no embedded repository and no untracked gitlink files at any depth. It then deletes the submodule links and modules, naming the git-ignored entries it loses, and runs the plain worktree remove.
  • A refusal names the submodule by its tree path, or by its git directory where it has none. It names the commit with the ref or the reflog that reaches it.
  • A prunable worktree whose git directory still holds modules refuses. The sweep keeps such an entry and removes the other prunable entries one at a time while it does.
  • The proof runs before the remote branch delete. After the delete it runs again without fetching.
  • pr_cleanup.py stays under its size ceiling. The shared reads moved into pr_cleanup_tree.py.
  • scripts/README.md and the repo-worktree skill describe the rule. The skill hands the task only its own pushable work and sends every other refusal to the maintainer.

Closes #4583

Testing

  • tests/test_pr_cleanup_modules.py holds 38 cases on throwaway repositories, covering both outcomes. One case follows the skill's recovery steps literally through to a removal.
  • The full unit suite passes on the head: 5430 tests, 13 skipped.

Local review

Twenty-two local passes ran. The twenty-second, over the head, found nothing, so no local finding is open.

Earlier local findings and their outcomes

The third pass's eight findings, listed on the first push:

  • Fixed in 6e9367e:
    • a fetch under fetch.pruneTags;
    • a commit only the reflog reaches;
    • a shallow submodule, which is now named shallow;
    • a submodule's own linked worktrees;
    • the missing sequencer;
    • the refusal naming the module rather than the tree path;
    • the sweep's recovery route.
  • unlink_read_only consolidation, declined. local_review.py's handler swallows a failure and lets rmtree go on deleting the rest of a throwaway directory, inside a finally that must not replace the read's result. This one must stop the removal at the first failure. Wrapping a raising handler in a suppress would stop rmtree at the first error, so the two contracts do not share one body. docker_lint.py's copy has to stay standalone.

The tenth pass's findings are answered in a95ac1e, the maintainer's strict redesign: the proof refuses outright what it cannot show cheaply. That covers a shallow submodule, a moved tag, and a reflog-only commit, and the skill routes each to the maintainer. The prune race is closed, and the dead tag strip is gone. The eleventh pass's findings are fixed in 1b0461e: Windows path separators, the sweep's prune for a .git-less entry, the recovery test, the README pronoun, and the reflog docstring. The twelfth pass's findings are fixed in 797a3fe. The thirteenth pass's findings are fixed in 19ea787. That covers a prunable entry resolving to an enclosing repository, the held sweep, the unneeded pruneTags overrides and their tests, the README tag sentence, and the skill's push target. The fourteenth pass's findings are fixed in 43cc019. A surviving worktree directory refuses before the remote delete, clear deletes modules before the links, and a branch commit goes to the maintainer. The over-hardened sweep keep is gone. The fifteenth pass's findings are fixed in e16bfb6, and its reflog question is answered: the maintainer keeps the strict reflog rule, accepting that a squash-merged submodule commit refuses for git's reflog window. The sixteenth pass's findings are fixed in 72c812c. The seventeenth pass's findings are fixed in de0acf0, and the eighteenth pass's in a4a121e. The nineteenth pass's findings are fixed in 76b0262, which also splits the clearing into pr_cleanup_clear.py so every file stays under its ceiling. The twentieth pass's findings are fixed in 487e94f, and the twenty-first pass's in b912bf2.

The eighth pass's findings are fixed in e2718cc: a prunable worktree's submodule repositories, a moved shallow pin, and the shared gitlink and paused-operation reads. Its unlink_read_only evidence, docker_lint.py's copy, is now named in that handler's docstring, and the decline stands. The ninth pass's findings are fixed in f32fc25: an unpushed tag on a pushed commit, the sweep held by one orphaned entry, and the README's sweep pronoun.

The sixth pass's findings are fixed in 4f417f6: a treeless submodule's git directory, any ref that reaches a commit, and a remote under another owner. Its unlink_read_only consolidation stays declined, as above. The seventh pass's findings are fixed in 0cdd09b: files in a gitlink path no repository tracks, a shallow submodule's history download, the README contradiction, and the shared status read.

The fourth and fifth passes' findings are fixed in e03dd7a and 843fea1. Those cover git before 2.42, log.showSignature, a tag refspec, the refusal naming what reaches the commit, the sweep route, a nested submodule's label, a recursive fetch, a staged gitlink, and a merged upstream branch.

🤖 Generated with Claude Code

ptr727 and others added 3 commits November 30, 2026 12:55
`cleanup` kept every worktree git refuses for a submodule, so a drive in a
repository with an initialized submodule ended at the maintainer. It now
proves each submodule repository under the worktree's `modules` clean,
untracked files included, stash-free, and contained in its own remote after
a fetch. Only then does it delete the submodule links and `modules` and run
the plain `worktree remove`. Otherwise it keeps the worktree, naming the
submodule and the commit no remote contains.

Closes #4583

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Them

The local review found two ways the proof passed while a commit was lost: a
repository embedded inside a submodule's tree, and a commit only a local tag
reached. The proof now checks every gitlink at each depth and every ref but
the tags a remote also holds. The re-check after the remote delete reads the
refs the first proof fetched, and the shared reads live in pr_cleanup_tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second local review found false refusals and a missed one. A submodule
pinned at a release tag on no remote branch refused, and a branch that
removed a submodule failed every run on its dangling core.worktree. An
operation paused in a submodule passed. The proof now counts a remote-held
tag as the remote's, reads each repository with its work tree overridden,
refuses a paused operation, and proves every commit before any tree, so a
nested commit names its own submodule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 30, 2026 21:28
@ptr727

ptr727 commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 0bef12706883cb32e330df3044ee45bf6004b369, the content this pull request carries at that commit against develop, and it recorded 8 findings.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6af58f8 and b912bf2.

Files ignored due to path filters: 3

  • .claude-plugin/fleet-skills/.source-digests/repo-worktree is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .github/skills/repo-worktree/SKILL.md is excluded by !.github/skills/**
Files selected for processing: 10

  • .agents/skills/repo-worktree/SKILL.md
  • scripts/README.md
  • scripts/pr_cleanup.py
  • scripts/pr_cleanup_clear.py
  • scripts/pr_cleanup_modules.py
  • scripts/pr_cleanup_reach.py
  • scripts/pr_cleanup_tree.py
  • tests/test_pr_cleanup.py
  • tests/test_pr_cleanup_modules.py
  • tests/test_pr_review_size.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Multiple unresolved safety flaws could let cleanup delete unverified work, including local-only tags, reflog-only commits, sequencer state, linked-worktree commits, or shallow-history commits.

11 open issues
What changed in this PR

This pull request extends cleanup to remove worktrees containing initialized submodules after proving their contents can be safely discarded. It adds recursive repository checks, integrates verified submodule removal into cleanup, expands repository-backed tests, and updates documentation and generated skills.

Changes:

  • Adds submodule safety proofs for repository state, recoverability, nested repositories, and paused operations.
  • Integrates submodule validation and clearing into worktree cleanup while sharing tree-state helpers.
  • Adds test coverage, updates script size limits, and synchronizes cleanup guidance across skill distributions.
File Description
tests/​test_pr_review_size.py Adds the new submodule cleanup module to the script size limits.
tests/​test_pr_cleanup.py Removes cleanup tests superseded by the dedicated submodule test suite.
tests/​test_pr_cleanup_modules.py Adds throwaway-repository tests for safe and refused submodule cleanup cases.
scripts/​README.md Documents the expanded cleanup contract and submodule removal behavior.
scripts/​pr_cleanup.py Integrates submodule validation and clearing into pull-request worktree cleanup.
scripts/​pr_cleanup_tree.py Centralizes shared cleanup status, gitlink, and operation-state helpers.
scripts/​pr_cleanup_modules.py Implements recursive submodule discovery, safety proofs, refusal reporting, and cleanup.
.github/​skills/​repo-worktree/​SKILL.md Updates the GitHub worktree cleanup skill with the new submodule behavior and recovery guidance.
.claude-plugin/​fleet-skills/​skills/​repo-worktree/​SKILL.md Updates the Claude fleet worktree cleanup skill with the new submodule behavior and recovery guidance.
.claude-plugin/​fleet-skills/​.source-digests/​repo-worktree Refreshes the generated source digest for the repository worktree skill.
.agents/​skills/​repo-worktree/​SKILL.md Updates the canonical worktree cleanup skill with submodule removal and recovery guidance.

Review effort: Lite

Comment thread scripts/pr_cleanup.py Resolved
Comment thread scripts/pr_cleanup_modules.py Resolved
Comment thread scripts/pr_cleanup_modules.py Resolved
Comment thread scripts/pr_cleanup_modules.py Resolved
Comment thread scripts/pr_cleanup_modules.py Resolved
Comment thread scripts/pr_cleanup_modules.py Resolved
Comment thread scripts/pr_cleanup_modules.py Resolved
Comment thread .agents/skills/repo-worktree/SKILL.md Resolved
Comment thread scripts/pr_cleanup_modules.py Resolved
Comment thread scripts/pr_cleanup_modules.py Resolved
The third local pass found more ways the proof missed a submodule's own
work. It now reads the commits a submodule holds before its fetch can prune
a tag, and fetches with tag pruning off. It counts each HEAD reflog entry,
refuses a pending sequencer and a submodule's own linked worktree, and
names a shallow submodule it cannot prove. A refusal names the submodule by
its path in the tree, and the commit proof moves to pr_cleanup_reach.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.58065% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.32%. Comparing base (6af58f8) to head (b912bf2).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
scripts/pr_cleanup_modules.py 96.80% 3 Missing ⚠️
scripts/pr_cleanup.py 94.44% 2 Missing ⚠️
scripts/pr_cleanup_reach.py 98.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4593      +/-   ##
===========================================
+ Coverage    79.16%   79.32%   +0.15%     
===========================================
  Files           52       55       +3     
  Lines        17234    17572     +338     
===========================================
+ Hits         13644    13939     +295     
- Misses        3590     3633      +43     
Flag Coverage Δ
python-3.13 79.32% <97.58%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ptr727 and others added 2 commits November 30, 2026 13:45
The fourth local pass found the proof failing on git before 2.42, which
takes no rev-list options on standard input, and on a signed reflog read
through git log. A tag refspec could still prune a local tag. A refusal now
names the branch, tag, or reflog that reaches the commit, the fetch names
each remote's branches itself, and a parent tree no longer reports a nested
submodule's change as its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fifth local pass found the proof's fetch recursing into a nested
submodule before that submodule's snapshot, so a tag refspec there could
delete the only name for a commit. The fetch now leaves nested submodules
to their own turn. A staged gitlink in a submodule's index now counts as a
change, and the skill says what to do with a merged upstream branch and a
commit only the reflog reaches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 843fea1767a780d70bd3979c797caecf8dc5a971, the content this pull request carries at that commit against develop, and it recorded 4 findings.

ptr727 and others added 2 commits November 30, 2026 14:09
…a Commit

The sixth local pass found a deinitialized submodule named by a path where
git reaches the superproject, a note or replacement ref reported as HEAD,
and no route for a submodule remote under another owner. A treeless
submodule's refusal now names its git directory, the refusal names any
non-remote ref, and the skill keeps pushes to this repository's owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The seventh local pass found files in a deinitialized submodule's path that
no status lists, so the removal deleted them unnamed, and the same held for
a submodule never initialized. Such a path now keeps the worktree. A shallow
submodule fetches only branch tips, so its proof no longer downloads its
history, and a worktree and a submodule share one status read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 0cdd09b7b159a3204552e7581592ef79a883fe18, the content this pull request carries at that commit against develop, and it recorded 5 findings.

ptr727 and others added 2 commits November 30, 2026 14:35
…hallow Pin

The eighth local pass found a worktree whose tree was deleted by hand
skipping the proof, so its git directory's submodule repositories were
deleted unproved, by cleanup and by the sweep's prune alike. Such a worktree
now refuses, and the sweep prunes nothing while one such entry is due. A
shallow submodule fetches only the branches it tracks, so its pin stays
connected once upstream moves, and the gitlink and paused-operation reads
are shared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ninth local pass found an annotated tag on a pushed commit deleted with
its message, and one orphaned worktree entry blocking every other prune.
A tag no remote holds now keeps the worktree. The sweep keeps the orphaned
entry and removes the others one at a time, and the README no longer gives
the sweep the clearing step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head f32fc25387b4eec8a5624321d041dc73c4e4b9d9, the content this pull request carries at that commit against develop, and it recorded 6 findings.

ptr727 and others added 3 commits November 30, 2026 15:04
Ten local passes kept finding edge cases in the ways the proof tried to
avoid refusing, so it now refuses them outright. A shallow submodule
refuses, the skill sends every refusal but this task's own pushable work to
the maintainer, and a refusal for a missing tree names its modules
directory. The sweep removes each prunable entry on its own, so it never
prunes an entry it did not judge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…odules

The Windows unit job failed on refusal paths that mixed git's forward
slashes with the native separator, so each path is now read through
realpath or normpath. The sweep again uses git worktree prune unless a
prunable entry holds submodule repositories, since per-entry removal
refused an entry whose .git file was gone. The recovery test now follows
the skill on a branch commit the task may push.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s Singly

The twelfth local pass found an embedded repository's refusal mixing path
separators on Windows, and the README saying the sweep always removes
prunable entries one at a time. Gitlink entry paths are now normalized, and
the README limits the one-at-a-time removal to a run that keeps an entry for
its submodule repositories.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 797a3fe08408aa9f6030a5a119dab7e94494c7c8, the content this pull request carries at that commit against develop, and it recorded 6 findings.

ptr727 and others added 2 commits November 30, 2026 15:52
…ng Repository

The thirteenth local pass found a worktree directory left without its .git
file resolving to the repository around it, so cleanup proved and cleared
the primary clone's own submodule repositories. A prunable entry now skips
the proof and the clearing, and a held sweep keeps such an entry rather than
failing to remove it. The unneeded pruneTags overrides and their two tests
are gone, and the skill names a new branch as the only push target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fourteenth local pass found a prunable worktree whose directory
outlived its .git file passing preflight, so the remote branch went before
git refused to remove it. It now refuses first. The clear deletes modules
before the submodule links, so an interrupted clear reruns to completion,
and the skill sends a branch commit to the maintainer, since it is often
one a squash merge already landed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 43cc019af508c5a0178c0e8fb259e436e2b4cc72, the content this pull request carries at that commit against develop, and it recorded 4 findings.

ptr727 and others added 2 commits November 30, 2026 16:35
… Husks

The fifteenth local pass found the clear docstring promising a rerun that
cannot read half-deleted repositories, and a held sweep predicting a removal
git refuses. A failed clear now names the hand step, a held sweep keeps an
entry whose directory outlived its .git file, and the note-ref test uses
refs/notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sixteenth local pass found the hand step a failed clear prints leaving
a submodule's files with no repository beside them, so the rerun refused
for good. The hand step now removes the worktree itself before cleanup runs
again, a test follows it literally, and the sweep text names the entry a
held run keeps for a missing .git file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 72c812c19ea15c0ea2ea03972add69e4e0ec8dd4, the content this pull request carries at that commit against develop, and it recorded 3 findings.

The seventeenth local pass found the hand step's git worktree remove and
the skill's git submodule update naming no directory, so each fails from
where it is literally run. Both now name it with -C, and the
interrupted-clear test runs the printed command as given, deleting with the
read-only handler Windows needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The eighteenth local pass found the printed git worktree remove splitting
at a space in a path, as a Windows profile or a macOS home can hold. Both
paths are now quoted, and the test checks the quoted form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head a4a121ee2bc2baba6b4341f9f644eb78ce668099, the content this pull request carries at that commit against develop, and it recorded 4 findings.

ptr727 and others added 2 commits November 30, 2026 17:38
… Step

The nineteenth local pass found a submodule update that leaves a rebase
or merge submodule on its branch, a hand step no one was told to run, the
README stating the clear order backwards, and a held sweep dropping git's
reason. The skill now updates with --checkout and sends the hand step to
the maintainer, and the held sweep prints git's reason. The clearing moves
to pr_cleanup_clear.py and the reads to pr_cleanup_modules.py, so every
file stays under its ceiling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The twentieth local pass found a .DS_Store that Finder writes into an
uninitialized submodule's empty directory refusing an ordinary macOS
worktree. Such file-manager metadata is no longer work. The prunable-entry
refusal no longer says a surviving tree is gone, the module docstring drops
the clearing that moved out, and the skill routes another owner's
submodule work to the maintainer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 487e94fa5aac018255f67bda32c6ff8611d98a78, the content this pull request carries at that commit against develop, and it recorded 3 findings.

…ranch

The twenty-first local pass found the skill telling an agent to stop on
any nonzero cleanup exit while letting it clear one, claiming every
refusal names a commit, and leaving the task's pushed submodule branch
unreported. The exception is now named where the stop rule sits, the
refusal text matches what cleanup prints, and the pushed branch goes to the
maintainer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head b912bf2c747191419e950487298976bfe63bafcd, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727

ptr727 commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Dec 1, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 5199db5 into develop Dec 1, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/4583-cleanup-populated-submodule branch December 1, 2026 02:46
ptr727 added a commit that referenced this pull request Dec 1, 2026
…Hook-Path Denials (#4594)

## Promoted pull requests

- #4590: Read the attention lists under a fine-grained token. The full
check read still runs first. A token refused `contexts` or `checkSuites`
gets a lean read of the same page and every later one. That read names
failing pull requests from the head's Actions runs and the jobs of each
run's listed attempt, and it records what went unread.
- #4592: Deny a commit or push whose text sets GIT_CONFIG*, HOME, or
XDG_CONFIG_HOME (each can change which hooks run), and read unquoted
bash brace expansion in the guard's lexer so brace-expanded blanket adds
and `commit -a` are refused under requirements 6 and 11.
- #4596: Expand stepped alphabetic and signed brace ranges in the write
guard, as bash does, so `git commit -{A..z..+32} x` is refused as the
blanket commit it runs (fixes a Copilot finding raised on this promotion
against #4592).
- #4597: Show every write-guard denial in the decision-flow diagram, the
brace cap and requirement 11 included, and split one self-test table
through `_rows` (fixes this promotion's local review findings against
#4592).
- #4593: Let `cleanup` remove a worktree holding a populated submodule
once a strict proof shows nothing is lost: every submodule repository
clean, untracked files included, no stash, paused operation, linked
worktree or shallow history, and every commit and tag its refs and HEAD
reflog reach held by its own remote after a fetch. Anything it cannot
show refuses and routes to the maintainer. The clearing lives in
scripts/pr_cleanup_clear.py.
- #4599: Answer the second local review of this promotion. The guard's
docs state its fail-closed behavior without a closed list, one set of
state-changing builtins serves both guard sites, and the attention read
tolerates a check suite's unread `workflowRun` as the review gate does,
marking only the pull request it names.

## Promotion review findings

Copilot raised one finding on head ed0326f, that the lean retry could
hide an unrelated null node. It was declined in its thread with the code
path: the lean re-read tolerates nothing, so a null that persists still
fails the read and exits 1.

Copilot raised three findings on head 9acbb87, all against #4592:

- Stepped alphabetic brace ranges were left literal. This was real, and
#4596 fixed it (`6797d691`). The fix also reads a leading `+` sign as
bash does. Copilot's own example, `-{a..z..2}`, was already denied,
since its literal word carries an `a`, so the regression rows use cases
that `develop` really allowed.
- An empty brace word must be kept. Declined, because bash drops the
empty word: `printf "[%s]" {,--all}` prints `[--all]`.
- The zero-padded self-test fixture was wrong. Declined, because the
fixture creates the directory `01` and the self-test passes.

Copilot's round on head 6797d69 opened on a verdict naming no defect:
that synthetic tests cannot establish live behavior. It was answered
with the live evidence and acknowledged as declined.

A local `frontier` pass against `main` at head 6797d69 raised two
findings against #4592, and #4597 fixed both (`9a5af3f9`). The
decision-flow diagram lacked the brace-cap denial, and requirement 11 as
well, as #4597's own review found. One self-test table was split by hand
rather than through `_rows`.

A second local `frontier` pass against `main` at head 9a5af3f raised
four findings, and #4599 fixed them (`e60890ad`). They were the brace
cap missing from the guard's fail-closed docs, a phrase with no
referent, two drifted lists of state-changing builtins, and a refused
`workflowRun` failing the attention read.

Closes #4584
Closes #4582
Closes #4514
Closes #4583

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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