K16 fix-up: a no_room refusal is told (Soul at 0cfc386)
- A line refused because the turn had no room to speak in was omitted from what she is told. It is her draft and nothing of it reached anyone, which can be told truly from the typed reason: "Nothing reached anyone. That turn had no room for her to speak in, so it was not sent: <draft>." Its quote is held by the same guard as every other. Verification: the roomless note fixture tells the refused line in that row and omits nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ce57956a62
commit
3d77bfd7b7
2 changed files with 7 additions and 1 deletions
|
|
@ -485,6 +485,10 @@ fn a_note_needs_no_room_and_speech_does() {
|
|||
let decision = noted(&roomless, json!([{ "draft": 2 }]), json!([{ "kind": "idea", "draft": 1, "about": null, "private": false }]));
|
||||
assert_eq!((decision["suggestions"][0]["text"].as_str(), decision["suggestions"][0]["room"].clone()), (Some(NOTE), Value::Null), "{decision}");
|
||||
assert_eq!(refusals(&decision), [("say".to_owned(), "no_room".to_owned())]);
|
||||
// He is told the line he meant to say had nowhere to go (Soul at 0cfc386: it was omitted).
|
||||
let outcome = crate::projection::outcome::outcome_of(&json!({ "interpreter": decision, "posted": [] })).unwrap();
|
||||
assert!(outcome.lines(packet().forms).contains(&"- Nothing reached anyone. That turn had no room for him to speak in, so it was not sent: \"Another thought.\".".to_owned()), "{:?}", outcome.lines(packet().forms));
|
||||
assert!(outcome.omitted.is_empty(), "{:?}", outcome.omitted);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ pub(crate) fn outcome_of(record: &Value) -> Option<Outcome> {
|
|||
}
|
||||
for refusal in decision["refused"].as_array().into_iter().flatten() {
|
||||
match (serde_json::from_value::<Refusal>(refusal["reason"].clone()), words(&refusal["text"])) {
|
||||
(Ok(reason @ (Refusal::Echo | Refusal::OverLines)), Some(text)) => outcome.parts.push(Part::Refused { reason, room: room.clone(), text }),
|
||||
(Ok(reason @ (Refusal::Echo | Refusal::OverLines | Refusal::NoRoom)), Some(text)) => outcome.parts.push(Part::Refused { reason, room: room.clone(), text }),
|
||||
(Ok(Refusal::NotAmendable), Some(added)) => outcome.parts.push(Part::NotAmended { refusal: None, room: room.clone(), added }),
|
||||
(Ok(reason @ (Refusal::Private | Refusal::SecondNote)), Some(_)) => outcome.parts.push(Part::NoteRefused(reason)),
|
||||
_ => outcome.omitted.push(format!("a refusal she is not told ({}): {}", refusal["reason"], refusal["why"])),
|
||||
|
|
@ -239,6 +239,7 @@ impl Part {
|
|||
Self::Amended { room, added } => format!("{} has {poss} line, now ending with: {}.", capitalized(room), quoted(added)),
|
||||
Self::NoteLeft(text) => format!("{cap_subj} left Self a note: {}.", quoted(text)),
|
||||
Self::Refused { reason: Refusal::Echo, room, .. } | Self::Gap { kind: GapKind::Conditional | GapKind::Unwritten | GapKind::Unresolved, room, .. } => format!("Nothing reached {}.", place(room)),
|
||||
Self::Refused { reason: Refusal::NoRoom, .. } => "Nothing reached anyone.".to_owned(),
|
||||
Self::Refused { room, .. } | Self::Unfinished { room, .. } => format!("Nothing of this reached {}:", place(room)),
|
||||
Self::Gap { kind: GapKind::Addressee | GapKind::Elsewhere, .. } => "Nothing reached anyone.".to_owned(),
|
||||
Self::Gap { kind: GapKind::MissingAffordance, .. } => "Nothing happened.".to_owned(),
|
||||
|
|
@ -271,6 +272,7 @@ impl Part {
|
|||
Self::Promise { .. } => format!(" It promises something {subj} {has} no way to do, now or later, and it will not happen by itself. The line stands as {subj} wrote it; {subj} can add to it."),
|
||||
Self::NoteLeft(_) => format!(" It waits in Self's inbox until Self reads it; nothing tells {obj} when, and nothing in it happens by itself."),
|
||||
Self::Refused { reason: Refusal::Echo, .. } => format!(" What {subj} wrote was mostly the words {subj} had just been sent, so none of it was sent."),
|
||||
Self::Refused { reason: Refusal::NoRoom, text, .. } => format!(" That turn had no room for {obj} to speak in, so it was not sent: {}.", quoted(text)),
|
||||
Self::Refused { text, .. } => format!(" {subj} had already sent {} that turn. {}", lines_word(), shown(&Quote::Wrote(text.clone()))),
|
||||
Self::Gap { kind: GapKind::Conditional, quote, .. } => after(format!("{cap_subj} wrote this and did not send it, and it is not sent unless {subj} send{s} it"), quote),
|
||||
Self::Gap { kind: GapKind::Addressee, quote, .. } => after(format!("{cap_subj} meant to send this and it was unclear to whom"), quote),
|
||||
|
|
|
|||
Loading…
Reference in a new issue