memoryd: the Honcho worker sends conclusions, their deletions and fleet notes

Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
2026-09-28 13:11:51 -07:00
co-authored by ornith-1.5-35b-a3b
parent 4ebfc36c1a
commit fb05b26462
9 changed files with 790 additions and 121 deletions
+9 -7
View File
@@ -1,9 +1,9 @@
//! The Honcho worker's other duties (M5c spec, section 5): with nothing to send it decides what
//! `brokerd` could not answer for; after a restart nothing is sent again, and a session with a
//! decided turn waits again (a session without one does not); a running turn is never decided;
//! actions of later tasks wait; a ledger that cannot be written stops it; no log line holds a
//! turn's text. Then `memoryd` itself: a reported turn reaches Honcho, woken at once, and a key
//! that cannot be read stops the start. Do not edit.
//! a retraction waits (nothing decides one); a ledger that cannot be written stops it; no log
//! line holds a turn's text. Then `memoryd` itself: a reported turn reaches Honcho, woken at
//! once, and a key that cannot be read stops the start. Do not edit.
#[path = "support/brokerd.rs"]
mod brokerd;
@@ -150,15 +150,17 @@ fn a_restart_never_decides_a_running_turn() {
}
#[test]
fn actions_of_later_tasks_wait() {
fn a_retraction_waits() {
// Nothing decides a retraction any more (M5c spec, section 4, 2026-09-28): one in the
// ledger is neither sent nor failed.
let fake = FakeHoncho::start();
let mut home = Home::new("worker-later");
let conclude = r#"{"type":"decided","time":"2026-09-28T10:00:00.000Z","item":{"type":"edit","id":"2026-09-28-0001","part":0},"action":{"type":"conclude","workspace":"trusted","peer":"kyle","session":"mm-a","text":"a fact"}}"#;
std::fs::write(home.ledger_path(), format!("{conclude}\n")).unwrap();
let retract = r#"{"type":"decided","time":"2026-09-28T10:00:00.000Z","item":{"type":"edit","id":"2026-09-28-0001","part":0},"action":{"type":"retract","session":"mm-a","text":"a note"}}"#;
std::fs::write(home.ledger_path(), format!("{retract}\n")).unwrap();
home.restart();
let mut w = home.worker(&fake, FAST);
assert_eq!(w.step(), Step::Idle);
assert_eq!(home.records().len(), 1, "the conclusion was failed or sent");
assert_eq!(home.records().len(), 1, "the retraction was failed or sent");
assert!(fake.requests().is_empty());
}