Repository navigation
Description
Goal
Take Pro and cloud-sync state and queries out of core's data model, store API, wire contracts and seeds, as ADR-081 (proposed) and ADR-083 (proposed) decide. Apply ADR-085 (proposed) to the seeded AI-chat privacy Play. Whatever stays in core is a neutral, documented hook, named for what it does rather than for who calls it.
Context
- Directive (Michael, 2026-09-29). Everything Pro or sync related, other than turning it on, lives in nodespace-sync. Pro is a separate build that replaces the installed app and keeps the same database.
- The Pro daemon is already pinned.
nodespaced-prolinksnodespace-coreandnodespace-daemonat rev680c35d8, per sync'sCargo.tomlandnodespaced-pro/Cargo.tomlat sync17f9557. A core API rename or removal reaches it only when sync bumps that pin, and then as a compile error in the bump PR. - The Pro GUI is not pinned yet.
sync/scripts/build-pro-dmg.shand sync'srelease.ymlbuild core's desktop app from core HEAD, together with the community daemon and CLI it bundles. A change toDatabaseInfo, the desktop DTO or the frontend type therefore reaches the Pro GUI immediately, while the Pro daemon still speaks the old shape. - No data migration.
- Core
CLAUDE.mdforbids migrations. create_schemarefuses any database whose tables' column names differ from the DDL (find_shape_mismatchesinpackages/core/src/db/schema.rs).- Released builds (v0.3.x) have real databases on disk.
- So every Move Pro-owned data out of core's data model (ADR-083) #3345 step is designed so that no existing database is refused, rewritten or re-bound (ADR-083 §6).
- Core
- Ratchet. Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299 adds
scripts/check-pro-boundary.ts. Its baselines are exact in both directions. Every Move Pro-owned data out of core's data model (ADR-083) #3345 sub-issue therefore runs it and pastes the printedBASELINES, and every sub-issue depends on Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299. - Locating code. Line numbers in the sub-issues are hints at core
af8ddb61. Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 and Turn the UI-extension registry into ADR-082's build-time frontend extension API #3317 move files, so find code by the symbol named.
Gate semantics (ADR-083 §7)
- Core first, no gate. A core API change that only the pinned Pro daemon calls lands in core first. Sync switches its call sites in the PR that bumps its pin, and a missed call site fails at compile time. This covers Rename the origin-filtered event channel to subscribe_to_events_excluding_origin #3338, Give the replicated-apply origin constant and engine gate neutral names, value unchanged #3339, Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340 and Generalize get_multi_membership_edges into member_of_edges with caller-supplied filters #3343. Sync cannot pre-adopt a name that does not exist yet, so a "sync merges first" gate on these could never be met.
- Also no gate:
- Delete the dead embedding push/pull seam; keep embedding.origin for existing databases #3337, because nothing outside core calls what it deletes;
- Carry opaque registry extensions through DatabaseInfo and drop the tray's synced label #3341, because it is wire-additive;
- Reword the AI-chat privacy Play description without tenant wording #3344, because it only changes wording.
- Canonical pin gate:
SYNC:Pro GUI and Pro daemon build from one pinned core rev. It applies to the one change the Pro GUI build consumes, Replace the registry's tenant-binding fields with extension keys and set_extensions #3342, which removesDatabaseInfofields 8 and 9 and the frontend's typed binding. - Blockers live on the issue that needs them. This parent lists the union of its sub-issues' dependencies, for tracking only. A filing tool must never copy the parent's dependencies onto the sub-issues.
- Assignment. Nothing is assigned at filing (core
CLAUDE.md). Whoever picks up a sub-issue self-assigns in the startup sequence.
Outcomes pre-selected from the draft ADRs
These are the drafts' recommendations. ADR-083 and ADR-085 are both still pending review.
| Item | Outcome | Where |
|---|---|---|
Embedding push/pull API, idx_emb_modified, the NodeService embedding wrappers |
Deleted. The embedding.origin and node.sync_seq columns stay, unused, until the next change that alters a table's column set (§3, decision 3-A). |
#3337 |
ConflictKind::SupersededEdit, DuplicateReactiveCreate |
Both stay. Only the docs are reworded (§4). | folded into #3365 |
| Push channel | Renamed subscribe_to_events_excluding_origin and set_excluded_event_origin; the internal names follow (§4, decision 4-A). |
#3338 |
Replicated-apply origin constant and is_sync_originated |
Identifiers renamed; the value sync-service is kept. Follows rule 2; not yet in the draft's inventory. |
#3339 |
DatabaseSettingsNode keys sync_enabled, auth_status, bound_tenant_schema, bound_tenant_collection |
The keys keep their names and belong to Pro. Core drops their declaration, seeding, validation and typed accessors, and exposes database_settings() and merge_database_settings(entries) (§1, §5, decision 1-A). |
#3340 |
Registry mirror, DatabaseInfo, DTO, tray |
An opaque extensions map on registry entries, on DatabaseInfo (map<string, string> extensions = 10), on the DTO and on the frontend type. Fields 8 and 9 become reserved. set_extensions(id, entries) rejects keys the registry defines. The tray label is deleted (§2, decision 2-A). |
#3341 (add), #3342 (remove) |
get_multi_membership_edges |
Becomes member_of_edges(min_memberships, exclude_member_types). The Pro values 2 and ["person"] move to the caller (§4, decision 5-B). |
#3343 |
| Personal AI-chat collection, schema default, privacy Play | Stay in core as a named exception (ADR-085 R6-a). Only the Play's user-visible description changes (ADR-085 §6, §8). | #3344 |
If review picks a different option, re-plan the affected sub-issue before starting it:
- ADR-083 1-B (
plugin:keys) or 1-C (a Pro sidecar file): Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340 needs a carry-over or re-bind plan. - 2-B (a Pro-owned binding index): Carry opaque registry extensions through DatabaseInfo and drop the tray's synced label #3341 and Replace the registry's tenant-binding fields with extension keys and set_extensions #3342 become a plain removal, gated on sync copying the legacy registry keys first.
- 3-B (drop the columns now): Delete the dead embedding push/pull seam; keep embedding.origin for existing databases #3337 drops them, and every existing database is refused once.
- 4-B (keep the push names): close Rename the origin-filtered event channel to subscribe_to_events_excluding_origin #3338.
- 5-A (keep the query) or 5-C (remove it): Generalize get_multi_membership_edges into member_of_edges with caller-supplied filters #3343 becomes doc-only in Sweep the Pro and sync wording C7 leaves around replicated writes and AI-chat privacy #3367, or a deletion gated on sync.
- ADR-085 R6-b or R6-c: Reword the AI-chat privacy Play description without tenant wording #3344 becomes a seeding removal. Existing databases keep the collection and the Play either way.
What nodespace-sync uses today (sync 17f9557)
| Core surface | Pro use | Changed by |
|---|---|---|
NodeService::get/set_bound_tenant, get/set_sync_enabled, get/set_auth_status |
nodespaced-pro main.rs, cloud_sync/mod.rs, grpc.rs, orchestrator.rs |
#3340 |
DatabaseEntry.bound_tenant_*, DatabaseManager::set_bound_tenant |
Registry mirror, and the one-database-per-tenant check (cloud_sync/mod.rs ~1021, grpc.rs ~1130) |
#3342 |
DatabaseInfo fields 8 and 9, and the desktop DTO |
The Pro frontend only: core's in-tree Pro UI until #3327 and #3333 land, then the Pro package | #3342 |
SqliteStore::get_multi_membership_edges |
Membership sweep (orchestrator.rs ~1941) |
#3343 |
subscribe_for_push, set_push_excluded_origin |
Push consumer (orchestrator.rs ~111, ~324) |
#3338 |
The origin value sync-service |
Set through sync's own nodespace_sync::echo::SYNC_SERVICE_CLIENT_ID and about 25 literals, never through core's constant |
#3339 keeps the value |
| Embedding push/pull API | None since ADR-045 | #3337 |
The reserved ConflictKind kinds |
None | #3365 (docs) |
Existing databases (no core-side migration)
-
database-settingsbucket keys keep their names. Core never reads, strips or rewrites them. The Pro daemon reads the same keys after its pin bump. -
The stored
database-settingsschema node keeps its four field declarations in existing databases until they are reset, becauseseed_core_schemas_if_needednever rewrites a stored core schema.- Those databases keep validating
sync_enabledas a boolean andauth_statusaslocalorconnected. - New databases get an empty field list.
- Those databases keep validating
-
~/.nodespace/databases.toml:- after Carry opaque registry extensions through DatabaseInfo and drop the tray's synced label #3341, any key that an entry does not define survives every save;
- after Replace the registry's tenant-binding fields with extension keys and set_extensions #3342, the former typed binding lines load into
extensionsand survive too.
Nothing is dropped.
-
Columns.
embedding.originandnode.sync_seqstay.idx_emb_modifiedstays in old databases and is absent from new ones. -
Proto fields 8 and 9 become
reserved, which is wire-compatible in both directions. -
The AI-chat collection and Play are unchanged. Old databases keep the old Play description.
Examined and not moved by #3345
set_local_person_identity: core onboarding.- The
restrictedToMembersandmember_ofpermissioncomments: Reword core data-model and identity docs that cite Pro, Supabase, RLS or tenants #3365 writes ADR-083 §4's storage-contract text. local_only: stays (ADR-061 §6).- PersonNode
auth_status: Pro-owned, and core never declares it. Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340 replaces the core test that names it. - Keeping the settings node out of Pro push and pull (ADR-083 §1): a nodespace-sync follow-up that needs no core change.
Sub-issues and order
| Key | Title | Size | Depends on |
|---|---|---|---|
| #3337 | Delete the dead embedding push/pull seam; keep embedding.origin for existing databases | M | NodeSpaceAI/nodespace-docs#92 (ADR-083), #3299 |
| #3338 | Rename the origin-filtered event channel to subscribe_to_events_excluding_origin | S | NodeSpaceAI/nodespace-docs#92 (ADR-083), #3299 |
| #3339 | Give the replicated-apply origin constant and engine gate neutral names, value unchanged | S | NodeSpaceAI/nodespace-docs#92 (ADR-083), #3299 |
| #3340 | Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor | M | NodeSpaceAI/nodespace-docs#92 (ADR-083), #3299 |
| #3341 | Carry opaque registry extensions through DatabaseInfo and drop the tray's synced label | M | NodeSpaceAI/nodespace-docs#92 (ADR-083), #3299 |
| #3342 | Replace the registry's tenant-binding fields with extension keys and set_extensions | M | #3341, #3327, #3333, pin gate |
| #3343 | Generalize get_multi_membership_edges into member_of_edges with caller-supplied filters | S | NodeSpaceAI/nodespace-docs#92 (ADR-083), #3299 |
| #3344 | Reword the AI-chat privacy Play description without tenant wording | S | NodeSpaceAI/nodespace-docs#96 (ADR-085), #3299 |
C7.2 is not filed. ADR-083 §4 keeps both reserved conflict kinds, so only wording is left, and that moves to #3365 (see below).
Waves:
- After ADR-083 and Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299: Delete the dead embedding push/pull seam; keep embedding.origin for existing databases #3337, Rename the origin-filtered event channel to subscribe_to_events_excluding_origin #3338, Give the replicated-apply origin constant and engine gate neutral names, value unchanged #3339, Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340, Carry opaque registry extensions through DatabaseInfo and drop the tray's synced label #3341 and Generalize get_multi_membership_edges into member_of_edges with caller-supplied filters #3343, in any order and in parallel. After ADR-085 and Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299: Reword the AI-chat privacy Play description without tenant wording #3344.
- After Move the Pro account, admission and synced-database settings out of core #3327, Move the Pro sync and collaboration UI out of core #3333, Carry opaque registry extensions through DatabaseInfo and drop the tray's synced label #3341 and the pin gate: Replace the registry's tenant-binding fields with extension keys and set_extensions #3342.
Shared files:
node_service/mod.rs: Delete the dead embedding push/pull seam; keep embedding.origin for existing databases #3337 edits a test, Rename the origin-filtered event channel to subscribe_to_events_excluding_origin #3338 the channel, Give the replicated-apply origin constant and engine gate neutral names, value unchanged #3339 two batch tests, and Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340 the seeding and accessors. The regions are disjoint.playbook/engine.rs: Rename the origin-filtered event channel to subscribe_to_events_excluding_origin #3338 updates two names in theis_sync_originateddoc, and Give the replicated-apply origin constant and engine gate neutral names, value unchanged #3339 rewrites that doc.database_manager.rs,tray.rsand the frontend fixtures: Carry opaque registry extensions through DatabaseInfo and drop the tray's synced label #3341, then Replace the registry's tenant-binding fields with extension keys and set_extensions #3342.person_seed_test.rs,behaviors/mod.rsand thenode_service/mod.rsdocs: Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340 and Reword core data-model and identity docs that cite Pro, Supabase, RLS or tenants #3365, on disjoint lines.
Expect rebases, not design conflicts. Re-run the ratchet after each rebase: two PRs that lower the same marker conflict on BASELINES.
Coordination with #3372
#3365 absorbs the former C7.2. This is ADR-083 §4, wording only, with no code change:
packages/core/src/models/conflict.rs, theConflictKind::SupersededEditdoc. It becomes "A local edit was overwritten by a newer edit from another writer under last-writer-wins." Drop "Reserved for the Recovered Items fold-in (S2); no writer yet."- The
DuplicateReactiveCreatedoc. Keep its meaning and drop the delivery-stage wording. packages/core/src/services/node_service/conflicts.rs, the reconcile match arm for both kinds. Replace "No detection yet for these kinds (S1-S3 scope)" with "core has no detector for these kinds".packages/desktop-app/src/lib/components/conflict-indicator-badge.svelte, the header comment. Stop claiming thatSupersededEditdata already lives in the journal.
#3367 drops two items, which #3345 now owns:
- the
core_plays.rsPlay description (Reword the AI-chat privacy Play description without tenant wording #3344); person_seed_test.rsline 7 and lines 31-39 (Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340).
#3345 rewrites the docs of what it renames or deletes, so #3367 finds these already clean:
- the embedding docs and the
SCHEMA_SQLcomments it touches (Delete the dead embedding push/pull seam; keep embedding.origin for existing databases #3337); - the channel docs (Rename the origin-filtered event channel to subscribe_to_events_excluding_origin #3338);
- the origin-constant and
is_replicated_applydocs (Give the replicated-apply origin constant and engine gate neutral names, value unchanged #3339); - the
DatabaseSettingsNodeBehavior,database-settingsschema andseed_database_settings_if_neededdocs (Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340); - the
DatabaseEntryandDatabaseInfodocs (Carry opaque registry extensions through DatabaseInfo and drop the tray's synced label #3341, Replace the registry's tenant-binding fields with extension keys and set_extensions #3342); - the
member_of_edgesdoc and its test doc (Generalize get_multi_membership_edges into member_of_edges with caller-supplied filters #3343).
Acceptance criteria
- Every filed sub-issue is closed. Give the replicated-apply origin constant and engine gate neutral names, value unchanged #3339 may be closed as not planned if ADR-083 leaves the origin constant alone.
- This grep prints nothing:
git grep -n -E 'bound_?[tT]enant|[bB]oundTenant|apply_remote_embeddings|embeddings_modified_since|upsert_embeddings_with_origin|get_multi_membership_edges|subscribe_for_push|set_push_excluded_origin|SYNC_SERVICE_CLIENT_ID|is_sync_originated' -- packages. Drop the last two names from the pattern if Give the replicated-apply origin constant and engine gate neutral names, value unchanged #3339 was closed as not planned. -
git grep -n -E 'sync_?[eE]nabled|auth_?[sS]tatus' -- packages/core packages/daemon packages/protoprints nothing once Reword core data-model and identity docs that cite Pro, Supabase, RLS or tenants #3365 has also merged. Frontend hits belong to Move the Pro sync and collaboration UI out of core #3333 and Add the "Share / Sync this database" entry point that opens nodespace.ai #3362. - A database created by the current release still opens after every sub-issue, with no incompatible-database screen and no rewrite.
- The free app works unchanged after every sub-issue:
- creating, editing and searching nodes;
- AI chat;
- the Conflicts pane;
- the tray database menu;
- the database switcher;
- onboarding identity.
- The Pro build stays green. Replace the registry's tenant-binding fields with extension keys and set_extensions #3342 merged only after the pin gate. Every other change is isolated by the Pro daemon's pin, and sync adapts in its pin-bump PR.
- Every sub-issue ran
bun run scripts/check-pro-boundary.tsand setBASELINESto the printed counts. At the end,cloudSyncHooksis 0. - The Consequences sections of ADR-083 and ADR-085 match what landed.
Dependencies
-
ADRs: NodeSpaceAI/nodespace-docs#92 (ADR-083) (ADR-083) and NodeSpaceAI/nodespace-docs#96 (ADR-085) (ADR-085).
-
Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299 (the ratchet): every sub-issue.
-
Move the Pro account, admission and synced-database settings out of core #3327, Move the Pro sync and collaboration UI out of core #3333 and the pin gate: Replace the registry's tenant-binding fields with extension keys and set_extensions #3342 only.
-
Sync follow-ups: noted in each sub-issue, not gates. They cover:
- the pin bumps that adopt the new names;
- the Pro-owned defaults;
- the settings-node sync exclusion.
The SYNC items are filed later.
Plan key: C7 (pro-boundary DAG).
🤖 Generated with Claude Code
Activity
mstomar125 commentedon Oct 1, 2026
Superseded by #3412 (umbrella against the final ADR-081–085)