pub struct Report {Show 13 fields
pub schema_version: u32,
pub status: Status,
pub harness: String,
pub api_schema: String,
pub final_message: Option<String>,
pub structured_output: Option<Value>,
pub turns: u32,
pub tool_calls: Vec<ToolCallRecord>,
pub usage: Usage,
pub context_usage: Usage,
pub session_id: String,
pub stop_reason: Option<String>,
pub error: Option<String>,
}Expand description
The single JSON document locode-exec prints to stdout (ADR-0009).
schema_version is frozen at 1; changing the envelope shape is a deliberate,
versioned change (see the golden test).
Fields§
§schema_version: u32Envelope schema version. Always 1 for this contract.
status: StatusThe terminal state of the run.
harness: StringThe harness pack the run used (e.g. grok).
api_schema: StringThe wire schema the run used (e.g. anthropic) — the provider’s api_schema().
Names the request/response protocol shape, not a gateway/endpoint.
final_message: Option<String>The assistant’s final text message, if the run completed with one.
structured_output: Option<Value>A schema-constrained task answer, if one was requested (--json-schema).
turns: u32How many sample→dispatch→append turns the loop ran.
tool_calls: Vec<ToolCallRecord>A record of every tool call made during the run.
usage: UsageToken accounting for the run: summed over every turn. This is the cost basis — what the run generated in total — and grows without bound as a run takes more turns.
context_usage: UsageToken accounting for the run’s final turn only — the context occupancy the next request starts from.
Not derivable from Report::usage: each turn’s request re-sends the whole
conversation, so a per-turn sum counts the same history once per turn and has no
relationship to the context window. The last turn’s request is the whole
conversation, which is why this one number answers “how full is the context?”.
Additive field (ADR-0018’s envelope-evolution policy: new optional report fields
are non-breaking and do not bump schema_version); absent in traces written
before 2026-07-25, where it reads as all-zero.
session_id: StringThe session identifier.
stop_reason: Option<String>The final model stop reason ("end_turn", "max_tokens", …), when a
completion was received (ADR-0009 amendment 2026-07-19): lets an eval
pipeline distinguish “model finished” from “model got truncated”
without re-reading the trace.
error: Option<String>A fatal error message, if the run ended in status == error/model_error.