memoryd: sync begins when Honcho is turned on, and conclusions are matched by peer

Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
2026-09-28 13:40:48 -07:00
co-authored by ornith-1.5-35b-a3b
parent fb2afa1979
commit 5f4e0d9997
25 changed files with 720 additions and 80 deletions
+8 -7
View File
@@ -1,6 +1,7 @@
//! Where a finished turn goes in Honcho (M5c spec, sections 4 and 5): the trusted or untrusted
//! workspace, or nowhere and why, from `brokerd`'s answer and the session's log; the order of the
//! checks; and the helpers that find a turn in the log. Do not edit.
//! checks; and the helpers that find a turn in the log. With no time sync began (`None`); that
//! check is in `honcho_decide_began.rs`. Do not edit.
use bxcore::sanitize::TAGS;
use bxcore::{
@@ -134,7 +135,7 @@ fn skip(why: &str) -> Action {
/// `decide` for the last turn of `records`.
fn last(state: &SessionStateReply, records: &[LogRecord]) -> Action {
decide(state, records, turns(records), AGENT).unwrap()
decide(state, records, turns(records), AGENT, None).unwrap()
}
/// `n` characters of `A1b2`…, which the secret rules take for a key's run.
@@ -192,14 +193,14 @@ fn a_turn_not_in_the_log_is_an_error() {
turn("two", Some("kyle"), "b"),
]);
for n in [0, 3, u64::MAX] {
let err = decide(&clean(), &records, n, AGENT).unwrap_err();
let err = decide(&clean(), &records, n, AGENT, None).unwrap_err();
assert_eq!(err, NoSuchTurn { turn: n, turns: 2 });
}
assert_eq!(
NoSuchTurn { turn: 3, turns: 2 }.to_string(),
"turn 3 is not in the session's log, which has 2 turns"
);
let err = decide(&clean(), &[], 1, AGENT).unwrap_err();
let err = decide(&clean(), &[], 1, AGENT, None).unwrap_err();
assert_eq!(err, NoSuchTurn { turn: 1, turns: 0 });
}
@@ -251,11 +252,11 @@ fn a_label_after_the_turn_does_not_count() {
turn_with_tool(Some("kyle"), true),
]);
assert_eq!(
decide(&clean(), &records, 1, AGENT).unwrap(),
decide(&clean(), &records, 1, AGENT, None).unwrap(),
to(Workspace::Trusted, "kyle")
);
assert_eq!(
decide(&clean(), &records, 2, AGENT).unwrap(),
decide(&clean(), &records, 2, AGENT, None).unwrap(),
to(Workspace::Untrusted, "kyle")
);
}
@@ -305,7 +306,7 @@ fn a_speaker_with_the_agents_name_goes_nowhere() {
assert_eq!(last(&clean(), &records), skip(AGENT_SPEAKER));
let records = log(&[turn("hello", Some("box.maker"), "hi")]);
assert_eq!(
decide(&clean(), &records, 1, "box_maker").unwrap(),
decide(&clean(), &records, 1, "box_maker", None).unwrap(),
skip(AGENT_SPEAKER)
);
let records = log(&[turn("hello", Some("Boxmaker0"), "hi")]);