Skip to content

docs(database): document data.db as a frozen, read-only legacy artifact - #939

Merged
lklimek merged 1 commit into
fix/issue-889-masternode-identity-lifecyclefrom
docs/frozen-legacy-database-architecture
Jul 27, 2026
Merged

docs(database): document data.db as a frozen, read-only legacy artifact#939
lklimek merged 1 commit into
fix/issue-889-masternode-identity-lifecyclefrom
docs/frozen-legacy-database-architecture

Conversation

@Claudius-Maginificent

Copy link
Copy Markdown
Collaborator

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.db is opened SQLITE_OPEN_READ_ONLY in production whenever it already exists (Database::open_legacy_read_only, src/app.rs); the schema ladder in database/initialization.rs only ever runs on a fresh install with no data.db yet. Nothing in the docs said so — CLAUDE.md described database/ 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 a DetKv key.

What changed

  • CLAUDE.md — 3 spots (DET Module Placement Policy, System Layers, ## Database section) now state plainly: database/ is frozen, read-only-in-production, migration-read-source-only; new durable state is always a DetKv key or a SecretStore entry, 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 why data.db is deliberately absent from the backing-store table.

Stacking note

This PR is based on fix/issue-889-masternode-identity-lifecycle (#925), not v1.0-dev directly — 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 to v1.0-dev automatically once #925 merges.

Testing

Documentation-only change; no functional code touched. cargo fmt --all clean.

Checklist

  • cargo fmt --all
  • N/A — no CHANGELOG entry (pure documentation/process correction, not a user-facing change)

Attribution

🤖 Co-authored by Claudius the Magnificent AI Agent

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.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Claudius-Maginificent, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ec3f25f-8bac-44a2-8140-ce82eb8439cf

📥 Commits

Reviewing files that changed from the base of the PR and between c0fdbfe and 8df8ad8.

📒 Files selected for processing (3)
  • CLAUDE.md
  • docs/kv-keys.md
  • src/database/mod.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/frozen-legacy-database-architecture

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

🕓 Ready for review — 8 ahead in queue (commit 8df8ad8)
Queue position: 9/9 · 2 reviews active
ETA: start ~19:37 UTC · complete ~19:58 UTC (median 20m across 30 recent reviews; 2 slots)
Queued 15m ago · Last checked: 2026-07-27 18:10 UTC

@lklimek
lklimek merged commit 2f93a41 into fix/issue-889-masternode-identity-lifecycle Jul 27, 2026
4 checks passed
@lklimek
lklimek deleted the docs/frozen-legacy-database-architecture branch July 27, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants