Skip to main content

Crate causa_runtime

Crate causa_runtime 

Source
Expand description

Optional execution components over the Causa material kernel.

TurnRunner owns only a gateway and ToolExecutor. Each run consumes a context and returns it in TurnOutcome, with any uncommitted tool batch. Model identity, generation, limits, optional preparation and observation are explicit per-run choices. Both entry points share the same loop.

ToolExecutor::bind fixes the actual tool surface and targets before preparation. Processing owns controlled collection of started calls; the runner validates and atomically appends results only after success. Unknown results are committed and stop further model rounds.

§Policy surface

ChoiceDefault and owner
Model rounds / tool declarationsTurnLimits: 10 / 64
Model retriesGateway implementation or caller wrapper
Material preparationNone; use the current context frame
ObservationNone; an optional synchronous borrowed callback
Tool processingExecutor-owned ordered before/after processors
Tool dispatchConcurrent pending calls; panic becomes failed result
Tool timeoutNone; local timeout becomes unknown outcome
Unknown outcomesCommit the successful batch, then stop
Output retention and persistenceCaller-owned policies and storage

The runner does not interpret imported tool declarations as work to resume. It creates work only from the current model output. Session admission, history, input queues, retries, budget strategies and observation storage belong to callers. Dropping a run future or panicking bypasses the normal material-return guarantee; stopping local waits cannot undo remote effects.

Re-exports§

pub use composition::ToolBridge;
pub use config::TurnLimits;
pub use config::TurnRunOptions;
pub use control::RunControl;
pub use driver::TurnInterruption;
pub use driver::TurnOutcome;
pub use driver::TurnResult;
pub use driver::TurnRunner;
pub use event::RunEvent;
pub use event::RunObserver;
pub use executor::BoundTools;
pub use executor::ToolCatalogError;
pub use executor::ToolExecutor;
pub use executor::ToolExecutorOptions;
pub use executor::ToolProcessingError;
pub use executor::ToolProcessorPhase;
pub use executor::ToolRegistryError;
pub use ids::new_block_id;

Modules§

composition
Composition layer — adapters bridging kernel ports into each other.
config
Per-run choices for the minimal runner.
control
Execution cancellation and absolute deadline.
driver
Single-run material ownership and logical model execution.
event
Optional synchronous observations; consumers own retained copies.
executor
Invocation-bound tool catalogs and controlled whole-batch processing.
ids
Runtime identity allocation conveniences.