use crate::muterprater::types::{
MutationTarget, PlanRefusal, PlannedDamage, PlannedRun, PressureLane, ProofPlan,
ScopedInvocation,
};
use crate::runner::Selection;
use std::collections::BTreeSet;
#[must_use]
pub fn mutant_scoped(target: &MutationTarget) -> Selection {
match target.owning_claim() {
Some(claim) => Selection::ByClaim(BTreeSet::from([claim])),
None => Selection::All,
}
}
pub fn plan_pass(
targets: &[MutationTarget],
scope: ScopedInvocation,
) -> Result<ProofPlan, PlanRefusal> {
let budget = scope.budget();
let runs: Vec<PlannedRun> = targets
.iter()
.map(|target| {
PlannedRun::intended(
PressureLane::CompiledMutation,
target.identity(),
PlannedDamage::BackendChosen,
mutant_scoped(target),
budget,
)
})
.collect();
ProofPlan::planned(scope, runs)
}