Expand description
Per-run observability trace store (spec unit #178 / M4).
Persists ordered spans keyed by conversation_id (the run id) in a local
SQLite database (~/.ryu/traces.db). Each span records:
kind—"tool-call"or"model-call"name— tool name or model idargs_hash— SHA-256 hex of the tool input (tool-call spans only; NOT the raw payload — privacy by default)started_at— Unix milliseconds (write time)ended_at— Unix milliseconds (finish time;Nonewhile running)error— non-Nonewhen the span ended with an errorsession_id— nullable link to the gateway audit row (populated when #176 threads the id; leftNoneuntil then)
Placement rationale (Core vs Gateway, see CLAUDE.md §1): span ordering and tool-call sequencing are what ran (orchestration) — Core. Token counts, cost, and provider-latency are what is measured/paid — Gateway audit only. Core’s trace intentionally stores NO tokens/cost fields.
Structs§
- Span
- A single ordered span within a run.
- Trace
Store - SQLite-backed trace store. Cheap to clone — wraps an
Arc<Mutex<Connection>>.
Functions§
- hash_
args - SHA-256 hex of a JSON value’s canonical representation.