Skip to main content

Runner

Struct Runner 

Source
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: String

Implementations§

Source§

impl Runner

Source

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.

Source

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).

Source

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. A BudgetExhausted terminal 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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<K, Q> Comparable<Q> for K
where K: Borrow<Q> + ?Sized, Q: Ord + ?Sized,

Source§

fn compare(&self, key: &Q) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<K, Q> Equivalent<Q> for K
where K: Borrow<Q> + ?Sized, Q: Eq + ?Sized,

Source§

fn equivalent(&self, key: &Q) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Fruit for T
where T: Send + Downcast,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more