95c903c10a
error-occurred.sh reads its two python helpers' stdin with `<<<`, a bash
here-string. dash has no such operator, so the script is a parse error, not a
runtime error: `sh error-occurred.sh` dies at line 32 with "Syntax error:
redirection unexpected" before any line runs.
tests/test_planning_disabled_optout.py runs every Copilot hook through
`["sh", str(script)]`, which ignores the `#!/bin/bash` shebang. On Ubuntu
/bin/sh is dash, so the hook exits 2 and the enabled-run assertion at line 200
fails. That is the whole of the current master CI failure; macOS and Windows
stay green because their /bin/sh parses `<<<`.
The four sibling hooks already pipe stdin instead, so this is the last `<<<`
under .github/. They pipe with `echo`, which is not safe to copy here: dash's
builtin echo expands backslash escapes, and $INPUT is raw JSON from Copilot,
so an escaped \n inside an error message becomes a real control character and
json.load rejects the payload. The hook then reports {} and the error is
dropped. `printf '%s\n'` never touches the escapes, which is the same reason
3c78c3c moved the output side of these hooks off echo.
Scoped to .github/hooks/scripts/. The four .gemini/hooks copies use `<<<`
too, but nothing invokes them through sh and settings.json runs them by path,
so their shebang applies and they are not part of this failure.