Repository navigation
Conversation
…ds, not a run
agentGuard denied inert commands because textProgram — the default
quiet for the switch finder — knew nothing beyond its TEXT_PROGRAMS
list:
- 'gh issue list --search' and 'paseo send' quoted arguments read as
runs. gh joins the word-programs behind an enumerated safe-verb list
(GH_WORDS) — the remote-session and extension-running verbs
(codespace, extension) stay guarded; paseo joins like echo.
- a python stdin script writing the words as a string literal
(python3 - <<'PY' … write_text('skills on')) read as a run. The new
stdin branch is inert only when the script runs nothing itself
(PY_RUNS: os/subprocess escapes, eval/exec, dynamic imports, pty
drivers, and the getattr/compile/globals indirection that could
smuggle one) and the words sit only inside quoted literals. Python
only — any other interpreter, a script FILE argument, and an
unquoted heredoc delimiter stay guarded.
Real activation, os.system, subprocess, exec with the words in the
clear, getattr indirection, node heredocs, and echo | python3 all stay
denied. Found while writing the adversarial set, reported not fixed
here: an UNQUOTED heredoc delimiter with a $(…) in the body is a real
shell run the scan layer never attributes — pre-existing on main,
touches quotedTextHit's segment pairing, left for a separate fix.
🌱 graft blast radiusNothing outside this diff depends on it. 1 area changed; no indexed dependents at depth 2. Who knows this code — 1 person across 1 area
Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no Test signal per changed area — 1 ✗Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
Fixes #827.
Root cause
textProgram— the default "quiet" for the switch finder inquotedTextHit— rejected anything outside itsTEXT_PROGRAMSlist, so agh --searchstring, apaseomessage argument, and a python stdin script writing the words as a string literal all read as runs.Fix (narrow, per the issue's own caution about broadening)
GH_WORDSlist; the remote-session and extension-running verbs (codespace,extension) stay guarded. paseo joins like echo/printf.python3 - <<'PY') are inert only when the script runs nothing itself —PY_RUNScatches os/subprocess escapes, eval/exec, dynamic imports, pty drivers, and the getattr/compile/globals indirection that could smuggle one — and the words sit only inside quoted literals. Python only; any other interpreter stays guarded.Tests (adversarial set)
Inert: the issue's four cases, plus dynamic assembly (
'trail ' + 'skills on', f-strings). Still denied:os.system,subprocess.run(shell=True),getattr(os, 'system'),exec, a script FILE argument, a node heredoc,echo | python3,gh extension run,gh codespace ssh, real activation.Pre-existing hole found, not fixed here
While writing the adversarial set: an unquoted heredoc delimiter with
$(…)in the body (python3 - <<PY+print('$(trail skills on)')) is a real shell run the scan layer never attributes —quotedTextHitskips substitution-capable heredoc bodies, pre-existing onmain. Left out deliberately (touches segment pairing in the core scanner); happy to take it in a follow-up if you want it.