tractatus/src
TheFlow 1e37019c28 fix(audit): fix PluralisticDeliberationOrchestrator cultural sensitivity audit logging
Problem:
- Cultural sensitivity checks were executing successfully but failing to create audit logs
- Error: "memoryProxy.getCollection is not a function"
- 12 blog posts analyzed, 0 audit logs created

Root Cause:
1. _auditCulturalSensitivity() was calling getMemoryProxy() and trying to use non-existent getCollection() method
2. Method was using fire-and-forget pattern (.catch()) instead of awaiting
3. Used 'context' field instead of 'metadata' field for custom data

Fix:
1. Use this.memoryProxy.auditDecision() instead of direct collection access
2. Await the audit call to ensure it completes before method returns
3. Store detailed assessment data in 'metadata' field (AuditLog schema)
4. Add memoryProxyInitialized check for safety
5. Map concerns to violations array with inst_081 ruleId

Result:
-  12 audit logs created (one per blog post analyzed)
-  Full metadata stored (risk_level, concerns, suggestions, audience)
-  Violations properly tracked for inst_081 (Cultural Sensitivity rule)
-  No more "Failed to create audit log" errors

Tested:
- node scripts/cultural-sensitivity-retrospective.js --report-only
- All 12 posts analyzed successfully with audit logs
- 1 post flagged for western_ethics_only pattern with full violation details

Location: src/services/PluralisticDeliberationOrchestrator.service.js:852-893

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 14:11:45 +13:00
..
config chore: add optimal submission timing to publication targets config 2025-10-26 11:34:27 +13:00
controllers fix(audit): ensure all hook denials are logged to audit database 2025-10-28 11:27:53 +13:00
middleware docs(auth): add RBAC explanation to requireRole middleware 2025-10-28 12:44:56 +13:00
models feat(research): add missed breach tracking system for framework effectiveness measurement 2025-10-27 12:26:53 +13:00
routes feat(content): add framework-guided blog pre-publication and comment analysis 2025-10-27 19:45:43 +13:00
services fix(audit): fix PluralisticDeliberationOrchestrator cultural sensitivity audit logging 2025-10-28 14:11:45 +13:00
utils feat(security): implement attack surface exposure prevention (inst_084) 2025-10-27 12:11:43 +13:00
server.js chore(infrastructure): improve session handoff and service initialization 2025-10-27 19:48:38 +13:00