Expand description
Epic S3: personal brain sync — event-log replication.
Structs§
- Export
Summary - Summary returned by
export_events. - Import
Summary - Summary returned by
import_events. - Sync
Cursors - Per-source cursor state persisted at
.kimetsu/sync-cursors.json. - Sync
Event - One line in a sync JSONL batch. Carries the full event so the remote
projector can replay it.
payloadis the redacted payload (same redaction the projector applies at ingest). - Sync
Report - Summary of a full sync cycle.
- Sync
Status - Status of the sync configuration and state.
Functions§
- atomic_
write - Write
datatopathatomically via a sibling temp file + rename. - export_
events - Export durable events from
connaftersince_rowid(exclusive). - import_
events - Import a JSONL batch (one
SyncEventper line) intoconn. - import_
events_ from_ file - Read a JSONL batch file and import it.
- is_
sync_ allowed - Returns
truewhenkindis allowed in a sync batch. - max_
local_ sync_ rowid - The max rowid among all rows in the local
eventstable with an allowed kind. This is what we compare against the stored export cursor to decide whether there’s anything new to push. - pull_
machine_ batches - Pull and import all batches from
<sync_dir>/<source_machine_id>/that come AFTERsince_cursor. Updates the cursor in the registry. - push_
machine_ batch - Write this machine’s new events as a JSONL batch under
<sync_dir>/<machine_id>/<cursor>.jsonl(atomic write). - sync_
conflict_ count - Slice B: count unresolved concurrent-supersede conflicts surfaced by team
sync (a member superseded to two different survivors). Deterministic across
brains; shown by
kimetsu brain sync --status. - sync_
dir - Full sync cycle:
- sync_
status - Compute the sync status without performing any writes.