Skip to content

Commit fe577ac

Browse files
Keep supervised failures failed and skip unknown events in web-search scans
Accounting gaps now judge only an outcome the runner reported in a valid result.json, so timeouts, runners that could not start and broken runner protocol keep their failed classification (outer supervision keeps precedence, #1468). The Trial-wide web-search scan skips events this build cannot decode, as the other Session-trace readers do, instead of aborting the Experiment on a native Arm's newer trace. Co-Authored-By: Claude <[email protected]>
1 parent 44a0cb9 commit fe577ac

7 files changed

Lines changed: 40 additions & 15 deletions

File tree

‎docs/eval-tasks.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,9 @@ Harness invocations. Provider traffic with no sessions, or fewer Harness
569569
sessions than Harness runs that contacted a provider, voids the Trial as
570570
`accounting_gap`. A runner with declared `harnesses` or `providers` that ends
571571
`delivered` or `stopped_to_ask` with no sessions also has an accounting gap.
572+
These checks judge only an outcome the runner reports in a valid
573+
`result.json`: a timeout, a runner that cannot start, a crash or a missing or
574+
invalid `result.json` stays `failed`, as outer supervision keeps precedence.
572575

573576
Before its first Trial, an Experiment prepares both Arms together:
574577

‎docs/experiment-results.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ them. Custom runner roles come from `record_command --role` or the session's
281281
Harness/SDK records become the same OTLP Session traces. Their costs use frozen
282282
prices, ignoring runner-reported USD. Provider traffic without Session evidence,
283283
unrecorded Harness runs across the proxy and declared provider/Harness runners
284-
finishing `delivered` or `stopped_to_ask` without sessions are accounting gaps.
284+
finishing `delivered` or `stopped_to_ask` without sessions are accounting gaps,
285+
judged only for an outcome the runner reported in a valid `result.json`;
286+
timeouts and broken runner protocol stay failed.
285287
Normalized web-search tool calls void a Trial as `web_search`.
286288
Resumes and fallback sessions belong to that same Step. Arm totals and
287289
`roles` include all spent attempts, including Voids. A missing session usage

‎docs/guide.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,8 @@ from frozen Experiment prices and available in Trial Peek and Waterfall.
13231323
Live 85% quota warnings pause the Experiment. Web-search tool calls void a
13241324
Trial as `web_search`; provider traffic without recorded sessions, missing
13251325
Harness sessions, or a declared provider/Harness runner delivering without
1326-
sessions voids it as `accounting_gap`.
1326+
sessions voids it as `accounting_gap`; a timed-out or crashed runner stays
1327+
failed.
13271328

13281329
Console clients can start the same Experiment with `POST /api/v1/start` (also
13291330
served at `/api/v1/runs`), putting `baseline_runner`, `candidate_runner` and

‎site/docs/index.html‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,8 @@
14031403
Live 85% quota warnings pause the Experiment. Web-search tool calls void a
14041404
Trial as <code>web_search</code>; provider traffic without recorded sessions, missing
14051405
Harness sessions, or a declared provider/Harness runner delivering without
1406-
sessions voids it as <code>accounting_gap</code>.</p>
1406+
sessions voids it as <code>accounting_gap</code>; a timed-out or crashed runner stays
1407+
failed.</p>
14071408
<p>Console clients can start the same Experiment with <code>POST /api/v1/start</code> (also
14081409
served at <code>/api/v1/runs</code>), putting <code>baseline_runner</code>, <code>candidate_runner</code> and
14091410
<code>suite</code> in the request&#39;s <code>experiment</code> object. The CLI&#39;s per-Arm conflicts and

‎src/evals/experiment/execution.rs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ impl<'a> Execution<'a> {
309309
// agent's own out-of-memory error leaves no kernel kill behind.
310310
let cap_killed = || launched.oom_killed();
311311
let mut runner_result = false;
312+
let mut reported = false;
312313
let mut protocol = if let Some(error) = interruption {
313314
void_interrupted(started.elapsed().as_millis(), &error)
314315
} else {
@@ -327,7 +328,10 @@ impl<'a> Execution<'a> {
327328
void_memory_cap(started.elapsed().as_millis())
328329
} else if arm.runner.is_some() {
329330
runner_result = true;
330-
custom::result(&output, &attempt, started.elapsed().as_millis())
331+
let (classified, valid) =
332+
custom::result(&output, &attempt, started.elapsed().as_millis());
333+
reported = valid;
334+
classified
331335
} else if sigkilled {
332336
Output::failed(
333337
started.elapsed().as_millis(),
@@ -381,6 +385,7 @@ impl<'a> Execution<'a> {
381385
arm.runner.as_ref().unwrap(),
382386
&traffic,
383387
&mut protocol,
388+
reported,
384389
self.signal,
385390
)?;
386391
}

‎src/evals/experiment/execution/custom.rs‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ pub(crate) mod sessions;
2020
mod tests;
2121
pub(super) use recording::Recorder;
2222

23+
/// Quota stops and web searches apply to every outcome. Accounting gaps judge
24+
/// only an outcome the runner reported in a valid `result.json`: outer
25+
/// supervision (a timeout, a runner that could not start) and broken runner
26+
/// protocol keep their `failed` classification.
2327
pub(super) fn collect(
2428
recorder: &mut Recorder,
2529
runner: &arms::Runner,
2630
traffic: &crate::proxy::Accounting,
2731
output: &mut Output,
32+
reported: bool,
2833
signal: &Path,
2934
) -> Result<()> {
3035
match recorder.collect() {
@@ -38,7 +43,7 @@ pub(super) fn collect(
3843
output.outcome = Outcome::Void;
3944
output.void_cause = Some(VoidCause::WebSearch);
4045
output.cause = Some("Session transcript contains a web-search tool call".into());
41-
} else if output.outcome != Outcome::Void {
46+
} else if reported && output.outcome != Outcome::Void {
4247
let sessions = recorder.sessions + imported.sessions;
4348
let harness_sessions = recorder.sessions + imported.harness_sessions;
4449
let crossed: Vec<_> = traffic
@@ -72,7 +77,7 @@ pub(super) fn collect(
7277
}
7378
}
7479
}
75-
Err(error) if output.outcome != Outcome::Void => {
80+
Err(error) if reported && output.outcome != Outcome::Void => {
7681
output.outcome = Outcome::Void;
7782
output.void_cause = Some(VoidCause::AccountingGap);
7883
output.cause = Some(format!(
@@ -106,13 +111,13 @@ pub(super) fn web_search(attempt: &Path) -> Result<bool> {
106111
// Decode through Value, as the other trace readers do:
107112
// arbitrary_precision numbers otherwise pass through
108113
// serde's tagged-enum buffer as maps rather than f64.
109-
let events =
114+
// Skip events this build cannot decode: a native Arm's
115+
// traces come from its own, possibly newer, build.
116+
let events: Vec<crate::harness::interpretation::event::Event> =
110117
serde_json::from_str::<Vec<serde_json::Value>>(&events)?
111118
.into_iter()
112-
.map(serde_json::from_value)
113-
.collect::<serde_json::Result<
114-
Vec<crate::harness::interpretation::event::Event>,
115-
>>()?;
119+
.filter_map(|event| serde_json::from_value(event).ok())
120+
.collect();
116121
if sessions::web_search(&events) {
117122
return Ok(true);
118123
}
@@ -238,7 +243,8 @@ struct ResultDocument {
238243

239244
/// Runner mistakes fail one Trial. Outer supervision classifies its own
240245
/// evidence before this function, and may override it after collection.
241-
pub(super) fn result(process: &ProcessOutput, attempt: &Path, elapsed: u128) -> Output {
246+
/// Also returns whether the outcome is the runner's own valid report.
247+
pub(super) fn result(process: &ProcessOutput, attempt: &Path, elapsed: u128) -> (Output, bool) {
242248
let result = (|| -> Result<Output> {
243249
let document: ResultDocument = serde_json::from_slice(
244250
&fs::read(attempt.join("output/result.json"))
@@ -286,9 +292,13 @@ pub(super) fn result(process: &ProcessOutput, attempt: &Path, elapsed: u128) ->
286292
}
287293
Ok(output)
288294
})();
289-
result.unwrap_or_else(|error| {
290-
Output::failed(elapsed, &diagnostic(process, &format!("{error:#}")))
291-
})
295+
match result {
296+
Ok(output) => (output, true),
297+
Err(error) => (
298+
Output::failed(elapsed, &diagnostic(process, &format!("{error:#}"))),
299+
false,
300+
),
301+
}
292302
}
293303

294304
fn diagnostic(process: &ProcessOutput, cause: &str) -> String {

‎src/evals/experiment/execution/custom/tests.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ fn timed_out_runner_after_provider_traffic_stays_failed() {
7373
&runner,
7474
&traffic,
7575
&mut output,
76+
false,
7677
&root.path().join("signal"),
7778
)
7879
.unwrap();
@@ -96,6 +97,7 @@ fn undeclared_runner_sending_provider_traffic_without_sessions_is_an_accounting_
9697
&runner,
9798
&traffic,
9899
&mut output,
100+
true,
99101
&root.path().join("signal"),
100102
)
101103
.unwrap();
@@ -122,6 +124,7 @@ fn harness_run_across_the_proxy_without_a_harness_session_is_an_accounting_gap()
122124
&runner,
123125
&traffic,
124126
&mut output,
127+
true,
125128
&root.path().join("signal"),
126129
)
127130
.unwrap();

0 commit comments

Comments
 (0)