CLI-12: Gate a pre-commit hook on the exit code
What it demonstrates
Section titled “What it demonstrates”The 0/1/2 exit-code contract wires validate straight into a shell gate or git hook.
Builds on: CLI-02: Read a single human finding with line:col
How it’s done
Section titled “How it’s done”A terminal session: the command as you’d run it, followed by the output it prints; trailing comments note the exit status.
#!/bin/shmarkdown-contract validate docs/planning || { echo 'contract findings present — commit blocked' >&2 exit 1 # 0 clean, 1 error-level findings, 2 usage/config error}Surfaces exercised
Section titled “Surfaces exercised”exit-code contract (0 clean / 1 error-level findings / 2 usage-config error) as the shell + CI gating basis