From f0899bf7889fbd0e463844ed23e9444550b42cdb Mon Sep 17 00:00:00 2001 From: Padreug Date: Sat, 6 Jun 2026 14:48:57 +0200 Subject: [PATCH] Update CLAUDE.md to reflect Fava-as-sole-source-of-truth for journal entries The previous journal_entries/entry_lines local mirror was removed during the Fava migration but the docs still described it as a local cache. Replace with explicit statement that Fava is canonical and the remaining SQLite tables hold orthogonal operational state. Co-Authored-By: Claude Opus 4.7 (1M context) --- CLAUDE.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b58591c..77bcd65 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -49,13 +49,9 @@ Libra is a double-entry bookkeeping extension for LNbits that enables collective ### Database Schema -**Note**: With Fava integration, Libra maintains a local cache of some data but delegates authoritative balance calculations to Beancount/Fava. +**Fava is the sole source of truth for journal entries.** Libra does NOT maintain a local mirror of transactions — the previous `journal_entries` and `entry_lines` tables were removed during the Fava migration. All transaction reads (history, balances, summaries) go through Fava's HTTP API; writes go through `PUT /api/add_entries` and are serialized via `FavaClient._write_lock`. When retrieving journal entries from Fava for UI display, results are enriched with a `username` field from LNbits user data. -**journal_entries**: Transaction headers stored locally and synced to Fava -- `flag` field: `*` (cleared), `!` (pending), `#` (flagged), `x` (void) -- `meta` field: JSON storing source, tags, audit info -- `reference` field: Links to payment_hash, invoice numbers, etc. -- Enriched with `username` field when retrieved via API (added from LNbits user data) +The SQLite tables below hold **operational state** that Fava doesn't (and shouldn't) own — workflow, RBAC, settings, reconciliation assertions. None of it is derivable from the Beancount file; they are independent stores, not caches. **extension_settings**: Libra wallet configuration (admin-only) - `libra_wallet_id` - The LNbits wallet used for Libra operations