Repository navigation
Conversation
…runs Quoted data that merely names the words tripped both gates: - a hook script named inside quoted data (an echo note, a git commit message, a git log -S pattern) denied with 'hook scripts run only from the host's hooks, never by hand' — hookUnrun had no echo/printf branch and its git bookkeeping branch rejected any quoted body, so the words read as a run. echo/printf now leave the hook unrun (their quoted arguments are the words), and git bookkeeping verbs treat quoted messages and search patterns as words. A pipe to an interpreter is still the run. - the save gate answered to 'npx skills update' or 'skills add' sitting in quoted prose, because SAVE_GATE matched raw text. The gate entry is now runsTrailSkillsGate: some simple command's program (bareCommand, the parser the agent guard trusts) is the trail CLI with a gate verb as its subcommand. A subagent quoting the words is no longer denied for being a subagent on a command that runs nothing.
🌱 graft blast radius2 areas changed → 2 areas can be affected. 3 dependent symbols, depth 2. flowchart TB
A0(("Pre-Bash Hooks<br/>2 symbols"))
A1(("Risk Assessment<br/>1 symbol"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0,A1 reached;
Who knows this code — 2 people across 4 areas
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 All 3 dependent symbols, grouped by areaPre-Bash Hooks — 2 symbols in 2 files
Risk Assessment — 1 symbol in 1 file
Test signal per changed area — 1 ✓ · 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.
10 test suites also reference this code12 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
Fixes #832.
Problem
Quoted data that merely names the words — another tool's CLI in a string, a hook filename inside a commit message — tripped both the agent guard and the save gate:
echo "note: graft-hooks.cjs is only named in this quoted text"→ denied: "Trail's hook scripts run only from the host's hooks, never by hand"echo "the other tool's command is: npx skills update"→ answered by the save gateRoot cause
hookUnrun(src/trace/shell-words.ts) had no echo/printf branch — they fell toreturn false, so quoting a filename read as a run; its git bookkeeping branch also rejected any quoted body (-mmessages,-Spatterns are bodies).SAVE_GATEagainst raw command text.Fix
hookUnrun: echo/printf leave the hook unrun (their quoted arguments are the words; a redirect still writes, a pipe is judged per segment upstream); git bookkeeping verbs treat quoted messages/patterns as words. Fed to an interpreter (echo … | node graft-hooks.cjs) is still the run.runsTrailSkillsGate:bareCommandof some simple command is the trail CLI (trail/graft/trail-dev,npx @nanonets/graft/@trailhq/trail-code) withskills add|lesson|updateas its subcommand. The subagent deny now only ever sees genuine trail-skills commands.Tests
Two new tests (RED first): quoted-data cases answer null while a real
trail skills addstill gates; hook-name-in-quoted-data is null while the piped form keeps itshook-scripthit. Full suite: 4550 tests, 6 failures — exactly the pre-existing set onmain.