fix(#276): remove reset --hard from worktree reuse path
Problem#
WorktreeService.createWorktree() called git reset --hard origin/master in the worktree reuse path, silently destroying any agent commits already on the branch from prior phases (e.g., execute → address_review).
Task / Link#
Closes #276
Changes#
- Remove
git reset --hard origin/masterfrom theworktreeReusedcode path - Keep
git fetch originto update remote refs while preserving the branch HEAD - Update invariant comment to reflect that the branch may contain agent work
- Update unit test to assert that
reset --hardis NOT called on worktree reuse
Notes#
The fresh-create and branch-attach paths are unaffected by this change.
Testing#
- Unit test
'reuses an existing valid worktree without removal, runs fetch only (no reset)'explicitly assertsresetCallisundefined - All existing worktree tests continue to pass
- CI: Lint + Test + Build ✅, E2E Tests ✅