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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Configuration for the SQLite event buffer.
use PathBuf;
use Deserialize;
/// Default maximum number of events retained before the oldest are evicted.
///
/// Bounds disk use while still tolerating a multi-minute upstream outage at
/// typical audit-event rates.
pub const DEFAULT_CAP: usize = 10_000;
/// Resolve the default buffer database path.
///
/// Returns the platform data directory joined with `agent-assembly/buffer.db` —
/// `~/.local/share/agent-assembly/buffer.db` on Linux (per the XDG
/// base-directory spec). Falls back to a relative `buffer.db` when no data
/// directory can be determined.
/// Operator configuration for the SQLite event buffer.
///
/// Deserialized from the `[storage.sqlite_buffer]` table of
/// `agent-assembly.toml`. Both fields are optional; omitted fields fall back to
/// [`default_path`] and [`DEFAULT_CAP`].
///
/// ```
/// use aa_storage_sqlite_buffer::{SqliteBufferConfig, DEFAULT_CAP};
///
/// let cfg = SqliteBufferConfig::default();
/// assert_eq!(cfg.cap, DEFAULT_CAP);
/// ```