Skip to main content

Module kernel

Module kernel 

Source
Expand description

Allocation-free prescriptive decision kernel. Allocation-free prescriptive decision kernel.

This module deliberately contains no HTTP, JSON, UUID, WAL, clock, or floating-point work. Snapshots may allocate when they are built; [PolicySnapshot::prescribe] does not allocate.

§Performance

8.6M decisions/sec on a single core (115ns per decision, 22-model catalog). All arithmetic is u64/i64/i128 — no f64 anywhere in the hot path.

§Safety

11 constraint gates are evaluated per decision. If no model passes all gates with positive utility, the request is rejected (fail-closed).

Structs§

DecisionTrace
Explainability snapshot for a prescribe call (alloc-free alongside decision).
KernelDecision
The result of evaluating a KernelInput against a PolicySnapshot.
KernelInput
A decision request to be evaluated against the policy.
KernelModel
A candidate model in the decision catalog.
PolicySnapshot
An immutable snapshot of the decision policy and model catalog.
RejectionHistogram
Per-constraint rejection counts from a single prescribe evaluation.

Enums§

KernelAction
The action the kernel decided to take.
KernelReason
Why the kernel made this decision.
PolicyError
Policy catalog validation errors.

Constants§

ALL_PROVIDERS
Bitmask that admits all providers (all 64 bits set).
ALL_REGIONS
Bitmask that admits all regions (all 64 bits set).
BASIS_POINTS
One basis point = 1/10,000. Used for quality, risk, and confidence values.
MAX_BPS
Maximum basis-points value accepted by policy validation (100%).
MAX_PROVIDER_ID
Maximum representable provider ID. IDs >= 64 are unconditionally rejected.
MAX_RISK_PENALTY_MULTIPLIER_BPS
Upper bound for PolicySnapshot::risk_penalty_multiplier_bps validation.