pub struct Runner {
pub facade: Arc<AreevFacade>,
pub clock: Arc<dyn Clock>,
pub executor: Arc<dyn HostToolExecutor>,
pub llm: Option<Arc<dyn ToolCallLlm>>,
pub observer: Option<Arc<dyn RunObserver>>,
pub ns: String,
pub principal: String,
}Expand description
The runtime driver: a host over one facade.
Fields§
§facade: Arc<AreevFacade>§clock: Arc<dyn Clock>§executor: Arc<dyn HostToolExecutor>§llm: Option<Arc<dyn ToolCallLlm>>The tool-calling model for abstract nodes; None = abstract nodes
refuse at load (RUN-E006).
observer: Option<Arc<dyn RunObserver>>§6.10 streaming subscriber; None = no events. Observational only — a slow observer delays (and eventually loses) events, never the run.
ns: String§principal: StringImplementations§
Source§impl Runner
impl Runner
Sourcepub fn start(
&self,
plan_hash: &Hash,
run_id: &str,
input: Value,
opts: &RunOptions,
) -> Result<RunSession, RunError>
pub fn start( &self, plan_hash: &Hash, run_id: &str, input: Value, opts: &RunOptions, ) -> Result<RunSession, RunError>
Start a new run of the Workflow at plan_hash and drive it until it
finishes or parks on a Client ask.
Sourcepub fn resume(
&self,
run_id: &str,
opts: &RunOptions,
) -> Result<RunSession, RunError>
pub fn resume( &self, run_id: &str, opts: &RunOptions, ) -> Result<RunSession, RunError>
Resume a run from its latest checkpoint: settle expired asks, adopt journaled responses, re-deliver dangling intents (§5.3).
Sourcepub fn fork(
&self,
base_run_id: &str,
at_superstep: Option<u64>,
new_run_id: &str,
new_plan: Option<&Hash>,
opts: &RunOptions,
) -> Result<Hash, RunError>
pub fn fork( &self, base_run_id: &str, at_superstep: Option<u64>, new_run_id: &str, new_plan: Option<&Hash>, opts: &RunOptions, ) -> Result<Hash, RunError>
§5.4 time-travel fork: a NEW run descending from one of base’s
checkpoints. The fork’s manifest records (base_run, base_checkpoint), an mg:fork_of Fact indexes the relationship,
and the SEED checkpoint derived_froms the base checkpoint — the
verifiability chain. The base run is never touched.
- Same plan (
new_plan = None): the base checkpoint’s scheduler state carries over under the new run id; the fork re-executes everything past the checkpoint under its own journal keys. ABudgetExhaustedterminal re-opens (that is how a run continues under raised budgets — budgets are the fork’s own knobs). - New plan (in-flight migration): full §6.1 validation re-runs; the graph restarts at its entry with the base checkpoint’s CONTEXT as the input.
v1 refuses forking a checkpoint that parked mid-superstep (pending asks address journal keys of the parent) — pick a closed superstep.
Returns the seed checkpoint hash; resume continues the fork.
Sourcepub fn respond(
&self,
run_id: &str,
tool_call_id: &str,
result: Value,
is_error: bool,
responder: &str,
) -> Result<(), RunError>
pub fn respond( &self, run_id: &str, tool_call_id: &str, result: Value, is_error: bool, responder: &str, ) -> Result<(), RunError>
Answer a Client ask (§6.6’s validation order). Responding and
resuming are separate acts: this writes the journaled result and
returns; resume spends the compute.
Sourcepub fn cancel(
&self,
run_id: &str,
principal: &str,
reason: &str,
) -> Result<(), RunError>
pub fn cancel( &self, run_id: &str, principal: &str, reason: &str, ) -> Result<(), RunError>
Write the cancel marker (the kill-switch primitive). The drive loop
polls it every iteration; resume after cancel drains.
Sourcepub fn shadow_eval(&self, run_ids: &[String]) -> ShadowReport
pub fn shadow_eval(&self, run_ids: &[String]) -> ShadowReport
Shadow evaluation (§8 Wave 4): journal-consistent replay of the given runs, writing nothing and dispatching nothing — the verify path holds no executor, no pool, and no model, so “zero effect dispatches” is a property of the code shape, and the report states it explicitly for the §7.4 pre-apply gate. A run that fails to load is reported inconsistent, never skipped silently.
Sourcepub fn recent_runs(&self, limit: usize) -> Result<Vec<String>, RunError>
pub fn recent_runs(&self, limit: usize) -> Result<Vec<String>, RunError>
The run_ids of the most recent runs in this namespace, newest
first — manifest link Facts in agent:harness are the census.
Sourcepub fn verify(&self, run_id: &str) -> Result<VerifyReport, RunError>
pub fn verify(&self, run_id: &str) -> Result<VerifyReport, RunError>
§5.5 gate 1 / verify tier 1: journal-consistent replay. Re-drives
the run from the manifest’s input with the clock scripted from
journaled readings and every effect answered from the journal —
writing NOTHING — and byte-compares every checkpoint the replay
commands against the stored chain. A missing journaled result stops
verification at that step (reported, not asserted); a divergent
checkpoint is the RUN-E009 condition, reported with both hashes.
Auto Trait Implementations§
impl !RefUnwindSafe for Runner
impl !UnwindSafe for Runner
impl Freeze for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more