Skip to main content

Module substrate

Module substrate 

Source
Expand description

The OmsSubstrate trait — the engine’s only contact with a store. It is defined in terms of the OMS Level-2 protocol (CAL text ↔ JSON rows, grain get/put/supersede) plus curated typed reads the built-in analyzers use. Areev is the first substrate; the in-repo ReferenceSubstrate lets engine CI run with zero Areev, and doubles as the third-party conformance kit.

Structs§

BudgetUsage
Assembly-budget pressure rollup.
Capabilities
Optional substrate capabilities, declared once and matched against each analyzer manifest’s requires list. A missing capability degrades an analyzer to an activation-ladder entry, never a silent no-op (§8).
GrainAccess
How often one grain has been surfaced by recall.
GrainSpec
A grain to be written by an apply. derived_from and other provenance go in fields; the substrate computes the content address.
HeadGroup
One entity holding more than one live head (fork surfacing input).
QueryUsage
How a recurring recall question has fared.
ReadOpts
Read filters for curated grain reads.
TelemetryView
A snapshot of the recall-telemetry sidecar’s rollups (§8). Telemetry-fed analyzers (cold_grains, coverage_gap, budget_pressure) read this via crate::analyzer::AnalyzeCtx::telemetry. It is an owned snapshot, not a live handle — analyzers stay read-only and can’t reach the sidecar. A substrate without a sidecar returns None, so the analyzer degrades to an activation-ladder entry rather than firing on absent evidence.

Traits§

OmsSubstrate
The full store protocol the engine binds to: reads (via the supertrait) plus governed writes, CAL, and state persistence. All methods are fallible; a substrate fault surfaces as crate::error::Error::Substrate.
SubstrateRead
The read-only slice of the substrate. Analyzers receive this (via AnalyzeCtx) and nothing else — the trust floor’s “analyzers execute read-only” is enforced by the type system: a &dyn SubstrateRead cannot reach any mutating method. It is object-safe (no generics) so builtin_analyzers() can hand out Box<dyn Analyzer>.