Skip to content

Destructive-command check blocks four more ways past its disk-wipe and force-push checks (GST-3207) - #4534

Merged
capy-ai[bot] merged 4 commits into
mainfrom
careful-stricter-wipefs-redirects-comments
Nov 19, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
careful-stricter-wipefs-redirects-comments

Conversation

@garrytan

@garrytan garrytan commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

The destructive-command check now blocks wipefs -a on every target, disk redirects written with quotes or through a link to /dev, and git push -fn --no-dry-run.
It only gets stricter: replaying 3,471 recorded agent commands against the previous check moves 0 decisions toward allow.
Nothing to do: the check runs in every session already.

What changed
  • wipefs -a (any spelling getopt accepts) is denied on every target. The image-file exemption is gone: GEVA-560's 254,322 commands hold no wipefs -a, so it never fired, and each fact it had to prove was a way past the deny. \wipefs and doubled quotes (wipefs'') are caught too.
  • A redirect into a disk is denied with its quotes removed (>'/dev'/sdb, > "/dev/mmcblk0") and through a folder whose real path is /dev (> d/sdb with d -> /dev, resolved on disk). mmcblk and rdisk join the redirect names.
  • git push --no-dry-run undoes an earlier -n (the last flag wins), so git push -fn --no-dry-run is a force-push.
  • A disk redirect is found however many other redirects come before it: every /dev/ redirect is scanned, and past 64 disk lookups the check asks.
  • The wipefs scan skips redirects and their targets, so wipefs > -- -$'a' /dev/sdb is read as a wipe, as at 1730386.
Tests and measurements

test/careful-replay.test.ts gains a STRICT_CASES table (20 rows) and a /dev link fixture, and five wipefs-on-an-image rows move from allow to deny. Run against 1730386's check, 15 rows fail and the rest are controls. Replay plus hook tests: 291 pass, 0 fail on bash 5.2.21 and on bash 3.2.57 at 4c30630; at the final head 2acaf4e, 292 pass, 0 fail on bash 3.2.57, and CI is green. Typecheck is clean.

Replays against 1730386 (commands fed to the hook, nothing run), on bash 5.2 and 3.2 at 4c30630, gave the same results on both; the three recorded sets were replayed again at 2acaf4e with the same result:

Set Rows Toward allow Toward ask or deny
GEVA-560 allowed-now (main flagged, 55aaa6c allowed) 2,831 0 0
GEVA-560 changed-vs-55aaa6c4 538 0 0
GEVA-560 incident set 102 0 0
Random mixes of the touched shapes 4,500 0 938
Random mixes at 2acaf4e (seed 7) 2,000 0 429

Latency p50 over the incident rows at 4c30630, interleaved with 1730386 (n=408): bash 5.2 131.4 vs 130.6 ms, bash 3.2 128.4 vs 128.3 ms. A 169 KB command holding 12,000 redirect-like words is checked in 0.8 s on bash 3.2 (a test pins it under 6 s): every /dev/ redirect is scanned; past 64 disk lookups the check asks.

Open notes

These are left for one design pass, replayed on GEVA-560's full corpus before review. Each was tried in #4531 and leaked:

  • Scratch tracking: /tmp deletes after a second cd, in groups and loops, and through cd $VAR.
  • Written deploy-hook heredocs allowed until run. In Destructive-command check stops asking about harmless /tmp work and written deploy hooks (GST-3207) #4531 a << after an unquoted # (cat > f # <<EOF) was read as a heredoc while bash ran the body.
  • The rebuilt SQL TRUNCATE text exemption (Destructive-command check closes the command-parsing gaps found after the last release (GST-3190) #4521's notes: grep ... | sh, >( ), git grep -O).
  • A quoted rm target with a space (G16).
  • A # inside quotes still ends the scan (rm -rf "a #" ~ asks rather than denies). Reading the words after it let them cancel catches (echo 'git push -f origin main # --dry-run' went from deny to allow), so it needs the same design pass.
  • \cd and \pushd are still not read as a cd. Treating them as a move to an unknown folder turned a default-branch force-push deny into an ask.
  • Every discard after a cd asks, cd $VAR && git reset -q --hard included.
  • echo x > /dev/shm/sda and echo x > /dev/fd/sdb are denied (1730386 allowed them): the new pre-scan matches any folder under /dev/. Follow-up: anchor it to disk names followed by a boundary, and add an allow row for /dev/shm.
  • echo wipefs-archive and wipefs --no-act still deny, and wi''pefs -a (quotes inside the word) is still allowed, as on main.
Agent notes

Review-loop exception: accepted by Captain GStack Minder (GSTA-36) 2026-11-19 via GSTA-655 thread ruling: an over-deny of disk-named redirects under /dev/shm and /dev/fd, below the blocking floor; nothing is let through; anchor fix as follow-up (second full pass at 2acaf4e, deferred p2/specialist-batched#1)

  • Second-model trail read (openai/gpt-6.2-sol, high) of 04cf4c0: 4 blocking, each a move toward allow or a bash 3.2 timeout from the quoted-# and backslashed-cd changes; both changes dropped and wipefs redirect skipping restored in 811faec. Second read of 811faec: those 4 fixed; 1 blocking (the redirect scan re-probed and rescanned per match, past 8 s on long commands), fixed in 4c30630. Third read of 4c30630: no blocking finding.
{
  "schema_version": 1,
  "pr": 4534,
  "head": "2acaf4e5c653fbc5142295cc25cbf04553c778bb",
  "version": "1.101.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 38391,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44595155275,
      "attempt": 1,
      "tree": "2893443381d5df94bcbaab809ad2a11732d4d19d"
    }
  ],
  "session_kind": "interactive",
  "run": "ship-4534-4c30630",
  "head_tree": "2893443381d5df94bcbaab809ad2a11732d4d19d",
  "product_patch_id": "41550aba9017bdeb49b09a38691c722bb0353d5b",
  "gstack_version": "1.101.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 147,
    "rules": "1afa38a4be3b5eef",
    "base": "2714e9f7f3eadf886dc974908aeca78ccfdf48a3",
    "registry": "2714e9f7f3eadf886dc974908aeca78ccfdf48a3",
    "gate_scan": {
      "tagged": 0,
      "head": "2acaf4e5c653fbc5142295cc25cbf04553c778bb"
    },
    "reasons": [
      "runtime=147"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @2893443381d5 (8 checks, current for 2acaf4e5c653)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44595155275/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=2893443381d5 tests=38391 skipped=67 runs=44595155275/1 profiles=ci-reuse/free-tests heads=2acaf4e5c653 verified=2026-11-19T19:16:57.370Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "careful/SKILL.md and template, README.md, docs/"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 3,
    "deferred": 1,
    "noted": 4,
    "fixed": 4,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "review_loop_exception": {
    "accepted_by": "Captain GStack Minder (GSTA-36)",
    "date": "2026-11-19",
    "via": "GSTA-655 thread ruling",
    "reason": "an over-deny of disk-named redirects under /dev/shm and /dev/fd, below the blocking floor; nothing is let through; anchor fix as follow-up",
    "second_pass": {
      "head": "2acaf4e5c653fbc5142295cc25cbf04553c778bb",
      "deferred": [
        "p2/specialist-batched#1"
      ]
    }
  },
  "gate_dispositions": []
}
{"head":"2acaf4e5c653fbc5142295cc25cbf04553c778bb","run":"ship-4534-4c30630","mark":"stop","tree":"2893443381d5df94bcbaab809ad2a11732d4d19d"}

…d force-push checks (GST-3207)

wipefs -a is denied on every target, disk redirects are read with quotes
removed and through a folder that links to /dev, a # inside quotes no
longer ends the scan, and --no-dry-run undoes -n. Nothing that asked or
was denied before is allowed now.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 19, 2026 17:50
…decision

Reading words after a quoted # let them cancel catches, and reading \cd
as a cd into an unknown folder turned a force-push deny into an ask, so
both are dropped. The wipefs scan skips redirects again, so a redirect
target of -- no longer ends its option scan.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ommands

The scan re-ran its pattern over the rest of the command and probed a
folder for every match, which took minutes on a long command full of
redirect-like words. It now lists each distinct redirect once with grep
and probes at most 64 of them.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…irects

The redirect scan sorted its matches and kept the first 64, and under pipefail a long list was thrown away whole, so padding a command with redirect-like words let a quoted /dev write through. Every redirect into /dev/ is now read with no limit, and past 64 folder lookups the command asks.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/adversarial-native#1 reader=adversarial-native
Review-Finding: p1/red-team#2 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit ab6a38b into main Nov 19, 2026
79 checks passed
@garrytan garrytan mentioned this pull request Nov 20, 2026
capy-ai Bot added a commit that referenced this pull request Nov 20, 2026
- Two /ship approval records stop needing workarounds. (#4549)
- For contributors: the paid auto-decide check counts a start step that ran while the skill loaded. (#4543)
- The destructive-command check closes three ways past its disk-wipe and force-push blocks. (#4534)
- A green CI run still counts when the repository's artifact storage is full. (#4536)
- `/cso` now audits repositories that track symlinks. (#4567)
- A doc-sync eval stops failing when the audit child drops one field from its result line. (#4555)
- The browse daemon no longer picks port 10080, which Chromium refuses to open. (#4554)
- Opted-in telemetry now says why a skill run ended, which coding agent and model family ran it, and whether an upgrade worked. (#4542)
- A preregistration with only its write-up and plain data now gets the write-up review: one reviewer, one round. (#4544)
- When owner rulings don't clear a stopped review, `gstack-review-read` now says which findings are left. (#4553)
- The prompt-routing hook now names your installed bug-fix skill on bug reports, alone, and never puts /verify ahead of it. (#4539)
- Owner rulings now close a stopped review whose findings were logged in a findings file. (#4568)
- /ship can finish after the owner accepts a stopped review's findings as open notes. (#4552)
- /ship no longer starts the full test suite on your machine when CI's earlier run can't be reused (GST-3277). (#4565)
- The prompt-routing hook no longer acts on words inside backticks. (#4566)
- In Claude Code, a gstack skill's start step now runs when the skill loads, so the model can't skip it. (#4509)
- gstack's telemetry backend only accepts writes through its own validated endpoint, and the community dashboard now counts real use. (#4537)
- gstack now says what it's adding before it adds a background job or a browser extension. (#4538)
- For contributors: every flaky pass in Free Tests is now recorded. (#4572)
- For contributors: Free Tests on pull requests starts its test shards one round of small jobs sooner. (#4570)
- Secret values written as `name=value` at the end of a path are now hidden. (#4571)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant