Inference (src/gate.rs)

RuView · v2/crates/ruview-ood/src/gate.rs · rust · MIT
ai, tag:knn-classified

Implements an inference gate that classifies domain and attaches uncertainty.

// Source: https://github.com/ruvnet/RuView | License: MIT | Copyright 2024 rUv
// Provided via justclaw.it.com; keep this notice with the code.
//! The inference gate (ADR-302 §2, ADR-300 rule 1).
//!
//! Every inference passes through the gate. It:
//!
//! 1. classifies the domain from distance + envelope + signal quality +
//!    calibration compatibility;
//! 2. attaches the model's own predictive **uncertainty** (the fourth ADR-302
//!    input), escalating a KNOWN domain to DEGRADED when uncertainty is
//!    elevated;
//! 3. **suppresses the confident class** when the domain is not KNOWN — an
//!    UNKNOWN domain returns no class, a first-class value rather than a
//!    confidently-wrong label (ADR-300 rule 1);
//! 4. emits a [`RecalibrationRequest`] whenever the state is DEGRADED

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key