diff --git a/crates/mind-body/src/projection/interpret/tests.rs b/crates/mind-body/src/projection/interpret/tests.rs index cfb52f9..8de2b09 100644 --- a/crates/mind-body/src/projection/interpret/tests.rs +++ b/crates/mind-body/src/projection/interpret/tests.rs @@ -2519,3 +2519,14 @@ fn k54_a_model_error_on_retry_keeps_the_first_answer() { let failed = decide(&OffThenError(std::cell::Cell::new(0)), "test", &x1_packet(), "The room is warm.", P3_PROSE, &Tuning::default()); assert_eq!((failed["failed"].as_str(), failed["retried"]["failed"].as_str(), failed.get("said")), (Some("the connector timed out"), Some("the answer is not the speech contract"), None), "{failed}"); } + +/// K51's fixpoint: a line held for repeating a held text joins what is held, so a line that shares a run of words only +/// with it is held too. One round would let "Kiko, here it is: as I said" go out beside the held welcome. +#[test] +fn k51_the_gate_runs_until_nothing_changes() { + let (_, p2) = held_then_kiko_asks(&[K45_WELCOME]); + let prose = format!("Kiko asked. Kiko, here it is: {K45_WELCOME} Kiko, here it is: as I said."); + let d = answered(&p2, &prose, json!({ "say": [say_holding(1, json!([])), say_holding(2, json!([]))], "gaps": [] })); + let reasons: Vec> = d["refused"].as_array().unwrap().iter().map(|refused| refused["reason"].as_str()).collect(); + assert_eq!((texts(&d), reasons), (Vec::::new(), vec![Some("held"); 2]), "{d}"); +}