interpreter sees acts: the swap test tells old from fresh by status (wakes in the test share a key)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-12-02 15:14:27 +01:00
commit 1b1ad4730b

View file

@ -381,9 +381,9 @@ fn a_drop_frees_its_words_and_a_ready_re_add_readies_the_open_intention() {
let old = intentions(&first).last().unwrap().clone();
let (swapped, applied) = run(&first, json!({ "intend": { "drop": [old["id"]], "add": [{ "summary": words, "expires_in_hours": 24 }] } }));
let after = intentions(&swapped);
let (retired, fresh) = (after.iter().find(|action| action["id"] == old["id"]).unwrap(), after.last().unwrap());
assert_eq!((retired["status"].as_str(), fresh["status"].as_str(), fresh["summary"].as_str(), reasons(&applied)), (Some("retired"), Some("active"), Some(words), vec![]));
assert_ne!(fresh["id"], old["id"]);
// (Both wakes here share one key, so the fresh intention's id repeats the old one's: told apart by status.)
let states = after.iter().filter(|action| action["summary"] == words).map(|action| action["status"].as_str().unwrap().to_owned()).collect::<Vec<_>>();
assert_eq!((states, reasons(&applied)), (vec!["retired".to_owned(), "active".to_owned()], vec![]));
assert_eq!(old["readiness"], "waiting");
let (readied, applied) = run(&first, json!({ "intend": { "add": [{ "summary": words.to_uppercase(), "expires_in_hours": 24, "readiness": "ready" }] } }));