WorktreePool.prepareForTask now rejects empty/"HEAD" base values and verifies that the worktree's HEAD actually landed at the resolved base SHA after `git checkout --detach`. This closes the FN-5432 / FN-5255 contamination pattern where a recycled worktree branched from a stale HEAD (reflog: "branch: Created from HEAD") and pinned the new task's tip to the previous occupant's commit. SelfHealingManager.tryReanchorForeignOnlyContamination is invoked from both PR-conflict and self-owned-branch-conflict catch sites before the unrecoverable-pause path. When the conflicted branch carries only foreign commits (no own work), the branch is reset to base via the existing recoverForeignOnlyContamination flow instead of being escalated for human adjudication. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
911 B
@runfusion/fusion
| @runfusion/fusion |
|---|
| patch |
fix(engine): prevent worktree-pool branch creation from inheriting a previous occupant's tip, and auto-reanchor branches that already inherited foreign commits.
-
WorktreePool.prepareForTasknow rejects empty/HEADbase values and verifies post-detach HEAD matches the resolved base SHA before creating the branch. This closes the FN-5432 / FN-5255 contamination pattern where recycled worktrees branched from a stale HEAD (reflog:branch: Created from HEAD) and pinned the new task's tip to the previous task's commit. -
SelfHealingManagernow attempts a foreign-only contamination reanchor before pausing a task withbranch-conflict-unrecoverable. When the task's branch carries only foreign commits (no own work), the branch is reset back to its base via the existingrecoverForeignOnlyContaminationpath instead of stranding the task for human adjudication.