Repository navigation
fix(guard): restore refusals for commands that run a shell - #229
Merged
Merged
Conversation
Scan a command that runs a shell or eval quote-blind, read -c only after a shell or su, scan heredoc bodies fed to a shell, carry quote state across heredoc lines, and judge >|, quoted targets with spaces and every tee file. Also quote the publish remedy with shellQuote, correct the fork check's doc comment, release the lock-wait e2e lock on the waiting line, and document the served-worktree skills folder removal.
- Read -c as a script after ash, mksh, yash, posh, csh, tcsh and fish too, and pin main's nested-shell refusals in a test. - Skip tee words behind an input redirect or here-string. - Dedupe command targets; match heredoc bodies to shell lines by line number. - Lock-wait e2e test asserts the sync waited for the release.
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.
Summary
Follow-ups from the
1.0.0..mainreview before stable 1.0.1. OpenSpec change:settle-release-review-follow-ups.The artifact guard (Claude hook and OpenCode middleware share
evaluate()):Shell words:
sh bash dash ksh zsh ash mksh yash posh csh tcsh fish, also as a path.Patterns:
>|is a redirect. A quoted target with spaces (> "a b.md") is one word. Everyteefile is judged, whatever its options; a word behind<or<<<is input, not ateefile.Other items:
project.ts: the archived-dependency remedy quotes the name withshellQuote, whichapply-chain.tsnow exports. It printsmate artifact publish 'acme'.companion-sync.ts: the doc comment ofcompanionForkRefusalnow says only the fork state is cached, and the ignore check runs per target.cli-e2e-launch-sync.test.ts: the held lock is released 500 ms after the CLI prints "waiting for another companion sync to finish", not on a 1.5 s timer. The test asserts the sync had not run before the release.runMategained an optionalonStderrcallback.commands.mdx: in a linked worktree served by the main worktree,mate claudeandmate wrapremove a.claude/skillsfolder that holds only Mate's links.Evidence
validate-artifact-pathhook fed aBashpayload; base8bffd332vs this branch):target: notes/x.mdand a suggested companion path.-crefusals main makes stay: a new test pinsash/mksh/yash/posh/csh/tcsh/fish -c,busybox ash -c,nice/timeout/sudo -u/docker exec/xargs … sh -candsu - acme -c. With only the five POSIX shells, 8 of them fail; with the full list, all pass.validate-artifact-path,shell-heredocandcompanion-policy: 147 pass, 0 fail.test:hooks: 157 pass.typecheck,lint,format:check,knip,docs:check: clean. The fullbun run testexited 0 before the shell-list commit; the affected guard tests and static checks passed again after it.mate claude(the hook was driven with a launched session's environment); the publish remedy text outside its integration test;-cafterscript,flockornpxis no longer read as a script (accepted in design.md).Merge Danger
Door: two-way
Revert the commits. Nothing persists.
Blast Radius: guard
A command that runs a shell and also quotes a
> x.mdtext is refused again, as in 1.0.0. Example:bash scripts/x.sh "--note > a.md". The refusal names the target. Commands that run no shell keep main's behaviour.