Repository navigation
Description
Goal
Stop new Pro or sync code from landing in nodespace-core while the existing Pro code moves out, and make every migration PR prove what it removed.
The product owner's directive (2026-09-29): everything Pro or sync related, other than turning it on, lives in nodespace-sync, and core carries no Pro logic. Pro is a separate build that uses core internally and replaces the installed app, keeping the same database. ADR-081 (proposed) records the boundary.
Context
-
Pro code is still being added to core. On 2026-09-29 alone, the tenant-admission card, its Decline/Remove actions, the stakeholder-gated collaboration controls and a refreshed copy of the Pro proto all landed here. Nothing in the repo pushes back.
-
Core already has a ratchet of the right shape.
scripts/check-code-references.tscounts issue-number and docs-path references. Its real-repo test (describe("real-repo ratchet")inscripts/check-code-references.test.ts) fails when a count rises aboveBASELINES. It runs inbun run test:scripts(bun test scripts/), and the merge gate runs that tier on every PR (TIERS.scriptsinscripts/test-gate.ts). -
Core has no CI runner, so
bun run mergeis the only enforcement point. Two gaps matter for Pro code:bun run test:changedskips the scripts tier for frontend-only diffs (classifyinscripts/gate-scope.ts), and treats.mdfiles,README.mdincluded, as inert. Most Pro drift is Svelte-only.- The push check (
.husky/pre-pushrunsbun run scripts/test-gate.ts) runs lint only.
So a Svelte-only Pro change first meets a ratchet in the merge gate, a few minutes into a run that holds the machine slot. Run the Pro-boundary ratchet in the push check and before the merge slot #3300 closes that gap.
-
tenantcan be ratcheted raw. Measured with the patterns in Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299, everytenantline in scope is Pro code except one lease-agreement sentence in apackages/agenttest fixture, which gets a single exemption (raw count 508, counted 507). -
An exact ratchet needs two rules before migration work starts. A planned move of existing Pro code into its own file raises a count (Move the Pro variant machine and DATABASE_SETTINGS_NODE_ID out of the generic registry files #3309 / Adopt ADR-082's contribution contract: ids, when() predicates, keyed and isolated outlets #3310 takes
proNamedFilesfrom 16 to 18). So does any test that proves Pro code is gone, because it names what it looks for. Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299 makes the first an accepted class of raise and gives the second a convention, so neither needs a policy exception later.
Scope overview
- A new ratchet,
scripts/check-pro-boundary.ts, and its bun test (Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299).- It counts 11 line markers plus the number of Pro-named files, in every git-tracked or untracked-not-ignored text file under
packages/andscripts/, plusREADME.md. - Baselines are exact and only go down. A count above its baseline fails, because that is new Pro code. A count below it also fails, because the baseline is stale. The failure prints the block to paste, so freed headroom can't be spent later.
- Exemptions are per test file and per marker, each carries a reason, and a stale one fails.
- It counts 11 line markers plus the number of Pro-named files, in every git-tracked or untracked-not-ignored text file under
- CLAUDE.md rules (Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299).
- Pro/sync features go in nodespace-sync (ADR-081), and it lists what core may contain.
- The three accepted raise classes and the absence-test convention.
- Pro/sync issues are filed in nodespace-sync. The issue-management skill gets the same routing step.
- Run the check at
git push, and in the merge gate's lint section before the machine slot (Run the Pro-boundary ratchet in the push check and before the merge slot #3300). - The first pay-down (Rewrite the restrictedToMembers and member_of permission comments as storage contracts #3301). Rewrite the
restrictedToMembersandmember_ofpermissioncomments incore_schemas.rsas the storage contracts ADR-083 §4 defines. It is comment-only, and it exercises the lower-the-baseline workflow end to end.
#3302 changes no product behaviour. The free app, the Pro build (which compiles core's desktop app from core HEAD) and user data are unaffected. Any sub-issue rolls back with a plain revert.
Sub-issues (in order)
| Key | Title | Size | Depends on |
|---|---|---|---|
| #3299 | Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule | M | NodeSpaceAI/nodespace-docs#88 (ADR-081) |
| #3300 | Run the Pro-boundary ratchet in the push check and before the merge slot | S | #3299 |
| #3301 | Rewrite the restrictedToMembers and member_of permission comments as storage contracts | S | #3299, NodeSpaceAI/nodespace-docs#92 (ADR-083) |
#3300 and #3301 are independent of each other.
Baselines measured at af8ddb6
These numbers are for orientation. #3299 sets its baselines from the script's own output at its base commit. The scan covered 1,400 files.
| Marker | Lines | Files | Main holders | Paid down by | Expected end state |
|---|---|---|---|---|---|
proCommands: pro_* identifiers |
275 | 25 | commands/pro_sync.rs, the lib.rs handler list, update_check.rs, membership-service.ts, the add-synced / workspace-members / account-settings tests |
#3336, #3327, #3333, #3357 (pro_env, Pro-edition test names) |
0 |
proSyncModule: proSync, ProSync*, pro-sync |
360 | 33 | the pro-sync store and its tests, ui-extensions(.svelte).ts and its test, account-settings, app-shell |
#3317 (moves it first), #3327, #3333 | 0 |
proProtocol: the Pro proto, CloudSyncService, ProClient/ProTier, the Pro Worker URLs |
95 | 15 | pro_client.rs, pro_sync.rs, the vendored proto, build.rs, refresh-pro-proto.ts, the pro-sync store |
#3322 (GrpcClient::channel docs), #3336, #3333, #3372 (daemon router.rs docs) |
0 |
proEvents: pro:tier-detected, quoted sync:status/sync:error |
87 | 16 | the pro-sync store and its tests, pro_sync.rs, tauri-sync-listener |
#3336, #3327, #3333, #3372 | 0 |
membershipService |
54 | 6 | the membership store and service plus their tests, workspace-members-card |
#3327, #3333 | 0 |
editionBranching |
122 | 25 | proto/src/socket.rs, daemon_setup.rs, the daemon's main.rs, grpc_client.rs, postinstall, tauri.pro.conf.json |
#3357 (most), #3336, #3362 (README), #3372 (doc comments) | 0, except NODESPACE_FORCE_COMMUNITY in the community pre-install guard if ADR-084 §5 keeps it in core (raise class 1) |
cloudBindState: bound_tenant*, sync_enabled, auth_status, and their camelCase forms |
322 | 42 | node_service/mod.rs, behaviors/mod.rs, core_schemas.rs, database_manager.rs, the ui-extensions test, labs-flags |
#3345, #3327, #3333, #3362 (Labs syncEnabled) |
0, unless ADR-083 keeps a field under these names |
cloudSyncHooks: apply_remote_embeddings, embeddings_modified_since, get_multi_membership_edges |
15 | 6 | the embedding store and service, sqlite_store/mod.rs, collection_service.rs |
#3345 | 0, or ADR-083's neutral names |
cloudWording: Supabase, RLS, pgvector, nodespace-sync, "Pro daemon" |
89 | 46 | doc comments across core, the daemon and the app; the vendored proto | #3301, #3372, #3336, #3345 | 0 |
tenantWording |
507 (raw 508) | 37 | pro_sync.rs, the add-synced dialog and its test, the vendored proto, database_manager.rs, node_service/mod.rs |
#3336, #3327, #3333, #3345, #3372 | 0 |
proWording: the word "Pro", excluding chip and model names |
314 | 78 | spread across the app, core docs, the installer and the README | #3301, then #3336 through #3372 | only raise-class-1 lines: the ADR-084 entry-point copy and the installer and CLI guard messages |
proNamedFiles |
16 | n/a | #3336: nodespace_pro.proto, pro_sync.rs, pro_client.rs, refresh-pro-proto.ts. #3357: tauri.pro.conf.json. #3333: 11 pro-*, first-pro-consent-* and pro-relogin-* sources and tests |
#3336, #3333, #3357 (#3309 / #3310 first raises it to 18) | 0 |
Rules every #3322–#3372 sub-issue follows
These apply to every sub-issue from the moment #3299 is on main. The filing pass adds the standard line to each #3322–#3372 sub-issue body.
Standard acceptance line. It is unconditional and goes in every #3322–#3372 sub-issue:
- [ ] Ran `bun run scripts/check-pro-boundary.ts` and pasted the printed `BASELINES` block into `scripts/check-pro-boundary.ts`; the check exits 0. Every count this change lowers is lowered, and every count it raises is listed in the PR description (marker, old → new, lines from `--changed`) under an accepted raise class.- It is missing today from Add daemon-ready tasks and a channel-rebuilt hook to AppExtensions #3307, Let an app built on core supply its update source through AppExtensions #3320, Add a neutral daemon:data-plane-ready event and stop reloading on pro:tier-detected #3318, Delete dead Pro residue: sync:* log listeners and the Recovered Items seed script #3328, Carry the download URL in the update-check payload instead of a hardcoded releases page #3319, Delete the vendored nodespace_pro.proto, its build.rs step and its build-only deps #3335, C7.2, 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, Generalize get_multi_membership_edges into member_of_edges with caller-supplied filters #3343, Reword the AI-chat privacy Play description without tenant wording #3344, Remove the pro feature and --edition from nodespaced and reject unknown arguments #3348 / Move the .pkg guard to a static pre-install check and declare NodeSpaceProduct #3349, Delete the in-core Pro daemon profile, NODESPACE_PRO_* switch and tauri.pro.conf.json #3354 and Collapse proto socket, pid and marker tables to debug/release; drop CLI Pro discovery #3355. Under the two-sided ratchet, each of those fails the merge gate as written.
- A sub-issue that expects no count to move keeps the line, because running the check is what proves it.
- The standard verification command is
bun run scripts/check-pro-boundary.ts. After Run the Pro-boundary ratchet in the push check and before the merge slot #3300 lands, the push check runs it too.
Accepted raise classes. Never raise a baseline to land Pro code. Only the three classes below may raise one. The PR description names the class, each raised marker (old → new) and the lines.
- The core side of the ADR-084 upgrade flow.
- The "Share / Sync this database" entry and its copy (Add the "Share / Sync this database" entry point that opens nodespace.ai #3362).
- The installer and CLI pieces ADR-084 assigns to core: the
NodeSpaceProductbundle key, the community installer's pre-install guard, the caskpreflight, a CLI uninstall refusal and the product check.
- A fix to Pro code that has not moved to nodespace-sync yet. Prefer a net-zero edit.
- A planned relocation of Pro code already in core, by a Turn the UI-extension registry into ADR-082's build-time frontend extension API #3317–Remove Pro edition branching from the core app, daemon, CLI and installer #3357 sub-issue, that adds no behaviour.
- Example: splitting Pro gating out of a generic module into its own file, so that a later sub-issue deletes it whole.
- The raise covers only what the move itself adds, such as new file names and wiring imports.
- The PR names the sub-issue doing the move, and the one that will delete the moved code.
- Known case: Move the Pro variant machine and DATABASE_SETTINGS_NODE_ID out of the generic registry files #3309 / Adopt ADR-082's contribution contract: ids, when() predicates, keyed and isolated outlets #3310 adds
pro-sync-variant.svelte.tsandpro-sync-variant.test.ts, takingproNamedFilesfrom 16 to 18.
A false positive gets a narrow checker fix instead: a pattern change or an EXEMPTIONS entry, with a test. Never a raise.
Absence-test convention. A test whose job is to assert that Pro code is absent must not contain the marker it looks for. It has two options:
- build its needle from fragments, for example
["pro", "tier"].join("_"),new RegExp(["ten", "ant"].join(""), "i")orconcat!("--edi", "tion"); - in a test file where fragments are impractical, get a per-file, per-marker
EXEMPTIONSentry with its reason.
Known cases:
| Sub-issue | Test | Marker it would add |
|---|---|---|
| #3318 | contract test | proEvents |
| #3324 | tenant_demo fixture |
cloudBindState |
| #3348 / #3349 | --edition tests |
editionBranching |
| #3361 | guard regex | tenantWording, proWording |
#3371's final zero is reachable only under this convention.
Parent acceptance criteria
-
scripts/check-pro-boundary.tsexists,bun run test:scriptsenforces it, and its baselines equal the real counts onmain. - A PR that adds a Pro marker fails at
git pushand in the merge gate, and the failure names the offending line. - A PR that removes a Pro marker fails until it lowers the baseline. The failure prints the block to paste, and pasting it changes only the numbers that moved.
- Fragment-built needles count 0. Exemptions are per test file and per marker, carry a reason, and fail when stale.
- CLAUDE.md states "Pro/sync features go in nodespace-sync (ADR-081)", what core may contain, the three accepted raise classes and the absence-test convention.
- CLAUDE.md's Finding Tasks section and the issue-management skill both route Pro/sync issues to nodespace-sync.
- The
restrictedToMembersandpermissioncomments incore_schemas.rsstate ADR-083 §4's storage contracts without naming a consumer, and the baselines they paid down are lowered. - No product behaviour changed. The free app, the Pro build and every core test behave exactly as before.
Dependencies
- NodeSpaceAI/nodespace-docs#88 (ADR-081): ADR-081 accepted and merged. The freeze is ADR-081's policy, and CLAUDE.md links to it.
- This is a parent-level blocker. Don't copy it onto the sub-issues.
- Each sub-issue lists only its own direct blockers. Rewrite the restrictedToMembers and member_of permission comments as storage contracts #3301 also needs NodeSpaceAI/nodespace-docs#92 (ADR-083) (ADR-083).
- Downstream. The Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322–Remove Pro, Supabase and nodespace-sync wording from core comments, docs and the skill #3372 parents list Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299, not Guardrail: stop new Pro code from landing in core #3302, as a direct parent-level dependency, so the standard acceptance line always has a check to run. Depending on Guardrail: stop new Pro code from landing in core #3302 as a whole would hold Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322–Remove Pro, Supabase and nodespace-sync wording from core comments, docs and the skill #3372 behind ADR-083, through Rewrite the restrictedToMembers and member_of permission comments as storage contracts #3301.
Filing notes
- File every Guardrail: stop new Pro code from landing in core #3302 issue unassigned. Whoever picks one up self-assigns it at that point (
bun run gh:assign <N> "@me"), as core's CLAUDE.md requires. - Bodies locate code by symbol and heading. Line numbers are hints at af8ddb6 and will drift.
Plan key: C1 (pro-boundary DAG).
🤖 Generated with Claude Code
Activity
mstomar125 commentedon Oct 1, 2026
Superseded by #3412 (umbrella against the final ADR-081–085)