Gate5 Orchestrator Execution Traces
Objective
Persist deterministic orchestrator traces for run lifecycle transitions and retry decisions so runtime behavior is auditable.
Runtime Contract
- State store record type:
OrchestratorExecutionTraceRecord. - Storage location:
InMemoryStateStore.orchestrator_execution_traces. - Trace identity fields are required on every record:
request_idtenant_iduser_id
- Trace records are append-only and chronological for each
run_id.
Emitted Events
Queue lifecycle
run_receivedstate_transition
Transitions covered by step labels:
enqueuedequeueawait_toolawait_user_confirmationresumecancelcompletefail
Retry policy
retry_attempt_startedretry_failure_recordedretry_scheduledretry_terminal_decisionretry_success
Validation Coverage
Contract tests verify:
- Lifecycle state transitions are traced end-to-end.
- Retry schedule and terminal decisions are traced with metadata.
- Trace identity propagation is preserved for auditability.
Relevant tests:
backend/tests/contracts/test_orchestrator_execution_traces.pybackend/tests/contracts/test_orchestrator_queue_cancellation.pybackend/tests/contracts/test_orchestrator_retry_policy.py
Traceability
- Child issue:
#49 - Parent epics:
#77,#81 - Interface contract:
docs/architecture/INTERFACES.md