6725642274
Adds Worktrees.snapshot(worktreePath, branch, message): stages into a temporary GIT_INDEX_FILE (never the worker's real index/HEAD), writes the tree, commit-trees it onto the worktree's current HEAD, and points refs/wip/<branch> at the result. add -A (never -f) respects .gitignore. SessionManager.release() now snapshots any dirty worktree before the preserve-or-remove decision, regardless of release cause (COMPLETED or SHUTDOWN) — preserving on disk alone is one `worktree remove --force` away from gone. A failing snapshot never escalates: the worktree is still preserved, the pane still stops, and the release listener is still notified. onRelease's listener now receives a ReleaseDetail (terminal, worktree path, branch, snapshot ref) instead of a bare terminal id, so Bridged's WORKER_FAILED wiring can put the same three facts into a failed ticket's detail — a lead can re-dispatch onto the same tree instead of starting from the base commit.