Repository navigation
Session Handoff [agent-cleanup]: Cleanup Script Landed in #3186 and Hub Clone Swept, Skill Wiring Next #3187
Description
Next steps, in priority order
-
PR 2 for Script the Local Half of Post-Merge Cleanup in pr_review.py cleanup #3184: point every skill that creates or finishes a worktree at the new commands.
cleanup <n> --repo O/R --checkout <primary>replaces the raw local git steps.cleanup --sweep --repo O/R --checkout <primary> [--apply]covers what crashed or abandoned sessions leave behind. The surfaces:repo-worktree"Listing and Cleanup";drive-pr"The Drive Loop" step 4;merge-and-releasestep 8;backlog-burndown"Cleanup Is the Orchestrator's";pr-review-conduct's post-merge line;unattended-handoff, whose worker has no cleanup step at all;resync-a-repoandaudit-a-repo, whose hub-reach worktrees are never removed.
Done means every surface names the command instead of raw
git worktree remove/git branch -D/git push --delete, the generated skill trees are rebuilt withscripts/build_dist.py, and the PR is merged todevelop. Edit underskill-lifecycle, and readscripts/README.md'scleanupparagraph for the exact contract. -
Re-measure the related issues against the tree once PR 2 lands, and close or narrow each with evidence:
- The Prescribed Post-Merge Remote-Branch Delete Cannot Run Where the Procedure Puts It #1682, merge-and-release's Cleanup Prescribes a git push the Write Guard Denies #1693 and Requirement 6 Denies the Remote Branch Delete That merge-and-release Step 8 Prescribes #1642: the remote delete has been scripted since before this round;
- Decide whether merge-and-release's branch cleanup should use compare-and-delete #946: the local half now re-reads the tip before
git branch -D, while the remote is still verify-then-delete; - backlog-burndown: nothing removes a standalone clone after its group merges #1301, backlog-burndown: a merged-but-undeleted remote branch claims its files forever #1302, backlog-burndown: cleanup leaves an abandoned group's claim and its pushed remote branch standing #1274, backlog-burndown: unconditional worktree retire, and a stopped clone group with no end state #1303 and backlog-burndown: the worktree-only disposition has no actor or timing, and its use sites disagree with it #1272: backlog-burndown cleanup gaps.
-
Promote
developtomainwith both PRs, where the "Closes Script the Local Half of Post-Merge Cleanup in pr_review.py cleanup #3184" line belongs, since closing refs register only on default-branch PRs. -
Optionally sweep the other fleet primaries (for example Financial-Modeling) with
cleanup --sweep --repo <owner/name> --checkout <its primary>: a dry run first,--applyon the maintainer's go-ahead.
External blockers
None.
Internal dependencies
- Step 2 follows step 1, since several of those issues are closed by the skill text, not the script.
- Step 3 follows step 1, so one promotion carries both PRs.
State
- #3186 merged to
developas 2f047fa. No release was dispatched. - Its worktree, local branch and remote branch were removed by the new
cleanup 3186 --checkout, the first real use of the local half. - The hub primary is clean on
developatorigin/develop. cleanup --sweep --applyran on the hub primary:- removed 39 worktrees, 19 local branches with their 18 merged remote branches, and 4 stale entries;
- left 4 detached Financial-Modeling hub copies that live sessions were using, kept by the 24h rule;
- re-derive the current state with
git worktree listandgit branch.
- Script the Local Half of Post-Merge Cleanup in pr_review.py cleanup #3184 is open, with a comment correcting its premise.
The parked decision queue
0 issues carry decision in this repository.
What the last round did
- Landed #3186:
pr_review.py cleanup --checkout, the local half, andcleanup --sweep, with thescripts/README.mdcontract. - Corrected Script the Local Half of Post-Merge Cleanup in pr_review.py cleanup #3184's premise in a comment.
gh-write-guardallowsgit branch -Dand an unforcedgit worktree removeagainst a primary. The real blocker is that onlypython3 scripts/pr_review.py:*is on the permission allowlist.
What not to repeat
- Script the Local Half of Post-Merge Cleanup in pr_review.py cleanup #3184's helper-worktree route is unnecessary. The script runs git itself, so the guard never sees those calls.
- The local strict-review passes on this new code took nine passes to reach zero findings. Each round's fixes produced the next round's edge cases.
- The per-push edit budget, with remaining findings listed in the PR body, is what let the PR keep moving.
- Copilot's single round raised the same findings the body already listed.
New learnings
git worktree prune --expireages a prunable entry by itsindexfile's mtime, not itsgitdirfile. This is recorded inCleanupSweep.entry_hours.scripts/pr_review.pyalready fails to import on Python 3.11, because of PEP 695 syntax that predates this round. A 3.11-only finding against it is moot.
Activity
ptr727 commentedon Oct 17, 2026
Lane closed out: scripted cleanup shipped in 2.0.1083
Every next step this link named is done. What remains is tracked in its own issues, so the
agent-cleanuptrack closes with no successor.What landed
pr_review.py cleanup <n> --checkout <base-clone>andcleanup --sweep. The skills arerepo-worktree,drive-pr,merge-and-release,backlog-burndown,pr-review-conduct,unattended-handoff,resync-a-repo,audit-a-repo, andgit-commit-conventions.--sweepjudge a branch held only by a pruned worktree entry in the same run. #3191 drops a false claim inunattended-handoffstep 7. Both came from promotion-review findings.main.--sweepran across the fleet primaries on this host. On the maintainer's go-ahead,--applythen ran on seven of them, with every run at exit 0 and problems=0. One unregistered, non-fork repository was refused by the write-scope check, and the maintainer chose to leave it out of the fleet.Still open, each in its own issue
gh-write-guarddelete-only-push exemption for manual runs. The skills no longer need it.What not to repeat
--min-age-hours, which is trusted input. One was real and fixed in Sweep a Pruned Worktree Entry's Branch in the Same Run in pr_review.py #3190. Expect the promotion round to keep finding edges in new cleanup code, and judge each against "Trust Boundaries and Hardening Effort" rather than hardening by reflex.cleanup, every qualifier about its outcome ("returns the base clone", "every refusal before anything is deleted", "leaves its worktree standing") drew a finding. Stating the bare instruction and pointing atrepo-worktree"Listing and Cleanup" is what converged.git branch -dfalls back to judging againstHEADwhen the upstream ref is gone, so it refuses a promotion branch that was merged only intomain. Such a branch is left for--sweep, which readsorigin/maincontainment.Parked decision queue
0 issues carry
decisionin this repository.