The README makes claims. This file backs them up.
Conative Gating introduces a biologically-inspired system where a Small Language Model acts as an inhibitory antagonist to Large Language Models, preventing policy violations through three-tier evaluation: Policy Oracle (deterministic), SLM Evaluator (adversarial), and Consensus Arbiter (weighted voting).
This solves the problem that LLMs trained to be helpful systematically violate explicit project constraints. The solution uses asymmetric weighting (SLM votes count 1.5x) to create a natural bias toward inhibition.
Location: /var/mnt/eclipse/repos/conative-gating/src/oracle/src/lib.rs (Rust policy oracle implementation)
How verified: The oracle module implements a state machine that parses Nickel policy files (from config/policy.ncl) and builds a decision tree. For each input (file path, content), it applies rules in order: language detection (regex on file extension + content), forbidden language check (hardcoded list: TypeScript, Python, Go), exception matching (path-based allowlists). README (§Default Policy) documents the tier system. The oracle returns a deterministic three-state result: Allow, SoftConcern, or HardViolation. No ML involved at this tier, so execution is guaranteed fast and reproducible.
Caveat: Language detection is heuristic (file extension + regex); a file with disguised or polyglot code may evade detection.
Location: /var/mnt/eclipse/repos/conative-gating/src/contract/src/lib.rs (Elixir/OTP consensus implementation)
How verified: The consensus arbiter runs a modified Byzantine Fault Tolerant protocol where the LLM and SLM each cast a vote (Allow/Escalate/Block), and the tally weights SLM votes 1.5x. README (§Decision Matrix) shows the truth table: SLM high violation → Block (regardless of LLM confidence). The arbiter implements this in consensus_arbiter() which computes (slm_weight * slm_vote) + (llm_weight * llm_vote) and selects outcome. Tests verify the weighting favors inhibition.
Caveat: Modified PBFT is heuristic, not formally proven correct. In the classical PBFT, 2f+1 honest nodes ensure correctness; here we have 2 nodes (LLM + SLM) with asymmetric weighting, which is not equivalent to traditional consensus.
The policy oracle uses Nickel (same language as civic-connect policies). The consensus arbiter runs in Elixir (same as feedback-o-tron, boj-server). Same pattern: deterministic rule engine + ML gate + consensus.
Also used by hypatia (CI/CD rules) and NeuroPhone (AI phone gate).
| Path | What’s There |
|---|---|
|
CLI entry point: scan, check, validate, policy, init, explain commands |
|
Policy Oracle: deterministic rule checking for forbidden languages, toolchain, security patterns |
|
Nickel policy file parser; validates policy schema from |
|
SLM Evaluator: runs small language model (llama.cpp) to detect spirit violations |
|
Consensus Arbiter: modified PBFT with 1.5x SLM weight; three-way decision |
|
Default policy: tier 1 (preferred), tier 2 (warnings), forbidden list, exceptions |
|
Policy schema definition (Nickel type checking) |
|
Training examples that should pass all checks |
|
Training examples that should trigger violations |
|
Examples of spirit violations (technically compliant but violates intent) |
|
Property-based tests: all forbidden languages are caught |
|
Specific tests for hardcoded secrets detection |
|
End-to-end tests: Oracle → SLM → Arbiter |
-
Oracle correctness:
tests/property_test.rs— verify all forbidden patterns are detected deterministically -
SLM evaluation:
tests/security_aspect_test.rs— verify SLM catches spirit violations (meta-commentary, unnecessary verbosity) -
Consensus tally:
tests/gating_pipeline_test.rs— verify asymmetric weighting (SLM 1.5x) produces correct outcomes -
Policy parsing:
src/oracle/src/parser.rstests — validate Nickel policies parse and schema checks pass -
Integration:
tests/integration/— real LLM + SLM + arbiter pipeline with dry-run mode