vios_app 0.1.1

Small JSON vaults: Argon2id + AES-GCM, with optional AAD binding.
Documentation
// 🧠 vault_reflex_override.rs — Override Reflex Engine

use crate::vault::vault_structs::{VaultMemory, EmotionalCongruence};

#[derive(Debug)]
pub enum ReflexAction {
    Allow,
    Block { reason: String },
    OverrideRequired { reason: String },
}

pub struct ReflexOverrideEngine {
    threshold: f32,
}

impl ReflexOverrideEngine {
    pub fn new(threshold: f32) -> Self {
        Self { threshold }
    }

    pub fn evaluate(
        &self,
        vault: &VaultMemory,
        congruence: Option<&EmotionalCongruence>,
    ) -> ReflexAction {
        match congruence {
            Some(c) => {
                if c.congruence_score >= self.threshold {
                    ReflexAction::Allow
                } else {
                    ReflexAction::OverrideRequired {
                        reason: format!(
                            "Incongruent tone ({} vs {}). Score: {}",
                            c.tone_emotion, c.facial_emotion, c.congruence_score
                        ),
                    }
                }
            }
            None => ReflexAction::Block {
                reason: "No congruence data available".into(),
            },
        }
    }
}