Repository navigation
Per-database bound-tenant storage (ADR-053 per-database cloud sync, S1) - #1604
Conversation
|
APPROVE Reviewed: small, additive storage slice. |
|
APPROVE — the slice itself is a clean, additive, community-safe storage foundation. One prominent process flag on the epic it opens (below). S1 is genuinely inert and migration-safe
|
Record the cloud tenant a database binds to so per-database sync can resolve it at runtime instead of from a build-time constant. Add bound_tenant_schema and bound_tenant_collection to the DatabaseSettingsNode schema (the authoritative per-database record) with string validation, and mirror them on the databases.toml DatabaseEntry (persisted, shown before the database is opened) with a DatabaseManager::set_bound_tenant setter. Both are empty until the Pro sync daemon binds the database; the community build is unaffected. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
APPROVE (re-review at
The S1 substance (additive, inert, |
Summary
First slice (S1) of ADR-053 per-database cloud sync (#1535): the additive, community-safe storage foundation for binding a database to a cloud tenant at runtime, replacing the current build-time-baked single tenant.
DatabaseSettingsNode(the authoritative per-database record) gainsbound_tenant_schemaandbound_tenant_collectionstring fields, withis_string/null validation in the behavior. Both are empty until the Pro sync daemon binds the database.DatabaseEntryindatabases.tomlmirrors the same two fields (#[serde(default)], so existing registries parse) so the bound tenant can be shown before the database is opened, with aDatabaseManager::set_bound_tenant(id, schema, collection)setter that keeps the mirror in step (passNoneto clear on unbind).No behavior change yet — nothing reads these fields; later slices (remove build-time injection, per-database session config, activate/deactivate lifecycle, status plumbing) build on them. The community build is unaffected (the fields are inert without the Pro sync daemon).
Tests
database_settings_*suite stays green (schema presence, defaults, validation).set_bound_tenant_mirrors_persists_and_clears: a fresh registration is unbound; set → the mirror reflects the schema/collection; it survives a reload from disk; unbind clears it.test:all+test:e2e+cargo test -p nodespace-appvia the pre-push gate;cargo fmt+cargo clippy --workspace -- -D warningsclean.Part of #1535 (this is S1 of the S1–S8 decomposition posted on the issue).