Some checks are pending
Auto-update PR branches / Update open PR branches (push) Waiting to run
CI / Frontend Static Quality Checks (push) Waiting to run
CI / Frontend Tests & Coverage (push) Waiting to run
CI / Rust Tests & Quality Checks (push) Waiting to run
CI / Linux build verification (push) Waiting to run
Deploy docs / Build VitePress site (push) Waiting to run
Deploy docs / Deploy to GitHub Pages (push) Blocked by required conditions
Release (Alpha) / Compute alpha version (push) Waiting to run
Release (Alpha) / Build release artifacts (push) Blocked by required conditions
Release (Alpha) / GitHub Release (alpha) (push) Blocked by required conditions
Release (Alpha) / Update docs and release pages (push) Blocked by required conditions
Source snapshot: 514ab1975951d94342ea38e64101d5a0f1c51c77
1.8 KiB
1.8 KiB
type, id, title, status, date
| type | id | title | status | date |
|---|---|---|---|---|
| ADR | 0024 | Vault cache stored outside vault directory | active | 2026-03-08 |
Context
The vault cache was originally stored as .laputa-cache.json inside the vault directory. This caused problems: the cache file appeared in git status, polluted the user's repo, and could be accidentally committed. It also confused vault scanning (the cache file was itself a file in the vault).
Decision
Store the vault cache at ~/.laputa/cache/<vault-hash>.json, outside the vault directory. The vault path is hashed (via DefaultHasher) to produce a deterministic filename. Legacy cache files inside the vault are auto-migrated and deleted on first run.
Options considered
- Option A (chosen): External cache at
~/.laputa/cache/— never pollutes the vault, no git issues, deterministic filename from vault path hash. Downside: separate cleanup needed if vault is deleted. - Option B: Cache inside vault with
.gitignore— simpler, travels with the vault. Downside: .gitignore can be overridden, users may not have one, still appears in file listings. - Option C: No persistent cache (in-memory only) — simplest, no file management. Downside: full rescan on every app launch, slow for large vaults.
Consequences
- Cache path:
~/.laputa/cache/<vault-hash>.json(e.g.,~/.laputa/cache/12345678.json). - Writes are atomic: write to
.tmpthen rename. - Legacy
.laputa-cache.jsonfiles inside the vault are auto-migrated and deleted. reload_vaultcommand deletes the cache file before rescanning.- The
.laputa/directory also stores other app data (future: vault metadata, indexes). - Re-evaluation trigger: if vaults need to be portable between machines (cache would need to travel with the vault or be regenerated).