vios_app 0.1.1

Small JSON vaults: Argon2id + AES-GCM, with optional AAD binding.
Documentation
// emotion_congruence.rs — Scoring logic for tone + facial emotion

/// Calculates congruence between tone-detected and face-detected emotion.
/// Returns (score: f32, reflex_triggered: bool, optional_reason: Option<String>)
pub fn calculate_congruence(voice: &str, face: &str) -> (f32, bool, Option<String>) {
    let match_pairs = vec![
        ("happy", "happy"),
        ("sadness", "sad"),
        ("anger", "angry"),
        ("neutral", "neutral"),
        ("fear", "fear"),
        ("surprise", "surprised"),
        ("disgust", "disgusted"),
    ];

    let matched = match_pairs.iter().any(|(v, f)| voice == *v && face == *f);

    let score = if matched { 1.0 } else { 0.45 };
    let reflex = score < 0.5;
    let reason = if reflex {
        Some(format!("Low congruence: {voice} (voice) vs {face} (face)"))
    } else {
        None
    };

    (score, reflex, reason)
}