The hook used `declare -A` (associative array, bash 4+ only). On
macOS where /bin/bash is still 3.2, the declaration silently failed
and the loop iterated zero entries — so the hook printed a parse
error to stderr but skipped its actual check, defeating the
protection against committing generated files without their source.
Rewrite with parallel arrays (GENERATED_GENS / GENERATED_SRCS
indexed in lockstep), which work on bash 3.2 onward. Verified the
hook executes cleanly under /bin/bash 3.2.57.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Prevent accidental edits to machine-generated files (Ragel scanners, Unicode
tables, autoconf, protobuf, SQLite amalgamation) with three enforcement layers:
- hooks/pre-commit: blocks commits of generated output without its source
- Makefile chmod a-w: Ragel outputs made read-only after generation
- make hooks: auto-installs hook via core.hooksPath on first build
docs/generated-files.md is the shared reference for all agents and developers.
CLAUDE.md and AGENTS.md both point to it.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>