singularity-forge/src/resources
Adam Dry 2ed7c830d9 fix: merge slice branches to integration branch instead of main (#200)
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.
2026-03-13 10:34:28 -06:00
..
agents Initial commit 2026-03-10 22:28:37 -06:00
extensions fix: merge slice branches to integration branch instead of main (#200) 2026-03-13 10:34:28 -06:00
skills feat(skills): add bundled skills — frontend-design, swiftui, debug-like-expert 2026-03-11 01:07:40 -06:00
GSD-WORKFLOW.md feat(M001/S03): Bug fixes and doc corrections 2026-03-12 13:21:05 -06:00