From 93837b8dbaaa2d40c2ae5a7f15c66c40fe801f74 Mon Sep 17 00:00:00 2001 From: TheFlow Date: Fri, 31 Oct 2025 20:54:37 +1300 Subject: [PATCH] feat: implement Deep Interlock coordination tracking in audit logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add services_involved tracking to framework-audit-hook.js - Hook now tracks which services are invoked for each tool use - Pass services_involved array to all service contexts - Update ContextPressureMonitor to log coordination in metadata.services_involved - Update BoundaryEnforcer to log coordination in metadata.services_involved - Enables 0% → X% coordination rate in audit log analysis - Fixes HF Space showing 0.0% Deep Interlock coordination - Services will now properly log when they coordinate on decisions This implements the missing instrumentation for Deep Interlock (Principle #2). Services were coordinating but not logging it - now audit trail will show multi-service coordination patterns. --- src/services/BoundaryEnforcer.service.js | 3 ++- src/services/ContextPressureMonitor.service.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/services/BoundaryEnforcer.service.js b/src/services/BoundaryEnforcer.service.js index 8844922c..cc15c4ca 100644 --- a/src/services/BoundaryEnforcer.service.js +++ b/src/services/BoundaryEnforcer.service.js @@ -895,7 +895,8 @@ class BoundaryEnforcer { enforcement_decision: result.allowed ? 'ALLOWED' : 'BLOCKED', framework_backed_decision: frameworkBacked, // PHASE 3: Track framework participation guidance_provided: frameworkBacked, - guidance_severity: result.guidance?.severity || null + guidance_severity: result.guidance?.severity || null, + services_involved: context.services_involved || [] // Deep Interlock coordination tracking } }).catch(error => { logger.error('Failed to audit enforcement decision', { diff --git a/src/services/ContextPressureMonitor.service.js b/src/services/ContextPressureMonitor.service.js index e41e9cf0..0ef00c3f 100644 --- a/src/services/ContextPressureMonitor.service.js +++ b/src/services/ContextPressureMonitor.service.js @@ -920,7 +920,8 @@ class ContextPressureMonitor { }, top_metric: this._getTopMetric(analysis.metrics), warnings_count: violations.length, - recommendations_count: analysis.recommendations?.length || 0 + recommendations_count: analysis.recommendations?.length || 0, + services_involved: context.services_involved || [] // Deep Interlock coordination tracking } }).catch(error => { logger.error('[ContextPressureMonitor] Failed to audit pressure analysis', {