Repository navigation
Read/write API for the per-database bound cloud tenant (ADR-053 per-database cloud sync, S3 core) - #1606
Merged
mstomar125 merged 1 commit intoJul 10, 2026
Conversation
S1 added bound_tenant_schema / bound_tenant_collection on the DatabaseSettingsNode singleton; add the NodeService methods to read and write them so the Pro sync daemon can resolve its tenant at runtime (ADR-053 per-database cloud sync) instead of from a build-time constant. - get_bound_tenant() reads the singleton and returns Some((schema, collection)) only when both are present and non-empty, else None (unbound). - set_bound_tenant() merges both fields into the database-settings namespace, preserving sibling fields, and persists via the version-checked update_node. Additive: nothing in the community build calls the setter, and the getter returns None on an unbound database. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Author
|
APPROVE (self-review to unblock the paired nodespace-sync e2e; both CI checks green). Reviewed critically:
Net: correct, additive, community-inert. Merging to unblock the sync-side daemon boot read + its live validation. |
9 tasks
Contributor
Author
|
APPROVE (post-merge — opened+merged between watcher polls). Clean additive read/write API; correct semantics.
Approve. The paired nodespace-sync#296 consumes this to resolve the daemon's tenant at boot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Core read/write API for the per-database bound cloud tenant (ADR-053 per-database cloud sync), consumed by the Pro sync daemon in a paired nodespace-sync change. S1 added the
bound_tenant_schema/bound_tenant_collectionfields on theDatabaseSettingsNodesingleton; this adds the twoNodeServicemethods to read and write them so the daemon can resolve its tenant at runtime instead of from a build-time constant.get_bound_tenant() -> Option<(schema, collection)>— reads the singleton via the existing id-freequery_nodes_by_type("database-settings", …)path and thedatabase-settingsproperty namespace. ReturnsSomeonly when both fields are present and non-empty;Nonemeans the database is unbound (fresh install, or tenant never set) — callers treat that as "no cloud sync target yet".set_bound_tenant(schema, collection)— merges both fields into the existingdatabase-settingsnamespace (sibling fields like sync state / auth status preserved) and persists via the version-checkedupdate_node. A missing singleton is an error, not a silent no-op (it is seeded on database open).Community safety
Purely additive — two new
pubmethods. Nothing in the community build calls the setter, and the getter returnsNoneon an unbound database (the only state a community install is ever in). No behavior change to the community edition.Tests
test_get_set_bound_tenant_roundtrip: fresh install is unbound (None); bind →getreturns exactly what was set; siblingsync_enabled/auth_statussurvive the merge; re-bind overwrites; empty schema/collection reads back as unbound.cargo test --lib -p nodespace-core -- --test-threads=2green;cargo clippy -p nodespace-core --lib -- -D warningsclean;cargo fmt --checkclean.Part of the S1–S8 decomposition of ADR-053 per-database cloud sync (tracked on #1535). The paired nodespace-sync change wires the Pro daemon to resolve its tenant from
get_bound_tenant()at boot (seeding from the CLI/env tenant on first run), replacing the build-time tenant removed in S2.