pub struct DurableInvocationExecutor { /* private fields */ }Expand description
First-party durable model/tool attempt executor.
Implementations§
Source§impl DurableInvocationExecutor
impl DurableInvocationExecutor
Sourcepub fn supports_tool_reconciliation(
&self,
descriptor: &ToolDescriptor,
) -> Result<bool, ToolProviderRegistryError>
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.
Sourcepub fn new(
store: PostgresStore,
schemas: JsonSchemaRegistry,
models: ModelProviderRegistry,
tools: ToolProviderRegistry,
budget: Arc<dyn InvocationBudgetProvider>,
options: DurableInvocationExecutorOptions,
) -> Result<Self, DurableInvocationExecutorBuildError>
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.
Sourcepub fn with_clock(
store: PostgresStore,
schemas: JsonSchemaRegistry,
models: ModelProviderRegistry,
tools: ToolProviderRegistry,
budget: Arc<dyn InvocationBudgetProvider>,
clock: Arc<dyn InvocationClock>,
options: DurableInvocationExecutorOptions,
) -> Result<Self, DurableInvocationExecutorBuildError>
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.
Sourcepub fn execute_model(
&self,
handoff: ModelAttemptHandoff,
) -> BoxFuture<'_, Result<ModelAttemptOutcome, ModelAttemptExecutionError>>
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.
Sourcepub fn commit_model_terminal(
&self,
handoff: ModelTerminalCommitHandoff,
) -> BoxFuture<'_, Result<ModelAttemptOutcome, ModelTerminalCommitError>>
pub fn commit_model_terminal( &self, handoff: ModelTerminalCommitHandoff, ) -> BoxFuture<'_, Result<ModelAttemptOutcome, ModelTerminalCommitError>>
Commits retained terminal model evidence without provider I/O.
Sourcepub fn execute_tool(
&self,
handoff: ToolAttemptHandoff,
) -> BoxFuture<'_, Result<ToolAttemptOutcome, ToolAttemptExecutionError>>
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.
Sourcepub fn start_tool_attempt(
&self,
handoff: ToolAttemptHandoff,
) -> BoxFuture<'_, Result<ToolAttemptStartOutcome, ToolAttemptExecutionError>>
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.
Sourcepub fn dispatch_started_tool(
&self,
handoff: ToolDispatchHandoff,
) -> BoxFuture<'_, ToolTerminalCommitHandoff>
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.
Sourcepub fn commit_tool_terminal(
&self,
handoff: ToolTerminalCommitHandoff,
) -> BoxFuture<'_, Result<ToolAttemptOutcome, ToolTerminalCommitError>>
pub fn commit_tool_terminal( &self, handoff: ToolTerminalCommitHandoff, ) -> BoxFuture<'_, Result<ToolAttemptOutcome, ToolTerminalCommitError>>
Commits retained terminal tool evidence without calling the tool.
Sourcepub fn reconcile_tool(
&self,
handoff: ToolReconciliationAttemptHandoff,
) -> BoxFuture<'_, Result<ToolReconciliationAttemptOutcome, ToolReconciliationAttemptExecutionError>>
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.
Sourcepub fn commit_tool_reconciliation(
&self,
handoff: ToolReconciliationHandoff,
) -> BoxFuture<'_, Result<ToolReconciliationOutcome, ToolReconciliationCommitError>>
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§
Auto Trait Implementations§
impl !RefUnwindSafe for DurableInvocationExecutor
impl !UnwindSafe for DurableInvocationExecutor
impl Forget for DurableInvocationExecutor
impl Freeze for DurableInvocationExecutor
impl Move for DurableInvocationExecutor
impl Send for DurableInvocationExecutor
impl Sync for DurableInvocationExecutor
impl Unpin for DurableInvocationExecutor
impl UnsafeUnpin for DurableInvocationExecutor
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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