From 98e30de3fbf69edc83f9ca5edbf058f560bb5671 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 31 Oct 2026 09:19:37 +0100 Subject: [PATCH] tests: the surface carries the reply's vote key; a withdrawn vote is read on a later beat; an urgency in her turn's second is consumed Co-Authored-By: Claude Sonnet 5.5 --- crates/mind-body/src/heartbeat/tests.rs | 12 ++++++++++++ crates/mind-body/tests/public_surface.txt | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/mind-body/src/heartbeat/tests.rs b/crates/mind-body/src/heartbeat/tests.rs index 0df4956..ab3c5b1 100644 --- a/crates/mind-body/src/heartbeat/tests.rs +++ b/crates/mind-body/src/heartbeat/tests.rs @@ -677,8 +677,20 @@ fn a_null_vote_withdraws_the_standing_one_and_an_urgency_only_pulse_leaves_it() urgency_permille: None, note: "test".into(), })]); + rig.advance(5000); rig.poll(); let withdrawn = rig.store.traces.borrow().last().cloned().unwrap(); assert_eq!(withdrawn.instances[ANN].vote_beat_s, None, "an explicit null withdraws it"); assert_eq!(withdrawn.tempo_s, 900, "she counts as silent again"); } + +#[test] +fn an_urgency_declared_in_the_second_of_her_turn_is_already_consumed() { + let rig = Rig::new(); + rig.turn(ANN, 3000); + rig.turn(BOB, 3000); + rig.pulse(ANN, 3000, None, Some(900)); + rig.poll(); + let trace = rig.store.traces.borrow().last().cloned().unwrap(); + assert_eq!(trace.instances[ANN].urgency_permille, 0, "a declaration is pending only when admitted after her turn"); +} diff --git a/crates/mind-body/tests/public_surface.txt b/crates/mind-body/tests/public_surface.txt index 3eb6cff..056dbd2 100644 --- a/crates/mind-body/tests/public_surface.txt +++ b/crates/mind-body/tests/public_surface.txt @@ -185,7 +185,7 @@ mind_body::persona: struct Config # [derive (Clone , Debug , PartialEq , Eq)] pu mind_body::persona: struct FileTrace pub-fields[] mind_body::persona: struct HuginnPersona pub-fields[] mind_body::persona: struct Organs< 'a > pub-fields[mind: & 'a dyn MindPort, launcher: & 'a dyn Launcher, clock: & 'a dyn Clock, host: & 'a str, chat: & 'a dyn Chat, connector: & 'a dyn Connector, persona: & 'a dyn PersonaState, trace: & 'a dyn Trace, tempo: Option < & 'a dyn TempoView >] -mind_body::persona: struct PersonaReply # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[say: Vec < Say >, start_self_run: Option < StartSelfRun >, tempo_vote_beat_s: Option < u32 >, urgency_permille: Option < u16 >] +mind_body::persona: struct PersonaReply # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[say: Vec < Say >, start_self_run: Option < StartSelfRun >, tempo_vote_beat_s: Option < Option < u32 > >, urgency_permille: Option < u16 >] mind_body::persona: struct Say # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[room: String, text: String] mind_body::persona: struct StartSelfRun # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[brief: String, repo: String, campaign: String] mind_body::persona: struct TraceItem # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[provenance: String, room: String, text: String]