Verified (evidence, not guess): the guards ARE effective — command-scoped by design,
wired into form/create, form/release, dm/create, menu/create; BS-47/BS-50 fire
correctly when called with their command (as all production callers + verify_option.test.ts do).
The 12 failures were a STALE test, not broken guards:
- 8 'should-trigger' used pre-command-scoping calls → added command args (BS-47 'dict typeCreate', BS-50 'menu create')
- BS-15b / BS-28 / BS-32b: guards removed from registry long ago → dropped stale assertions
- BS-5: real check is ctx===null (not 'empty existingEnCodes') → fixed test
- BS-51 WARN / BS-44 INFO / BS-60 ERROR: test asserted wrong levels → fixed
- BS-60 repurposed (invalid jnpfKey / placeholder columnOptions, not missing vmodel) → fixed trigger
Impl: fixed objective dup-id bug — renamed 2nd 'BS-14' (type=4 view-release WARN) → 'BS-14b'.
Un-quarantined: removed --exclude from scripts/quality-gate.sh.
Verified: full gate green WITH blindspot_guards (tsc 0 + all unit incl. 41/41 guards + smoke).
Co-Authored-By: Claude <[email protected]>
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]>