Persona K64: pin the view's guard, no "not read it yet" beside a found read of the same target in the conversation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-22 18:57:48 +01:00
commit 6d1eadc489

View file

@ -3548,3 +3548,20 @@ fn k64_an_unread_target_stays_a_read_need() {
assert!(x5_r6_view(&state).contains("It needs her to read https://ccrma.stanford.edu/~jos/pasp/, and she has not read it yet."), "{read:?}");
}
}
/// A read need with no receipt never reads as unread beside a read of the same target that this conversation found (K64):
/// an entry opened before K64, or put from outside, shows the read and when.
#[test]
fn k64_the_view_never_says_unread_beside_a_read_of_the_same_target() {
let mut state = libby(&json!([]));
state["commitments"] = json!([{ "id": "c-r1-t5-1", "to": DERU, "room": MINDS, "event": "5", "madeAt": (now() - chrono::Duration::minutes(40)).to_rfc3339(), "words": "I'll read it and come back to you.", "status": "open", "needs": { "kind": "read", "request": { "kind": "web", "target": PASP } }, "closedAt": null, "closedBy": null, "extensions": {} }]);
let room = Room { messages: vec![RoomLine { event: "$x5-1".into(), ..line(MINDS, DERU, "Deru", X5_DERU_R5, true) }], here: Some(MINDS.into()), ..Room::default() };
let view = |found: bool| {
let exchange = crate::projection::exchange::Exchange { tried: vec![crate::projection::exchange::Tried { key: ReadRequest::Web(PASP.into()).normal(), found, what: PASP.into(), at: now() - chrono::Duration::minutes(30) }], ..Default::default() };
let (minds, operators) = (vec![LIBBY.to_owned(), DERU.to_owned()], vec![META.to_owned()]);
select(&Inputs { kind: TurnKind::Chat, state: &state, room: &room, history: &History::default(), observation: None, people: People { operators: &operators, minds: &minds, own_sender: LIBBY }, now: now(), seed: 1, affordances: &[Affordance::Perceive, Affordance::Speak], domain: None, exchange: Some(&exchange) }, &Tuning::default()).in_view
};
let found = view(true);
assert!(found.contains("It needs her to read https://ccrma.stanford.edu/~jos/pasp/: she read it about half an hour ago.") && !found.contains("not read it yet"), "{found}");
assert!(view(false).contains("and she has not read it yet."), "a read that found nothing is no read of it");
}