nixfleet_reconciler/planner_gates/
quarantine.rs

1//! Anti-thrash quarantine gate (new-shape). Same predicate as
2//! `gates::quarantine`, just parameterized directly on
3//! `(channel, target_closure, quarantines)` instead of digging through
4//! `Observed`. Phase 6g deletes the old version.
5//!
6//! No FleetState dependency — quarantines are a closed input.
7
8use crate::planner_gates::GateBlock;
9use crate::planner_types::{ChannelId, ClosureHash, QuarantineSet};
10
11pub fn check(
12    quarantines: &QuarantineSet,
13    channel: &ChannelId,
14    target_closure: &ClosureHash,
15) -> Option<GateBlock> {
16    let set = quarantines.get(channel)?;
17    if set.contains(target_closure) {
18        Some(GateBlock::Quarantined {
19            channel: channel.clone(),
20            closure_hash: target_closure.clone(),
21        })
22    } else {
23        None
24    }
25}