Expand description
JSONL <-> SQLite event mirror consistency and recovery.
The JSONL leg is the disaster-recovery source for immutable raw events. This module keeps the boundary small: verify event-set parity, replay acknowledged JSONL rows into SQLite, and provide a mirrored append path for callers that need the JSONL fsync to happen before the SQLite commit.
Structs§
- Event
Mismatch - Difference for an event id present in both stores but with different content.
- Event
SetParity - Event-set parity report between JSONL and SQLite.
- Replay
Report - Replay outcome for JSONL recovery into SQLite.
Enums§
- Mirror
Single Event Outcome - In-transaction outcome reported by
mirror_single_event_into_sqlite_in_tx.
Constants§
- MIRROR_
APPEND_ PARITY_ INVARIANT_ RULE_ ID - Required contributor rule id documenting that the JSONL <-> SQLite
parity invariant (BUILD_SPEC §7) composed into the policy decision for
a mirrored append. The mirror refuses a final outcome of
RejectorQuarantineso a parity violation cannot enter the durable event set.
Functions§
- append_
event - Appends one event to JSONL and then commits the same sealed event to SQLite.
- append_
signed_ event - Appends one signed event to JSONL and then commits the same sealed event to SQLite.
- mirror_
policy_ decision_ test_ allow - Build a
PolicyDecisionthat satisfies the mirror parity invariant gate forappend_event/append_signed_event. Intended for tests and fixtures only; production callers MUST composeMIRROR_APPEND_PARITY_INVARIANT_RULE_IDfrom real parity evidence. - mirror_
single_ event_ into_ sqlite - Mirror exactly one already-sealed event into SQLite.
- mirror_
single_ event_ into_ sqlite_ in_ tx - In-transaction variant of
mirror_single_event_into_sqlitefor callers that compose the SQLite-side mirror into a larger atomic cutover transaction (B1: schema v2 cutover, ADR 0033 §1 partial-mutation refusal). - replay_
jsonl_ into_ sqlite - Replays JSONL events missing from SQLite.
- verify_
event_ set_ parity - Verifies that JSONL and SQLite contain the same immutable event set.