diff --git a/crates/mind-body/src/projection/outcome.rs b/crates/mind-body/src/projection/outcome.rs index d74c189..d6b6ab9 100644 --- a/crates/mind-body/src/projection/outcome.rs +++ b/crates/mind-body/src/projection/outcome.rs @@ -171,11 +171,15 @@ pub(crate) fn outcome_of(record: &Value) -> Option { Some(Quote::Wrote(text)) if kind == GapKind::MissingAffordance => (0..receipts.len()).find(|at| receipts[*at].text == *text && !promised.contains(at)), _ => None, }; + // A promise 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)); match (quote, sent) { (_, Some(at)) => { promised.push(at); outcome.parts.push(Part::Promise { room: receipts[at].room.clone(), text: receipts[at].text.clone() }); } + (Some(Quote::Wrote(text)), None) if kind == GapKind::MissingAffordance && unreceipted(&text) => outcome.omitted.push(format!("a promise in a line said with no receipt that it went out: {}", gap["words"])), (Some(quote), None) if kind != GapKind::Unresolved => outcome.parts.push(Part::Gap { kind, room: room.clone(), quote }), _ => outcome.omitted.push(format!("a gap she cannot be shown truly (kind {}, from {}): {}", gap["kind"], gap["from"], gap["quote"])), } diff --git a/crates/mind-body/src/projection/outcome/tests.rs b/crates/mind-body/src/projection/outcome/tests.rs index fc7b154..941c367 100644 --- a/crates/mind-body/src/projection/outcome/tests.rs +++ b/crates/mind-body/src/projection/outcome/tests.rs @@ -71,6 +71,19 @@ fn a_promise_is_told_as_the_room_having_it_and_what_will_not_happen_by_itself() assert_eq!(told(&unsent).0, ["- Nothing happened. He reached for something he has no way to do from here, now or later, and it will not happen by itself. He wrote: \"Missed you too. I'll send the render tonight.\". That he wanted it is kept in his record; no one has taken it up."], "no receipt, no promise row"); } +/// Soul's rows at 0cfc386: a promise in a said line whose receipt's words differ, or that has no receipt, was told +/// "Nothing happened" beside the receipt's "has, from him". What reached the room is the receipt's alone (I16.10). +#[test] +fn a_promise_in_a_said_line_with_no_matching_receipt_is_not_told_as_nothing_happening() { + let text = "I'll send it tonight."; + let promise = |posted: Value| json!({ "interpreter": { "room": MINDS, "said": [{ "room": MINDS, "text": text }], "refused": [], "gaps": [{ "kind": "missing_affordance", "from": "draft", "draft": 1, "words": text }] }, "posted": posted }); + let (lines, omitted) = told(&promise(json!([{ "event": "40", "room": MINDS, "text": "I'll send it tonight!" }]))); + assert_eq!(lines, ["- #minds:gamecult.org has, from him: \"I'll send it tonight!\"."], "the receipt alone"); + assert!(omitted.len() == 2 && omitted[1].starts_with("a promise in a line said with no receipt"), "{omitted:?}"); + let (lines, omitted) = told(&promise(json!([]))); + assert!(lines.is_empty() && omitted.len() == 2, "{lines:?} {omitted:?}"); +} + #[test] fn an_unfinished_draft_a_failed_turn_and_a_later_break_are_told_as_what_they_were() { let (lines, _) = told(&record("I was about to tell you that", json!({ "say": [], "gaps": [] }), &[]));