From ada5197617d700eb8c9124639cd670234469f32b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 22 Nov 2026 08:09:17 +0100 Subject: [PATCH] Persona K47: test fixes (a hold's words are optional; P5's item is cloned); K45's carries cap pinned Co-Authored-By: Claude Opus 5.5 --- crates/mind-body/src/projection/commit/tests.rs | 11 +++++++++++ crates/mind-body/src/projection/interpret/tests.rs | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/crates/mind-body/src/projection/commit/tests.rs b/crates/mind-body/src/projection/commit/tests.rs index ae3da6d..0d2eb38 100644 --- a/crates/mind-body/src/projection/commit/tests.rs +++ b/crates/mind-body/src/projection/commit/tests.rs @@ -1051,3 +1051,14 @@ fn k40_an_outside_close_is_not_hers_to_reopen() { amended["commitments"][0]["closedBy"]["act"] = json!("amended"); assert_eq!(f2_r9(&amended, json!([reopening(F2_R9_WORDS, None, true)])).0["commitments"][0]["status"], "open"); } + +/// K45 (map 16.30.2): each `Held` refusal's draft is carried by its hold once, at most four, the oldest dropping. +#[test] +fn k45_a_hold_carries_each_held_draft_once_and_at_most_four() { + let (state, listed) = x1_holding(); + let held = |text: &str| json!({ "act": "say", "draft": 1, "reason": "held", "text": text, "hold": { "who": "Meta", "id": "h1" } }); + let mut record = hearing(&[], listed, json!([])); + record["interpreter"]["refused"] = json!([held("One."), held("Two."), held("One."), held("Three."), held("Four."), held("Five.")]); + let (after, applied) = apply(&state, &record, "x", "r1-t4", now()); + assert_eq!((after["holds"][0]["carries"].clone(), after["holds"][1].get("carries"), applied.held_unrecorded.len()), (json!(["Two.", "Three.", "Four.", "Five."]), None, 0), "{after}"); +} diff --git a/crates/mind-body/src/projection/interpret/tests.rs b/crates/mind-body/src/projection/interpret/tests.rs index 4e968cc..64f8e5e 100644 --- a/crates/mind-body/src/projection/interpret/tests.rs +++ b/crates/mind-body/src/projection/interpret/tests.rs @@ -1789,7 +1789,7 @@ fn k39_unquoted_hold_is_retried() { next["holds"] = state["holds"].clone(); let room = Room { messages: vec![line(MINDS, "@meta:gamecult.org", "Meta", "Is it ready?", true)], here: Some(MINDS.into()), ..Room::default() }; let packet = packet_in(TurnKind::Chat, &next, &room, 1); - assert_eq!(packet.holds.iter().map(|hold| hold.words.as_str()).collect::>(), ["hold it, don't post it in here yet"], "{:?}", packet.holds); + assert_eq!(packet.holds.iter().map(|hold| hold.words.as_deref()).collect::>(), [Some("hold it, don't post it in here yet")], "{:?}", packet.holds); } // --------------------------------------------------------------------------------------------- @@ -2098,7 +2098,7 @@ fn k47_p5_malformed_hold_item_is_a_fault() { let malformed = json!([{ "line": "q3", "words": "hold it, don't post it in here yet", "where": "there" }]); let model = answering(vec![json!({ "say": [say_holding(1, json!([])), say_holding(2, json!([]))], "gaps": [], "hold": malformed }).to_string()]); let decision = decide(&model, "test", &x1_packet(), "The room is warm.", X1_LIBBY_R1, &Tuning::default()); - assert_eq!((decision["retried"]["holds"].clone(), decision["hold_faults"].clone(), decision["state_unused"].clone()), (json!(["q3"]), json!(["q3"]), malformed), "{decision}"); + assert_eq!((decision["retried"]["holds"].clone(), decision["hold_faults"].clone(), decision["state_unused"].clone()), (json!(["q3"]), json!(["q3"]), malformed.clone()), "{decision}"); assert!(speech_prompts(&model)[1].contains("named holds it did not open from a listed line's own words: q3.")); let naming = answering(vec![json!({ "say": [say_holding(1, json!(["q3"])), say_holding(2, json!([]))], "gaps": [], "hold": malformed }).to_string()]); let held = decide(&naming, "test", &x1_packet(), "The room is warm.", X1_LIBBY_R1, &Tuning::default());