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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-22 08:09:17 +01:00
commit ada5197617
2 changed files with 13 additions and 2 deletions

View file

@ -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}");
}

View file

@ -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::<Vec<_>>(), ["hold it, don't post it in here yet"], "{:?}", packet.holds);
assert_eq!(packet.holds.iter().map(|hold| hold.words.as_deref()).collect::<Vec<_>>(), [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());