While exercising dev-review-release on t-587.2 with a fresh root, setup-worktrees created directories that are not valid git worktrees.
Repro: 1. Run: Omni/Ide/dev-review-release.sh setup-worktrees --root _/tmp/t587-e2e --name t-587 --base live 2. setup logs show worktrees created and branches t-587-dev/test/live. 3. Run a loop once (review succeeded once for t-587.2). 4. Next loop invocation fails with: Workspace missing: /home/ben/omni/live/_/tmp/t587-e2e/dev 5. Inspecting shows directory exists but git fails: git -C /home/ben/omni/live/_/tmp/t587-e2e/dev rev-parse --is-inside-work-tree fatal: not a git repository: /home/ben/omni/live/.git/worktrees/dev1 6. /home/ben/omni/live/_/tmp/t587-e2e/dev/.git contains: gitdir: /home/ben/omni/live/.git/worktrees/dev1 but .git/worktrees/dev1 does not exist.
Impact:
Likely related to worktree creation/hook interaction (we also saw branchless hook noise: fatal bad object 000... during setup). Need robust detection/repair in setup/loop and root-cause in worktree management/hook integration.
Review (patchset 1): APPROVED
Changes reviewed:
Omni/Ide/dev-review-release.sh: +2 functions (workspace_is_valid_git_repo, ensure_role_workspace), new --name flag for loop subcommand, updated setup hints to include --name.Omni/Ide/DEV_REVIEW_RELEASE.md: documents auto-recovery behavior and --name usage.Omni/Ide/README.md: adds example with --name flag.Verification:
git worktree add -f confirms it correctly handles: (a) stale admin entry after mv, (b) missing admin dir (gitdir pointing to nonexistent path), (c) workspace dir doesn't exist at all ✓Code quality:
.broken-<timestamp> (safe, non-destructive) ✓-f flag correctly to allow re-checkout of same branch ✓--name defaulting from --root basename matches setup behavior ✓Automation (review) run review-t-588-20260211-221919 cost_cents=0 cumulative_cost_cents=0.
1a247c5f3629bd0cff6c343865d6082d2a3cf2ae: Integrated successfully. Lint verification passed.
Automation (integrator) run integrator-t-588-20260211-222433 cost_cents=0 cumulative_cost_cents=0.
Implemented fix in commit 5c1a2ab9: loop startup now validates role workspace health and auto-recovers broken gitdir worktrees by preserving broken dirs and force re-adding worktrees. Added loop --name for explicit branch prefix during repair, and updated setup/loop docs. Repro validated with intentionally broken .git pointer under _/tmp/t588-repro.