Skip to main content

Crate lash_trace

Crate lash_trace 

Source
Expand description

Durable diagnostics for the lash runtime: the TraceSink channel and its record vocabulary.

A TraceSink receives one TraceRecord per runtime event — session and turn lifecycle, prompt builds, LLM calls, per-tool start/completion, token usage, protocol steps, and Lashlang execution-graph updates. Each record carries a TraceContext (session / turn / graph-node identity) plus a tagged TraceEvent payload; TraceEvent::kind is the single source of truth for the type tag string that consumers match on.

JsonlTraceSink writes one JSON line per record at schema TRACE_SCHEMA_VERSION; TeeTraceSink fans out to several sinks; and the optional otel feature adds an OtelTraceSink that converts each record to an OpenTelemetry span. This is the durable diagnostics reporting channel — distinct from the app-facing TurnActivity stream and the low-level SessionEvent stream that the runtime crates expose.

For the full map of reporting channels, guidance on when to consume which, and the schema-evolution policy that governs TRACE_SCHEMA_VERSION, see docs/reporting.html; for the attach-a-sink how-to, see docs/tracing.html.

Structs§

JsonlTraceSink
StderrTraceSink
Writes each trace record as one JSON line to stderr — handy for cargo run debugging without a trace file.
TeeTraceSink
Fans each trace record out to several sinks in order (e.g. stderr + a JSONL file). Stops at the first sink that errors.
TraceAgentFrameSwitch
TraceAttachment
TraceContext
TraceError
TraceLabelMetadata
TraceLashlangChildExecution
TraceLashlangExecutionIdentity
TraceLashlangGraph
Trace-derived Lashlang execution graph snapshot for hosts and debugging tools.
TraceLashlangGraphChildLink
Link from an observed parent Lashlang node to a child execution graph.
TraceLashlangGraphEdge
Trace-derived Lashlang graph edge.
TraceLashlangGraphNode
Trace-derived Lashlang graph node.
TraceLashlangGraphStore
In-memory store that reduces Lashlang execution trace records into graph snapshots.
TraceLashlangMap
TraceLashlangMapEdge
TraceLashlangMapNode
TraceLlmMessage
TraceLlmRequest
TraceLlmResponse
TracePromptComponent
TraceProviderStreamEvent
TraceRecord
TraceRuntimeScope
TraceRuntimeStreamEvent
TraceTokenUsage
TraceToolCallOutput
TraceToolSpec

Enums§

TraceBranchSelection
TraceContentBlock
TraceEvent
TraceLashlangEdgeSelection
Observed branch-edge selection state.
TraceLashlangExecutionEvent
TraceLashlangNodeStatus
Observed Lashlang graph node state.
TraceLashlangStatus
TraceLevel
TraceRuntimeSubject
TraceSinkError
TraceToolCallOutcome
TraceToolCallStatus

Constants§

TRACE_SCHEMA_VERSION
Version of the durable trace JSONL schema, written to TraceRecord::schema_version on every record.

Traits§

TraceSink

Functions§

json_hash
sha256_hex