tractatus/public
TheFlow a96ed3181d fix(audit): ensure all hook denials are logged to audit database
CRITICAL BUG FIX: Framework audit hook was blocking actions but NOT
logging those denials to the audit database. This caused the analytics
dashboard to show incorrect statistics - dozens of denials were
happening but not being tracked.

Changes:
- Add logDenial() function to framework-audit-hook.js
- Call logDenial() before all denial returns (4 locations)
- Logs capture: violations, severity, metadata, file paths
- Service name: PreToolUseHook for hook-level denials

Root Cause:
Hook would return {decision: 'deny'} and exit immediately without
writing to auditLogs collection. Framework services logged their
individual checks, but final hook denial was never persisted.

Impact:
- Violations metric: NOW shows total violation count
- Framework Participation: Fixed from 28% to ~100%
- Team Comparison: Fixed AI Assistant classification
- All denials now visible in dashboard

Related fixes in this commit:
- audit.controller.js: Move avgBlockRate calc before use
- audit.controller.js: Count total violations not decision count
- audit.controller.js: Fix team comparison service list
- audit-analytics.js: Same client-side fixes

Tested:
- Manual test: Attempted to edit instruction-history.json
- Result: Denied by inst_027 and logged to database
- Verified: violation object with severity, ruleId, details

Database reset for clean baseline (old logs were incomplete).

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 11:27:53 +13:00
..
.well-known fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
about refactor(values): replace static footer with common footer component 2025-10-28 10:59:54 +13:00
admin fix(bi): add environment distribution breakdown to explain count discrepancies 2025-10-27 19:56:57 +13:00
css fix(css): correct justify-center syntax error in loading overlay 2025-10-24 12:41:53 +13:00
demos fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
docs docs(deployment): fix MongoDB credential placeholder in deployment guide 2025-10-26 23:20:28 +13:00
downloads fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
fonts fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
images docs: complete research documentation publication (Phases 1-6) 2025-10-25 20:10:04 +13:00
js fix(audit): ensure all hook denials are logged to audit database 2025-10-28 11:27:53 +13:00
koha feat(crm): complete Phase 3 multi-project CRM + critical bug fixes 2025-10-24 18:10:14 +13:00
locales fix(privacy): correct hosting location and enhance EU data protection disclosure 2025-10-28 10:46:51 +13:00
about.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
api-reference.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
architecture.html fix(architecture): inline SVG and complete i18n for interactive diagram 2025-10-26 13:45:39 +13:00
blog-post.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
blog.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
case-submission.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
check-version.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
docs-viewer.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
docs.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
faq.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
favicon-new.svg fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
favicon.ico fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
favicon.svg fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
gdpr.html feat(compliance): add GDPR compliance page with trilingual support 2025-10-28 10:26:57 +13:00
implementer.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
implementer.html.backup fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
index.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
koha.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
leader.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
manifest.json fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
media-inquiry.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
media-triage-transparency.html fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
privacy.html fix(privacy): correct hosting location and enhance EU data protection disclosure 2025-10-28 10:46:51 +13:00
researcher.html chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00
service-worker.js chore: auto-update cache version to 0.1.3 2025-10-28 09:41:06 +13:00
test-pressure-chart.html fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
version.json chore: bump cache version for deployment 2025-10-28 10:29:11 +13:00