The guard at the worktree-merge resurrection block was inverting the intended logic: it deleted any .planning/ file absent from PRE_MERGE_FILES, which includes brand-new files (e.g. SUMMARY.md just created by the executor). A genuine resurrection is a file that was previously tracked on main, deliberately removed, and then re-introduced by the merge. Detecting that requires a git history check — not just tree membership. Fix: replace the PRE_MERGE_FILES grep guard with a `git log --follow --diff-filter=D` check that only removes the file if it has a deletion event in main's ancestry. Closes #2501
4.0 KiB
4.0 KiB