Files
tolaria/docs/adr/0002-filesystem-source-of-truth.md
Test 99ae8260cb docs: add Architecture Decision Records (ADRs) — 5 backfill + process in CLAUDE.md
- docs/adr/README.md: format spec, rules, index
- 0001: Tauri v2 + React stack
- 0002: filesystem as source of truth
- 0003: single note model (no tabs)
- 0004: vault vs app settings storage
- 0005: Tauri iOS for iPad (vs SwiftUI)
- CLAUDE.md: ADR process — when to read, when to create, when to supersede
2026-03-28 10:05:23 +01:00

1.5 KiB

type, id, title, status, date
type id title status date
ADR 0002 Filesystem as the single source of truth active 2026-02-14

Context

Laputa needs a persistence model. The core question: does the app own the data, or does the filesystem? This affects sync, conflict resolution, offline support, portability, and long-term trust with users.

Decision

The vault is the source of truth. The app never owns the data — it only reads and writes .md files. All cache, React state, and in-memory representations are derived from the filesystem and must be reconstructible by deleting them. When in doubt, the file on disk wins.

Alternatives considered

  • Database-first (SQLite): faster queries, easier relationships. Rejected — creates lock-in, makes files unreadable outside the app, complicates sync.
  • Cloud-first (proprietary sync): easier multi-device. Rejected — zero lock-in is a core principle; git handles sync.
  • Hybrid (DB + files): DB as primary, files as export. Rejected — two sources of truth always diverge.

Consequences

  • Notes are plain markdown files, readable and editable by any text editor
  • Git provides history, sync, and collaboration for free
  • Vault can be opened/edited externally without app corruption
  • App rebuilds cache on startup — acceptable cost for integrity guarantees
  • No "save" button needed — autosave writes to disk immediately
  • Triggers re-evaluation if: vault size grows to millions of files and filesystem scanning becomes a bottleneck