pub enum RunRecord {
Header {
identity: RunIdentity,
meta: Box<RunMeta>,
},
OwnershipChanged {
machine_id: String,
world_id: String,
at: i64,
},
Inference {
stage: String,
iteration: usize,
request: InferenceRequestRecord,
response: InferenceResponseRecord,
at: i64,
},
InferenceUsage {
kind: InferenceKind,
stage: String,
iteration: usize,
provider: String,
model: String,
prompt_tokens: usize,
completion_tokens: usize,
cached_tokens: usize,
cache_write_tokens: usize,
at: i64,
},
ToolBatch {
calls: Vec<ToolCallRecord>,
at: i64,
stage_index: usize,
iteration: usize,
response: String,
},
ToolCallDone {
iteration: usize,
call_id: String,
result: String,
at: i64,
},
ContextCheckpoint {
snapshot: ContextSnapshot,
at: i64,
},
ContextDiff {
delta: ContextDelta,
at: i64,
},
Message {
message: MessageRecord,
at: i64,
},
StatusChanged {
status: RunStatus,
at: i64,
},
Checkpoint {
meta: Box<RunMeta>,
context: ContextSnapshot,
at: i64,
},
Progress {
meta: Box<RunMeta>,
delta: ContextDelta,
at: i64,
},
}Expand description
One entry in the run journal. Folding the sequence reconstructs the run.
Variants§
Header
The run’s identity + static metadata. Always the first record.
Fields
identity: RunIdentityOwnership/identity.
OwnershipChanged
Ownership handed to a different world/machine (e.g. resumed elsewhere).
Fields
Inference
One inference: what went out and what came back.
Fields
request: InferenceRequestRecordThe request digest.
response: InferenceResponseRecordThe response.
InferenceUsage
What one provider call cost, written as it lands.
RunRecord::Progress carries cumulative counters, so two calls between
two ticks are indistinguishable downstream: their sum arrives as one
number, and a chart of it shows a spike no single call ever made. This
record is per call, so token-over-time telemetry is exact and “no request
ever exceeded the window” is provable from the journal rather than
inferred from region-size checkpoints.
Deliberately lighter than RunRecord::Inference, which carries the
full request and response: every call re-sends the whole window, so
journaling those bodies for each of them would multiply the file by the
context size. The window is already recoverable from the surrounding
RunRecord::ContextCheckpoint and RunRecord::ContextDiff records.
Fields
kind: InferenceKindWhich kind of call this was.
ToolBatch
A batch of tool calls, written when the batch is dispatched to the tool
lane - before anything runs. Calls the dispatcher already resolved inline
(context tools, refusals, gate denials) carry result: Some(..); lane
calls start at result: None and are completed by matching
RunRecord::ToolCallDone records as each call finishes. A batch still
pending at fold time surfaces as FoldedRun::pending_batch so a
crash-resume can replay executed calls instead of re-running them.
Fields
calls: Vec<ToolCallRecord>The calls (inline results pre-filled; lane calls pending).
ToolCallDone
One tool call of the pending batch finished; its result.
Fields
iteration: usizeThe iteration of the RunRecord::ToolBatch this belongs to.
ContextCheckpoint
A full context-window snapshot that subsequent diffs rebase on.
ContextDiff
A context-window change since the previous snapshot/diff.
Message
An inbound message.
StatusChanged
A run-status change.
Checkpoint
A full resumable checkpoint: the updated metadata + the full window, so a reader can continue without folding the whole journal.
Fields
context: ContextSnapshotThe full window snapshot as of this checkpoint.
Progress
A step forward: the updated metadata plus a diff of the context window
since the previous point. This is the compact per-tick record the writer
emits between full checkpoints - meta is small, and the context (the bulk)
is carried as a ContextDelta rather than a full snapshot.