Skip to main content

DurableInvocationExecutor

Struct DurableInvocationExecutor 

Source
pub struct DurableInvocationExecutor { /* private fields */ }
Expand description

First-party durable model/tool attempt executor.

Implementations§

Source§

impl DurableInvocationExecutor

Source

pub fn supports_tool_reconciliation( &self, descriptor: &ToolDescriptor, ) -> Result<bool, ToolProviderRegistryError>

Returns whether the exact installed binding implements reconciliation.

§Errors

Fails if no exact provider binding exists for the descriptor snapshot.

Source

pub fn new( store: PostgresStore, schemas: JsonSchemaRegistry, models: ModelProviderRegistry, tools: ToolProviderRegistry, budget: Arc<dyn InvocationBudgetProvider>, options: DurableInvocationExecutorOptions, ) -> Result<Self, DurableInvocationExecutorBuildError>

Builds an executor using the production system/monotonic clock.

§Errors

Fails unless the exact embedded invocation journal schema is installed in the frozen offline registry.

Source

pub fn with_clock( store: PostgresStore, schemas: JsonSchemaRegistry, models: ModelProviderRegistry, tools: ToolProviderRegistry, budget: Arc<dyn InvocationBudgetProvider>, clock: Arc<dyn InvocationClock>, options: DurableInvocationExecutorOptions, ) -> Result<Self, DurableInvocationExecutorBuildError>

Builds an executor with an injected trusted paired clock.

§Errors

Fails unless the exact embedded invocation journal schema is installed.

Source

pub fn execute_model( &self, handoff: ModelAttemptHandoff, ) -> BoxFuture<'_, Result<ModelAttemptOutcome, ModelAttemptExecutionError>>

Executes at most one physical model provider exchange.

StartAttempt commits before provider I/O. If that event is found idempotently, this method loads current state and never calls the model. A terminal database failure returns the exact response/error recovery handoff so callers can retry persistence without repeating provider I/O.

Source

pub fn commit_model_terminal( &self, handoff: ModelTerminalCommitHandoff, ) -> BoxFuture<'_, Result<ModelAttemptOutcome, ModelTerminalCommitError>>

Commits retained terminal model evidence without provider I/O.

Source

pub fn execute_tool( &self, handoff: ToolAttemptHandoff, ) -> BoxFuture<'_, Result<ToolAttemptOutcome, ToolAttemptExecutionError>>

Executes at most one physical tool implementation call.

Start duplicate suppression and retained terminal recovery have the same no-repeat semantics as Self::execute_model.

Source

pub fn start_tool_attempt( &self, handoff: ToolAttemptHandoff, ) -> BoxFuture<'_, Result<ToolAttemptStartOutcome, ToolAttemptExecutionError>>

Commits a tool attempt start without performing provider I/O.

Only ToolAttemptStartOutcome::Started grants dispatch authority. This split is intended for bounded ordered coordinators; ordinary callers should prefer Self::execute_tool.

Source

pub fn dispatch_started_tool( &self, handoff: ToolDispatchHandoff, ) -> BoxFuture<'_, ToolTerminalCommitHandoff>

Performs exactly one provider call for a fresh durable start and retains its terminal evidence without committing it.

The returned handoff must be committed with Self::commit_tool_terminal. Separating provider completion from the commit lets a coordinator restore proposal-order journal semantics even when read-only calls finish out of order.

Source

pub fn commit_tool_terminal( &self, handoff: ToolTerminalCommitHandoff, ) -> BoxFuture<'_, Result<ToolAttemptOutcome, ToolTerminalCommitError>>

Commits retained terminal tool evidence without calling the tool.

Source

pub fn reconcile_tool( &self, handoff: ToolReconciliationAttemptHandoff, ) -> BoxFuture<'_, Result<ToolReconciliationAttemptOutcome, ToolReconciliationAttemptExecutionError>>

Performs at most one bounded provider reconciliation probe and commits any authoritative evidence atomically.

The current invocation is reloaded before provider I/O. If the stable reconciliation event already won, this returns the terminal revision without another query or replay. Pending performs no durable mutation; callers should persist a delayed node retry using the supplied interval.

Source

pub fn commit_tool_reconciliation( &self, handoff: ToolReconciliationHandoff, ) -> BoxFuture<'_, Result<ToolReconciliationOutcome, ToolReconciliationCommitError>>

Atomically commits authoritative evidence for an unknown tool attempt.

This is a trusted worker/operations boundary. It validates successful output against the frozen local schema registry, appends a distinct audit event, and advances the invocation in one fenced PostgreSQL transaction. It never resolves or calls a tool provider.

Trait Implementations§

Source§

impl Clone for DurableInvocationExecutor

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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