feat: add WorktreeManager for isolated test environments

Reusable platform module (lib/worktree.ts) that creates git worktrees
for test isolation and harvests useful changes as patches. Includes
SHA-256 dedup, original SHA tracking for committed change detection,
and automatic gitignored artifact copying (.agents/, browse/dist/).

12 unit tests covering lifecycle, harvest, dedup, and error handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-23 17:31:43 -07:00
parent 062b92fec7
commit 0f1f1eb1c5
3 changed files with 569 additions and 0 deletions

1
.gitignore vendored
View File

@@ -6,6 +6,7 @@ bin/gstack-global-discover
.claude/skills/
.agents/
.context/
.gstack-worktrees/
/tmp/
*.log
bun.lock