Skip to content

Commit c97f682

Browse files
committed
test(smoke): matcher guard tracks Read inclusion for the coverage note
Check 8d still locked the matcher to the pre-DeusData#963 'Grep|Glob' and failed the pr-smoke leg on all platforms. The matcher now includes Read (the augmenter injects the coverage note when a not-fully-indexed file is read; structurally non-blocking, so the issue-DeusData#362 gate hazard cannot recur). The guard now pins the exact new matcher and still rejects Search/catch-all creep. Refs DeusData#963 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent afc649f commit c97f682

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

‎scripts/smoke-test.sh‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -929,21 +929,24 @@ if ! path_match "$CMD" "$SELF_PATH"; then
929929
fi
930930
echo "OK 8c: Claude Code MCP (.claude/.mcp.json)"
931931

932-
# 8d: Claude Code hooks — matcher must be exactly "Grep|Glob" (no Read, no Search).
933-
# Gating Read breaks Claude Code's read-before-edit invariant (issue #362), so
934-
# this assertion locks in the matcher to prevent regressions.
932+
# 8d: Claude Code hooks — matcher must be exactly "Grep|Glob|Read" (no Search).
933+
# Read is matched for the indexing-coverage note (#963); safe against the old
934+
# issue-#362 gate hazard because the augmenter is structurally non-blocking
935+
# (always exit 0, additionalContext only). This assertion locks in the exact
936+
# matcher to prevent both regressions (Read dropped again) and creep (Search
937+
# or catch-all matchers sneaking back).
935938
if ! cat "$FAKE_HOME/.claude/settings.json" 2>/dev/null | python3 -c "
936939
import json, sys
937940
d = json.load(sys.stdin)
938941
hooks = d.get('hooks', {}).get('PreToolUse', [])
939-
ok = any(h.get('matcher') == 'Grep|Glob' for h in hooks)
940-
bad = any('Read' in str(h.get('matcher', '')) for h in hooks)
942+
ok = any(h.get('matcher') == 'Grep|Glob|Read' for h in hooks)
943+
bad = any('Search' in str(h.get('matcher', '')) for h in hooks)
941944
sys.exit(0 if (ok and not bad) else 1)
942945
" 2>/dev/null; then
943-
echo "FAIL 8d: PreToolUse hook matcher is not exactly 'Grep|Glob' (or still contains Read)"
946+
echo "FAIL 8d: PreToolUse hook matcher is not exactly 'Grep|Glob|Read'"
944947
exit 1
945948
fi
946-
echo "OK 8d: Claude Code PreToolUse hook (matcher=Grep|Glob, Read excluded)"
949+
echo "OK 8d: Claude Code PreToolUse hook (matcher=Grep|Glob|Read)"
947950

948951
# 8e: Claude Code shim script — must be non-blocking augmenter, not a gate.
949952
if [ "$(uname -s)" != "MINGW64_NT" ] 2>/dev/null; then

0 commit comments

Comments
 (0)