From f1f8fa74c427212a537e2604426486f91bc9205e Mon Sep 17 00:00:00 2001 From: scotares Date: Sun, 29 Nov 2026 01:12:51 +0800 Subject: [PATCH 1/2] test(xtask): state each arm's requests when the candidate-text flow fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The flow asserts that the current arm's requests carry the summarizer prompt; when that failed on a loaded macOS runner the message said only which assertion tripped, not whether compaction ran at all — a current arm with no summarizer request and a current arm whose prompt went missing are different failures (#2308). The failure now lists each run's record and, per arm, every request with its size and whether it carried the product or candidate text, so the next occurrence answers the question from its own message. Twenty sequential runs and twenty runs at four-way concurrency pass locally, so the trigger is still unproven; this change is the evidence the next occurrence needs, not a fix. --- xtask/src/scenario_eval.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/xtask/src/scenario_eval.rs b/xtask/src/scenario_eval.rs index 43a358479..6e575416e 100644 --- a/xtask/src/scenario_eval.rs +++ b/xtask/src/scenario_eval.rs @@ -16837,11 +16837,29 @@ mod tests { } let current = fixture.arm("current"); let candidate = fixture.arm("candidate"); + // A current arm without a summarizer request means compaction did not + // run, not that the product prompt went missing; the failure states + // which requests each arm recorded. + let mut diagnosis = String::new(); + for record in &records { + diagnosis.push_str(&format!("\nrecord {record}")); + } + for (arm, requests) in [("current", ¤t), ("candidate", &candidate)] { + diagnosis.push_str(&format!("\n{arm}: {} requests", requests.len())); + for request in requests.iter() { + diagnosis.push_str(&format!( + "\n summarizer={} candidate={} bytes={}", + request.contains("You summarize a coding session"), + request.contains("CANDIDATE SUMMARY PROMPT"), + request.len() + )); + } + } assert!( current .iter() .any(|request| request.contains("You summarize a coding session")), - "the current arm's summarizer request carries the product prompt" + "the current arm's summarizer request carries the product prompt: {diagnosis}" ); assert!( current @@ -16853,7 +16871,7 @@ mod tests { candidate .iter() .any(|request| request.contains("CANDIDATE SUMMARY PROMPT")), - "the candidate arm's summarizer request carries the candidate text" + "the candidate arm's summarizer request carries the candidate text: {diagnosis}" ); assert!( candidate From eb7e568e6146106761b8978cc9194a1ab4dd36fc Mon Sep 17 00:00:00 2001 From: scotares Date: Sun, 29 Nov 2026 09:29:05 +0800 Subject: [PATCH 2/2] test(xtask): name each arm's compaction outcome in the failing flow The request markers used the same phrase the assertion looks for, so a prompt that lost its text read exactly like a run that never compacted (#2308 review). Each arm's line now also states the export's `context/compaction` statuses and strategies and its `context/budget` estimates, which say whether compaction ran at all; the markers stay, and no prompt or event body is printed. The assertion and its parameters are unchanged. --- xtask/src/scenario_eval.rs | 39 +++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/xtask/src/scenario_eval.rs b/xtask/src/scenario_eval.rs index 6e575416e..f9d3eed41 100644 --- a/xtask/src/scenario_eval.rs +++ b/xtask/src/scenario_eval.rs @@ -16760,6 +16760,39 @@ mod tests { path } + /// What a run's export says about its own compaction and input estimate: + /// the fact the request markers cannot tell apart from a lost prompt. + fn compaction_evidence(out: &Path, arm: &str) -> String { + let path = out + .join("outputs") + .join(arm) + .join("case") + .join("run-0.timeline.jsonl"); + let (mut statuses, mut estimates) = (Vec::new(), Vec::new()); + if let Ok(export) = std::fs::read_to_string(&path) { + for line in export.lines() { + let Ok(value) = serde_json::from_str::(line) else { + continue; + }; + let event = &value["event"]; + match (event["type"].as_str(), event["name"].as_str()) { + (Some("context"), Some("compaction")) => statuses.push(format!( + "{} {}", + event["data"]["status"].as_str().unwrap_or("-"), + event["data"]["strategy"].as_str().unwrap_or("-") + )), + (Some("context"), Some("budget")) => estimates.push( + event["data"]["estimatedInputTokens"] + .as_f64() + .unwrap_or_default(), + ), + _ => {} + } + } + } + format!("compactions={statuses:?} estimates={estimates:?}") + } + /// Both arms run the shipped assembly on the same scenario, and the /// candidate text reaches the candidate arm's summarizer request and only /// that arm's. The judge is the wide one: the run's message makes its view @@ -16845,7 +16878,11 @@ mod tests { diagnosis.push_str(&format!("\nrecord {record}")); } for (arm, requests) in [("current", ¤t), ("candidate", &candidate)] { - diagnosis.push_str(&format!("\n{arm}: {} requests", requests.len())); + diagnosis.push_str(&format!( + "\n{arm}: {} requests {}", + requests.len(), + compaction_evidence(&options.out, arm) + )); for request in requests.iter() { diagnosis.push_str(&format!( "\n summarizer={} candidate={} bytes={}",