Skip to main content

DecisionActionExecutor

Trait DecisionActionExecutor 

Source
pub trait DecisionActionExecutor: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 DecisionExecutionRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>, DecisionExecutorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn execution_class(&self) -> DecisionExecutionClass { ... }
    fn supports_payload_strategy(&self, _strategy: &PayloadStrategyRef) -> bool { ... }
    fn execute_with_snapshot<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        request: &'life1 DecisionExecutionRequest,
        snapshot: &'life2 KnowledgeSnapshot,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>, DecisionExecutorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Narrow execution API implemented by native collectors and plugin bridges.

The contract for what an executor may read is deliberately minimal:

Required Methods§

Source

fn id(&self) -> &str

Returns the stable identity used by planner executor fields and routes.

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 DecisionExecutionRequest, ) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>, DecisionExecutorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes one semantic action request and returns immutable observations only.

Every returned observation must describe request.case().subject(), identify this executor as its source component, and carry the case ID as its source correlation ID. The adapter rejects the complete batch when any observation violates that contract.

Provided Methods§

Source

fn execution_class(&self) -> DecisionExecutionClass

Returns how this executor is driven. Defaults to DecisionExecutionClass::TransportBound so existing executors keep their current transport-accounted execution path unchanged.

Source

fn supports_payload_strategy(&self, _strategy: &PayloadStrategyRef) -> bool

Returns whether this executor can materialize an exact strategy revision.

The fail-closed default prevents a legacy executor from silently ignoring planner-selected strategy semantics.

Source

fn execute_with_snapshot<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, request: &'life1 DecisionExecutionRequest, snapshot: &'life2 KnowledgeSnapshot, ) -> Pin<Box<dyn Future<Output = Result<Vec<Evidence>, DecisionExecutorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Executes a DecisionExecutionClass::LocalKnowledge action from an immutable subject-scoped snapshot, returning immutable observations under the same provenance contract as execute.

This is additive: transport-bound executors never receive this call, so they need not implement it. It is deliberately fail-closed — the default returns a deterministic error rather than delegating to execute. An executor that declares DecisionExecutionClass::LocalKnowledge but forgets to override this method therefore cannot silently run transport work while the runtime has already skipped request preflight, response accounting, and HTTP telemetry validation for it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§