Tests: react runs the room in one call; the narrator is handed the player's turn and no cost or permission menu
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d2c91cac36
commit
b0c3a699aa
2 changed files with 45 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue