use crate::fact::MemoFact;
use crate::scoring::confidence::apply_decay;

const DECAY_PER_DAY: f64 = 0.95;

pub fn apply_to_facts(facts: &mut [MemoFact]) {
    for fact in facts.iter_mut() {
        let days = (chrono::Utc::now() - fact.last_accessed).num_seconds() as f64 / 86_400.0;
        fact.confidence = apply_decay(fact.confidence, days, DECAY_PER_DAY);
    }
}
