Repository navigation
Stop gstack-uninstall deleting unpushed or kept work under any folder it removes (GST-2303) - #4282
Merged
Merged
Conversation
… it removes (GST-2303) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…l installs, and read worktrees on git before 2.36 in gstack-uninstall (GST-2303) Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/red-team#3 reader=red-team Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: p1/specialist-batched#2 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… checkout's remotes in gstack-uninstall (GST-2303) Review-Finding: p2/specialist-batched#1 reader=security Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…tch FETCH_HEAD in gstack-uninstall (GST-2303) Review-Finding: fc/fix-check#1 reader=fix-check Review-Finding: fc/fix-check#2 reader=fix-check Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…es without -z (GST-2303) Review-Finding: v11/outside-voice#1 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gstack-uninstall now checks every folder it is about to delete for git work that exists nowhere else, and stops instead of deleting it. This serves gstack's goal of being safe to install and remove: uninstalling should never cost you unpushed commits or kept state.
What changed
~/.gstack. A checkout with uncommitted changes, commits no remote holds, or a locked worktree stops the uninstall with exit 2 and names the checkout.--keep-stateno longer deletes the state it promised to keep. An install that holds kept state is refused instead.git fetch origin stablestill uninstalls cleanly, including through aurl.insteadOfrewrite. A commit that only a local fetch (git fetch . HEAD) wrote is still treated as unpushed.Why
Uninstall used to check only the repo you ran it from. An unpushed
.gstackrepo inside~/.claude/skills/gstack, an edited project-local install, or a notes repo under.agents/skills/gstack-*was deleted without warning, and--keep-staterun from inside the gstack checkout deleted the very lanes it was told to keep.Blast radius
Only bin/gstack-uninstall and its docs change, and every new path fails closed: when git cannot prove a checkout is safe, the folder is kept and uninstall exits 2. The 73 uninstall tests (including the docs-helper replays and an old-git shim) pass, and CI free-tests run 42789222890 is green at this head.
Documentation
Status: updated. One factual fix in docs/troubleshooting.md, with no blockers.
Scope: the 5 committed files between 6c23638 and 8eb1173 (bin/gstack-uninstall, test/uninstall.test.ts, docs/uninstall.md, docs/troubleshooting.md and the GST-2303 changelog.d fragment), plus the README.md and docs/install.md links to the uninstall doc. Nothing was staged, unstaged or untracked.
Documentation health:
has worktrees git cannot list (gstack-uninstall needs git 2.36 or later)message and its fix.Coverage: all shipped features have adequate documentation. The new refusals have reference coverage in docs/uninstall.md and how-to fixes in docs/troubleshooting.md. No diagrams drifted, so there is no documentation debt.
Test plan
Agent notes
GST-2303. Shipped by GSTA-508 for Captain GStack Minder (GSTA-36).
Pre-Landing Review: pass 1 and pass 2 (full, risk:security), a fix-check at f10dc27, Step 11 voices at f10dc27 (native Opus 5.5, outside GPT-6.1 Sol), and a granted fix-check at 8eb1173 (grant a-c68964597f88). The outside voice's blocking finding (the old-git fallback dropping a locked newline-named worktree) was fixed in 8eb1173 by removing the fallback.
REVIEW_LOOP: passes=2 blocking_found=4 deferred=0 noted=6 fixed=8 scope=frozen unbound=1 fix_checks=2 dispatches=8
Ruled note: bin/gstack-uninstall:415:fix-check at f10dc27 ruled by Captain GStack Minder (GSTA-36) at 2026-11-10T08:13:44.631Z: insteadOf false stop fixed mechanically in 07c9eb8 (git remote get-url --all); fail-closed; no further fix-check (approval a-63a5aedf8e9e)
Ruled note: changelog.d/uninstall-checks-every-folder-it-deletes-gst-2303.md:4:fix-check at 8eb1173 ruled by Captain GStack Minder (GSTA-36) at 2026-11-10T08:47:16.814Z: changelog fragment omits the git < 2.36 refusal; informational, fails closed, no data loss (approval a-70f3ec961a8e)
Ruled note: docs/uninstall.md:45:fix-check at 8eb1173 ruled by Captain GStack Minder (GSTA-36) at 2026-11-10T08:47:17.441Z: docs helper names the wrong reason on old git when it keeps the folder; informational, fails closed, no data loss (approval a-8a2dca98d546)
Ruled note: bin/gstack-uninstall:429:fix-check at 8eb1173 ruled by Captain GStack Minder (GSTA-36) at 2026-11-10T08:47:17.589Z: needs-git-2.36 message also shows for other -z list failures; informational, fails closed, no data loss (approval a-855e69d96f3e)
Open notes (not blocking):
Approvals
Approved: yes (record r-9f11d4a0b950). The full approval record stays private.
Plan: exempt: bug fix
Plan check: exempt bug fix
Agent notes