- Node.js ≥ 20 installed
- SDK is built:
cd ../../ && npm run build
cd samples/hook-governance
npm installExpected: Clean install, no errors.
npm startExpected:
- Demo 1:
src/utils/helper.tswrite → allowed;/etc/passwdwrite → blocked with reason - Demo 2: Three email addresses redacted to
[EMAIL_REDACTED]; nested object also scrubbed - Demo 3: Backend blocked from
src/auth.ts; Frontend allowed - Demo 4: Ask #1–#3 allowed; Ask #4–#5 blocked with rate limit reason
Verify: Exit code is 0.
npm testExpected: All tests pass.
npx tsc --noEmitExpected: Zero errors.
Look at the "Combined Pipeline" test in tests/hook-governance.test.ts — it creates a single pipeline with all four policies active and verifies they all enforce simultaneously.