From d524ab7736558d1b88f9a4a69a04bb1898ca900b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 28 Nov 2026 07:13:18 +0100 Subject: [PATCH] persona outcome: a reach naming a refused line stays a clause of the row that tells it; the told unknown row names its kind Co-Authored-By: Claude Opus 5.5 --- crates/mind-body/src/persona/drain_tests.rs | 2 +- crates/mind-body/src/projection/outcome.rs | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/crates/mind-body/src/persona/drain_tests.rs b/crates/mind-body/src/persona/drain_tests.rs index 1c31275..f097c5d 100644 --- a/crates/mind-body/src/persona/drain_tests.rs +++ b/crates/mind-body/src/persona/drain_tests.rs @@ -1151,7 +1151,7 @@ fn t_l3_an_unknown_send_is_told_at_her_next_real_turn_exactly_once_though_a_line let all = records(&rig); let before_turn: Vec = all.iter().filter(|record| record["room"] != json!(room(3))).cloned().collect(); let told = |records: &[Value]| crate::projection::history(records).last_outcome.map(|last| last["untold"].clone()); - assert_eq!(told(&before_turn), Some(json!([{ "room": MINDS, "text": rig.mouth.sent.borrow()[0].text }])), "aside={aside}: told at her next turn"); + assert_eq!(told(&before_turn), Some(json!([{ "kind": "unknown", "room": MINDS, "text": rig.mouth.sent.borrow()[0].text }])), "aside={aside}: told at her next turn"); rig.run(scripted(false)); assert_eq!(told(&records(&rig)), Some(Value::Null), "aside={aside}: told once"); } diff --git a/crates/mind-body/src/projection/outcome.rs b/crates/mind-body/src/projection/outcome.rs index 971ddf3..2476fce 100644 --- a/crates/mind-body/src/projection/outcome.rs +++ b/crates/mind-body/src/projection/outcome.rs @@ -305,8 +305,13 @@ pub(crate) fn outcome_of(record: &Value) -> Option { let decision = &record["interpreter"]; // What her trace holds that she has not been told, whatever record holds it (`turn::untold`, the one derivation): a send that may or may not // have gone out, a send refused or never made, a line set aside, a put refused. No other place tells these. + // Where each refused send is told, so a reach naming its draft is a clause of that row (K63). + let mut refused_at: Vec<(&Value, usize)> = Vec::new(); for item in record["untold"].as_array().into_iter().flatten() { let room = words(&item["room"]); + if item["kind"] == "refused" { + refused_at.push((item, outcome.parts.len())); + } match (item["kind"].as_str(), words_of(&item["text"])) { (Some("unknown"), Some(text)) => outcome.parts.push(Part::Unknown { room, text }), (Some("refused"), Some(text)) => outcome.parts.push(Part::Unsent { room, text, reach: false }), @@ -346,12 +351,18 @@ pub(crate) fn outcome_of(record: &Value) -> Option { let mut rows: Vec<(&Value, usize)> = Vec::new(); // A said line is told by its receipt; one the actuator refused (T6) or left unknown by `untold`, from the record that settled it; one with // none of these is not told, and reported. - let settled_send = |line: &Value| ["refused_sends", "unknown_sends"].iter().any(|field| record[*field].as_array().into_iter().flatten().any(|sent| sent["room"] == line["room"] && sent["text"] == line["text"])); + let settled_in = |field: &str, line: &Value| record[field].as_array().into_iter().flatten().any(|sent| sent["room"] == line["room"] && sent["text"] == line["text"]); + let refused_send = |line: &Value| settled_in("refused_sends", line); + let settled_send = |line: &Value| refused_send(line) || settled_in("unknown_sends", line); for line in decision["said"].as_array().into_iter().flatten() { let went = receipts.iter().any(|posted| Some(posted.room.as_str()) == line["room"].as_str() && Some(posted.text.as_str()) == line["text"].as_str()); match (went, words_of(&line["text"])) { (true, _) => {} - (false, _) if settled_send(line) => {} + (false, _) if settled_send(line) => { + if let Some((_, at)) = refused_at.iter().find(|(item, _)| item["room"] == line["room"] && item["text"] == line["text"]) { + rows.push((&line["rests_on"]["draft"], *at)); + } + } (false, _) => outcome.omitted.push(format!("a line said with no receipt that it went out: {}", line["text"])), } } @@ -420,7 +431,7 @@ pub(crate) fn outcome_of(record: &Value) -> Option { }; // A reach in a line the decision said and no receipt shows went out: whether it reached the room is unknown, so // she is told neither that nothing happened nor that it did (I16.10), as the line itself is not told. - let unreceipted = |text: &str| decision["said"].as_array().into_iter().flatten().any(|line| line["text"].as_str() == Some(text)); + let unreceipted = |text: &str| decision["said"].as_array().into_iter().flatten().any(|line| line["text"].as_str() == Some(text) && !refused_send(line)); match (quote, sent) { (_, Some(at)) => { unbacked.push(at);