Repository navigation
feat: conflict guard warns on unregistered on-disk worktrees - #474
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #470
worktree_check_conflictnow readsgit worktree listfor the requested repos and prints a WARNING for any worktree no active.md claim covers (exit code unchanged). New report-onlyworktree_audit_orphanslists 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