tractatus/scripts
TheFlow d7a58aa466 feat(infrastructure): add MongoDB sync and CSP compliance checking
DATABASE SYNC INFRASTRUCTURE:
- scripts/sync-instructions-to-db.js
  - Syncs .claude/instruction-history.json to MongoDB governanceRules collection
  - Handles inserts, updates, and deactivations
  - Validates file and database counts match
  - Used in governance audit (54 → 56 → 59 active rules)
  - Required for production deployment of governance rules

CSP COMPLIANCE CHECKING:
- scripts/check-csp-violations.js
  - Enforces Content Security Policy compliance (inst_008)
  - Checks staged HTML files for:
    - Inline scripts (<script> tags with code)
    - Inline event handlers (onclick, onload, etc.)
    - Inline styles (style attributes)
  - Integrated with .git/hooks/pre-commit
  - Blocks commits with CSP violations

REASON FOR CREATION:
- sync-instructions-to-db.js: Needed to deploy governance rules to production
- check-csp-violations.js: Pre-commit hook was calling missing script

USAGE:
- Sync to DB: node scripts/sync-instructions-to-db.js
- CSP check: Runs automatically on git commit (via pre-commit hook)

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 00:31:54 +13:00
..
add-security-rules-2025-10-21.js fix(security): comprehensive security incident response for API key exposure 2025-10-22 00:31:30 +13:00
apply-governance-audit-2025-10-21.js feat(governance): comprehensive governance rules audit and consolidation 2025-10-22 00:30:24 +13:00
check-csp-violations.js feat(infrastructure): add MongoDB sync and CSP compliance checking 2025-10-22 00:31:54 +13:00
clean-test-db.js fix: add Jest test infrastructure and reduce test failures from 29 to 13 2025-10-09 20:37:45 +13:00
install-gitleaks-hook.sh fix(security): comprehensive security incident response for API key exposure 2025-10-22 00:31:30 +13:00
sync-instructions-to-db.js feat(infrastructure): add MongoDB sync and CSP compliance checking 2025-10-22 00:31:54 +13:00
verify-rules-implementation.js feat(governance): comprehensive governance rules audit and consolidation 2025-10-22 00:30:24 +13:00