Skip to main content

StrategyStore

Struct StrategyStore 

Source
pub struct StrategyStore { /* private fields */ }

Implementations§

Source§

impl StrategyStore

Source

pub fn database_path(portable_root: &Path) -> PathBuf

The strategy database path for a data root, without opening or creating the store.

Source§

impl StrategyStore

Source

pub fn open(portable_root: &Path) -> Result<StrategyStore, Error>

Source

pub fn open_for_migration(portable_root: &Path) -> Result<StrategyStore, Error>

Source

pub fn open_in_memory() -> Result<StrategyStore, Error>

Source

pub fn db_path(&self) -> &Path

Source

pub fn durable_queue(&self) -> DurableQueue

Source

pub fn durable_subscriptions(&self) -> DurableSubscriptionStore

Source

pub fn durable_control(&self) -> DurableControlledStore

Source

pub fn with_connection<T>( &self, operation: impl FnOnce(&mut Connection) -> Result<T, Error>, ) -> Result<T, Error>

Source

pub fn register_definition( &self, revision_digest: &str, semantics_digest: &str, workflow: &WorkflowDefinition, asset_count: usize, imported_at_unix_ms: i64, ) -> Result<StrategyDefinition, Error>

Source

pub fn list_definitions(&self) -> Result<Vec<StrategyDefinitionSummary>, Error>

Source

pub fn definition_by_revision( &self, revision_digest: &str, ) -> Result<StrategyDefinition, Error>

Source

pub fn latest_definition( &self, definition_id: &str, ) -> Result<StrategyDefinition, Error>

Source

pub fn update_binding( &self, revision_digest: &str, slot_id: &str, value_id: &str, model: &str, reasoning_effort: &str, expected_revision: Option<u64>, ) -> Result<BindingValue, Error>

Source

pub fn replace_slot_bindings( &self, revision_digest: &str, slot_id: &str, candidates: &[BindingCandidate], expected_revision: Option<u64>, ) -> Result<Vec<BindingValue>, Error>

Source

pub fn remove_binding( &self, revision_digest: &str, slot_id: &str, expected_revision: Option<u64>, ) -> Result<(), Error>

Source

pub fn authorization_preview( &self, revision_digest: &str, ) -> Result<StrategyAuthorization, Error>

Source

pub fn grant_authorization( &self, revision_digest: &str, expected_authorization_digest: &str, ) -> Result<StrategyAuthorization, Error>

Source

pub fn revoke_authorization(&self, revision_digest: &str) -> Result<(), Error>

Source

pub fn start_run( &self, revision_digest: &str, input: Value, idempotency_key: &str, conversation_id: Option<&str>, cwd: Option<String>, ) -> Result<RunSnapshot, Error>

Source

pub fn admit_assistant_run( &self, revision_digest: &str, semantics_digest: &str, workflow: &WorkflowDefinition, bindings: &[BindingValue], input: Value, idempotency_key: &str, conversation_id: &str, assistant_membership_id: &str, route_receipt: Value, ) -> Result<(RunSnapshot, bool), Error>

Atomically freezes one Assistant-temporary definition, exact Membership bindings, authorization and run snapshot. The definition digest already commits to the route receipt; existing rows must be byte-for-byte equivalent and can never be rebound.

Source

pub fn run_id_by_idempotency_key( &self, idempotency_key: &str, ) -> Result<Option<String>, Error>

Source

pub fn run(&self, run_id: &str) -> Result<RunSnapshot, Error>

Source

pub fn apply_event( &self, run_id: &str, event: ReducerEvent, ) -> Result<RunSnapshot, Error>

Source

pub fn claim_next_command( &self, run_id: &str, claimant: &str, lease_until_unix_ms: i64, ) -> Result<Option<RunCommand>, Error>

Source

pub fn renew_command_lease( &self, command_id: &str, claimant: &str, lease_until_unix_ms: i64, ) -> Result<(), Error>

Source

pub fn authorize_effect( &self, run_id: &str, command_id: &str, attempt_token: &str, expected_authorization_digest: &str, claimant: &str, lease_until_unix_ms: i64, ) -> Result<(), Error>

Revalidate the exact command and authorization immediately before an effect permit is issued. The write lock serializes this admission with binding updates and authorization revocation; a later revoke does not retroactively invalidate the already-issued one-shot permit.

Source

pub fn recover_next_expired_command(&self, run_id: &str) -> Result<bool, Error>

Atomically fence and recover the next expired effect claim of one run.

Lease renewal and this recovery both require the same SQLite write lock. The winner observes and commits one state transition; the loser cannot act on a stale pre-lock observation. Claimed-before-start work is retried in the same transaction, while expired running work is retained as in-doubt and is never blindly retried.

A previous host process disappearing is not an input here. There is no abandoned-host path: an unexpired claim stays held by its recorded owner, so process exit is neither lease revocation nor authority to repeat an external effect. Only the persisted lease clock resolves a claim, and only in one of two ways: a claim whose effect never started is retried against the same attempt identity, while a claim whose effect was already in flight stays in doubt and is never blindly repeated.

Source

pub fn projection_for_definition( &self, revision_digest: &str, ) -> Result<StrategyProjection, Error>

Source

pub fn projection_for_run( &self, run_id: &str, ) -> Result<StrategyProjection, Error>

Source

pub fn active_run_for_conversation( &self, revision_digest: &str, conversation_id: &str, ) -> Result<Option<RunSnapshot>, Error>

Source

pub fn bind_conversation_if_absent( &self, run_id: &str, conversation_id: &str, ) -> Result<(), Error>

Trait Implementations§

Source§

impl Clone for StrategyStore

Source§

fn clone(&self) -> StrategyStore

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StrategyStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.