ADR-0014: Execution Trace, UDB, and Observability Boundariesπ
Statusπ
Accepted.
Contextπ
Execution history, negative-experience evidence, security events, and operational telemetry have different owners, retention rules, and read paths. Combining them in one event journal would make unrelated data depend on one schema and lifecycle.
Decisionπ
ContextUnity keeps these records in separate domains:
- Brain owns durable Execution Trace records and UniversalDebugBus (UDB) cases.
- Shield owns its security checks and audit event emission.
- Operational telemetry is a separate signal and does not replace product records.
Invariant: A record stays with the service that owns its lifecycle and authorization; another domain may keep only an explicit, bounded reference.
Brain Execution Traceπ
TraceHandlersMixin.LogTrace validates write permission, tenant, project, and user bindings before calling Brain storage. Brain stores terminal records in execution_traces; GetTraces requires read permission plus tenant and user binding.
finalize_execution_trace identifies a run by tenant and graph-run ID. An identical payload digest returns the existing receipt; a conflicting payload is rejected. The stored record includes terminal status and reason, trace schema version, steps, prompt evidence, control evidence, and final verdict.
Invariant: Execution Trace reads and writes remain tenant-scoped, and trace writes require a project-bound token for the trace project.
UniversalDebugBusπ
contextunity.core.udb defines the shared closed contracts. FaultOccurrence is immutable, tenant-scoped, and idempotent; DebugCase aggregates fault and recovery counts under ErrorEvidencePolicyV1. Brain owns UDB persistence and case lifecycle.
The v1 score is (fault_count + 1) / (fault_count + success_count + 2). Comparable verified recovery evidence contributes to the success count; mitigation attempts do not. The model has no time-based decay.
Invariant: UDB evidence contains bounded typed references and safe identifiers, not raw exception text, prompts, or tool payloads.
Shield audit and operational telemetryπ
Shield's AuditTrail emits structured AuditEvent entries to a logger and optionally to a JSON Lines file when a caller constructs it with a log path. Shield RPC handlers process security operations through their service paths.
Operational telemetry reports latency and failures. Brain owns trace and UDB records; Shield owns its security operations. Each product record follows its own storage and retention contract.
Consequencesπ
- Brain exposes trace and UDB records through their own typed storage and service paths.
- Shield audit events remain a distinct log stream with the durability limits of that implementation.
- Cross-domain views use explicit references and cannot silently merge ownership, authorization, or retention.
- A general-purpose event journal is not a current service contract.