From ff2c2605f372b1de59bae2d8ff559c8f94f2cb62 Mon Sep 17 00:00:00 2001 From: Jeremy McSpadden Date: Thu, 26 Mar 2026 19:15:31 -0500 Subject: [PATCH] feat(gsd): enable safety mechanisms by default (snapshots, pre-merge checks) (#2678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flip two safety mechanisms from opt-in to opt-out so all users benefit from rollback protection and merge regression checks without manual configuration. - git.snapshots: false → true (creates recovery refs before destructive ops) - git.pre_merge_check: false → "auto" in solo mode (auto-detects test runner) Both remain configurable; users can explicitly disable with snapshots: false or pre_merge_check: false. Closes #2677 --- docs/configuration.md | 8 ++-- .../extensions/gsd/commands-prefs-wizard.ts | 6 +-- .../gsd/docs/preferences-reference.md | 4 +- src/resources/extensions/gsd/git-service.ts | 7 ++-- .../extensions/gsd/preferences-types.ts | 2 +- .../extensions/gsd/tests/git-service.test.ts | 39 +++++++++++++++++-- .../extensions/gsd/tests/preferences.test.ts | 2 +- 7 files changed, 51 insertions(+), 17 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index d632e8315..0d8712d5c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -374,8 +374,8 @@ git: auto_push: false # push commits to remote after committing push_branches: false # push milestone branch to remote remote: origin # git remote name - snapshots: false # WIP snapshot commits during long tasks - pre_merge_check: false # run checks before worktree merge (true/false/"auto") + snapshots: true # WIP snapshot commits during long tasks + pre_merge_check: auto # run checks before worktree merge (true/false/"auto") commit_type: feat # override conventional commit prefix main_branch: main # primary branch name merge_strategy: squash # how worktree branches merge: "squash" or "merge" @@ -392,8 +392,8 @@ git: | `auto_push` | boolean | `false` | Push commits to remote after committing | | `push_branches` | boolean | `false` | Push milestone branch to remote | | `remote` | string | `"origin"` | Git remote name | -| `snapshots` | boolean | `false` | WIP snapshot commits during long tasks | -| `pre_merge_check` | bool/string | `false` | Run checks before merge (`true`/`false`/`"auto"`) | +| `snapshots` | boolean | `true` | WIP snapshot commits during long tasks | +| `pre_merge_check` | bool/string | `"auto"` | Run checks before merge (`true`/`false`/`"auto"`) | | `commit_type` | string | (inferred) | Override conventional commit prefix (`feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `perf`, `ci`, `build`, `style`) | | `main_branch` | string | `"main"` | Primary branch name | | `merge_strategy` | string | `"squash"` | How worktree branches merge: `"squash"` (combine all commits) or `"merge"` (preserve individual commits) | diff --git a/src/resources/extensions/gsd/commands-prefs-wizard.ts b/src/resources/extensions/gsd/commands-prefs-wizard.ts index f006cca61..98d12be78 100644 --- a/src/resources/extensions/gsd/commands-prefs-wizard.ts +++ b/src/resources/extensions/gsd/commands-prefs-wizard.ts @@ -390,7 +390,7 @@ async function configureGit(ctx: ExtensionCommandContext, prefs: Record/ + * Enabled by default; opt out with prefs.snapshots === false. + * Ref path: refs/gsd/snapshots/