Created
Jun 23, 18:36
Started
Jun 23, 19:15
Completed
Jun 23, 19:57
DevOps handoff
Type
Bug
Shape
backend
Worktree Slug
doctor-reconcile-worktrees
Repositories
mcritchie-studio
Release Train
—
Branch
feat/doctor-reconcile-worktrees
Acceptance Criteria
Expected Test Plan
Checks Run
Agent Context
REWORK (carl HEAVY block): prunable worktree (git lists it, dir rm'd on disk) crashed BOTH doctor and snapshot --write with uncaught Errno::ENOENT (capture_status chdir into missing dir). Fix: (1) capture_status now rescues SystemCallError -> [false] defense-in-depth; (2) orphan_worktree_issues guards !Dir.exist?(dir) -> distinct 'prunable' label, skips git calls; (3) NIT: orphan_label() appends 8-char SHA1 path hash so same-basename orphans don't collapse under doctor_issues_by_label. Repro confirmed pre-fix crash + 3/4 new tests fail without fix. Rebased onto origin/release.
Stage Timeline
Who handled each stage, the time it took (measured), and the model / tokens / cost reported (best-effort) — plus who's on it right now. — means the agent didn't report that metric.
Conversation
QA review feedback, agent handoffs, and follow-up notes for this task.
2-senior review: carl (HEAVY) REQUEST_CHANGES; jasper (LIGHT) approve. Fix before resubmit: (1) MAJOR bin/agent-worktree (orphan_worktree_issues ~1393 + capture_status/git_value chdir ~164): a PRUNABLE worktree (git still lists it but its dir was deleted on disk) is flagged orphan, then git_branch/git_dirty?/base_ref_for chdir into the missing dir and raise uncaught Errno::ENOENT — crashing BOTH doctor AND snapshot --write (runs in QA/conductor automation). Reproduced by carl. NEW crash path on exactly the drift the feature targets. Fix: guard orphan dirs where !Dir.exist?(dir) — skip or label 'prunable' BEFORE computing branch/merge/clean — and add a regression test that deletes a listed worktree dir and asserts doctor exits 0. (2) MINOR: cover the prunable path + the missing-satellite-repo path. (3) NIT: two orphan dirs sharing a basename produce identical slug/orphan:<basename> labels grouped under one key — disambiguate with a short path hash. Then rebase onto origin/release before resubmitting.
Rework RE-REVIEW PASS: carl (HEAVY) approve — prunable-orphan ENOENT crash RESOLVED (two-layer: orphan_worktree_issues guards !Dir.exist? + emits 'prunable' issue; capture_status rescues SystemCallError); both doctor and snapshot --write exit 0, verified failing-first vs pre-fix commit; label-collision nit fixed (path-hash). jasper (LIGHT) approve. No blockers. Non-blocking: orphan issues counted in snapshot.summary but not per-worktree (enhancement).
Sealed-bid sizing
Edit →Alex (PM)
—
Avi (PO)
—
Dev
—
Actual
—
We emailed a one-tap sign-in link to . It expires shortly and can only be used once.
No email? Check spam, or close this and try again.