feat(FN-4068): add branch conflict detection and recovery for stale worktre

Implements branch conflict detection and recovery across the Fusion engine, CLI, and dashboard — surfacing git worktree conflicts when tasks conflict with unrelated branch state, and providing a recovery workflow to resolve them. The executor and worktree pool now integrate typed branch conflict che

Fusion-Task-Id: FN-4068
This commit is contained in:
Fusion
2026-05-12 17:10:26 -07:00
committed by gsxdsm
parent ceccc382b1
commit bddcc3a931
28 changed files with 1341 additions and 209 deletions

View File

@@ -73,6 +73,12 @@ describe("settings key parity", () => {
expect(DEFAULT_PROJECT_SETTINGS.heartbeatMultiplier).toBe(1);
});
it("defaults sibling branch rename escape hatch to disabled", () => {
expect(DEFAULT_PROJECT_SETTINGS.executorAllowSiblingBranchRename).toBe(false);
expect(isProjectSettingsKey("executorAllowSiblingBranchRename")).toBe(true);
expect(isGlobalSettingsKey("executorAllowSiblingBranchRename")).toBe(false);
});
it("defaults completionDocumentationMode to off", () => {
expect(DEFAULT_PROJECT_SETTINGS.completionDocumentationMode).toBe("off");
});

View File

@@ -180,6 +180,7 @@ export const DEFAULT_PROJECT_SETTINGS = {
testCommand: undefined,
buildCommand: undefined,
recycleWorktrees: false,
executorAllowSiblingBranchRename: false,
worktreeNaming: "random",
taskPrefix: "FN",
includeTaskIdInCommit: true,

View File

@@ -2081,6 +2081,10 @@ export interface ProjectSettings {
* of being deleted. New tasks acquire a warm worktree from the pool,
* preserving build caches (node_modules, target/, dist/). Default: false. */
recycleWorktrees?: boolean;
/** When true, restores the legacy behavior of silently creating sibling
* branches like `fusion/FN-123-2` when the canonical task branch is already
* checked out elsewhere. Default: false. */
executorAllowSiblingBranchRename?: boolean;
/** Controls how worktree directory names are generated when creating fresh worktrees.
* Only applies when recycleWorktrees is NOT enabled (pooled worktrees retain their existing names).
* - "random": Human-friendly adjective-noun names (e.g., swift-falcon) — default