Repository navigation
Closed
Labels
pro-boundaryPro/core boundary: Pro code moves to nodespace-sync (ADR-081..085)
Description
Summary
Add an opaque, per-database extensions map end to end, as ADR-083 §2 recommends (proposed; decision 2-A). Nothing is removed yet.
- Registry:
DatabaseEntry.extensionsholds every key of adatabases.tomlentry that the registry does not define, verbatim through load and save. - Wire:
DatabaseInfo.extensions(map<string, string> extensions = 10) carries the string-valued entries. - Desktop: the desktop DTO and the frontend
DatabaseInfoboth carryextensions. - Core reads no key from it.
This PR also deletes the tray's "synced" label. Per ADR-083 §2 and §7 item 2, that can land at any time.
The change is additive: fields 8 and 9 and the typed binding fields stay until #3342. There is no gate.
Context (lines at af8ddb61 are hints)
- Registry.
DatabaseEntryis inpackages/daemon/src/services/database_manager.rs(~81-106).- It has no
deny_unknown_fields, so today an unknown key is ignored on load and silently dropped on the nextRegistry::save. - Every registry mutation goes through
mutate_and_save.
- It has no
- Serde flatten with toml 0.8.2 was checked with a probe. With
#[serde(flatten)] extensions: toml::Table:- unknown keys, nested tables included, load into the map and are written back;
Nonefields are skipped;- RFC 3339
created_atstrings round-trip; - the typed fields keep working next to the map.
- Wire and desktop:
- proto
DatabaseInfoinpackages/proto/proto/database_service.proto(~54-78); - daemon mapping
listing_to_infoinpackages/daemon/src/services/database_service.rs(~58-71); - desktop DTO
DatabaseEntryandto_entryinpackages/desktop-app/src-tauri/src/commands/database.rs(~37-90); - frontend
DatabaseInfoandIMPLICIT_BROWSER_DATABASEinpackages/desktop-app/src/lib/stores/database.svelte.ts(~26-49, ~74-84).
- proto
- Why no gate. The change is wire-additive.
- A Pro GUI built from core HEAD talks to the pinned Pro daemon. It decodes the missing field 10 as an empty map, and fields 8 and 9 still arrive.
- Nothing in sync constructs
DatabaseEntryliterals.
- Tray.
database_menu_entriesinpackages/daemon/src/tray.rs(~243-291) addssyncedwhenbound_tenant_schemais set (~276-278).- Only the community daemon runs a tray;
nodespaced-prostarts none. So the label only ever showed for a core user whose registry the Pro daemon had written. - Its doc (~244-256) also says "Deliberately NOT whether a database is currently open". That is stale: the open marker exists (~268-273).
- Only the community daemon runs a tray;
Scope
- Registry (
database_manager.rs):- Add
#[serde(flatten)] pub extensions: toml::TabletoDatabaseEntry. Its doc: keys of this entry that the registry does not define, kept verbatim; core interprets none of them; an extension stores per-database values here (ADR-083). - Add
#[serde(skip_serializing_if = "Option::is_none")]to theOptionfields. - Set
extensions: toml::Table::new()in the struct literals (~771-778, ~856-863, and the test at ~1162-1169).
- Add
- Proto. Add to
DatabaseInfo:// Per-database keys the registry stores for extensions, copied verbatim. // Core interprets none of them. Only string values are carried. map<string, string> extensions = 10;
- Daemon mapping.
listing_to_infofillsextensionsfrom the entry's string-valued entries and skips values of any other type. - DTO. Add
pub extensions: std::collections::BTreeMap<String, String>(camelCaseextensions) toDatabaseEntry, and copy it into_entry. - Frontend:
- Add
extensions: Record<string, string>toDatabaseInfo, documented as opaque per-database keys for extensions that core never reads. - Add
extensions: {}toIMPLICIT_BROWSER_DATABASE. - Add it to every fixture that builds a full
DatabaseInfo;git grep -n 'lastOpenedAt: null' -- packages/desktop-app/srcfinds them:src/tests/stores/database.test.ts(db(), ~131-143);src/tests/components/navigation-sidebar-nav-items.test.ts(~26-36);add-synced-database-dialog.test.tsandpro-sync.test.ts, unless Move the Pro account, admission and synced-database settings out of core #3327 or Move the Pro sync and collaboration UI out of core #3333 has already deleted them.
- Add
- Tray:
- Delete the
syncedmarker. - Rewrite the doc: the label carries the persisted default flag, the live open state and a missing-file state.
- The test helpers
listing_with_defaultandlisting(~803-826) drop theirtenantparameter. The literal setsextensions: toml::Table::new()and keepsbound_tenant_schema: None, bound_tenant_collection: Noneuntil Replace the registry's tenant-binding fields with extension keys and set_extensions #3342. - Rename
labels_carry_default_and_synced_statetolabels_carry_default_state. markers_render_in_a_stable_ordernow expectsAll — default · open.- The two missing-entry tests drop
Some("tenant_demo").
- Delete the
Out of scope
- Removing the typed binding fields, proto fields 8 and 9, and
set_bound_tenant(Replace the registry's tenant-binding fields with extension keys and set_extensions #3342). - A registry setter for extensions:
set_extensions(Replace the registry's tenant-binding fields with extension keys and set_extensions #3342). - Any reader of a specific extension key. That is the Pro package's job.
Steps
- Start. Follow core
CLAUDE.md's startup sequence:EnterWorktree({name: "issue-<N>-registry-extensions"});bun install;- the
bun run testbaseline; gh:assign, thengh:status.
- Make the Scope changes in this order: registry, proto, daemon mapping, DTO, frontend, tray.
- Add tests:
database_manager.rs,registry_round_trips_entry_keys_it_does_not_define. Write adatabases.tomlwhose entry hasplugin_state = "keep"and a nested[databases.extra]table.Registry::loadputs both inextensions, andid,name,pathandcreated_atare intact.- After
saveand a reload, both are still there.
database_manager.rs,a_rename_keeps_extension_keys.DatabaseManager::renameon such an entry leavesextensionsunchanged on disk.database_service.rstests,listing_to_info_carries_string_extensions_only. A string value is carried; an integer or table value is skipped.commands/database.rs,to_entry_passes_extensions_through. It runs underbun run rust:test:app-units.tray.rs,extension_keys_add_no_marker. An entry with extension keys renders as its plain name.
- Ratchet. Run
bun run scripts/check-pro-boundary.tsand setBASELINESto the printed counts. ExpectcloudBindStateandtenantWordingto drop along with the tray marker and itstenant_demofixtures. - Finish:
bun run test:changed, thenbun run quality:fix(it includes svelte-check), then commit;- push to
issue-<N>-registry-extensions; gh pr create --repo NodeSpaceAI/nodespace-core --base main --head issue-<N>-registry-extensions, thengh:status "In Review";- after approval,
bun run merge <PR#>in the background.
Acceptance criteria
- An existing
databases.tomlloads even when an entry has keys the registry does not define, and every such key survives every registry save. -
ListDatabasescarriesextensions(string values only) through the proto, the DTO and the frontend type. - No core code reads a specific key out of
extensions. - The tray shows no "synced" label, and its doc matches what it renders.
- The database switcher, Settings → Databases and the tray's database submenu work unchanged for free users.
-
bun run scripts/check-pro-boundary.tsexits 0, andBASELINESequals its printed counts. - Core builds, all tests pass, and svelte-check is clean.
Tests and verification
bun run test:changed.tools/bin/cargo-nextest nextest run -p nodespace-daemon --lib database_manager.tools/bin/cargo-nextest nextest run -p nodespace-daemon --lib database_service.tools/bin/cargo-nextest nextest run -p nodespace-daemon --lib traybun run rust:test:app-unitsbun run --cwd packages/desktop-app test src/tests/stores/database.test.ts src/tests/components/navigation-sidebar-nav-items.test.tscargo clippy -p nodespace-daemon -p nodespace-proto --all-targets -- -D warnings -D clippy::unused-async- Manual check. Use an isolated
NODESPACE_HOMEwhosedatabases.tomlhas an extra key. The daemon starts, lists the database and survives a rename, and the key is still in the file.
Dependencies
- NodeSpaceAI/nodespace-docs#92 (ADR-083) (ADR-083, proposed): decision 2-A.
- Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299: the ratchet.
- No gate: the change is additive.
Risks and rollback
- Serde flatten buffers the whole entry. The probe and the round-trip test cover
DateTime,PathBuf, theDatabaseIdnewtype and nested tables. - Rollback. Revert the PR. Saves made while the change was live wrote unknown keys back unchanged. After the revert, the next save drops them again, which is today's behaviour.
Plan key: C7.5 (pro-boundary DAG).
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
pro-boundaryPro/core boundary: Pro code moves to nodespace-sync (ADR-081..085)
Activity
mstomar125 commentedon Sep 30, 2026
Completed in #3399 (merged). Auto-close did not fire; closing manually.