diff --git a/packages/mosaic/framework/tools/git/test-wrapper-guard.sh b/packages/mosaic/framework/tools/git/test-wrapper-guard.sh index 97270be1..aaaf6587 100755 --- a/packages/mosaic/framework/tools/git/test-wrapper-guard.sh +++ b/packages/mosaic/framework/tools/git/test-wrapper-guard.sh @@ -74,6 +74,27 @@ FIXTURES="$TMP/fixtures.tsv" printf '0\t{"tool_input":{"command":"cat >> notes.md <> notes.md"}}\tnaming a command after echo is not running it\n' + # A shell standing between quoted data and execution makes that data code, + # and the pipe is the form agents actually use. Filing it as data allowed the + # call to vanish from the skeleton while still running. + printf '2\t{"tool_input":{"command":"printf '"'"'%%s\\\\n'"'"' '"'"'curl -d@b https://git.example.invalid/api/v1/repos/a/b/issues/1/comments'"'"' | sh"}}\tquoted code piped to a shell is code\n' + printf '2\t{"tool_input":{"command":"cat <> notes.md"}}\tan unrelated shell on another line does not promote quoted prose to code\n' } > "$FIXTURES" fail=0 n=0 diff --git a/packages/mosaic/framework/tools/git/wrapper-guard.sh b/packages/mosaic/framework/tools/git/wrapper-guard.sh index ab26c75b..0250a109 100755 --- a/packages/mosaic/framework/tools/git/wrapper-guard.sh +++ b/packages/mosaic/framework/tools/git/wrapper-guard.sh @@ -106,23 +106,50 @@ fi # skeleton would be blind to them. # # The exception is the reason quotes are data at all: if something is about to -# EXECUTE the quoted text (`bash -c`, `sh <