diff --git a/crates/mind-body/src/persona/drain_tests.rs b/crates/mind-body/src/persona/drain_tests.rs index d0c3612..8b69e8c 100644 --- a/crates/mind-body/src/persona/drain_tests.rs +++ b/crates/mind-body/src/persona/drain_tests.rs @@ -1050,7 +1050,7 @@ fn t_w1_a_one_turn_wake_writes_one_turn_row() { assert_eq!((records.len(), records[0]["held"].clone(), records[0].get("acted")), (1, json!([]), None), "the wake record holds no line a turn held"); let calls: Vec = rig.all_records().iter().filter(|row| row["agent"] == "call").map(|row| row["call"].as_str().unwrap().to_owned()).collect(); assert_eq!(calls, [format!("{wake}-t1-m1"), format!("{wake}-t1-m2")], "a request id names the wake, the turn and the call"); - assert!(rig.all_records().iter().filter(|row| row.get("agent").is_some()).all(|row| row["wake"] == format!("{wake}-t1")), "her agent's rows say which turn they belong to"); + assert!(rig.all_records().iter().filter(|row| matches!(row["agent"].as_str(), Some("call" | "settle" | "receipt"))).all(|row| row["wake"] == format!("{wake}-t1")), "her agent's calls and receipts say which turn they belong to"); } /// W1-I2 and the kill: a start that dies after its agent's turn and before its wake record has decided the lines it answered, and @@ -1070,8 +1070,10 @@ fn t_w1_a_start_killed_after_its_turn_has_decided_and_acked_its_lines_and_is_tol rig.mouth.held.borrow_mut().push(line(2, &room(1), META, "still there?")); let second = Tally::default(); rig.run(second.clone()); - let input = format!("{:?}", rig.agent.seen.borrow().last().unwrap()); + let seen = rig.agent.seen.borrow(); + let Some(InputItem::UserText { text: input }) = seen.last().and_then(|items| items.last()) else { panic!("her agent was given a user text") }; assert!(input.contains("still there?") && !input.contains("morning, are you there"), "the first line was not answered again: {input}"); + drop(seen); let persona = second.0.borrow().iter().find(|prompt| !prompt.starts_with("You are a private Projector.") && !prompt.starts_with(INTERPRETER)).cloned().unwrap(); assert!(persona.contains("QUIETLINE") && persona.contains("did not go out"), "the turn's receipt is told at her next wake: {persona}"); } diff --git a/crates/mind-body/src/projection/simulate.rs b/crates/mind-body/src/projection/simulate.rs index bc61c2d..76df5d7 100644 --- a/crates/mind-body/src/projection/simulate.rs +++ b/crates/mind-body/src/projection/simulate.rs @@ -528,7 +528,7 @@ fn run(harness: &Harness, plan: &SimFile, members: &[Member], repeat: usize) -> let (how, by) = why.map_or((None, vec![]), |why| (why.how, why.by)); let mut turn = json!({ "round": round, "persona": member.entry.name, "id": id, "woke": cause, "how": how, "addressed_by": by, "kind": kind, "room": here, "outcome": outcome, "failed": failed, "said": line, "report": waked.report }); let seq = records[at].len(); - records[at].push(json!({ "key": key, "seq": seq, "room": here, "held": [], "narration": waked.narration, "prose": waked.prose, "usage": waked.usage, "selected": waked.report["renders"][0]["selected"], "status": if failed.is_none() { "completed" } else { "failed" }, "failed": failed, "at": now.to_rfc3339() })); + records[at].push(json!({ "key": key, "seq": seq, "room": here, "rooms": [here], "held": [], "narration": waked.narration, "prose": waked.prose, "usage": waked.usage, "selected": waked.report["renders"][0]["selected"], "status": if failed.is_none() { "completed" } else { "failed" }, "failed": failed, "at": now.to_rfc3339() })); // The Interpreter, as the drain takes it after a completed wake: the same call and put (`interpret_and_put`) against her // in-run copy, its receipt a row of her trace that her next wake is told from (`outcome::told`). if failed.is_none()