Root-cause fix (audit §12.4.1): the only pre-commit gate was _gate_webapi,
which greps comment provenance / webapi ref-rate but NEVER runs tsc or vitest
→ 48 type errors + 20 failing tests could merge under an all-green gate (false green).
- scripts/quality-gate.sh: [1] tsc --noEmit (block) [2] vitest run tests/unit (block)
[3] backend smoke (advisory local / mandatory CI). No ceremony (no magic-string grep).
git rev-parse for root (no hardcoded /home/ubuntu).
- scripts/githooks/pre-commit (version-controlled): runs quality-gate (blocking),
then _gate_webapi as advisory (never blocks).
- scripts/install-hooks.sh: git config core.hooksPath scripts/githooks
- README §232: gate now enforced, tsc rule 靠自觉 → 门强制
blindspot_guards.test.ts quarantined via --exclude (12 fails = registry drift,
PLAN §P2.5) — loudly documented, not silently hidden.
Verified: NEGATIVE test — injected a type error, gate BLOCKED the commit (exit 2);
removed → tsc 0, gate passes. Gate passes its own gate.
Co-Authored-By: Claude <[email protected]>