mod traits#

module traits#

Async storage traits implemented by adaptive persistence backends. Storage traits used by adaptive backends.

Traits

trait StorageBackend#

Minimal async storage interface required by the adaptive runtime.

Functions

fn list_runs(&self, agent_id: &str) -> impl Future<Output = Result<Vec<RunRecord>>> + Send#

List stored runs for an agent.

fn load_plan(&self, agent_id: &str) -> impl Future<Output = Result<Option<ExecutionPlan>>> + Send#

Load the current execution plan for an agent.

fn store_run(&self, record: &RunRecord) -> impl Future<Output = Result<()>> + Send#

Persist one observed run.

trait StorageBackendDyn#

Object-safe storage interface used by the adaptive runtime.

Backends implement this trait when they need to be stored behind trait objects and accessed through dynamic dispatch.

Functions

fn list_runs_dyn<'a>(&'a self, agent_id: &'a str) -> BoxStorageFuture<'a, Vec<RunRecord>>#

List stored runs for an agent.

fn load_accumulators<'a>(&'a self, agent_id: &'a str) -> BoxStorageFuture<'a, Option<AccumulatorState>>#

Load trie accumulator state for an agent.

fn load_observations<'a>(&'a self, _agent_id: &'a str) -> BoxStorageFuture<'a, Option<PromptIrList>>#

Load prompt IR observations for an agent or derived ACG profile.

Notes

The default implementation returns Ok(None).

fn load_plan_dyn<'a>(&'a self, agent_id: &'a str) -> BoxStorageFuture<'a, Option<ExecutionPlan>>#

Load the current execution plan for an agent.

fn load_stability<'a>(&'a self, _agent_id: &'a str) -> BoxStorageFuture<'a, Option<StabilityResult>>#

Load an ACG stability result for an agent or derived profile.

Notes

The default implementation returns Ok(None).

fn load_trie<'a>(&'a self, agent_id: &'a str) -> BoxStorageFuture<'a, Option<TrieEnvelope>>#

Load the serialized prediction trie for an agent.

fn store_accumulators<'a>(&'a self, agent_id: &'a str, state: &'a AccumulatorState) -> BoxStorageFuture<'a, ()>#

Persist trie accumulator state for an agent.

fn store_observations<'a>(&'a self, _agent_id: &'a str, _observations: &'a [crate::acg::prompt_ir::PromptIR]) -> BoxStorageFuture<'a, ()>#

Persist prompt IR observations for an agent or derived ACG profile.

Notes

The default implementation is a no-op.

fn store_plan(&self, _plan: &ExecutionPlan) -> Result<()>#

Persist an execution plan for an agent.

Notes

The default implementation is a no-op for backends that do not persist plans.

fn store_run_dyn<'a>(&'a self, record: &'a RunRecord) -> BoxStorageFuture<'a, ()>#

Persist one observed run.

fn store_stability<'a>(&'a self, _agent_id: &'a str, _result: &'a StabilityResult) -> BoxStorageFuture<'a, ()>#

Persist an ACG stability result for an agent or derived profile.

Notes

The default implementation is a no-op.

fn store_trie<'a>(&'a self, agent_id: &'a str, envelope: &'a TrieEnvelope) -> BoxStorageFuture<'a, ()>#

Persist a serialized prediction trie for an agent.