Kevin

Reaping — two sweeps, one landing test

worktree_reaper retires directories; branch_reaper retires bare refs. Both gate on landed_on_main (ancestry OR patch-id OR tree identity) and one protect list.

Reaping — two sweeps, one landing test (v2026-08-02T101544Z-ab2bbdebf5) 2026-08-27 | worktree_reaper retires directories; branch_reaper retires bare refs. Both gate on landed_on_main (ancestry OR patch-id OR tree identity) and one protect list. 1 - Worktree Reaper - Retiring Git Worktrees worktree_reaper.py enumerate_worktrees() _git() _compose_teardown() config/worktree-retire.yaml load_config() list of worktr… 2 - Branch Reaper - Retiring Orphaned Branches branch_reaper.py enumerate_branches() evaluate_all_branches() _reap() config/worktree-retire.yaml load_config() list of branch… 1. Load configuration from worktree-… 2. Enumerate all worktrees 3. Evaluate each worktree against re… 4. Compose teardown for any worktree… 5. Publish retirement events to kv/g… Example Worktree Configuration enabled: true quiet_hours: 12 delete_remote: true protect_branches: - main - release/* Example Branch Record branch: feature-branch tip_sha: abc123def456 verdict: reaped failed_gate: null detail: branch deleted successfully at: 2023-10-01T12:00:00Z remote_deleted: true The worktree reaper evaluates each worktree against several criteria, including whether the branch has landed on main and if there are any untracked files. The branch reaper focuses on orphaned branches that have no associated worktrees and checks if their content is already on main before deletion. Legend actor = initiates work · process = code path · store = state on disk · bus = durable queue · dashed = separate process cyan = request flow · pink = state read/write · dashed green = pull / return path · red = refusal As of 2026-08-27 14:59 UTC, from commit 1b71989

Provenance

This drawing is generated, not drawn. It is rebuilt from the source files below, so when they change the picture changes — a diagram here cannot quietly describe a system that no longer works this way.

Owner
Kevin
Slug
worktree-branch-reaping
Rendered
2026-08-02T101544Z
From commit
ab2bbdebf5
Updated
27 Aug 2026, 14:59 UTC
Sources at
1b71989
Watches
3 paths
  • daemon/src/worktree_reaper.py
  • daemon/src/branch_reaper.py
  • daemon/config/worktree-retire.yaml