Summary
Introduce an append-only event log — an immutable stream of memory lifecycle events enabling replay, recovery, synchronization, and deterministic reconstruction.
Scope
- Event vocabulary:
MemoryAdded, MemoryUpdated, MemoryMerged, MemoryArchived, SnapshotCreated, PromotionRequested.
- Each event: id, type, timestamp, target memory id(s), before/after payloads as needed, sequence number.
- Storage: append-only (SQLite table or JSONL log file under the mount) with monotonically increasing sequence; no in-place updates/deletes.
- Replay API: reconstruct memory state from the event stream (deterministic; used for recovery/sync, not the hot read path).
GET /v1/events with cursor + limit (tail-style), for consumers/sync.
- Emit events from existing write paths (add/update) without changing their external behavior.
Out of scope: distributed sync protocol, cross-instance replication (EMOS-side).
Acceptance Criteria
Migration
Additive. Event log starts empty; existing memories are unaffected (a baseline snapshot can seed the log on first vNext boot, documented in the RFC).
Testing
- Unit: each lifecycle path emits the correct event type + payload.
- Unit: replay reconstruction matches direct DB state for a fixture workload.
- Unit: append-only guarantee (no update/delete of log rows); monotonic sequence.
- Unit:
/v1/events pagination returns contiguous, ordered results.
Depends on
Summary
Introduce an append-only event log — an immutable stream of memory lifecycle events enabling replay, recovery, synchronization, and deterministic reconstruction.
Scope
MemoryAdded,MemoryUpdated,MemoryMerged,MemoryArchived,SnapshotCreated,PromotionRequested.GET /v1/eventswith cursor + limit (tail-style), for consumers/sync.Out of scope: distributed sync protocol, cross-instance replication (EMOS-side).
Acceptance Criteria
GET /v1/eventssupports cursor + limit pagination/v1/add//v1/searchbehavior or latency materiallyMigration
Additive. Event log starts empty; existing memories are unaffected (a baseline snapshot can seed the log on first vNext boot, documented in the RFC).
Testing
/v1/eventspagination returns contiguous, ordered results.Depends on