queue, heartbeat tests: a question in another item's run is no boundary; no held brief, no held note

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-01 02:55:43 +01:00
commit 9faeb94035
2 changed files with 18 additions and 0 deletions

View file

@ -1091,3 +1091,12 @@ fn a_trip_and_a_wait_say_so_in_the_trace() {
beats_until(&rig, 12, || notes().contains(&waiting));
assert!(notes().contains(&waiting), "{:?}", notes());
}
#[test]
fn a_beat_with_no_held_brief_writes_no_held_note() {
let (rig, source) = rig_with_a_persona_turn();
brief_by(&rig, ANN, crate::persona::AGENT, "free", &source);
rig.poll();
let notes: Vec<String> = rig.store.traces.borrow().iter().flat_map(|trace| trace.instances.iter().map(|instance| instance.note.clone())).collect();
assert!(notes.iter().all(|note| !note.contains("held")), "{notes:?}");
}

View file

@ -604,6 +604,15 @@ mod tests {
}
}
#[test]
fn a_question_in_a_run_that_did_not_claim_the_item_is_no_boundary() {
let (mind, item) = worked(&[E, E, E]);
mind.committed(vec![spec("y")]);
mind.committed(vec![run("other", RunTurn::SelfRun, RunOperator::Mind, &[spec_ref("y")])]);
mind.committed(vec![question_in("fork", &run_ref("other"))]);
assert_eq!(breaker(&mind, &item, &[]).unwrap(), Breaker::Trip { run: run_ref("h2") }, "the question holds y's run, not x's count");
}
/// A daemon that is not there: the failure names no input, endpoint or
/// instance.
#[test]