Tests follow PersonaStatus: the MCP whoami answers in it, a receipt-less planted row is not a door read

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-10 08:53:05 +02:00
commit c5af029d20
2 changed files with 5 additions and 3 deletions

View file

@ -270,7 +270,7 @@ fn the_persona_tools_round_trip_against_a_live_daemon() {
assert!(!error);
assert_eq!(nothing, Value::Null);
let (_, whoami) = mcp.call("whoami", json!({}));
assert_eq!(whoami["status"]["persona"], Value::Null);
assert_eq!(whoami["status"]["persona"], json!("Absent"));
let (error, committed) = mcp.call("persona_put", put(persona(INSTANCE, T1), None));
assert!(!error);
@ -281,7 +281,7 @@ fn the_persona_tools_round_trip_against_a_live_daemon() {
assert_eq!(view["value"], persona(INSTANCE, T1));
assert_eq!((view["updated_at"].as_str(), view["receipt_id"].as_str()), (Some(T1), Some(receipt.as_str())));
let (_, whoami) = mcp.call("whoami", json!({}));
assert_eq!(whoami["status"]["persona"], json!(T1));
assert_eq!(whoami["status"]["persona"], json!({ "Stored": { "updated_at": T1 } }));
let (error, stale) = mcp.call("persona_put", put(persona(INSTANCE, T2), None));
assert!(!error, "a stale put is an answer");

View file

@ -559,7 +559,9 @@ mod tests {
store.plant(row);
let mind = Mind::open_with(store, &yggdrasil).unwrap();
assert_eq!(persona_in_status(&mind), status);
assert_eq!(mind.persona().is_err(), status == crate::wire::PersonaStatus::Unreadable);
if status == crate::wire::PersonaStatus::Unreadable {
assert!(matches!(mind.persona(), Err(MindRefusal::Unavailable { .. })), "the door answers what the status says");
}
}
assert_eq!(persona_in_status(&seeded_over(&MemoryStore::new())), crate::wire::PersonaStatus::Absent);
}