tractatus/src/services
TheFlow 6da6e8032a 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
..
AdaptiveCommunicationOrchestrator.service.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
AnthropicMemoryClient.service.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
BlogCuration.service.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
BoundaryEnforcer.service.js feat(framework): implement Phase 3 bidirectional communication architecture 2025-10-27 19:45:24 +13:00
ClaudeAPI.service.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
ClaudeMdAnalyzer.service.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
ContentAnalyzer.service.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
ContentGovernanceChecker.service.js feat(governance): extend framework checks to all external communications 2025-10-25 09:53:09 +13:00
ContentSimilarity.service.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
ContextPressureMonitor.service.js feat(blog): integrate Tractatus framework governance into blog publishing 2025-10-25 08:47:31 +13:00
CrossReferenceValidator.service.js feat(framework): implement Phase 3 bidirectional communication architecture 2025-10-27 19:45:24 +13:00
DeepL.service.js fix(i18n): add axios dependency and fix DeepL API parameters 2025-10-26 00:59:05 +13:00
index.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
InstructionPersistenceClassifier.service.js feat(blog): integrate Tractatus framework governance into blog publishing 2025-10-25 08:47:31 +13:00
koha.service.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
MediaTriage.service.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
MemoryProxy.service.js feat(research): add cross-environment audit log sync infrastructure 2025-10-27 12:11:16 +13:00
MetacognitiveVerifier.service.js feat(framework): implement Phase 3 bidirectional communication architecture 2025-10-27 19:45:24 +13:00
PluralisticDeliberationOrchestrator.service.js fix(audit): fix PluralisticDeliberationOrchestrator cultural sensitivity audit logging 2025-10-28 14:11:45 +13:00
RuleOptimizer.service.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
Translation.service.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
VariableSubstitution.service.js feat: implement Rule Manager and Project Manager admin systems 2025-10-11 17:16:51 +13:00