pub struct StrategyStore { /* private fields */ }Implementations§
Source§impl StrategyStore
impl StrategyStore
Sourcepub fn database_path(portable_root: &Path) -> PathBuf
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
impl StrategyStore
pub fn open(portable_root: &Path) -> Result<StrategyStore, Error>
pub fn open_for_migration(portable_root: &Path) -> Result<StrategyStore, Error>
pub fn open_in_memory() -> Result<StrategyStore, Error>
pub fn db_path(&self) -> &Path
pub fn durable_queue(&self) -> DurableQueue
pub fn durable_subscriptions(&self) -> DurableSubscriptionStore
pub fn durable_control(&self) -> DurableControlledStore
pub fn with_connection<T>( &self, operation: impl FnOnce(&mut Connection) -> Result<T, Error>, ) -> Result<T, Error>
pub fn register_definition( &self, revision_digest: &str, semantics_digest: &str, workflow: &WorkflowDefinition, asset_count: usize, imported_at_unix_ms: i64, ) -> Result<StrategyDefinition, Error>
pub fn list_definitions(&self) -> Result<Vec<StrategyDefinitionSummary>, Error>
pub fn definition_by_revision( &self, revision_digest: &str, ) -> Result<StrategyDefinition, Error>
pub fn latest_definition( &self, definition_id: &str, ) -> Result<StrategyDefinition, Error>
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>
pub fn replace_slot_bindings( &self, revision_digest: &str, slot_id: &str, candidates: &[BindingCandidate], expected_revision: Option<u64>, ) -> Result<Vec<BindingValue>, Error>
pub fn remove_binding( &self, revision_digest: &str, slot_id: &str, expected_revision: Option<u64>, ) -> Result<(), Error>
pub fn start_run( &self, revision_digest: &str, input: Value, idempotency_key: &str, conversation_id: Option<&str>, cwd: Option<String>, ) -> Result<RunSnapshot, Error>
Sourcepub 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>
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.
pub fn run_id_by_idempotency_key( &self, idempotency_key: &str, ) -> Result<Option<String>, Error>
pub fn run(&self, run_id: &str) -> Result<RunSnapshot, Error>
pub fn apply_event( &self, run_id: &str, event: ReducerEvent, ) -> Result<RunSnapshot, Error>
pub fn claim_next_command( &self, run_id: &str, claimant: &str, lease_until_unix_ms: i64, ) -> Result<Option<RunCommand>, Error>
pub fn renew_command_lease( &self, command_id: &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.
Sourcepub fn recover_next_expired_command(&self, run_id: &str) -> Result<bool, Error>
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.
pub fn projection_for_definition( &self, revision_digest: &str, ) -> Result<StrategyProjection, Error>
pub fn projection_for_run( &self, run_id: &str, ) -> Result<StrategyProjection, Error>
pub fn active_run_for_conversation( &self, revision_digest: &str, conversation_id: &str, ) -> Result<Option<RunSnapshot>, Error>
pub fn bind_conversation_if_absent( &self, run_id: &str, conversation_id: &str, ) -> Result<(), Error>
Trait Implementations§
Source§impl Clone for StrategyStore
impl Clone for StrategyStore
Source§fn clone(&self) -> StrategyStore
fn clone(&self) -> StrategyStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more