Skip to content

feat: conflict guard warns on unregistered on-disk worktrees - #474

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/unregistered-worktree-guard
Oct 6, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/unregistered-worktree-guard

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #470

worktree_check_conflict now reads git worktree list for the requested repos and prints a WARNING for any worktree no active.md claim covers (exit code unchanged). New report-only worktree_audit_orphans lists every unclaimed worktree with ahead/behind/dirty and flags zero-commit claims STALE? — it removes nothing (48 orphans on the dev box today). Docs now state the guard reads active.md only.

Tests: new tests/test_worktree_orphan_guard.py (8); full Brain suite 1203 passed. Each new test was red on the unfixed code first.

Heart: readiness STALE (release validation stale: source moved since rehearsal — PyAutoNerves); human-acknowledged 2026-10-05. Tier notify — auto-merge on green per the approved plan; PyAutoBrain has no PR test CI, so the gate is the local full suite above.

Part of bundle pyautobrain-worktree-guards (one issue + one PR per member). No workspace impact (Brain tooling only).

🤖 Generated with Claude Code

worktree_check_conflict reads claims only from active.md, so a linked git
worktree no ledger mentions was invisible to it. It now prints a WARNING
per requested repo's on-disk worktree not covered by any active.md or
parked.md `worktree:` path (equal or parent, ~-expanded); exit code is
unchanged and the registry still fails closed.

- worktree_list_on_disk <repo>: linked worktrees from `git worktree list
  --porcelain` (path, branch), main checkout skipped.
- worktree_audit_orphans [repo...]: report-only sweep over every checkout;
  ORPHAN rows with ahead/behind vs origin/main and dirty count, STALE? for
  active claims with zero commits and zero changes. Removes nothing.
- Docs: guard reads active.md only; WARNING + audit described in
  start_dev reference and WORKFLOW.
- tests/test_worktree_orphan_guard.py: 8 hermetic cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 closed this Oct 5, 2026
@Jammy2211 Jammy2211 reopened this Oct 5, 2026
@Jammy2211
Jammy2211 merged commit db2aa37 into main Oct 6, 2026
3 of 6 checks passed
@Jammy2211
Jammy2211 deleted the feature/unregistered-worktree-guard branch October 6, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: conflict guard warns on unregistered on-disk worktrees

1 participant