tractatus/public/js
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
..
admin fix(audit): ensure all hook denials are logged to audit database 2025-10-28 11:27:53 +13:00
components feat(compliance): add GDPR compliance page with trilingual support 2025-10-28 10:26:57 +13:00
demos fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
utils fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
blog-post.js docs: complete research documentation publication (Phases 1-6) 2025-10-25 20:10:04 +13:00
blog.js fix(newsletter): resolve CSRF token issue for static HTML pages 2025-10-25 09:37:16 +13:00
case-submission.js feat(i18n): add multilingual support to case-submission and media-inquiry pages 2025-10-26 16:41:54 +13:00
check-version.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
docs-app.js fix(docs): card overflow, sequencing, colour legend, and category fixes 2025-10-26 11:03:23 +13:00
docs-search-enhanced.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
docs-viewer-app.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
faq.js feat(i18n): add German and French translations for all FAQ Q&As 2025-10-26 14:43:25 +13:00
i18n-simple.js feat(compliance): add GDPR compliance page with trilingual support 2025-10-28 10:26:57 +13:00
koha-donation.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
koha-success.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
koha-transparency.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
leader-page.js feat(leader): WCAG accessibility with 9 accordions, keyboard navigation 2025-10-23 00:19:23 +13:00
media-inquiry.js feat(i18n): add multilingual support to case-submission and media-inquiry pages 2025-10-26 16:41:54 +13:00
media-triage-transparency.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
page-transitions.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
researcher-page.js feat(researcher): WCAG compliance, Berlin/Weil foundations, fixed footer i18n 2025-10-22 23:56:37 +13:00
scroll-animations.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
version-manager.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00