use crate::aggregation::reducer::{EvidenceEvent, EvidencePolarity};
pub const MIN_CONTRADICTORY_TECHNIQUES: usize = 3;
pub const STRONG_THRESHOLD: f64 = 0.20;
#[must_use]
pub fn passes_not_present_gate(events: &[EvidenceEvent]) -> bool {
let mut has_positive = false;
let mut contradictory_count = 0usize;
let mut has_strong = false;
for event in events {
match event.polarity {
EvidencePolarity::Positive => {
has_positive = true;
}
EvidencePolarity::Contradictory => {
contradictory_count += 1;
if event.weight >= STRONG_THRESHOLD {
has_strong = true;
}
}
}
}
!has_positive && contradictory_count >= MIN_CONTRADICTORY_TECHNIQUES && has_strong
}
#[cfg(test)]
#[path = "coverage_gate_tests.rs"]
mod tests;