When working on a feature branch (e.g. f-123-new-thing), GSD creates slice branches correctly from the current branch but merges them back to main instead of the feature branch. This is because getMainBranch() always resolved to the repo default branch with no concept of where the user started. Fix: record the current branch as the "integration branch" in a per-milestone metadata file (.gsd/milestones/<MID>/<MID>-META.json) when auto-mode starts. getMainBranch() checks this metadata before falling back to repo defaults, so switchToMain() and mergeSliceToMain() target the correct branch. Key details: - Integration branch is captured once per milestone (idempotent) - Committed immediately so it survives branch switches (.gsd/ files are discarded during checkout) - main_branch preference still takes highest priority - Falls back to existing detection if metadata missing (backward compat) - Per-milestone: different milestones can target different branches - Validates branch still exists before using it Tests: 41 new assertions across git-service.test.ts and worktree.test.ts covering the full lifecycle, multi-slice workflows, resume scenarios, backward compatibility, and edge cases. |
||
|---|---|---|
| .. | ||
| agents | ||
| extensions | ||
| skills | ||
| GSD-WORKFLOW.md | ||