Skip to main content

Crate aa_storage

Crate aa_storage 

Source
Expand description

Storage trait abstraction for the Agent Assembly persistence layer.

This crate is a thin facade over aa_core::storage: it re-exports the storage trait contract verbatim. The traits themselves live in aa-core so they can also be reached at aa_core::storage::* — the two import paths are interchangeable. Backend driver crates may depend on this crate to express “I implement the storage contract” without coupling to the rest of aa-core’s API surface, and existing aa_storage::* paths keep working.

The crate is a pure interface — no concrete backend dependency (no sqlx, redis, or tonic).

§Traits

  • PolicyStore — fetch and invalidate an agent’s effective policy
  • AuditSink — append-only emission of audit entries
  • SessionStore — persist, load, and delete per-execution session records
  • CredentialStore — store and retrieve named secret material
  • RateLimitCounter — read-modify-write counters for rate limiting
  • LifecycleStore — agent register / heartbeat / deregister bookkeeping

§Single import path

use aa_storage::{AgentId, AuditSink, PolicyDocument, PolicyStore};

Modules§

builtin
Placeholder registration of the OSS driver names.
conformance
Reusable trait-conformance harness for driver crates.
factory
Factory traits that build a storage backend from its TOML subsection.

Structs§

AgentId
Stable identifier for an agent — UUID v4 encoded as raw bytes.
AuditEntry
An immutable, hash-chained record of a single governance event.
DriverName
Name of a storage driver as written in agent-assembly.toml (e.g. "redis", "postgres", "memory").
PolicyDocument
Minimal policy document stub.
Registry
Registry of storage-driver factories, keyed by DriverName per kind.
SessionId
Per-execution session identifier — UUID v4 encoded as raw bytes.
SessionRecord
A persisted record of a single agent execution session.
StorageConfig
The [storage] section: which driver backs each storage kind, plus the per-driver connection subsections.

Enums§

ConfigError
Error returned when a [storage] configuration cannot be resolved against the driver Registry.
StorageError
Failure modes common to all storage backends.

Traits§

AuditSink
Append-only sink for governance AuditEntry records.
CredentialStore
Stores and retrieves named secret material as opaque bytes.
LifecycleStore
Tracks agent liveness through register, heartbeat, and deregister.
PolicyStore
Fetches and invalidates the effective PolicyDocument for an agent.
RateLimitCounter
Atomic counters keyed by an arbitrary string, used for rate limiting.
SessionStore
Persists, loads, and deletes SessionRecords.

Type Aliases§

Result
Convenience alias for results returned by storage trait methods.