Repository navigation
Disk hygiene: reclaim_disk.sh and a doctor disk-free row - #2426
Closed
remigiusz-antczak wants to merge 1 commit into
Closed
remigiusz-antczak wants to merge 1 commit into
remigiusz-antczak wants to merge 1 commit into
Conversation
…nches; doctor disk-free row .claude/skills/agentic-delivery/scripts/reclaim_disk.sh lists (dry run by default) linked worktrees that are unlocked, have no modified, untracked or ignored files, have a HEAD reachable from origin/main or another branch, and whose last reflog move is older than RECLAIM_MIN_AGE_HOURS (default 24; non-numeric or below 1 falls back to 24 with a stderr note; clamped at 87600), plus local branches merged into that base. --apply runs git worktree remove (never --force) and git branch -D on exactly the listed items. Protected branch names, the main checkout, the current worktree, hidden index changes (assume-unchanged, skip-worktree) and unfinished rebases, merges, cherry-picks, reverts or bisects are skipped with a reason. The lock is the only liveness signal: agent worktrees are locked while running, so an unlocked, clean worktree older than the age is treated as abandoned. A missing or unparsable reflog counts as young (fail closed). perun_doctor.py gains a disk free row: WARN under 50 GiB, FAIL under 10 GiB (PERUN_DISK_WARN_GB, PERUN_DISK_FAIL_GB), with a hint naming the script. operating-discipline.md's teardown section names both. scripts/test_reclaim_disk.py builds scenario repos and removes each of 12 guards in turn (checkedout, dirty, freshbr, hidden, inprogress, locked, main, merged, protected, reach, top, young); each mutant must leak exactly its own expected items. Registered in scripts/ci-tests.d/reclaim-disk.sh. size-budget-raise: .claude/skills/agentic-delivery/references/operating-discipline.md 11608→11835 adds the disk-hygiene line to the teardown section Tests: 5/5 (test_reclaim_disk guards_killed=12/12, test_perun_doctor, test_doctor_orphan_dbs, test_doctor_review_scanners, test_doctor_stale_local_skills); size gate ok (207 files); fragments ok Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4dfwdDQiF3RQMUqYBqefc
Collaborator
Author
|
Superseded by #2428 (rebased on current main, one squashed commit). |
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.
Adds a disk guard so finished lane worktrees and merged branches no longer pile up until the disk is nearly full.
What changes
.claude/skills/agentic-delivery/scripts/reclaim_disk.shis dry-run by default. It lists linked worktrees that are unlocked, have no modified, untracked or ignored files, have a HEAD reachable from origin/main or another branch, and whose last reflog move is older thanRECLAIM_MIN_AGE_HOURS(default 24). It also lists local branches merged into that base.--applyremoves exactly the listed items withgit worktree remove(never--force) andgit branch -D.perun_doctor.pygains adisk freerow: WARN under 50 GiB, FAIL under 10 GiB, with a hint that names the script.Tests
5/5.
scripts/test_reclaim_disk.pyremoves each of 12 guards in turn, and each mutant must leak exactly its own expected items (guards_killed=12/12). The four doctor tests still pass. The size gate and fragment gate pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01B4dfwdDQiF3RQMUqYBqefc