From ee7c6b5c2b117c29d3670563d4534f86284074ba Mon Sep 17 00:00:00 2001 From: Jeremy McSpadden Date: Sat, 21 Mar 2026 09:33:24 -0500 Subject: [PATCH] fix(worktree): recurse into tasks/ when syncing slice artifacts back to project root (#1678) (#1681) syncWorktreeStateBack() only processed files directly in each slice directory, silently skipping the tasks/ subdirectory. Task-level summaries (T01-SUMMARY.md, T02-SUMMARY.md, etc.) were therefore never copied from the worktree back to the project root before teardown, causing data loss when the worktree was removed on milestone completion. Fix: detect the tasks/ directory entry in the inner loop and recurse into it, copying all .md files and appending them to the synced list. Consistent with how syncStateToProjectRoot() already uses recursive copy via safeCopyRecursive(). Adds regression test (case 8 in worktree-sync-milestones.test.ts) covering slice-level and task-level summary sync.