diff --git a/crates/ghostlight-dungeon/src/play.rs b/crates/ghostlight-dungeon/src/play.rs index 19c6d2b..e30c412 100644 --- a/crates/ghostlight-dungeon/src/play.rs +++ b/crates/ghostlight-dungeon/src/play.rs @@ -6374,6 +6374,50 @@ pub(crate) mod tests { assert!(dispatch_result.contains("Mara nods once."), "{dispatch_result}"); } + /// The Gestalt round is one inference for the room: `react` runs the named + /// person from one reply (no Projector stage), and the prose under their + /// header reaches the agent as a draft it must commit. + #[tokio::test] + async fn react_runs_the_room_in_one_call() { + let fixture = play_world(Some("Mara"), "player-react-one-call").await; + let snapshot = fixture.world.snapshot().await.unwrap(); + let mara_id = subject_id_text(&snapshot, persona_id(&snapshot)); + let round = output( + "r0", + vec![ + call_event("c0", REACT_TOOL, serde_json::json!({"subjects": [mara_id]})), + call_event("c1", END_TURN_TOOL, serde_json::json!({})), + ], + ); + let personas = PersonaLane::new( + ControllerPort::new(fixture.world.clone()), + ScriptedPort::new(vec![ + output("gestalt", vec![text_event("=== Mara ===\nMara tightens her grip on the ledger.")]), + output("proj-narrate", vec![text_event("Quiet.")]), + ]), + "gpt-5.6-sol".into(), + "gpt-5.6-sol".into(), + ) + .unwrap(); + let directory = tempfile::tempdir().unwrap(); + let table = PlayTable::new( + fixture.world.clone(), + personas, + ScriptedPort::new(vec![round]), + "gpt-5.6-terra".into(), + Arc::new(Semaphore::new(2)), + directory.path().join("play-turn-v1.cc"), + ) + .unwrap(); + table.run(&fixture.principal, test_turn_id(72), "Who's there?".into()).await.unwrap(); + let stored = table.store.lock().await; + let turn = stored.current().unwrap(); + let result = turn.calls.iter().find(|call| call.round == 0 && call.slot == 0).and_then(|call| call.result.clone()).unwrap(); + assert!(result.contains("Mara tightens her grip on the ledger."), "{result}"); + assert!(!result.contains("==="), "the header is framing, not prose: {result}"); + assert_eq!(turn.persona_turns.len(), 1); + } + /// PA.f124: `execute_dispatch`'s own summaries print a subject through /// the library's `id_text` — the same printer `table_view` and /// `dispatch`'s own matching use — never `{subject:?}`'s raw diff --git a/crates/ghostlight/src/controllers.rs b/crates/ghostlight/src/controllers.rs index 6c5f66e..edabb7a 100644 --- a/crates/ghostlight/src/controllers.rs +++ b/crates/ghostlight/src/controllers.rs @@ -9358,6 +9358,7 @@ mod tests { projector_text.contains(heard.as_str()), "the Human's own heard line is missing from its own slice" ); +assert!(projector_text.contains("I ask about the hinge."), "the player's own turn is given to the storyteller"); assert!(!projector_text.contains("\"cost\"") && !projector_text.contains("\"permission\""), "no cost or permission menu is handed over"); for absent in [secret.as_str(), "The Vault Ledger"] { assert!( !projector_text.contains(absent),