el_runtime/lib.rs
1//! `el-runtime` — the Core: inference session lifecycle, the port traits that
2//! the collaborator contexts plug into, and the decode-loop orchestrator
3//! (ADR-001). Air-gap is structural (ADR-004): this crate has no network
4//! dependency, and the only outbound seam is the opt-in [`ports::HybridRelay`].
5//!
6//! The decode step composes collaborators in a fixed, invariant order
7//! (`docs/ddd/domain-events.md`): **grammar mask → safety adjust → sample →
8//! commit**, so safety steering only ever operates over already-legal tokens.
9
10#![forbid(unsafe_code)]
11
12mod defaults;
13mod ports;
14mod session;
15
16pub use defaults::{AllowAllMasker, IdentityCompressor, NullEngine};
17pub use ports::{GrammarMasker, HybridRelay, InferenceEngine, Ports, PromptCompressor};
18pub use session::InferenceSession;
19
20// Re-export the safety ports and the concrete on-device steerers/guards so
21// adapters wire one type system (they depend on `el-runtime`, not `el-safety`).
22pub use el_safety::{
23 contrastive_adjustment, AnchorGuard, Checkpoint, CheckpointManager, ChunkGuard,
24 ContrastiveSteerer, ExpertLogits, LightweightFilter, LogitAdjustment, NoSafety, RollbackPolicy,
25 SafetyModeSelector, SafetyScore, SafetySteerer,
26};