Skip to main content

apply_policy

Function apply_policy 

Source
pub fn apply_policy(
    confirmed_grammar: GrammarState,
    dsa_score: f64,
    consistency_gate_passed: bool,
    semantic: SemanticDisposition,
    persistence_count: usize,
    persistence_threshold: usize,
) -> PolicyState
Expand description

Apply policy based on grammar state, DSA score, motif match, and persistence.

  • Silent: gate failed or no motif
  • Watch: motif active, below escalation
  • Review: persistence >= K AND motif class == Review
  • Escalate: persistence >= K AND Violation-class motif