Expand description
§The L1 contract — the conversation runtime
This module is the engineered surface of the runtime layer: the closed set of primitives L1 exposes upward, curated and named. L0 moves frames; this layer gives those frames meaning — and enforces it.
L1 promises: a concurrent session runtime over the L0 stream — typed
shared State, tool dispatch, governed flows with load-time compilation
and a self-explaining monitor, out-of-band extraction that fills the state
guards read, phases and watchers, transcripts, persistence, and a
LiveHandle that can always answer why (explain, truth traces)
and steer now (update_step_posture).
L1 never: opens its own idea of a socket beyond L0’s transport, renders application prose, or hides an enforcement decision — every denial carries its reason, every stuck guard can print its atoms.
The primitives, by concern:
| Concern | Primitives |
|---|---|
| Shared truth | State, StateKey, PrefixedState |
| Capability | ToolFunction, SimpleTool, TypedTool, ToolDispatcher |
| Governance | Flow, Step, Guard, Pred, Constraint, CompiledFlow, FlowMonitor, Enforcement, Marking, Verdict |
| Explanation | FlowExplanation, GuardTrace, Violation |
| Understanding | TurnExtractor, LlmExtractor, FieldPromotion, ExtractionTrigger |
| Steering | Phase, PhaseMachine, Transition, InstructionModifier, Watcher |
| The session | LiveSessionBuilder, LiveHandle, LiveEvent, EventCallbacks, TranscriptBuffer |
| Memory of it | SessionPersistence, SessionSnapshot, FsPersistence, MemoryPersistence |
| Models | BaseLlm, LlmRequest, LlmResponse |
Re-exports§
pub use crate::state::PrefixedState;pub use crate::state::State;pub use crate::state::StateKey;pub use crate::tool::SimpleTool;pub use crate::tool::ToolDispatcher;pub use crate::tool::ToolFunction;pub use crate::tool::TypedTool;pub use crate::flow::CompiledFlow;pub use crate::flow::Constraint;pub use crate::flow::Enforcement;pub use crate::flow::Flow;pub use crate::flow::FlowExplanation;pub use crate::flow::FlowMonitor;pub use crate::flow::Guard;pub use crate::flow::GuardTrace;pub use crate::flow::Marking;pub use crate::flow::Pred;pub use crate::flow::Step;pub use crate::flow::Verdict;pub use crate::flow::Violation;pub use crate::live::extractor::ExtractionTrigger;pub use crate::live::extractor::FieldPromotion;pub use crate::live::extractor::LlmExtractor;pub use crate::live::extractor::TurnExtractor;pub use crate::live::builder::LiveSessionBuilder;pub use crate::live::callbacks::EventCallbacks;pub use crate::live::events::LiveEvent;pub use crate::live::handle::LiveHandle;pub use crate::live::phase::InstructionModifier;pub use crate::live::phase::Phase;pub use crate::live::phase::PhaseMachine;pub use crate::live::phase::Transition;pub use crate::live::transcript::TranscriptBuffer;pub use crate::live::watcher::Watcher;pub use crate::live::persistence::FsPersistence;pub use crate::live::persistence::MemoryPersistence;pub use crate::live::persistence::SessionPersistence;pub use crate::live::persistence::SessionSnapshot;pub use crate::llm::BaseLlm;pub use crate::llm::LlmRequest;pub use crate::llm::LlmResponse;