Expand description
Change journal of a project’s knowledge.
Every save of the store appends one row per fact it added, changed or removed, numbered by a log sequence number (LSN) that only grows. A reader asks “what changed since LSN n” instead of reloading and diffing the whole store, and a session can be shown the facts it touched.
Rows carry the fact’s identity (category, key with secrets redacted,
creation time), the names of the fields that changed and the writing
session, never a value: the store holds the values, and a row is shown
with its key only while that fact is visible in the reader’s admitted
view (ctx_knowledge changes). Local only; nothing is sent anywhere.
The journal sits beside knowledge.json and is written under the same
project lock as the store, so its order is the order of the saves. It
keeps the newest rows within MAX_JOURNAL_BYTES; LSNs continue across
a trim.
Structs§
- Change
- A change before it is numbered.
- Journal
Row - One journaled change of one fact.
Functions§
- diff
- The changes from
beforetoafter, in identity order. - head_
lsn - The newest LSN, 0 for an empty or missing journal.
- rows_
since - The rows after
since, oldest first, at mostlimit.