Skip to content

fix(manager): reconcile project assignments with worktrees - #334

Merged
boadij merged 5 commits into
mainfrom
fix/project-worktree-removal-retirement
Oct 9, 2026
Merged

boadij merged 5 commits into
mainfrom
fix/project-worktree-removal-retirement

Conversation

@boadij

@boadij boadij commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Fixes #330

Implements ADR 0019.

Summary

  • Reconcile Manager-owned project assignments against a repository-verified git worktree list --porcelain -z inventory at startup, inspection, resume, and worktree-removal event boundaries.
  • Fail closed when checkout identity is ambiguous. Missing assignment provenance does not cause branch reassociation to retire a surviving linked checkout; detached worktrees do not block cleanup when a saved checkout path proves they are unrelated; without provenance, any surviving linked checkout remains conservatively ambiguous. Unreadable saved sessions are not treated as evidence of a surviving checkout.
  • Retirement revalidates the active Manager, repository/worktree scope, and exact assignment identity under the assignment lock. Ordinary supervision defers on lock contention; native removal-event reconciliation uses bounded, abortable retries.
  • Create and verify new checkouts before publishing assignments. Remove pending project messages before the exact assignment. Retire confirmed-missing work instead of reconstructing its worktree during resume_project.

The original Herdr event-callback root cause remains unproven; this change does not attribute the original failure to a specific cause.

External Review #3 follow-up

Verification

  • npm test -- extension/controller-api.test.ts — passed (111 tests).
  • npm test -- extension/commands.test.ts — passed (111 tests).
  • npm run validate — passed (907 total; 906 passed, 1 skipped), including build and package audit (66 files).
  • Final npm run check — passed (907 total; 906 passed, 1 skipped).
  • git diff --check — passed.
  • GitHub Actions for final commit cd385e8c3a75e5cebeaddb1f166b4b8335d292cf — passed (run 38005869226): Ubuntu, macOS, and Windows validation; package build/audit; container checks; aggregate CI.
  • The branch is mergeable against current main; merge base: 9ee5b397ac9aa0127dcc2f55f4ad79bbb965576e.
  • No new live smoke was run: conflict resolution changed tests only; the included main changes are the already-merged PR refactor(lead): default orchestrators to coordination-only tools #336 behavior.

Safeguards and limitations

Reconciliation does not mutate/prune Git worktrees or delete branches or Pi sessions. Historical assignments without trustworthy checkout provenance remain conservatively ambiguous when another linked checkout survives. The native removal smoke recorded earlier in this PR verifies current user-facing cleanup behavior but does not prove the original #330 callback failure mechanism.

Verify repository-scoped Git worktree inventory before retiring exact project assignments, and reconcile Manager startup, inspection, resume, and removal-event paths. Persist new assignments only after the checkout is verified, share identity-checked cleanup, and stop reconstructing confirmed-missing worktrees. Update lifecycle coverage, smoke expectations, and current behavior documentation.

Fixes #330
@boadij
boadij merged commit bc679d7 into main Oct 9, 2026
7 checks passed
@boadij
boadij deleted the fix/project-worktree-removal-retirement branch October 9, 2026 23:49
boadij pushed a commit that referenced this pull request Oct 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.22.2](v0.22.1...v0.22.2)
(2026-10-09)


### Fixes

* **manager:** reconcile project assignments with worktrees
([#334](#334))
([bc679d7](bc679d7))


### Refactoring

* **lead:** default orchestrators to coordination-only tools
([#336](#336))
([9ee5b39](9ee5b39))


### Documentation

* **adr:** define worktree-backed project assignment lifecycle
([#331](#331))
([123848b](123848b))
* establish performance and efficiency principle
([#335](#335))
([7d1dfef](7d1dfef))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

fix(manager): reconcile project assignments after worktree removal or absence

1 participant