ExAgent. Continuation. Recovery. Policy
(ExAgent v3.0.0)
View Source
Versioned decisions for supervised recovery of an uncertain continuation.
Stability — Stable.
Version 1 closes model-only uncertainty by default. It can prepare one linked retry for a declared read, or look up a write's outcome by its saved key. Settling a write requires its declared reconciler and confirmed evidence. An unresolved callback, deferral, or write without a matching lookup stays in the inbox. All operations still require authorization.
Summary
Functions
Build the versioned policy for Continuation.Recovery. With no options,
model-only uncertainty closes as :cancelled with its evidence intact.
Bind a custom unary decision function to a versioned policy reference.
See ExAgent.Continuation.Recovery for the decision actions and context.
Change the version when the function's decisions change.
Types
@type model_resolver() :: (resolver_context() -> {:ok, ExAgent.t(), map()} | nil)
@type resolver_context() :: %{ namespace: String.t(), effect: ExAgent.Continuation.effect_summary() }
@opaque t()
@type tool_resolver() :: (resolver_context() -> ExAgent.Tool.t() | nil)
Functions
Build the versioned policy for Continuation.Recovery. With no options,
model-only uncertainty closes as :cancelled with its evidence intact.
:modelaccepts:cancel(default),:leave, or{:retry, resolver}. Selecting retry explicitly accepts possible duplicate provider spend. The resolver returns the effect's trusted agent and continuation binding as{:ok, agent, binding}, ornil. A linked retry uses the saved key when present and otherwise uses the effect ID. A lost retry remains in the inbox. Use a catalogue in place of the resolver to select an exact saved effect leaf.:resolve_tooloptionally returns the trustedToolthat matches the saved effect's leaf and name, ornil. ExAgent checks the persisted tool fingerprint and asks the authorizer before invoking its reconciler. A catalogue resolves the exact leaf and selects the tool by name.
Resolvers receive the trusted Store namespace and effect metadata. Use the namespace to choose tenant-specific bindings. Keep the lookup read-only and bounded. The policy never invokes the tool's write callable.
@spec new( ExAgent.Continuation.versioned_reference(), (ExAgent.Continuation.run_details() -> term()) ) :: t()
Bind a custom unary decision function to a versioned policy reference.
See ExAgent.Continuation.Recovery for the decision actions and context.
Change the version when the function's decisions change.