Skip to main content

DispatchRecorder

Trait DispatchRecorder 

Source
pub trait DispatchRecorder:
    Send
    + Sync
    + Debug {
    // Required method
    fn record<'life0, 'life1, 'async_trait>(
        &'life0 self,
        mutation: &'life1 DispatchMutation,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn commit_accepted_step<'life0, 'async_trait>(
        &'life0 self,
        _messages: Vec<Message>,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Signs + durably records a dispatch mutation before it applies (#67).

Called BEFORE the mutated operation may proceed (#539/#540). The harness holds no signing key, so this is the seam through which a mutation reaches the control plane’s provenance signer.

Fail-closed contract: Self::record returning Err means the mutation could not be recorded, so the caller MUST NOT apply it — a rewrite/injection then denies the call, and a redaction that can’t be recorded withholds the unredacted result. An absent recorder means no mutation is applied at all (the proposed call runs unchanged), so mutations are off unless a signer is wired.

Required Methods§

Source

fn record<'life0, 'life1, 'async_trait>( &'life0 self, mutation: &'life1 DispatchMutation, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record mutation durably. Ok(()) authorizes applying it; Err(reason) fails closed.

Provided Methods§

Source

fn commit_accepted_step<'life0, 'async_trait>( &'life0 self, _messages: Vec<Message>, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Commit one accepted execution-step body group before the turn may make another provider or tool call.

The served harness implements this with a labeled proposal and a State receipt from Control. A recorder that cannot supply that durability barrier fails closed rather than allowing a turn to continue with work that cannot be resumed safely.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§