This was generated by AI during triage.
Two robustness gaps in prune_babysit_worktrees.py observed at queue-start prune:
- A leftover state record for a merged/closed PR whose worktree directory no longer exists makes prune error
fatal: not a git repository on every run instead of self-healing. When git status (or equivalent) fails with "not a git repository" for a tracked worktree path, treat that path as already-gone and drop its state record.
- On Windows a file lock blocking removal can leave an empty directory behind, requiring manual
rm -rf + git worktree prune. Detect the residual empty directory and either retry/clean it or report it explicitly rather than leaving a silent orphan.
Acceptance: an orphaned state record pointing at a nonexistent path is dropped without erroring the whole prune; a lock-blocked removal does not silently leave an untracked empty directory (it is cleaned or clearly reported).
Sweep-converted from #657.
Work-class: C3 (bug-fix-shaped) — attended triage 2026-07-23, operator-ratified. 🤖
This was generated by AI during triage.
Two robustness gaps in
prune_babysit_worktrees.pyobserved at queue-start prune:fatal: not a git repositoryon every run instead of self-healing. Whengit status(or equivalent) fails with "not a git repository" for a tracked worktree path, treat that path as already-gone and drop its state record.rm -rf+git worktree prune. Detect the residual empty directory and either retry/clean it or report it explicitly rather than leaving a silent orphan.Acceptance: an orphaned state record pointing at a nonexistent path is dropped without erroring the whole prune; a lock-blocked removal does not silently leave an untracked empty directory (it is cleaned or clearly reported).
Sweep-converted from #657.
Work-class: C3 (bug-fix-shaped) — attended triage 2026-07-23, operator-ratified. 🤖