pub struct RunStats {Show 15 fields
pub turns: u32,
pub usage: Usage,
pub cost_usd: Option<f64>,
pub usage_complete: bool,
pub stop_cause: Option<StopCause>,
pub exhausted: bool,
pub ended_on_failed_call: bool,
pub tool_calls: u32,
pub tool_errors: u32,
pub tool_denied: u32,
pub tool_staged: u32,
pub malformed_tool_args: u32,
pub blocked_sends: u32,
pub compactions: u32,
pub taint: Taint,
}Expand description
How a run went, in numbers a machine can compare across sessions.
Every field is a deterministic count taken from
crate::agent::RunOutcome — nothing here is a model’s opinion, and
nothing is derived from the content of a tool result. That is the
property that lets this be an input to automated grading: a counter
carries no instructions, so a corpus of these cannot be an injection
surface the way a corpus of transcript excerpts would be.
Every field defaults, so a session written before this record existed loads, and a field added later does not invalidate the ones already recorded.
Fields§
§turns: u32§usage: Usage§cost_usd: Option<f64>§usage_complete: boolFalse when usage is a lower bound rather than a measurement.
stop_cause: Option<StopCause>Why the loop stopped. The single most informative field here: it separates “the model decided it was done” from every way the harness cut it short, and none of that is visible in the answer text.
exhausted: bool§ended_on_failed_call: boolThe model stopped of its own accord with its last call failed.
tool_calls: u32Tool calls attempted, and how they went. errors counts the
environment refusing (including a call to a tool that does not exist);
denied counts a human or a policy refusing, which is the harness
working and must not be averaged in with failure.
tool_errors: u32§tool_denied: u32§tool_staged: u32§malformed_tool_args: u32§blocked_sends: u32§compactions: u32§taint: TaintWhat had entered the conversation by the end. Recorded here as well as
in Record::Taint because this record is read on its own, by a
reader that is counting rather than reconstructing.
Implementations§
Source§impl RunStats
impl RunStats
Sourcepub fn absorb(&mut self, o: &RunOutcome)
pub fn absorb(&mut self, o: &RunOutcome)
Fold another run’s outcome in.
An episode — a replayed session, a multi-turn eval case, a batch item — is several runs on one conversation, and is one row. Counters sum, because the episode really did spend all of it. Three fields do not, and the split is the whole reason this is a method rather than a loop at each call site:
stop_cause,exhaustedandended_on_failed_calldescribe how the episode ended, so the last run wins. An episode whose first turn ended on a failure and whose second recovered has not finished over a failure, and summing would say it had.taintmerges and never resets: it is a property of the conversation, and a later clean run does not un-read what an earlier one read.usage_completeis an AND: one lower-bound turn makes the total a lower bound.