aa_core/storage/mod.rs
1//! Storage trait abstraction for the Agent Assembly persistence layer.
2//!
3//! This module defines the narrow storage traits that every persistence backend
4//! implements. It is a **pure interface** — no concrete backend dependency
5//! (no `sqlx`, no `redis`, no `tonic`); it uses only `async-trait`, `thiserror`,
6//! and the concrete domain types from `aa-core`.
7//!
8//! The OSS Postgres/Redis/memory drivers and the Enterprise gateway driver all
9//! implement the same contract, so swapping the persistence backend never
10//! changes any caller code.
11//!
12//! Callers import the traits and the domain types they reference from one path:
13//!
14//! ```
15//! use aa_core::storage::{AgentId, AuditSink, PolicyDocument, PolicyStore};
16//! ```
17//!
18//! The [`aa-storage`](https://docs.rs/aa-storage) crate re-exports this module
19//! verbatim, so `aa_storage::*` and `aa_core::storage::*` are interchangeable.
20
21mod audit_sink;
22pub mod conformance;
23mod credential_store;
24mod error;
25mod lifecycle_store;
26mod policy_store;
27mod rate_limit_counter;
28mod session_store;
29
30pub use audit_sink::AuditSink;
31pub use credential_store::CredentialStore;
32pub use error::{Result, StorageError};
33pub use lifecycle_store::LifecycleStore;
34pub use policy_store::PolicyStore;
35pub use rate_limit_counter::RateLimitCounter;
36pub use session_store::{SessionRecord, SessionStore};
37
38// Re-export the concrete domain types the traits reference so call sites import
39// the storage contract and its types from a single path.
40pub use crate::audit::AuditEntry;
41pub use crate::identity::{AgentId, SessionId};
42pub use crate::policy::PolicyDocument;