tractatus/tests/unit
TheFlow 2756953963 feat(framework): implement Phase 1 proactive content scanning
CREATED:
- scripts/framework-components/ProhibitedTermsScanner.js (420 lines)
  • Scans codebase for inst_016/017/018 violations
  • Pattern detection for guarantee language, fabricated stats, unverified claims
  • Auto-fix capability with context awareness
  • CLI interface: --details, --fix, --staged flags

- tests/unit/ProhibitedTermsScanner.test.js (39 tests, all passing)
  • Pattern detection tests (inst_017, inst_018)
  • Context awareness tests
  • Auto-fix functionality tests
  • Edge case handling

MODIFIED:
- scripts/session-init.js
  • Added Section 7: Scanning for Prohibited Terms
  • Renumbered subsequent sections (CSP → 8, Dev Env → 9, Continuous → 10)
  • Scans on every session start, reports violations

- scripts/hook-validators/validate-file-write.js
  • Added missing checkPreActionCheckRecency() function (fixes hook crash)

- package.json/package-lock.json
  • Added glob@11.0.3 dependency

RESULTS:
• Scanner operational: 39/39 tests passing
• Session integration: Runs automatically on session start
• Current scan: Found 364 violations (188 inst_017, 120 inst_018, 56 inst_016)
• Violations need user review (many in historical docs, specifications)

IMPACT:
• Framework now PROACTIVE instead of reactive
• Violations detected at session start (not weeks later)
• Auto-fix available for simple cases
• Closes critical detection gap identified in framework assessment

NEXT STEPS (user decision):
• Review 364 violations (many false positives in historical docs)
• Optionally: Implement pre-commit hook
• Phase 2: Context-aware rule surfacing
• Phase 3: Active metacognitive assistance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 17:37:51 +13:00
..
services feat: implement Rule Manager and Project Manager admin systems 2025-10-11 17:16:51 +13:00
AdaptiveCommunicationOrchestrator.test.js test(unit): add comprehensive tests for value pluralism services 2025-10-12 16:35:30 +13:00
BlogCuration.service.test.js fix: MongoDB persistence and inst_016-018 content validation enforcement 2025-10-11 00:17:03 +13:00
BoundaryEnforcer.test.js fix: MongoDB persistence and inst_016-018 content validation enforcement 2025-10-11 00:17:03 +13:00
ClaudeAPI.test.js test: increase coverage for ClaudeAPI and koha services (9% → 86%) 2025-10-09 21:17:32 +13:00
ContextPressureMonitor.test.js docs: regenerate PDFs and update documentation metadata 2025-10-14 10:53:48 +13:00
CrossReferenceValidator.test.js test: add comprehensive unit test suite for Tractatus governance services 2025-10-07 01:11:21 +13:00
InstructionPersistenceClassifier.test.js test: add comprehensive unit test suite for Tractatus governance services 2025-10-07 01:11:21 +13:00
koha.service.test.js test: increase coverage for ClaudeAPI and koha services (9% → 86%) 2025-10-09 21:17:32 +13:00
markdown.util.test.js test: add comprehensive coverage for governance and markdown utilities 2025-10-09 21:32:13 +13:00
MemoryProxy.service.test.js fix(tests): update MemoryProxy tests for v3 MongoDB architecture 2025-10-21 12:14:57 +13:00
MetacognitiveVerifier.test.js feat: achieve 100% test coverage - MetacognitiveVerifier improvements 2025-10-07 11:03:49 +13:00
PluralisticDeliberationOrchestrator.test.js test(unit): add comprehensive tests for value pluralism services 2025-10-12 16:35:30 +13:00
ProhibitedTermsScanner.test.js feat(framework): implement Phase 1 proactive content scanning 2025-10-21 17:37:51 +13:00