From 1b1ad4730b216a67cf070e5707d19a4122696e75 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 2 Dec 2026 15:14:27 +0100 Subject: [PATCH] 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 --- crates/mind-body/src/projection/commit/tests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/mind-body/src/projection/commit/tests.rs b/crates/mind-body/src/projection/commit/tests.rs index 1f72915..edad085 100644 --- a/crates/mind-body/src/projection/commit/tests.rs +++ b/crates/mind-body/src/projection/commit/tests.rs @@ -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::>(); + 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" }] } }));