Repository navigation
Destructive-command check closes the parsing gaps found after #4513 and blocks wipefs -a in every spelling (GST-3190) - #4525
Merged
Conversation
… the last release (GST-3190) Force-pushes to main written with --repo=, after a cd or with --all are blocked again; pipeline cds, $ reset revisions, quiet git clean, alternate git trees, find -L, trailing rm flags, reassigned mktemp variables, .. paths and same-line dry runs ask again; dry-run pushes, wipefs on files and SQL text in greps no longer trip it; GSTACK_SESSION_KIND=interactive outranks CI=1. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…atement, and six review fixes (GST-3190) A dry run on the line before no longer excuses a real aws delete. SQL text that is printed into a pipe or file still asks, push-option values are not read as flags, wipefs stays blocked unless every target is a disk image, cd counts only as a command, and || is not a pipe. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… and wipefs reads /dev and option values correctly (GST-3190) Puts back the earlier cd handling, so a discard after if cd, while cd or time cd asks again. wipefs stays blocked for any /dev/ target, and the values of -t, -o and -O are not read as targets. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ncluding targets from xargs or stdin (GST-3190) wipefs goes back into the whole-command disk-wipe deny for -a, a short group holding a, --a, --al or --all. The only exemption is a command whose every wipefs leads its statement and names only image files outside /dev. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…isting regular files in a command of plain wipefs statements (GST-3190) The image exemption now also needs every target to exist as a regular file that is not a symlink, every statement in the command to be a proven wipefs, and no redirect into /dev other than null, stdout or stderr. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Nov 19, 2026
Merged
capy-ai Bot
added a commit
that referenced
this pull request
Nov 19, 2026
- `gstack-artifact validate` no longer passes a run.json that gstack-autoplan never wrote. (#4494) - /ship's changed-number check no longer stops on tests that only share a word with the change (#4478). (#4496) - On Capy, /ship no longer edits or comments on pull requests as you. (#4518) - The destructive-command check stops asking about scratch deletes and catches the real damage it used to miss. (#4513) - The destructive-command check reads commands more carefully, closing gaps found after the last release. (#4525) - The Codex readiness check and the second-model review now pick the same model for a custom Codex provider (GST-3089). (#4491) - gstack's Codex hooks work when your Codex folder's path has a `(`, `&` or other shell character in it. (#4528) - Uninstalling gstack keeps your own Codex hooks trusted. (#4528) - Codex hook setup matches Codex more closely. (#4528) - On Windows, setup copies the Claude Code hook code that gstack's Codex hooks import (#4528) - /review's checklist on Codex reads shell commands more carefully. (#4528) - On Codex, gstack now suggests the right skill for a prompt and stops destructive commands before they run. (#4512) - On Codex, /review is now held once when it tries to finish without its adversarial pass or its report, as it already is on Claude Code. (#4522) - On Codex, gstack's skill suggestion now names the skill the way Codex lists it. (#4523) - On Codex, gstack's suggested prompts and docs now name skills the way Codex lists them. (#4524) - /review on Codex with gpt-6.1-sol is no longer held back for a second-model pass it already ran. (#4526) - On Codex, office-hours, plan-design-review and gstack-upgrade work again when you name them. (#4510) - gstack knows when Codex is running unattended. (#4510) - Codex reviewers start with a clean context. (#4510) - Docs no longer say Codex has no hook support. (#4510) - A command whose output was cut off no longer counts as a finished read. (#4492) - A folder marked as published data can no longer hide source code or agent files from /ship's review. (#4516) - Correction to the on-by-default helper hooks entry: the hook still routes only to /review, /qa and /verify, so skills you've installed yourself aren't suggested yet. With gstack's skills it routes 14 of 60 real bug reports (was 17), and long prompts are no longer skipped. (#4505) - /sync-gbrain's read check now works when the first page in your code source is over 64 KB. (#4497) - Free-suite CI no longer fails before any test runs when Ubuntu's package mirror is slow. (#4530) - Syncing a second repo no longer makes the first one ask for /sync-gbrain again. (#4532) - gstack's helper hooks are now on by default in Claude Code, OpenClaw and Hermes, and the prompt-routing hook fires on real bug reports. (#4503) - `gstack-pregate clear --receipt` accepts a remote gate run from before a merged release when the release only regenerated a declared release output. (#4483) - The second-model review now keeps the reviewer's own result, and reports a used-up budget as a budget stop. (#4515) - When the reviewer wrote its review to the result file it was asked for, Codex then replaced that file with its short closing message ("Done, I wrote the review"), so the review was thrown away and reported as missing its markers. (#4515) - When the provider refuses the call with HTTP 402 Payment Required (usually a metering proxy that hit its allowance, or an account out of credits or quota), gstack used to record only "exit 1". (#4515) - The pre-commit /verify check now fails a check that times out, and its checks share one time budget (GST-3201). (#4527) - /ship's review collector no longer reads a reviewer's own scope list or list of passed checks as findings (GST-3201). (#4527) - Merge-queue stack tests fail when git cannot list a PR's added test files (GST-3201). (#4527) - /ship can now review results PRs that publish raw session data. (#4511) - /ship's review pass works when the checkout you ship isn't the project's default checkout. (#4507) - A second review round no longer reports done when nothing was reviewed. (#4520) - The prompt-routing hook now suggests skills you install yourself, and no longer sends ordinary bug reports to /qa (GST-3123). (#4506) - gstack's script runner and merge-queue checks now also refuse cut-off output. (#4502) - A failed second-model review reports the cause that actually stopped it, and the runner never deletes its own prompt. (#4519) - `gstack-ship-queue ready` now fills in the trial merges and the second-model trail read instead of printing lines to fill. (#4529) - Five small ship-tool fixes. (#4529) - A ruling the owner gives while a `/ship` run is open can be relayed. (#4529) - /ship no longer kills a working test run as stalled when the test command starts its workers in their own session. (#4533) - /ship no longer stops a review because the state-machine reader started its reply the way its instructions say. (#4504) - When Claude Code runs /verify right before a commit, it now gets a quick check instead of the full fix loop (GST-3150). (#4508) 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.
The destructive-command check now blocks force-pushes to main written with
--repo=, after acd, or with--all, and asks again for the other shapes that slipped past it after #4513.wipefs -ais blocked in every spelling, including targets fed byxargs; only existing image files it names outside/devare exempt. Dry runs and greps for SQL text stop over-blocking.Nothing to do: the check runs in every session already.
What changed, by shape
Steps back from main, fixed first:
git push --repo=origin +refs/heads/mainandgit push --repo=origin --force mainare denied. With--repo, every operand is read as a possible refspec (git itself reads the first one as the repository, so this is the cautious reading).cdinside a pipeline (cd /tmp | true && rm -rf dir) no longer counts as moving into scratch: bash runs each pipeline part in a subshell. A subshell now gives back the exact outer state, socd /tmp && (pwd) && rm -rf dirno longer asks.git reset --hard "$REV"asks again.printf x >> f && git reset --hardon a clean tree stays allowed: the only work it can lose is what the same command wrote.git stash popearlier in the same command does make a later discard ask, because pop drops the stash, the same lossstash dropalways asks about.Gaps in the catches #4513 added:
git clean -q/--quietno longer hides the dry-run listing.--work-tree,--git-dir,GIT_DIR=andGIT_WORK_TREE=forms ofcheckout -f,switch -fandclean -fask.find -L <dir> -delete(leading find options) is read correctly.rm dir -rfwith flags at the end asks whenrmis the command;docker rm web -fandaws s3 rmstay those tools' subcommands.mktempvariable assigned again in the same command is no longer scratch...beats the/procand/devexemptions, acdthrough..is never scratch, andrm -rf ../buildno longer rides the build-output allow.plancounts only as a whole word.cdafterif,while,untilortimestill counts, soif cd B; then git clean -fdx; fiasks.GSTACK_SESSION_KIND=interactiveoutranksCI=1in the every-session guard hook (claude -pstays headless).wipefs:
wipefsis back in the whole-command disk-wipe deny for-a, any short-option group holdinga(-fa), and the abbreviations--aand--althat getopt accepts for--all. That deny sees targets the word scan cannot:ls /dev/sd* | xargs wipefs -aandecho /dev/sdb | xargs wipefs --allare denied again.wipefsthat leads its statement (aftersudoorNAME=value), and every target, with options read the way getopt reads them, must be a plain literal path outside/devwith a disk-image suffix (.img,.iso,.raw,.qcow2,.vhd,.vhdx,.vmdk,.dmg) that already exists as a regular file, not a symlink, in a folder the check knows. A redirect into/devother than/dev/null,/dev/stdoutor/dev/stderrbreaks the exemption. A short group stops att,oorO, whose value is the rest of the word, or the next word when nothing follows, sowipefs -a -tvfat /dev/sdbno longer hides its device.wipefs -a demo.img,wipefs -t ext4 -a demo.imgandwipefs --all disk.qcow2 build/b.isoare allowed.ls *.img | xargs wipefs -a(targets not spelled out),ln -sf /dev/sdb d.img; wipefs -a d.imgand a symlinkedalias.img,wipefs -a demo.img > /dev/mmcblk0,wipefs -a demo.img; wi''pefs -a /dev/sdb, an image created earlier in the same command, awipefsbeside any other statement or insidebash -c '…',wipefs -tvfat /dev/sdbwithout-a(the deny reads theainvfat), and quoted image names with spaces.Other over-catches removed:
git push -nfis a dry run (letters afteroin a short-option group are a push-option value, not flags).TRUNCATE x;) is ignored inside grep, rg, ag, ack andgit grep, and inecho/printftext when nothing after it pipes or redirects (||is not a pipe);./psql/in a path is a folder, not a client.Force-pushes that only asked:
cd . && git push -f originon main is denied: git now reads the folder acdchain leads to for the force-push lookups (discard checks still ask after anycd).git push --force --all,--branchesand--mirrorare denied when main, master or the default branch exists locally.Speed: the statement loop no longer indexes a bash array, which is linear per read on bash 3.2, so a 200 KB command takes about a third of the time on bash 3.2. Everyday commands against 55aaa6c on the same machine (interleaved, the 102 GEVA-560 commands in turn, n=400 each): bash 5.2 p50 99.6 ms vs 95.1 ms, bash 3.2.57 p50 94.3 ms vs 90.6 ms; p90 is lower on the branch in both. Process start dominates, and the base p50 itself moved by 20 ms between passes on this machine, so the 4 ms gap is within run-to-run drift.
Tests
test/careful-replay.test.tsgains 63 rows (PARSER_CASES), one or more per shape above. The 8 wipefs rows (xargs, stdin,--a,--al, an attached-tvalue alone and in a group,--alon/dev/sdb.img, image names fromxargs) each fail at f7dd58d and are denied at 944b41e. 4 more (a symlinked image, a symlink made in the same command, a redirect into/dev/mmcblk0, a quoted spelling) fail at 05b36ee; three are controls. The test trees now hold realdemo.img,disk.qcow2andbuild/b.isofiles and analias.imgsymlink.test/destructive-guard-hook.test.tsgains theCI=1case. Replay plus hook tests: 270 pass, 0 fail on bash 5.2.21 and on bash 3.2.57.Not in this PR (outside its scope, none a step back from main): a quoted scratch path with a space, denying a literal home path, a failure while reading input before the safety trap, a backtick revision in
reset --hard, and the extra/tmpasks GEVA-560 measured (a relativerm -rfafter a secondcd, a subshell, a loop or an unresolved$VAR).Open notes from #4521's review, left for a follow-up:
grep 'truncate users;' a.sql | sh, the same through<( )process substitution andgit grep -O, andecho "$(dbtool exec 'TRUNCATE TABLE users')".LC_ALL=C cd /tmp && rm -rf dirasks, and printed SQL text followed by a pipe in a later statement asks.cdinto scratch, andecho cd /tmpstill counts as acd.grep 'a; truncate demo;'(a quoted;) still asks, andsudo -u root rm dir -rfis still allowed, as on main.Open notes from this PR's second-model review, ruled not to block because each needs quote tricks or contradictory flags and main already allows an equivalent shape:
wipefs -a demo.img >'/dev'/sdb: a quoted/devredirect target isn't seen as/dev(main already allowsecho hi >'/dev'/sdb).wipefs -a demo.img" #" /dev/sda: a quoted#is read as a comment, so the later target is never seen (it only reaches the disk if a file nameddemo.img #exists).git push -fn --no-dry-run origin main:--no-dry-runafter annin a short group isn't read as undoing the dry run (main already allowsgit push --force -n --no-dry-run origin main).git push --mirrorin a checkout without a local default branch still only asks, as on main.git grep -h 'TRUNCATE TABLE' | dbwrap prod: search output piped to an unlisted client, the same class as the SQL-text note above./devcan get a redirect past the image exemption (wipefs -a demo.img > d/sdbwithd -> /dev): the/devchecks read the path as text. Main already allowsecho hi > d/sdbthrough the same folder._RX_WIPEFSalso matches a longer word, soecho wipefs-archivenow denies.Agent notes
Follow-up to Destructive-command check stops asking about scratch deletes and blocks real damage (GST-3169) #4513 (55aaa6c), GST-3190. Carries Destructive-command check closes the command-parsing gaps found after the last release (GST-3190) #4521's three commits (e20997b, e74219a, f7dd58d) unchanged plus two wipefs commits (05b36ee, and b8293b8 from the round-1 review under a fix-round grant). Decision trails: captain drive reports/GSTA-647-decisions.tsv and reports/GSTA-650-decisions.tsv.
Local checks: at 05b36ee, 11 more test files that load the check or the hooks, 405 pass, 3 skipped (real Codex CLI); typecheck, module-size ratchet, changelog-fragments and spawnSync tripwire green. At b8293b8, replay, hook and hook-scripts tests 556 pass on bash 3.2.57; 1,200 wipefs-shaped fuzz commands across both heads, 0 crashes on bash 5.2 and 3.2.
Plan: exempt: bug fix
Ruled note: careful/bin/check-careful.sh:391:outside-voice at b8293b8 ruled by Captain GStack Minder (GSTA-36) at 2026-11-19T13:45:15.524Z: a quoted /dev redirect target needs a quote trick; main already allows echo hi >'/dev'/sdb (approval a-1dc0735f73d8)
Ruled note: careful/bin/check-careful.sh:515:outside-voice at b8293b8 ruled by Captain GStack Minder (GSTA-36) at 2026-11-19T13:45:16.536Z: git push -fn --no-dry-run needs contradictory flags; main already allows git push --force -n --no-dry-run (approval a-c289674fc5e4)
Ruled note: careful/bin/check-careful.sh:472:outside-voice at b8293b8 ruled by Captain GStack Minder (GSTA-36) at 2026-11-19T13:45:17.464Z: git push --mirror asks at every head; not a regression from main (approval a-153c82a0c35a)
Ruled note: careful/bin/check-careful.sh:985:outside-voice at b8293b8 ruled by Captain GStack Minder (GSTA-36) at 2026-11-19T13:45:19.502Z: search output piped to an unlisted client is the ruled SQL-text class; main asks only on the word, never the file (approval a-5041355f66fd)
Ruled note: careful/bin/check-careful.sh:741:adversarial-native at b8293b8 ruled by Captain GStack Minder (GSTA-36) at 2026-11-19T13:45:21.224Z: a quoted # hiding a later wipefs target needs a quote trick and a file named with it (approval a-5654b7908015)