Expand description
§oxide-mirror — Local, Event-Sourced Data Mirror
oxide-mirror keeps a SQLite-backed local copy of remote API data so AI
agents can run complex SQL queries (joins, aggregations, time-window
filters) across many services without paying the latency or rate-limit
cost of going over the wire every time.
The crate is organised around four cooperating pieces:
event— the durable, append-onlyDeltalog shape that every sync source emits. Each delta carries an explicitProvenance(source id + confidence) so callers can reason about who wrote what.source— theSyncSourcetrait thatoxide-gengenerated clients implement. A source knows how to pull a batch of deltas starting from a cursor and to advance the cursor when the batch has been applied.store—MirrorStoreowns the SQLite pool, the schema migrations, the event log, the materialisedMirroredRecordtable, and the per-source cursor table. ExposesMirrorStore::queryfor read-only SQL.sync—Syncerties the previous two together, pulling deltas from aSyncSource, applying them through aConflictStrategy, and persisting the new cursor.
kernel::MirrorModule wires everything into the oxide-k kernel so
sync runs and queries can be triggered via the kernel message bus.
Re-exports§
pub use conflict::ConflictResolution;pub use conflict::ConflictStrategy;pub use conflict::HighestConfidence;pub use conflict::KeepLocal;pub use conflict::LastWriteWins;pub use conflict::MergeJson;pub use error::MirrorError;pub use error::Result;pub use event::Delta;pub use event::DeltaOp;pub use event::MirroredRecord;pub use event::Provenance;pub use kernel::MirrorModule;pub use source::PullResult;pub use source::StaticSource;pub use source::SyncSource;pub use store::MirrorStore;pub use sync::SyncReport;pub use sync::Syncer;
Modules§
- conflict
- Conflict resolution strategies for incoming deltas.
- error
- Error type for
oxide-mirror. - event
- Delta + record shapes shared across the mirror.
- kernel
oxide-kbus integration.- source
- The
SyncSourcetrait + reusable test helpers. - store
- SQLite-backed
MirrorStore. - sync
- Glue layer that drives a
SyncSourceagainst aMirrorStore.