From e13824cabcf461e35bc8d8bc2312c9c9b1cc8915 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 1 Dec 2026 16:27:11 +0100 Subject: [PATCH] persona: the simulator's report says why an Interpreter step kept nothing Co-Authored-By: Claude Sonnet 5.5 --- crates/mind-body/src/projection/simulate.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/mind-body/src/projection/simulate.rs b/crates/mind-body/src/projection/simulate.rs index 54ee1c0..e389568 100644 --- a/crates/mind-body/src/projection/simulate.rs +++ b/crates/mind-body/src/projection/simulate.rs @@ -213,7 +213,7 @@ fn done(row: &Value, after: &Value) -> Value { let intentions: Vec = changes().filter(|change| change["family"] == "intend").map(|change| json!({ "change": change["change"], "id": change["id"], "words": words(change["id"].as_str().unwrap_or_default()) })).collect(); let identity: Vec<&Value> = changes().filter(|change| change["family"] == "self" && change["change"] == "identity").map(|change| &change["id"]).collect(); let refused: Vec = row["refused"].as_array().into_iter().flatten().map(|refusal| format!("{}: {}", refusal["family"].as_str().unwrap_or_default(), refusal["reason"].as_str().map_or_else(|| refusal["reason"].to_string(), str::to_owned))).collect(); - json!({ "status": row["status"], "deltas": deltas, "intentions": intentions, "identity": identity, "refused": refused }) + json!({ "status": row["status"], "error": row["error"], "deltas": deltas, "intentions": intentions, "identity": identity, "refused": refused }) } fn speaker(line: &Line, member: &Member, operators: &[String], cast: &[String]) -> Speaker { @@ -739,6 +739,9 @@ fn transcript_line(line: &Value) -> String { /// the identity fields changed and what the guards refused with why. Nothing when no Interpreter ran. fn interpreter_words(did: &Value) -> Vec { let mut out = Vec::new(); + if let Some(error) = did["error"].as_str() { + out.push(format!("kept nothing: {}", one_line(error))); + } let deltas: Vec = did["deltas"].as_object().into_iter().flatten().map(|(what, count)| format!("{what} x{count}")).collect(); out.push(format!("deltas: {}", if deltas.is_empty() { "none".to_owned() } else { deltas.join(", ") })); for intention in did["intentions"].as_array().into_iter().flatten() {