Skip to content

Move Pro-owned data out of core's data model (ADR-083) #3345

Closed as not planned
8 of 8 issues completed
Closed as not planned

Description

@mstomar125

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

Gate semantics (ADR-083 §7)

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:

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-settings bucket 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-settings schema node keeps its four field declarations in existing databases until they are reset, because seed_core_schemas_if_needed never rewrites a stored core schema.

    • Those databases keep validating sync_enabled as a boolean and auth_status as local or connected.
    • New databases get an empty field list.
  • ~/.nodespace/databases.toml:

    Nothing is dropped.

  • Columns. embedding.origin and node.sync_seq stay. idx_emb_modified stays 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

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:

  1. 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.
  2. 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:

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, the ConflictKind::SupersededEdit doc. 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 DuplicateReactiveCreate doc. 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 that SupersededEdit data already lives in the journal.

#3367 drops two items, which #3345 now owns:

#3345 rewrites the docs of what it renames or deletes, so #3367 finds these already clean:

Acceptance criteria

Dependencies


Plan key: C7 (pro-boundary DAG).

🤖 Generated with Claude Code

Sub-issues

Sub-issues

8 of 8 Issues completed
Loading 8 sub-issues

Activity

  1. self-assigned this
    on Sep 30, 2026
  2. added
    pro-boundary
    on Sep 30, 2026
  3. mstomar125 commented on Oct 1, 2026

    @mstomar125
    ContributorAuthor

    Superseded by #3412 (umbrella against the final ADR-081–085)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

pro-boundary

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions