CI red on `Script tests (pytest)`, three failures, and the first is a real guard
defect that six review rounds on macOS could not see.
`pretooluse-bom-guard.sh` detects a BOM with `head -c3 | xxd -p`. `xxd` ships
with vim and is ABSENT on the Linux CI runner (verified on the runner host), so
the substitution yields empty, never equals efbbbf, and the guard passes every
BOM silently. It has been fail-open on any host without vim for its whole life.
`od -A n -t x1 -N 3` is POSIX and byte-identical on both platforms.
It surfaced only because #776's non-vacuity assertion demands that hook actually
reach a decision. The environment was a sampled population too — every review
round ran where xxd exists.
The other two failures were my tests being platform-specific:
- Linux prints a bare `Terminated` job-control notice where macOS prints
`Terminated: 15 sleep 5`; the exemption regex required a trailing colon or
space and so did not match.
- The locale matrix used en_US.UTF-8, which is not installed on the runner, so
bash itself warned and the assertion was measuring the absent locale rather
than the export fix. Unavailable locales are skipped with that reason stated.
And the stripper test is reframed. It compared the stripped hook against the
merge base, which asserted two unrelated things — that the stripper is exact, and
that no hook was edited for any other reason. The second went red the moment a
hook had a real defect fixed. It now asserts the property that actually protects
the A/B control: every line removed is a preamble line and none is added.
Mutation-checked — widening the stripper to eat `set -` lines turns it red.
Refs: #776
Decisions-Edit: yes
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>