Skip to main content

Module journal

Module journal 

Source
Expand description

Mutation journal for device-owned replication.

Provides a durable, contiguous, append-only journal that wraps existing semantic-memory mutation paths. Each journal entry records:

  • device/store identity
  • monotonic sequence number
  • operation kind (add_fact, add_message, etc.)
  • canonical payload for replication

The journal is committed atomically with the semantic mutation in the same SQLite transaction. Export and replay operations provide the foundation for device-primary → server-replica synchronization.

Structs§

ExportedBatch
A batch of journal entries ready for replication.
JournalEntry
A single journal entry representing one semantic mutation.

Enums§

ReplayOutcome
Outcome of replaying a journal entry.

Constants§

MIGRATION_V37
V37 migration: mutation journal for device-owned replication.

Functions§

append_journal_entry
Append a journal entry within an active transaction.
export_contiguous
Export a contiguous range of journal entries.
mutate_and_journal
Execute a mutation closure within a transaction that also journals it.
next_expected_sequence
Get the next expected sequence number for a device/store pair.
replay_journal_entry
Apply a single journal entry on a replica store.