ExAgent. Judge. Approval
(ExAgent v3.0.0)
View Source
Review and certify a persisted :ask decision.
Stability — Candidate.
The host reads an approval request from ExAgent.Continuation.pending/2
and gives it to review/3. Pass the resulting review to commit/3, then
use the returned continuation reference on the ordinary resume path. Review
does the inference. Commit uses the existing C7 approval CAS and can be
retried with the same review after a lost acknowledgement.
The host authorizes disclosure of the stored call to the reviewer with
:review, and authorizes :approve or :deny when committing. Both
calls must return the same reviewer actor ID. An abstention or unavailable
review leaves the approval pending. A review whose inference outcome was lost
also remains pending for explicit resolution. Resuming the run consumes the
recorded decision even if the reviewer is now offline.
Summary
Functions
Commit the review using the original request's operation ID.
Read the actor and bounded verdict evidence from a confirmed automatic
decision in the trusted scoped Store. Returns {:error, :no_review_evidence}
for a pending or manual decision.
Obtain a decisive review for the exact stored request.
The review's qualified usage, separate from the paused run's accounting.
Types
Functions
@spec commit(ExAgent.Store.scoped(), t(), keyword()) :: {:ok, ExAgent.Continuation.admin_reply()} | {:error, term()}
Commit the review using the original request's operation ID.
Supply :actor, :authorize and optionally :catalog and :diagnostics, as for
ExAgent.Continuation.decide/4. The authorizer's target includes
:review with the bounded evidence. A denial uses the ordinary fixed
tool denial message. Reviewer explanations and usage stay outside the
decision record. usage/1 returns the measured usage to the host.
@spec evidence(ExAgent.Store.scoped(), ExAgent.Continuation.ApprovalRequest.t()) :: {:ok, evidence()} | {:error, term()}
Read the actor and bounded verdict evidence from a confirmed automatic
decision in the trusted scoped Store. Returns {:error, :no_review_evidence}
for a pending or manual decision.
@spec review( ExAgent.Store.scoped(), ExAgent.Continuation.ApprovalRequest.t(), keyword() ) :: {:ok, t()} | {:error, term()}
Obtain a decisive review for the exact stored request.
Supply the approval policy options of ExAgent.Judge.approver/1, excluding
:escalate. Also supply :actor, :authorize and a :version for the
reviewer policy. Versions and reviewer actor IDs are 1–64 ASCII letters,
digits, underscores, hyphens or dots. Bump the version when the reviewer
policy changes. Pass :catalog to validate the stored definition and tool
before sharing the request with the reviewer.
The reviewer uses its own usage and timeout. The paused run's Store clock
also caps the review by its expiry and deadline. {:error, :review_abstained}
asks the host to decide through its usual approval inbox. An inference error
is returned as {:error, {:review_failed, reason}}.
@spec usage(t()) :: ExAgent.Message.Usage.t()
The review's qualified usage, separate from the paused run's accounting.