Skip to content

Commit e75a6b5

Browse files
committed
test(hooks): session-start-fleet selftest leaves the bash-3.2 floor to the repo-wide gate
The selftest's own construct scan spelled the forbidden tokens into a grep pattern and a message, which scripts/check-bash32-floor.mjs flags wherever they stand (no filename allowlist, by design). The floor is already held over .claude/hooks/** by that gate; the selftest keeps bash -n and the executable bit and points at the gate instead. Claude-Session: https://claude.ai/code/session_01SSWEKCxzY8HYr8EsFpR8VG Co-authored-by: Claude <noreply@anthropic.com>
1 parent 857b804 commit e75a6b5

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎.claude/hooks/session-start-fleet.selftest.sh‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,13 @@ exit0 'git not on PATH'
185185
says 'touch: unavailable' 'without git the touch is reported unavailable, not invented'
186186
says "$POINTER" 'and the pointer still prints'
187187

188-
echo "== syntax, mode, and the bash-3.2 floor's loudest constructs =="
188+
echo "== syntax and mode =="
189+
# The bash-3.2 floor itself is held repo-wide over `.claude/hooks/**` by
190+
# `scripts/check-bash32-floor.mjs` (`pnpm check:bash32-floor`), whose scan has no filename
191+
# allowlist and flags a construct's TOKEN wherever it stands; it is deliberately not re-scanned
192+
# here, because spelling the forbidden tokens into a grep pattern is itself a finding there.
189193
if bash -n "$hook" 2>/dev/null; then ok 'bash -n parses the hook'; else nope 'bash -n rejects the hook'; fi
190194
if [ -x "$hook" ]; then ok 'the hook is executable'; else nope 'the hook is not executable'; fi
191-
# Comment lines are stripped first: the header NAMES these constructs in order to forbid them.
192-
if grep -vE '^[[:space:]]*#' "$hook" | grep -nE '\bmapfile\b|\breadarray\b|declare -A|\$\{[A-Za-z_]+(,,|\^\^)\}|EPOCHSECONDS|&>>?|\|&' >/dev/null; then
193-
nope 'a bash-4+ construct is in the hook (mapfile/readarray/declare -A/${x,,}/EPOCHSECONDS/&>/|&)'
194-
else
195-
ok 'none of the loudest bash-4+ constructs appear in the hook'
196-
fi
197195

198196
echo "== wiring: settings.json registers this hook on SessionStart =="
199197
if [ -f "$settings" ]; then

0 commit comments

Comments
 (0)