Skip to main content

AutoApprovingElicitor

Struct AutoApprovingElicitor 

Source
pub struct AutoApprovingElicitor;
Expand description

ElicitationInvoker that immediately approves every elicitation: dispatch returns a synthetic id (echoing the requested from as the resolved approver), check reports Resolved { Approved } on the first pass, and validate returns a genuine verdict. This lets a single request flow dispatch → check → validate → allow without a real channel — for evaluator tests and offline demos.

NOT for production: it makes no actual approval decision. Hosts wire a real channel invoker (e.g. the apl-cpex ElicitationHandler bridge).

Trait Implementations§

Source§

impl Default for AutoApprovingElicitor

Source§

fn default() -> AutoApprovingElicitor

Returns the “default value” for a type. Read more
Source§

impl ElicitationInvoker for AutoApprovingElicitor

Source§

fn dispatch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, step: &'life1 ElicitStep, resolved_from: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<ElicitationDispatch, ElicitationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

First arrival. Register the intent and open the channel backchannel for step, returning the correlation id plus the pending metadata the evaluator writes into the bag (elicitation.id / .approver / .intent_id). Short and synchronous — the human’s decision happens after this returns, inside the channel. Read more
Source§

fn check<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _step: &'life1 ElicitStep, _id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<ElicitationStatus, ElicitationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retry. Read the current status of a dispatched elicitation by id without blocking — Pending until the human acts, then Resolved (carrying approved/denied) or Expired. step is passed (the same step that dispatched) so the invoker can resolve which handler plugin owns this elicitation — on a retry only the id is in the bag, but the step is still in scope.
Source§

fn validate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _step: &'life1 ElicitStep, _id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<ElicitationValidation, ElicitationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Resolution. Verify that the resolved response is genuine — the signed token validates, its intent binding matches this id, and the responder is the resolved approver. Returns the verdict plus the facts the evaluator records for audit. The runtime applies the scope-over-args check separately before honoring an approval. step resolves the owning handler plugin (see check).

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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