From 09cf7cc4144830e165d4e6e0e5e4726bd973f898 Mon Sep 17 00:00:00 2001 From: Weksa Date: Fri, 13 Nov 2026 01:02:21 +0000 Subject: [PATCH 1/2] test-text-withheld-arms: recall, the lowering step, the cycle editor and the stance ablation stop on a withheld prompt, each arm killed by a mutant Co-Authored-By: Claude Sonnet 5.5 --- crates/weksa/tests/golf_loop.rs | 69 ++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 15 deletions(-) diff --git a/crates/weksa/tests/golf_loop.rs b/crates/weksa/tests/golf_loop.rs index f754f95..984ab8e 100644 --- a/crates/weksa/tests/golf_loop.rs +++ b/crates/weksa/tests/golf_loop.rs @@ -5199,27 +5199,15 @@ fn a_round_stops_on_a_prompt_that_holds_test_text() { )); } -/// Refuses every prompt as holding Test text, as the answer door does. -struct Refuses; - -impl weksa::model::ModelPort for Refuses { - fn model(&self) -> &str { - "fake-model" - } - fn answer(&mut self, _: &weksa::context::Prompt) -> Result { - Err(weksa::model::PortError::Withheld) - } -} - #[test] -fn every_model_call_stops_on_a_withheld_prompt() { +fn the_encode_step_and_ontology_mint_stop_on_a_withheld_prompt() { use weksa::run::{RunError, round}; let w = world(); let mut run = run_over(w.dir.path()); let scorer = weksa::score::Scorer::new(OneBag); - let r = round(&mut run, &mut Refuses, &scorer); + let r = round(&mut run, &mut Withholds, &scorer); assert!(matches!(r, Err(RunError::Withheld)), "{:?}", r.map(|_| ())); - assert!(matches!(run.mint_ontology(&mut Refuses, "en-US"), Err(RunError::Withheld))); + assert!(matches!(run.mint_ontology(&mut Withholds, "en-US"), Err(RunError::Withheld))); } #[test] @@ -5239,3 +5227,54 @@ fn model_written_test_group_text_is_withheld_too() { "a model-written Test-group item is in no split, and its text is still held out" ); } + +// ---- test-text-withheld-arms: a refused prompt stops every model call, none skips it ---- + +/// Refuses every prompt as holding Test text, as the answer door does. +struct Withholds; + +impl ModelPort for Withholds { + fn model(&self) -> &str { + "fake-model" + } + fn answer(&mut self, _: &Prompt) -> Result { + Err(PortError::Withheld) + } +} + +#[test] +fn recall_stops_on_a_withheld_prompt() { + let dao = dao(); + assert!(matches!(dao.run.recall(&mut Withholds), Err(RunError::Withheld))); +} + +#[test] +fn the_lowering_step_of_a_round_stops_on_a_withheld_prompt() { + // Encoding is answered; every lowering prompt is refused. + let mut dao = dao(); + let mut model = fake(&good_answers()); + model.raw_lowering = Some(Err(PortError::Withheld)); + let r = round(&mut dao.run, &mut model, &Scorer::new(Bag)); + assert!(matches!(r, Err(RunError::Withheld)), "{:?}", r.map(|_| ())); +} + +#[test] +fn the_cycle_editor_stops_on_a_withheld_prompt() { + let mut dao = dao(); + two_rounds(&mut dao); + let mut model = cycle_fake(ONE_CONCEPT); + model.edit = Some(Err(PortError::Withheld)); + let r = cycle(&mut dao.run, &mut model, &Scorer::new(Bag)); + assert!(matches!(r, Err(RunError::Withheld)), "{:?}", r.map(|_| ())); +} + +#[test] +fn a_stance_ablation_stops_on_a_withheld_prompt() { + let (dao, _) = recorded_dao(|_| {}); + let mut rec = Lowerer::new(blind); + let r = ablate(&dao, &mut rec, &mut Withholds); + assert!(matches!(r, Err(RunError::Withheld)), "{:?}", r.map(|_| ())); + // A recorded answer that is refused stops it as well. + let r = ablate(&dao, &mut Withholds, &mut Lowerer::new(blind)); + assert!(matches!(r, Err(RunError::Withheld)), "{:?}", r.map(|_| ())); +} -- 2.47.3 From 92cf30bec0f5f813ae4c01a59d6e56403c9e4450 Mon Sep 17 00:00:00 2001 From: Weksa Date: Fri, 13 Nov 2026 01:23:03 +0000 Subject: [PATCH 2/2] withheld-arms s1: a refused lowering step discards the attempt's packets (killed by deleting discard_packets) Co-Authored-By: Claude Sonnet 5.5 --- crates/weksa/tests/golf_loop.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/weksa/tests/golf_loop.rs b/crates/weksa/tests/golf_loop.rs index 984ab8e..9272af3 100644 --- a/crates/weksa/tests/golf_loop.rs +++ b/crates/weksa/tests/golf_loop.rs @@ -5256,6 +5256,10 @@ fn the_lowering_step_of_a_round_stops_on_a_withheld_prompt() { model.raw_lowering = Some(Err(PortError::Withheld)); let r = round(&mut dao.run, &mut model, &Scorer::new(Bag)); assert!(matches!(r, Err(RunError::Withheld)), "{:?}", r.map(|_| ())); + assert!( + !dao.root.join("round-1/packets.cc").exists(), + "the refused attempt's packets are discarded" + ); } #[test] -- 2.47.3