persona drain tests: a refused put is stamped once and told at her next real turn, once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-28 07:21:02 +01:00
commit a0520d7daf

View file

@ -396,9 +396,19 @@ fn t_l2_second_stale_put_is_put_refused_in_the_record() {
assert_eq!(rig.log().iter().filter(|event| *event == "put").count(), 2, "never a third put");
let rows = rig.trace.rows.borrow();
assert_eq!(rows.len(), 1, "the record is appended though the put was refused");
assert!(rows[0].1["put_refused"].is_string(), "{:?}", rows[0].1);
assert!(rows[0].1["put_refused"].is_string() && rows[0].1["put_refused_at"].is_string(), "the refusal is stamped once, when it was made: {:?}", rows[0].1);
assert_eq!(rig.log().iter().position(|event| event == "trace"), Some(0), "the record comes before the puts: {:?}", rig.log());
assert!(rig.store.puts.borrow().is_empty(), "nothing of hers landed");
drop(rows);
// Told at her next real turn, once, though a failed wake and a later turn in another room come after the record.
let telling = Rc::new(RefCell::new(Vec::new()));
rig.mouth.held.borrow_mut().push(line(2, &room(1), META, "again"));
rig.run(Spy { inner: scripted(false), prompts: telling.clone() });
assert!(telling.borrow().iter().any(|prompt| prompt.contains("was not kept")), "told at her next real turn: {:?}", telling.borrow());
let again = Rc::new(RefCell::new(Vec::new()));
rig.mouth.held.borrow_mut().push(line(3, &room(1), META, "and again"));
rig.run(Spy { inner: scripted(false), prompts: again.clone() });
assert!(!again.borrow().iter().any(|prompt| prompt.contains("was not kept")), "told once: {:?}", again.borrow());
}
#[test]