#[non_exhaustive]pub struct CaseOutcome {
pub name: String,
pub passed: bool,
pub predicates: Vec<(String, bool)>,
pub latency: Duration,
pub tokens: Option<u32>,
pub tool_calls: Vec<String>,
pub final_text: Option<String>,
pub error: Option<String>,
pub transcript: Vec<Value>,
}Expand description
The result of running one eval case.
Serialize/Deserialize let a host persist a run to results/*.json and the HTML report load it
back. Duration round-trips through serde’s built-in {secs, nanos} form; the predicates tuples
serialize as [label, passed] pairs.
#[non_exhaustive]: likely to gain diagnostic fields. The runner builds it via CaseOutcome::new
(the canonical constructor) rather than a struct literal, so a new field is a one-line change there;
external crates that need to construct one should use CaseOutcome::new too.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe case name (the host’s case identifier).
passed: boolWhether EVERY expectation held (the case passed).
predicates: Vec<(String, bool)>Per-predicate (label, passed) in the case’s expect order — for pinpointing WHICH predicate
failed.
latency: DurationWall-clock time for the whole case run (player-context prefetch + every model turn + tool application).
tokens: Option<u32>Completion tokens summed across the case’s model turns, when the backend reported usage;
None when no turn carried a usage object (e.g. a llama-server route that omits it).
tool_calls: Vec<String>The tool calls the model made, as "name(compact-args)" strings (for debugging a failure).
Excludes the harness’s automatic up-front get_player_context prefetch.
final_text: Option<String>The model’s final free-text reply (the summary line), if any.
error: Option<String>An error from the run itself (backend failure, etc.). When Some, passed is false and the
predicates were scored against whatever world state existed when the run aborted.
transcript: Vec<Value>The full per-case conversation transcript (every user/assistant/tool message), with the
leading role:"system" message(s) STRIPPED — the system prompt is stored once at run level (see
RunRecord::system_prompt). Rendered by the HTML report’s per-case expander.
#[serde(default)] is REQUIRED for backward compatibility: existing results/*.json were
written before this field existed; without the default, the report loader
(crate::report_html::generate_report) would fail to deserialize them and silently drop those
runs from the report.
Implementations§
Source§impl CaseOutcome
impl CaseOutcome
Sourcepub fn new(
name: String,
passed: bool,
predicates: Vec<(String, bool)>,
latency: Duration,
tokens: Option<u32>,
tool_calls: Vec<String>,
final_text: Option<String>,
error: Option<String>,
transcript: Vec<Value>,
) -> Self
pub fn new( name: String, passed: bool, predicates: Vec<(String, bool)>, latency: Duration, tokens: Option<u32>, tool_calls: Vec<String>, final_text: Option<String>, error: Option<String>, transcript: Vec<Value>, ) -> Self
The canonical constructor, taking every field in declaration order. Used by the runner (and any
external crate) so the #[non_exhaustive] struct can be built without a struct literal; adding a
field updates this one signature.
Trait Implementations§
Source§impl Clone for CaseOutcome
impl Clone for CaseOutcome
Source§fn clone(&self) -> CaseOutcome
fn clone(&self) -> CaseOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more