mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-02 11:45:20 +02:00
fe34349966
Adds opt-in auto-commit during long sessions so work survives Claude Code crashes, Conductor workspace handoffs, and context switches. Local-only by default — pushing requires explicit opt-in. Codex review caught multiple landmines that would have shipped: 1. checkpoint_push=true default would push WIP commits to shared branches, trigger CI/deploys, expose secrets. Now default false. 2. Plan's original /ship squash (git reset --soft to merge base) was destructive — uncommitted ALL branch commits, not just WIP, and caused non-fast-forward pushes. Redesigned: rebase --autosquash scoped to WIP commits only, with explicit fallback for WIP-only branches and STOP-and-ask for conflicts. 3. gstack-config get returned empty for missing keys with exit 0, ignoring the annotated defaults in the header comments. Fixed: get now falls back to a lookup_default() table that is the canonical source for defaults. 4. Telemetry default mismatched: header said 'anonymous' but runtime treated empty as 'off'. Aligned: default is 'off' everywhere. 5. /checkpoint resume only read markdown checkpoint files, not the WIP commit [gstack-context] bodies the plan referenced. Wired up parsing of [gstack-context] blocks from WIP commits as a second recovery trail alongside the markdown checkpoints. Changes: - bin/gstack-config: add checkpoint_mode (default explicit) and checkpoint_push (default false) to CONFIG_HEADER. Add lookup_default() as canonical default source. get() falls back to defaults when key absent. list now shows value + source (set/default). New 'defaults' subcommand to inspect the table. - scripts/resolvers/preamble.ts: preamble bash reads _CHECKPOINT_MODE and _CHECKPOINT_PUSH, prints CHECKPOINT_MODE: and CHECKPOINT_PUSH: so the mode is visible. New generateContinuousCheckpoint() section in T2+ tier describes WIP commit format with [gstack-context] body and the rules (never git add -A, never commit broken tests, push only if opted in). Example deliberately shows a clean-state context so it doesn't contradict the rules. - ship/SKILL.md.tmpl: new Step 5.75 WIP Commit Squash. Detects WIP count, exports [gstack-context] blocks before squash (as backup), uses rebase --autosquash for mixed branches and soft-reset only when VERIFIED WIP-only. Explicit anti-footgun rules against blind soft- reset. Aborts with BLOCKED status on conflict instead of destroying non-WIP commits. - checkpoint/SKILL.md.tmpl: new Step 1.5 to parse [gstack-context] blocks from WIP commits via git log --grep="^WIP:". Merges with markdown checkpoint for fuller session recovery. - Golden ship fixtures regenerated (ship is T4, preamble change shows up). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>