Description
Codex is event-sourced. task_started and task_complete bracket a turn and carry native duration_ms and time_to_first_token_ms; turn_context carries the model and effort that the usage records do not.
model_provider is not stable within a namespace: both codex-lb and openai appear across sessions. Never infer it.
Acceptance Criteria
- #1 task_started and task_complete populate the turn with TTFT and duration at Source native
- #2 turn_aborted populates the same fields with Outcome interrupted and its reason
- #3 turn_context supplies model, effort, cwd, approval_policy, sandbox_policy and personality
- #4 session_meta supplies cli_version, originator, thread_source, forked_from_id, parent_thread_id and context window id
- #5 model_provider is read per session and never inferred from the namespace
- #6 The native 32-hex trace_id from task_started is used as the trace id with TraceIDSource native
Definition of Done
- #1 just check passes: fmt-check, lint, build, test-short, probe-ci, dashboard-check and docs-links all clean
Implementation Plan
Wave 1 lane 5: write table-driven tests first, implement Codex sessions/items/dedup within the frozen model, and prove duplicate representations count once; root integrates and runs the final gate.
Final Summary
Codex session and turn metadata, native timing, provider, context lineage, personality, and native trace id decoding are implemented; corpus gate passed.