Skip to content

Destructive-command check catches abbreviated --no-dry-run, stops over-blocking /dev/shm, and the redactor keeps regex literals with a slash in brackets - #4594

Closed
garrytan wants to merge 2 commits into
mainfrom
guard-fixes-batch-b
Closed

garrytan wants to merge 2 commits into
mainfrom
guard-fixes-batch-b

Conversation

@garrytan

@garrytan garrytan commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

The destructive-command check now denies git push -fn --no-dry origin main, and stops hard-denying a --no-dry-run that git reads as a push-option value and redirects into /dev/shm or /dev/fd.
The secret redactor stops redacting regex literals like /token=[A-Za-z0-9/]+/g, and an escaped \/ no longer ends a regex, which was leaking /token=<value>\/x.
Nothing to do; each change sits on top of the existing catches, with tests that dangerous neighbours still deny.

What changed, file by file
  • careful/bin/check-careful.sh: the push parser resets dry-run on --no-dr…--no-dry-run (checked against real git: --no-d is ambiguous and git refuses it), and skips one --no-dry* word right after -o, --push-option or a short flag group ending in o. Still denied: no -n, -o taking another value, a value attached in the group (-fnox), a second --no-dry.
  • careful/bin/check-careful.sh: the /dev redirect pre-scan skips >/dev/shm/<disk name> and >/dev/fd/<disk name> lines only; those still go through the on-disk folder lookup. Still denied: /dev/sda, /dev/shm/../sda, /dev/shm/sda/../../sdb, /dev/./sda, /dev//sda, a real disk beside a shm redirect, and /dev/./sda behind 70 decoy redirects.
  • lib/redact-patterns.ts: isRegexLiteralBody finds the closing slash outside character classes and escapes.
  • test/helpers/native-auto-decide.ts: a skill load whose output holds the loader's own SKILL_START: line (a start that timed out partway) is no longer credited as the session's start.
Agent notes

Lane GSTA-685, small-fix batch B items 6, 7(a)(d)(e), 8(a). Item 5 dropped (the export-subst ratchet already catches export $( in heredoc bodies; not reproducible). Deferred: 7(b) slow-probe timeout and 7(c) warn-vs-refuse past the probe cap (behavior design), 8(b) skill-load degrade (resolver change regenerating 56 SKILL.md files). Redactor fix carried from the second-model patch in handoffs/GSTA-675. Every fixed item has a test that failed before the fix.

{"head":"ec64ac6d40a54fbd0f588384b29d7e1bd1058462","run":"ship-4594-a","status":"started","review_loop":{"passes":1,"blocking_found":1,"deferred":0,"noted":2,"fixed":3,"scope":"frozen","fix_checks":1,"rounds":2,"dispatches":{"specialist":3,"red-team":1}}}

Open in Capy

…over-denying /dev/shm; redactor keeps regex literals with a slash in brackets

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

trunk-io Bot commented Nov 21, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

…he secret scan on main

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

capy-ai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Closing unmerged: superseded by #4599, which carries these fixes plus a fix for the redirect blocker this PR's second review found.

@capy-ai capy-ai Bot closed this Nov 21, 2026
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