1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Policy version history for aa-gateway.
//!
//! Tracks applied policy versions with timestamps and change attribution,
//! enabling rollback to any previous version.
//!
//! # Storage layout
//!
//! Each applied policy is stored as a pair of files in the history directory
//! (default `~/.aa/policy-history/`, configurable via [`HistoryConfig`]):
//!
//! ```text
//! ~/.aa/policy-history/
//! 20260428T120000Z-abcdef12.yaml # YAML snapshot
//! 20260428T120000Z-abcdef12.meta.json # JSON metadata sidecar
//! ```
//!
//! The naming convention is `<ISO-8601-timestamp>-<sha256-prefix>`.
//!
//! # Key types
//!
//! - [`PolicyVersionMeta`] — lightweight index entry (JSON sidecar content)
//! - [`PolicySnapshot`] — full version: metadata + YAML body
//! - [`HistoryConfig`] — directory path and retention limit
//! - [`PolicyHistoryError`] — error variants for store operations
//! - [`PolicyHistoryStore`] — async trait for storage backends
pub use HistoryConfig;
pub use PolicyHistoryError;
pub use FsHistoryStore;
pub use PolicyVersionMeta;
pub use PolicySnapshot;
pub use PolicyHistoryStore;