docs(database): document data.db as a frozen, read-only legacy artifact - #939
Conversation
CLAUDE.md described src/database/ as a live, general-purpose SQLite persistence layer. In production, an existing data.db is opened with SQLITE_OPEN_READ_ONLY (Database::open_legacy_read_only, src/app.rs) and the schema ladder in database/initialization.rs runs only on a fresh install with no data.db yet — never against an existing one. Nothing in the docs said so, and this silently misled a recent PR (#889) into adding a new SQL table there, which is unwritable after an install's first boot. Clarify in CLAUDE.md, src/database/mod.rs, and docs/kv-keys.md that database/ is a migration-read source and recovery artifact only; all new durable state belongs in DetKv or SecretStore.
|
Warning Review limit reached
Next review available in: 32 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Ready for review — 8 ahead in queue (commit 8df8ad8) |
2f93a41
into
fix/issue-889-masternode-identity-lifecycle
TL;DR: Documents that
src/database/(data.db) is a frozen, read-only-in-production legacy artifact — not a general persistence layer — closing a documentation gap that let PR #925 add new SQL storage there by mistake.Why
data.dbis openedSQLITE_OPEN_READ_ONLYin production whenever it already exists (Database::open_legacy_read_only,src/app.rs); the schema ladder indatabase/initialization.rsonly ever runs on a fresh install with nodata.dbyet. Nothing in the docs said so — CLAUDE.md describeddatabase/as ordinary "SQLite persistence (rusqlite), one module per domain," with no read-only caveat. That gap is exactly what let round 7 of #925 add a new SQL table (forgotten_identities) there, which becomes permanently unwritable after an install's first boot — round 8 of #925 removes that table and reimplements it as aDetKvkey.What changed
CLAUDE.md— 3 spots (DET Module Placement Policy, System Layers,## Databasesection) now state plainly:database/is frozen, read-only-in-production, migration-read-source-only; new durable state is always aDetKvkey or aSecretStoreentry, never a new table.src/database/mod.rs— added a module-level doc comment stating the same at the point an implementer is most likely to look.docs/kv-keys.md— added a note explaining whydata.dbis deliberately absent from the backing-store table.Stacking note
This PR is based on
fix/issue-889-masternode-identity-lifecycle(#925), notv1.0-devdirectly — it only carries this one docs commit on top of #925's current tip, so the diff shown here is just the 3-file docs change. GitHub will retarget it tov1.0-devautomatically once #925 merges.Testing
Documentation-only change; no functional code touched.
cargo fmt --allclean.Checklist
cargo fmt --allAttribution
🤖 Co-authored by Claudius the Magnificent AI Agent