"Never patch derived state. If it drifts, purge the affected span and replay from JSONL."
The Ground Truth Is an Append-Only Log
Under all those projections sits a storage spine Vesta adopts wholesale from cwkPippa. Ground truth is an append-only JSONL log — one log per journal. Every crumb event — add, edit, tombstone, move-out, move-in — is a single appended line. Live state isn't stored as such; it's folded from the events on read. Want the current state of a crumb? Replay its events in order and apply them. The source log is never rewritten, never edited in place — it only grows. That's the same append-only discipline you saw for re-filing and journal moves, now as the foundation of the whole store: history is the truth, and current state is just history folded forward.
SQLite Is Derived, and You Never Patch It
Folding events on every read would be slow for queries like 'how many crumbs each day' or 'everything tagged garden', so Vesta keeps a SQLite mirror that owns every query surface: calendar counts, tag filters, the multi-year month-day index, future full-text search. But the mirror is strictly derived. It holds no truth of its own; it's a fast index built from the JSONL. And that leads to the single most important operational rule, inherited verbatim from cwkPippa: if the mirror ever drifts from the log, you purge the affected span and replay from JSONL — you never patch the derived state.
Fernet at Rest, Plaintext Where It Must Be
Because a journal is deeply private, the JSONL ground truth is Fernet-encrypted at rest, line by line, keyed by a Vesta-specific passphrase held in the operating system's Keychain. Backups and any peer mirrors carry only opaque encrypted blobs — a copy of the log on another machine reveals nothing without the key. But encryption is applied with judgment, not everywhere. Two working surfaces stay deliberately plaintext: the derived SQLite mirror (it's local, rebuildable, and holds no truth the encrypted log doesn't) and the draft .md files (they're filesystem-canonical so Rekindle can open them in place). Encrypting those would break the Rekindle round trip for no security gain, since the real archive — the append-only log — is already ciphertext. Protect the ground truth; don't cargo-cult encryption onto the working surfaces that need to stay open.