Skip to content

Commit 8fd93a2

Browse files
committed
test(smoke): pin the Claude PostToolUse matcher that covers the graph tools
Smoke check 8d required Claude's PostToolUse matcher to be exactly Read. The drift note widens it on purpose to Read|mcp__.*codebase-memory-mcp__.*, so a graph tool call can reset the search count, and the macOS PR smoke failed on it. 8d now requires exactly the new matcher, and besides a Search matcher it also refuses a catch-all ("*" or empty) matcher, as its comment promised. Checked against real installs: the previous binary's Read-only settings fail 8d, the new install passes, and the new install plus a catch-all PostToolUse entry fails. Refs DeusData#509 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 4026175 commit 8fd93a2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎scripts/smoke-test.sh‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,22 +1697,24 @@ echo "OK 8c-i: Claude exact-tool graph subagent"
16971697

16981698
# 8d: Claude Code hooks keep search augmentation and read-coverage reporting
16991699
# separate: PreToolUse matches exactly Grep|Glob|Bash, while PostToolUse matches
1700-
# exactly Read. Neither hook may grow a Search or catch-all matcher.
1700+
# exactly Read plus the graph tools, whose calls reset the drift note. Neither
1701+
# hook may grow a Search or catch-all matcher.
17011702
if ! cat "$FAKE_HOME/.claude/settings.json" 2>/dev/null | python3 -c "
17021703
import json, sys
17031704
d = json.load(sys.stdin)
17041705
all_hooks = d.get('hooks', {})
17051706
pre = all_hooks.get('PreToolUse', [])
17061707
post = all_hooks.get('PostToolUse', [])
17071708
ok = (any(h.get('matcher') == 'Grep|Glob|Bash' for h in pre) and
1708-
any(h.get('matcher') == 'Read' for h in post))
1709-
bad = any('Search' in str(h.get('matcher', '')) for h in pre + post)
1709+
any(h.get('matcher') == 'Read|mcp__.*codebase-memory-mcp__.*' for h in post))
1710+
bad = any('Search' in str(h.get('matcher', '')) or h.get('matcher', '') in ('', '*')
1711+
for h in pre + post)
17101712
sys.exit(0 if (ok and not bad) else 1)
17111713
" 2>/dev/null; then
17121714
echo "FAIL 8d: Claude search/read hook matchers are not exact"
17131715
exit 1
17141716
fi
1715-
echo "OK 8d: Claude Code PreToolUse Grep|Glob|Bash + PostToolUse Read"
1717+
echo "OK 8d: Claude Code PreToolUse Grep|Glob|Bash + PostToolUse Read and graph tools"
17161718

17171719
# 8e: Claude Code shim script — must be non-blocking augmenter, not a gate.
17181720
# #929: Windows installs a .cmd script (extensionless bash shims triggered the

0 commit comments

Comments
 (0)