Expand description
Local in-process SQLite event buffer for Agent Assembly.
When the upstream NATS/gateway is briefly unreachable, Assembly keeps
emitting governance AuditEntry records into this buffer instead of
dropping them. Once the connection recovers, the buffer flushes its backlog
— in insertion order — through the upstream AuditSink. This gives
Assembly partial
autonomy so a transient outage never silently loses audit-trail data.
The buffer is a single SQLite file opened in WAL mode, so a buffered event survives a process restart and is replayed on the next reconnect.
use aa_storage_sqlite_buffer::EventBuffer;
// Open (or create) a buffer holding at most 10_000 events.
let buffer = EventBuffer::new("/var/lib/agent-assembly/buffer.db", 10_000)?;Structs§
- Audit
Entry - An immutable, hash-chained record of a single governance event.
- Event
Buffer - A restart-safe, FIFO event buffer backed by a single SQLite file.
- Sqlite
Buffer Config - Operator configuration for the SQLite event buffer.
Enums§
- Storage
Error - Failure modes common to all storage backends.
Constants§
- DEFAULT_
CAP - Default maximum number of events retained before the oldest are evicted.
- METRIC_
EVENTS_ BUFFERED - Counter incremented once per event accepted into the buffer.
- METRIC_
EVENTS_ DROPPED - Counter incremented when the cap is exceeded and an oldest event is evicted.
- METRIC_
EVENTS_ FLUSHED - Counter incremented once per event successfully flushed to the sink.
Traits§
- Audit
Sink - Append-only sink for governance
AuditEntryrecords.
Functions§
- default_
path - Resolve the default buffer database path.
Type Aliases§
- Result
- Convenience alias for results returned by storage trait methods.