From 2f6cc5241246e31590a59e4c0e22333fef37805a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 3 Dec 2026 00:14:11 +0100 Subject: [PATCH] Tests: an abandoned row cut short of the repair limit is not a valid ending Co-Authored-By: Claude Sonnet 5.5 --- crates/ghostlight/src/controllers.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/ghostlight/src/controllers.rs b/crates/ghostlight/src/controllers.rs index a5d5ce1..577ff70 100644 --- a/crates/ghostlight/src/controllers.rs +++ b/crates/ghostlight/src/controllers.rs @@ -14490,6 +14490,11 @@ mod tests { }; assert_eq!(refusals.len(), crate::elaboration::MAX_REFUSALS + 1); assert!(row.integrity_is_valid()); + let mut cut = row.clone(); + if let SeedCheckpoint::NoPatch { refusals, .. } = &mut cut { + refusals.remove(0); + } + assert!(!cut.integrity_is_valid(), "a seed session cut short of its limit read as ended"); drop(stored); assert_eq!(runner.step().await.unwrap(), SeedOutcome::NoPatch); assert_eq!(script.seen.lock().unwrap().len(), seen, "an abandoned seed session ran inference again"); @@ -14543,6 +14548,10 @@ mod tests { refusals.pop(); })); assert!(!tamper(&|refusals| refusals.last_mut().unwrap().after_round = 1)); + // At exactly the repair limit the session was still repairable. + assert!(!tamper(&|refusals| { + refusals.remove(0); + })); let calls = port.calls(); let after = runner.sweep(pool(1), 1).await.unwrap(); assert_eq!((after.claimed, after.started), (0, 0), "{after:?}");