Skip to main content

Module driver

Module driver 

Source
Expand description

The execution stack here — retry scheduling, tool batch dispatch, artifact spill, control plumbing, and trace construction. The canonical consumer of the kernel’s contracts lives here, one layer up.

Structs§

AttemptTrace
One model attempt inside a round — an entry of the retry ledger.
Continuation
The single continuation of a paused turn: everything resuming needs beyond the paused outcome’s fact state, the runner, the new options, and the new control. Rounds and quotas are read from here — never from the trace, which is observational and may be trimmed freely without changing where a resume continues or what it may spend.
ConversationOutcome
The conversation entry’s counterpart to TurnOutcome: consume/return — the state comes back with the active turn sealed inside and its outcome stamped; the host then calls commit (Completed) or abort_turn (Interrupted).
ModelRoundTrace
One model round: framing, attempts, output, applied blocks, and its tool batch (when any).
OutputSummary
Summary of the model output that closed a round, recorded before any tool dispatch.
PreparedApproval
The hook-prepared work an approval pause checkpoints: the hook has already filtered / rejected / rewritten the model-emitted batch, and those decisions cannot be re-derived on resume — they are saved, not re-run. The original payloads remain derivable from the committed tool-call blocks (fact identity); the independent rewrite and rejections live here as serializable data.
ToolBatchTrace
One dispatched tool batch, as observed by the executor.
ToolCallTrace
One dispatched tool call, as observed by the executor.
TurnOutcome
A bare-turn entry’s result: the turn context (sealed unless the turn paused), the outcome, and the trace.
TurnRunner
The execution stack over the kernel’s ports: frame materialization, bounded model retry, tool batch dispatch through the hook and interaction seams, run control plumbing, and trace construction.
TurnTrace
The turn’s trace: one record per model round plus totals.

Enums§

PausePoint
Where a turn paused. The execution stack currently emits only the approval position; the steering position exists so hosts that suspend before a model round produce a continuation the same resume machinery consumes (the pause point and the round together define the next step — never free-floating Options).
TurnInterruption
Why a turn terminated in TurnResult::Interrupted. The serde shape (kind / detail) is part of the event wire contract; see the wire-contract note on TurnOutcome.
TurnResult
How a turn ended: completed, interrupted, or paused mid-turn. The serde shapes are a load-bearing wire contract (embedded in ContextEvent); tests/serialization.rs pins them.