Files
fusion/packages
gsxdsm ac342f5012 FN-6220: harden AI merge worktree cleanup
Harden AI merge cleanup so temporary clean-room worktrees are removed and audited reliably.

- Canonicalize AI merge cleanup paths and prune stale git worktree metadata after removals.
- Treat already-absent or de-registered cleanup paths as idempotent success while still auditing genuine failures.
- Add regression coverage for successful, no-op, retry, thrown, orphaned, and dangling-registration cleanup paths.
- Document the inline and self-healing cleanup lifecycle for AI merge temp worktrees.

Files changed:
 docs/architecture.md                               |   4 +-
 .../engine/src/__tests__/merger-ai-cleanup.test.ts |  28 +-
 .../ai-merge-worktree-cleanup.test.ts              | 284 +++++++++++++++++++++
 packages/engine/src/merger-ai.ts                   | 108 +++++---
 4 files changed, 392 insertions(+), 32 deletions(-)

Fusion-Task-Id: FN-6220

Fusion-Task-Lineage: b002313c-4349-49c2-8d0f-cd1853369d84
2026-06-11 20:02:21 -07:00
..
2026-06-10 19:05:55 -07:00
2026-06-10 19:05:55 -07:00
2026-06-10 19:05:55 -07:00
2026-06-10 19:05:55 -07:00
2026-06-10 19:05:55 -07:00
2026-06-10 19:05:55 -07:00
2026-06-10 19:05:55 -07:00