From fca3ec1a3a831f8b4ec4ce6e6b2e88422cb9247c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 17 Oct 2026 12:58:54 +0200 Subject: [PATCH] controllers tests: fresh narrative selects with a moved digest read ScopeMoved Co-Authored-By: Claude Sonnet 5.5 --- crates/ghostlight/src/controllers.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/crates/ghostlight/src/controllers.rs b/crates/ghostlight/src/controllers.rs index de84678..9e8f538 100644 --- a/crates/ghostlight/src/controllers.rs +++ b/crates/ghostlight/src/controllers.rs @@ -8449,12 +8449,7 @@ mod tests { .turn(CommandId::new(), &stale_opportunity) .await .unwrap_err(); - assert!(matches!( - error, - ControllerError::NoOpportunity { - expected: ControllerMode::NarrativePersona - } - )); + assert!(matches!(error, ControllerError::ScopeMoved), "{error:?}"); assert!( capturing.prepared.lock().unwrap().is_empty(), "a stale scope digest reached inference" @@ -11370,14 +11365,13 @@ mod tests { let refreshed = after.opportunities[0].clone(); assert_ne!(refreshed, opportunity); assert_eq!(refreshed.scope_digest, opportunity.scope_digest); - // A digest the world does not derive selects nothing. + // A digest the world does not derive selects nothing: the scope is + // still offered, at a digest this caller did not see. let mut forged = opportunity.clone(); forged.scope_digest = ScopeDigest::fixture("sha256:not-this-scope"); assert!(matches!( runner.run_narrative(CommandId::new(), &forged).await, - Err(ControllerError::NoOpportunity { - expected: ControllerMode::NarrativePersona - }) + Err(ControllerError::ScopeMoved) )); let NarrativeRun::Completed(resumed) = runner.run_narrative(command_id, &refreshed).await.unwrap()