Fixes two classes of task failures found while investigating stuck in-review tasks FN-2165 (worktree base ref missing) and FN-2152 (stray .tmp-fn-2152 gitlink accidentally committed via merger amend). FN-2165 — stale baseBranch: - resolveWorktreeStartPoint now returns null instead of throwing NonRetryableWorktreeError when the stored baseBranch is gone. Caller clears task.baseBranch and falls back to branching from the default base (HEAD) so the task self-heals instead of failing permanently. - New TaskStore.clearStaleBaseBranchReferences() nulls baseBranch on any dependent task when its upstream branch is deleted. Wired into cleanupBranchForTask (archive/delete), merger branch cleanup, self-healing orphan-branch sweep, executor dep-abort and conflict-cleanup paths, and stale-branch recovery. Nested worktrees: - assertWorktreePathNotNested guard in tryCreateWorktree refuses to create a worktree inside another registered worktree (previously produced pathological paths like .worktrees/green-finch/.worktrees/amber-panda when rootDir pointed at a worktree instead of the main repo). Context-overflow recovery (FN-2182 class): - Reduced-prompt retry budget raised from 1 → 3 within the same session. - Adds a fresh-session requeue path when same-session retries still overflow: task moves back to todo with worktree retained, bounded by computeRecoveryDecision / MAX_RECOVERY_RETRIES. Prevents late-step context exhaustion from becoming terminal. Gitlink prevention (FN-2152 class): - .gitignore now excludes .tmp-fn-* and .tmp-kb-* so stray worktrees at the repo root cannot be captured by git add -A. - Merger amend flow now scans staged entries for 160000 gitlinks and unstages them with a loud warning; the project uses no submodules, so any such entry is a bug (this is how f8f90f26 landed in HEAD as .tmp-fn-2152). Tests: new coverage for baseBranch fallback, nested-worktree guard, and clearStaleBaseBranchReferences. Full engine + core + dashboard + cli suites pass (15349 tests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
41 lines
760 B
Plaintext
41 lines
760 B
Plaintext
# Dependencies
|
|
node_modules/
|
|
|
|
# Build output
|
|
dist/
|
|
*.tsbuildinfo
|
|
|
|
# Coverage reports
|
|
coverage/
|
|
|
|
# hai runtime (local board state — don't commit)
|
|
.fusion/
|
|
.hai/
|
|
.worktrees/
|
|
.factory/
|
|
kb.db/
|
|
|
|
# Stray worktrees accidentally created at the repo root by the executor
|
|
# or by manual `git worktree add` invocations. Without this, any such
|
|
# directory gets captured as a 160000 gitlink by `git add -A` during
|
|
# merger amend, producing broken submodule entries in HEAD (see FN-2152).
|
|
.tmp-fn-*
|
|
.tmp-kb-*
|
|
|
|
# Pi
|
|
.pi/
|
|
|
|
# Local kb state and backups
|
|
.kb/
|
|
.fusion-backup/
|
|
.fusion-backup-*/
|
|
|
|
# Stray runtime databases
|
|
fusion.db
|
|
fusion.db-wal
|
|
fusion.db-shm
|
|
|
|
# Capacitor mobile platform directories (generated by `cap add`)
|
|
packages/dashboard/ios/
|
|
packages/dashboard/android/
|