Add a repo-local Codex hook setup under `.codex/` so trusted Codex
users get pre-commit guardrails automatically in this repository.
The hook intercepts Bash-based `git commit` tool calls and first runs
the deterministic repo-policy focus checks against the staged commit
snapshot so invariant violations are reported before formatting.
If those checks pass, the hook runs
`./devtools/format-code.sh --git-changed`, skips unrelated Git commands,
allows commits when `clang-format-18` is unavailable, skips formatting
when no tracked `.c` or `.h` files changed, and blocks partial-staging
cases or real formatter failures.
When formatting changes files, the hook re-stages only the tracked files
that were already part of the pending commit.
Add `devtools/list-git-changed-c-h-files.sh` so the hook and formatter
share one source of truth for tracked changed `.c` and `.h` files.
With the help of AI-Agents: Codex