blocked selects the held questions by key alone; the retire test pins which run's claims an answer retires

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-01 06:20:11 +01:00
commit 79e4cac5fd
2 changed files with 12 additions and 18 deletions

View file

@ -31,7 +31,7 @@ use clap::{CommandFactory, FromArgMatches, Parser, Subcommand};
use cultnet_rs::{PROJECTION_DOCUMENT, Selection};
use eureka_state::hold;
use huginn_mind::eureka_pipeline::{
Line, PipelineDocument, PipelineKind, PipelineRef, Short, Slug, pipeline_key,
Line, PipelineDocument, PipelineRef, Short, Slug, pipeline_key,
};
use huginn_mind::{
BATCH_MAX, Faculty, HuginnMindRequest, HuginnMindResponse, MindRefusal, PipelineAdmissionBatch, PipelineAdmissionOutcome,
@ -329,7 +329,6 @@ fn blocked(
return Ok(0);
}
let selection = Selection {
schemas: Some(vec![PipelineKind::Question.type_id().to_string()]),
keys: Some(keys),
..Selection::default()
};

View file

@ -665,23 +665,18 @@ mod tests {
held.contains(&a) && held.contains(&b) && held.items().len() == 2,
"{held:?}: retire holds what the answer retired"
);
let retired: Vec<bool> = holds(&mind)
.unwrap()
.iter()
.map(|hold| hold.retired)
.collect();
assert_eq!(retired, [true]);
mind.committed(vec![close(a.clone(), withdrawn())]);
assert_eq!(
on_hold(&mind).unwrap().items(),
std::slice::from_ref(&b),
"a resolved claim drops out"
);
// Another run's question, still open, is not this answer's: only the claims of f2 are retired.
let c = spec_ref("c");
mind.committed(vec![spec("c")]);
mind.committed(vec![run("g", RunTurn::SelfRun, RunOperator::Mind, std::slice::from_ref(&c))]);
mind.committed(vec![close(run_ref("g"), recorded())]);
mind.committed(vec![question_in("other", &run_ref("g"))]);
let retired: Vec<PipelineRef> = holds(&mind).unwrap().into_iter().filter(|hold| hold.retired).flat_map(|hold| hold.items).collect();
assert_eq!(retired, [a.clone(), b.clone()]);
mind.committed(vec![close(a, withdrawn())]);
assert_eq!(on_hold(&mind).unwrap().items(), [b.clone(), c.clone()], "a resolved claim drops out");
mind.committed(vec![close(b, withdrawn())]);
assert!(
on_hold(&mind).unwrap().items().is_empty(),
"all resolved, nothing is held"
);
assert_eq!(on_hold(&mind).unwrap().items(), [c], "all of f2's resolved, only the open question's claim is held");
}
#[test]