Skip to main content

Module revision

Module revision 

Source
Expand description

Per-memory revision chain (V8 S11c) — tamper-evident content history.

Every memory.update that changes content appends one revision entry to the revisions DBI, keyed rev:{galaxy}:{memory_id}:{seq}. The chain is self-verifying by construction:

  • seq is continuous (gaps prove deletion);
  • entry[n].new_hash == entry[n+1].old_hash (breaks prove splicing);
  • the last new_hash must equal the memory’s current content_hash (mismatch proves an out-of-band rewrite).

Entries carry hashes, not full content — cheap local tamper-evidence (recovery of old text rides wm backup). The chain hashes nothing of its own; it needs no keys and no crypto infrastructure, and it detects the exact rewrite class the write-audit journal cannot see: edits that are declared, journaled, and still leave no record of what was there before.

Structs§

MemoryRevision
One content revision of a memory — appended on every content change.
RevisionActor
Who performed a revision — snapshotted from the dispatch context.
RevisionChainReport
Result of walking one memory’s revision chain.

Functions§

revision_key
LMDB key for one revision: rev:{galaxy}:{memory_id}:{seq:010}. Zero-padded seq keeps lexicographic order == numeric order.
revision_prefix
Key prefix covering every revision of one memory (for range scans).
verify_chain
Verify a revision chain against the memory’s current content hash.