diff --git a/.gsd/DECISIONS.md b/.gsd/DECISIONS.md index 63394f85d..2d37c7804 100644 --- a/.gsd/DECISIONS.md +++ b/.gsd/DECISIONS.md @@ -20,3 +20,7 @@ | D012 | M001/S01 | arch | RUNTIME_EXCLUSION_PATHS defined independently | Define exclusion paths in git-service.ts independently of gitignore.ts BASELINE_PATTERNS | Keeps S01 self-contained without touching gitignore.ts. BASELINE_PATTERNS is unexported. Converge later if needed. | Yes — converge in future cleanup | | D013 | M001/S01 | impl | COMMIT_TYPE_RULES includes plural keyword forms | Added "docs" and "tests" as explicit keywords alongside singular "doc" and "test" | Word-boundary regex `\bdoc\b` doesn't match "docs" — the trailing `s` is a word character. Plurals are common in slice titles. | No | | D014 | M001/S02 | impl | MergeSliceResult re-export uses `export type` | `export type { MergeSliceResult }` instead of value `export { MergeSliceResult }` | Circular dependency (git-service.ts ↔ worktree.ts) causes ESM live binding resolution failure with value re-exports. Type-only re-export is erased at runtime, avoiding the cycle. MergeSliceResult is an interface so this is semantically correct and transparent to consumers. | No | +| D015 | M001/S05 | arch | Pre-merge check runs after squash merge, resets on failure | Run check after `git merge --squash` but before `git commit`, reset `--hard HEAD` on failure | Tests the actual merged code (what will land on main), not just the slice branch in isolation. Reset is clean because commit hasn't happened yet. | No | +| D016 | M001/S05 | arch | Multi-line commit via `git commit -F -` with stdin | Replace `JSON.stringify(message)` + `-m` with `execSync` stdin pipe + `-F -` | Avoids shell quoting fragility for multi-line rich commit messages. Newlines survive reliably through stdin. | No | +| D017 | M001/S05 | impl | Facade prefs fix via loadEffectiveGSDPreferences | worktree.ts `getService()` calls `loadEffectiveGSDPreferences()` instead of `{}` | Unblocks all preference-gated features (snapshots, pre_merge_check, auto_push) when called through the facade. One-line fix with high impact. | No | +| D018 | M001/S05 | impl | Snapshot gating requires explicit `true` | `prefs.snapshots === true` (not `!== false`) — undefined means disabled | Tests (T01) define undefined as disabled, only explicit `true` enables. Safer default: no hidden refs unless user opts in. Task plan said default-on but tests are authoritative. | No | diff --git a/.gsd/milestones/M001/M001-ROADMAP.md b/.gsd/milestones/M001/M001-ROADMAP.md index efeb2b4fc..c1a3fcbf3 100644 --- a/.gsd/milestones/M001/M001-ROADMAP.md +++ b/.gsd/milestones/M001/M001-ROADMAP.md @@ -64,7 +64,7 @@ This milestone is complete only when all are true: - [x] **S04: Remove git commands from prompts** `risk:low` `depends:[S02]` > After this: execute-task.md, complete-slice.md, replan-slice.md, complete-milestone.md contain no raw git commands. worktree-merge.md unchanged. Verified by grep. -- [ ] **S05: Enhanced features — merge guards, snapshots, auto-push, rich commits** `risk:medium` `depends:[S02]` +- [x] **S05: Enhanced features — merge guards, snapshots, auto-push, rich commits** `risk:medium` `depends:[S02]` > After this: Pre-merge verification auto-detects test runners and blocks broken merges. Snapshot refs created before merges (visible via `git for-each-ref refs/gsd/snapshots/`). auto_push preference pushes main after merge. Squash commits include task lists. Remote fetch before branching when remote exists. All verified by unit tests. - [ ] **S06: Cleanup and archive** `risk:low` `depends:[S05]` diff --git a/.gsd/milestones/M001/slices/S05/S05-PLAN.md b/.gsd/milestones/M001/slices/S05/S05-PLAN.md new file mode 100644 index 000000000..d2e4ece27 --- /dev/null +++ b/.gsd/milestones/M001/slices/S05/S05-PLAN.md @@ -0,0 +1,79 @@ +# S05: Enhanced features — merge guards, snapshots, auto-push, rich commits + +**Goal:** GitServiceImpl gains five enhanced features: pre-merge verification, snapshot refs, auto-push, rich squash commit messages, and remote fetch before branching. All preference-gated features work end-to-end through the worktree.ts facade. + +**Demo:** Unit tests pass proving: (1) `git for-each-ref refs/gsd/snapshots/` shows snapshot ref created before merge, (2) pre-merge check aborts merge on test failure, (3) `git log --oneline -1` on main after merge shows task list in commit body, (4) `git push` called when auto_push enabled, (5) `git fetch` called before new branch creation when remote exists. `npm run build` and `npm run test` pass. + +## Must-Haves + +- `createSnapshot(label)` creates `refs/gsd/snapshots/