Repository navigation
Description
Summary
Add scripts/check-pro-boundary.ts, a ratchet in the style of scripts/check-code-references.ts. It counts Pro/sync markers across core and fails when any count moves off its checked-in baseline, in either direction. Its bun test is the enforcement point, through bun run test:scripts and the merge gate.
In the same PR, write into CLAUDE.md the rules every later migration PR relies on:
- Pro/sync features go in nodespace-sync (ADR-081, proposed);
- the three accepted classes of baseline raise;
- the absence-test convention.
Also route Pro/sync issues to nodespace-sync, in CLAUDE.md's Finding Tasks section and in the issue-management skill.
Context
-
Why. Core ships no Pro code, because nodespace-sync owns the Pro app (ADR-081). Turn the UI-extension registry into ADR-082's build-time frontend extension API #3317 through Remove Pro, Supabase and nodespace-sync wording from core comments, docs and the skill #3372 move the existing code out. This issue freezes it in the meantime, and makes each move lower a number.
-
Template.
scripts/check-code-references.ts(201 lines at af8ddb6) has:SCAN_ROOTS,EXTENSIONS,EXCLUDE_DIR_NAMES,EXCLUDE_FILE_NAMESandBASELINES;countReferences,baselineFailuresand animport.meta.mainCLI.
Its test,
scripts/check-code-references.test.ts, has fixture-directory unit tests plus adescribe("real-repo ratchet")block that throws the actionable failure message. -
Where this check deliberately differs from the template:
-
File discovery uses
git ls-files, not a filesystem walk. A walk also reads gitignored output.- On the dev machine,
packages/desktop-app/src-tauri/resources/skill/holds a stale staged copy ofpackages/skill/SKILL.mdandreferences/*.md. It is gitignored by theresources/skill/line inpackages/desktop-app/src-tauri/.gitignore. Once.mdis scanned, that copy would add machine-dependentProlines. src-tauri/binaries/also collects extensionlessnodespaced-pro-*binaries from Pro builds.
- On the dev machine,
-
It scans more file types. The template scans only
.rs,.ts,.svelteand.js. Pro markers also live in:- the vendored
.proto; packages/skill/*.md;tauri.pro.conf.jsonandCargo.toml;scripts/pkg-resources/postinstall, which has no extension.
The template itself is not changed.
- the vendored
-
The baseline is exact. The template passes silently on a decrease. Here a decrease also fails and prints the block to paste, so headroom freed by migration PRs can't be spent on new Pro code.
-
It scans all of
packages/, not a fixed list, so a new package enters the ratchet automatically. That includespackages/agent, which is counted only; nothing there is modified. -
Exemptions are per file and per marker, and only for test files. The template drops whole files by basename. Here an exemption hides one marker in one test file, carries a reason, and fails once it goes stale.
-
Each baseline sits under its own one-line comment, and the printed block reproduces that layout exactly.
- The merge queue replays queued PRs with cherry-picks (
buildStackinscripts/merge-pr.ts) and ejects a PR that conflicts. - Git treats edits on adjacent lines as a conflict. With the numbers on consecutive lines, two PRs that lower different markers would eject each other.
- With a comment line between each pair, only PRs that change the same marker conflict.
- The merge queue replays queued PRs with cherry-picks (
-
-
Two rules the migration needs from day one:
-
Relocation. Some migration steps first move Pro code that is already in core into its own file, so that a later step can delete it whole.
- Example: 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 moves the Pro sync-variant gating (
resolveProSyncVariant,isProSyncActive) out ofui-extensions.svelte.tsintopro-sync-variant.svelte.tsandpro-sync-variant.test.ts. That takesproNamedFilesfrom 16 to 18. - An exact ratchet forbids this unless relocation is an accepted class of raise.
- Example: 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 moves the Pro sync-variant gating (
-
Absence tests. A test that proves Pro code is gone names what it looks for, so it adds the very marker it guards against. The plan has several:
- Add a neutral daemon:data-plane-ready event and stop reloading on pro:tier-detected #3318's extension contract test (
proEvents); - Remove tenant and sync wording shown to free users in Database settings #3324's
tenant_demofixture (cloudBindState); - 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's
--editiontests (editionBranching); - Delete the Labs syncEnabled flag and guard the free app's single sync entry point #3361's guard regex (
tenantWording,proWording).
Without a convention, Drive every Pro-boundary ratchet count to zero and make the check a hard ban #3371's goal of every marker at 0 can't be reached.
- Add a neutral daemon:data-plane-ready event and stop reloading on pro:tier-detected #3318's extension contract test (
-
-
Gate facts.
- The root
package.jsondefines"test:scripts": "bun test scripts/". - The merge gate runs
TIERS.scriptsunscoped (scripts/test-gate.ts, in the lane afterTIERS.frontend). test:changedruns the scripts tier only when the diff reachesscripts/, Rust orpackages/skill(classifyinscripts/gate-scope.ts). It treats.mdand.claude/files as inert.- Run the Pro-boundary ratchet in the push check and before the merge slot #3300 adds a run at push time.
- The root
Scope
- New file:
scripts/check-pro-boundary.ts.- Exported values:
REPO,SCAN_PREFIXES = ["packages/", "scripts/"],SCAN_ROOT_FILES = ["README.md"],SCANNED_EXTENSIONS,EXCLUDED_FILES,TEST_PATH,MARKERS,EXEMPTIONSandBASELINES. - Exported types:
LineMarkerName,MarkerName(LineMarkerName | "proNamedFiles") andExemption. - Exported functions:
isProNamedFile(path),listScannedFiles(repoRoot?),countMarkers(files, repoRoot?, exemptions?),exemptionProblems(exemptions?, repoRoot?),changedFilesSinceMain(repoRoot?),formatBaselines(counts)andbaselineFailures(counts, baselines?, changedFiles?). - A CLI under
if (import.meta.main).
- Exported values:
- New file:
scripts/check-pro-boundary.test.ts. It usesbun:testand is DOM-free, as CLAUDE.md requires forscripts/. CLAUDE.md:- a new section,
## Pro / Sync Boundary (CRITICAL), between## Architecture & Docsand## Node Type System & Schema Architecture (CRITICAL); - one paragraph in
## Finding Tasks, directly after the "Never assign an issue at creation time" paragraph.
- a new section,
.claude/skills/github-issue-management/SKILL.md: a new### Step 0: Confirm the issue belongs in nodespace-coreunder## Pre-Operation Steps, before### Step 1: Read the Workflow Guide (MANDATORY).
Marker definitions
Each entry in MARKERS is { pattern: RegExp; summary: string }. These are the exact patterns, and each trailing comment is that marker's summary.
The pattern is tested once per line, so a line counts at most once per marker, and one line can count under several markers.
proCommands: /\bpro_[a-z][a-z0-9_]*/ // pro_* Tauri commands, the pro_sync / pro_client modules, pro_env
proSyncModule: /[pP]roSync|pro-sync/ // the proSync store, resolveProSyncVariant, isProSyncActive, pro-sync imports
proProtocol: /nodespace_pro\b|nodespace\.pro\.v1|CloudSyncService|\bPro(?:Client|Tier)\b|pro\.nodespace\.ai|127\.0\.0\.1:8787/ // the Pro proto, CloudSyncService, ProClient / ProTier, Pro Worker URLs
proEvents: /pro:tier-detected|['"`]sync:(?:status|error)['"`]/ // quoted pro:tier-detected, sync:status and sync:error event names
membershipService: /membershipService|MembershipService|membership-service/ // the Pro membership service
editionBranching: /\bis_pro(?:_build)?\b|NODESPACED?_PRO_|feature\s*=\s*"pro"|nodespaced-pro|(?:daemon|ui|incompatible-database)(?:-dev)?-pro\.(?:sock|pid|json)|PRO_DAEMON_BINARY_NAME|tauri\.pro\.conf|\.daemon(?:\.dev)?\.pro\b|--edition\b(?!\s*=?\s*20\d\d)|FORCE_COMMUNITY/ // Pro build, daemon, socket, launchd and installer branching
cloudBindState: /bound_?[tT]enant|[bB]oundTenant|sync_?[eE]nabled|[sS]yncEnabled|auth_?[sS]tatus|[aA]uthStatus/ // tenant binding, sync_enabled and auth_status state
cloudSyncHooks: /apply_remote_embeddings|embeddings_modified_since|get_multi_membership_edges/ // cloud embedding and membership-edge sync hooks
cloudWording: /[Ss]upabase|\bRLS\b|pgvector|nodespace[-_]sync|[Pp]ro daemon/ // Supabase, RLS, pgvector, nodespace-sync and "Pro daemon" wording
tenantWording: /tenant/i // the word tenant (one fixture exempt, see EXEMPTIONS)
proWording: /(?<!\b(?:M\d|V\d|MacBook|iPad|iPhone) )\bPro\b/ // the word Pro, except chip and model names such as "M2 Pro", "DeepSeek V4 Pro"
// plus proNamedFiles: scanned files whose basename matches /(^|[-_.])pro([-_.]|$)/ (summary: files whose basename has a pro segment)The implementation must preserve three properties:
nodespace_pro\bmust not matchnodespace_proto, the core proto crate.- The
--editionlookahead keepsrustfmt --edition 2021from counting. proEventscounts only quoted event names. Prose that merely mentions an event is left to Remove Pro, Supabase and nodespace-sync wording from core comments, docs and the skill #3372.
File selection
- A path is scanned when it is
README.md, or when it starts with aSCAN_PREFIXESentry and either:- its extension is in
SCANNED_EXTENSIONS(.rs .ts .svelte .js .proto .toml .md .json .sh .plist .css .html .py); or - it has no extension.
- its extension is in
- The extension is the part of the basename from its last
., unless that.is the first character. A dotfile such as.gitignoretherefore has no extension, and is scanned. EXCLUDED_FILESare dropped:scripts/check-pro-boundary.tsandscripts/check-pro-boundary.test.ts. Both match their own patterns, and the checker's own name is Pro-named.CLAUDE.mdand.claude/are left out on purpose. They sit outside the prefixes, and CLAUDE.md states the rule and names the markers.
Exemptions
export const TEST_PATH = /(^|\/)(tests?|__tests__)\/|\.(test|spec)\.ts$|_tests?\.rs$|(^|\/)tests\.rs$/;
export type Exemption = { file: string; markers: readonly LineMarkerName[]; reason: string };
export const EXEMPTIONS: readonly Exemption[] = [
{
file: "packages/agent/tests/it/live_embedding_prefix_measurement.rs",
markers: ["tenantWording"],
reason: 'lease-agreement fixture prose ("a replacement tenant"), not tenant code',
},
];- An entry hides only its own markers, and only in its own file. That file's other markers still count, and the same marker still counts in every other file.
exemptionProblemsreports one message per bad entry, and the real-repo test fails on any of them. An entry is bad when:- its file is missing from the scan;
- its file doesn't match
TEST_PATH; - its reason is empty;
- it names no marker, or an unknown one;
- it has no raw hit left for one of its markers. A stale exemption would silently hide the next real hit.
proNamedFilescan't be exempted. The type excludes it. An absence test must not have a Pro-named file name.
The absence-test convention
Some tests exist to assert that Pro code is absent: a guard that greps for a Pro name, a fixture that proves a removed field is ignored, or a test that a removed flag is rejected. Such a test must not contain the marker it looks for. It has two options.
- Build the needle from fragments, which no marker matches:
- TypeScript:
["pro", "tier"].join("_"),new RegExp(["ten", "ant"].join(""), "i"),"sync:" + "status"; - Rust:
concat!("--edi", "tion"),["NODESPACE", "PRO", "SUPABASE_URL"].join("_").
- TypeScript:
- Add an
EXEMPTIONSentry for that file and those markers, with the reason. This is only for a file matchingTEST_PATHwhere fragments are impractical.
Three more points:
- Inline Rust test modules in product files (
#[cfg(test)] mod tests) don't matchTEST_PATH, so they must use fragments. - Fragments belong only in absence tests. In product code they hide Pro code, and review rejects them.
- This is not the same as
src/tests/free-user-guardrail.test.ts, which imports the Pro modules to prove they stay inert in the free build. That suite counts normally, and it leaves core along with the code it tests.
Baselines at af8ddb6
Take the real numbers from the CLI at your base commit. Do not copy these.
| Marker | Baseline |
|---|---|
proCommands |
275 |
proSyncModule |
360 |
proProtocol |
95 |
proEvents |
87 |
membershipService |
54 |
editionBranching |
122 |
cloudBindState |
322 |
cloudSyncHooks |
15 |
cloudWording |
89 |
tenantWording |
507 (raw 508; the one exemption removes 1) |
proWording |
314 |
proNamedFiles |
16 |
That run scanned 1,400 files. The 16 Pro-named files are listed below. Paths that start with src-tauri/ or src/ are under packages/desktop-app/.
packages/desktop-app/src-tauri/proto/nodespace_pro.protosrc-tauri/src/commands/pro_sync.rssrc-tauri/src/services/pro_client.rssrc-tauri/tauri.pro.conf.jsonsrc/lib/components/first-pro-consent-modal.sveltesrc/lib/components/first-pro-consent-slot.sveltesrc/lib/components/pro-relogin-modal.sveltesrc/lib/components/pro-relogin-slot.sveltesrc/lib/plugins/pro-plugin.tssrc/lib/stores/pro-sync.svelte.tssrc/tests/components/first-pro-consent-modal.test.tssrc/tests/components/first-pro-consent-slot.test.tssrc/tests/components/pro-relogin-modal.test.tssrc/tests/stores/pro-sync-settings-refresh.test.tssrc/tests/stores/pro-sync.test.tsscripts/refresh-pro-proto.ts
BASELINES layout
export const BASELINES = {
// pro_* Tauri commands, the pro_sync / pro_client modules, pro_env
proCommands: 275,
// the proSync store, resolveProSyncVariant, isProSyncActive, pro-sync imports
proSyncModule: 360,
// …one summary comment line and one value line per marker, in MARKERS order…
// files whose basename has a pro segment
proNamedFiles: 16,
} satisfies Record<MarkerName, number>;formatBaselines(counts) returns exactly this text for any set of counts, built from each marker's summary. A test holds the checker's own source to formatBaselines(BASELINES). Pasting the printed block therefore changes only the numbers that moved.
Out of scope
- Removing, moving or rewording any Pro code or comment. That is Rewrite the restrictedToMembers and member_of permission comments as storage contracts #3301 and Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 through Remove Pro, Supabase and nodespace-sync wording from core comments, docs and the skill #3372; this PR only measures.
- Changing
scripts/check-code-references.tsor its baselines. - Editing anything under
packages/agent. It is scanned only. - Running the check at push time or from
scripts/test-gate.ts. That is Run the Pro-boundary ratchet in the push check and before the merge slot #3300. - A mirror check in nodespace-sync. That is a later SYNC item.
Steps
-
Confirm ADR-081 is merged. Work from an up-to-date
main, in a worktree.<docs>is your nodespace-docs checkout:../nodespace-docsin CLAUDE.md's layout,../docson some machines.git -C <docs> fetch origin main git -C <docs> ls-tree --name-only origin/main decisions/ | grep '^decisions/081-'
Always check
origin/main, never a local checkout that may be stale. The draft is named081-pro-is-a-separate-app-core-ships-no-pro-code.md; link whatever name actually merged. -
Write
scripts/check-pro-boundary.ts.-
Header comment, in the template's voice. Cover:
- why the check exists (ADR-081);
- what it counts;
- that baselines are exact, are lowered in the same PR that removes code, and are never raised to land Pro code;
- the three accepted raise classes and the absence-test convention, by pointing to CLAUDE.md's "Pro / Sync Boundary" section;
- why discovery uses git;
- why each baseline has its own comment line.
Include no issue numbers, and no
nodespace-docs/ordocs/<section>/path.check-code-references.tsscans this file, and its doc-path baseline is 0. -
listScannedFiles(repoRoot = REPO). Rungit -C <repoRoot> ls-files -z --cached --others --exclude-standard, split the output on NUL, and apply the file selection rules above. If git fails, throw an Error saying the check needs a git checkout. Never return[]silently. -
countMarkers(files, repoRoot = REPO, exemptions = EXEMPTIONS).- Read each file as UTF-8. Skip any file that can't be read, such as a path still in the index but deleted from the working tree.
- For every line, and every marker not exempt for that file, record a hit
path:line: trimmed textwhen the pattern matches. - Count
proNamedFileswithisProNamedFile. Its hits are the paths. - Return
{ counts: Record<MarkerName, number>, hits: Record<MarkerName, string[]> }.
-
exemptionProblems(exemptions = EXEMPTIONS, repoRoot = REPO). Return one message per problem listed under Exemptions. The stale check counts raw hits with the marker's pattern, ignoring exemptions. -
changedFilesSinceMain(repoRoot = REPO), best effort. Takegit merge-base origin/main HEAD, thengit diff --name-only --no-renames <base>, plus untracked files, the same waychangedFiles()inscripts/gate-scope.tsdoes. Return[]on any error. -
formatBaselines(counts). Return theexport const BASELINES = { … } satisfies Record<MarkerName, number>;text in the layout above: one summary comment line and one value line per marker, inMARKERSorder, thenproNamedFiles. -
baselineFailures(counts, baselines = BASELINES, changedFiles = []). Return one message per marker that is off its baseline.- Above the baseline. Give the marker, its summary, the count and the baseline, then this text: "Pro and sync code belongs in nodespace-sync (ADR-081); core may only expose a generic extension point. A test that asserts Pro code is absent builds its needle from fragments or gets an EXEMPTIONS entry. Only the accepted raise classes in CLAUDE.md ('Pro / Sync Boundary') may raise a baseline, and the PR description must name them."
- Then list the hits in
changedFilesfirst, under "In files this branch changed:", followed by every hit. - For a marker whose baseline is 0, say the marker is fully removed from core.
- Then list the hits in
- Below the baseline. "
<marker>is now N, below its baseline M: lowerBASELINES.<marker>to N in scripts/check-pro-boundary.ts in this change." - When any message is returned, also append one block holding
formatBaselines(counts), introduced as "Paste over BASELINES in scripts/check-pro-boundary.ts:".
- Above the baseline. Give the marker, its summary, the count and the baseline, then this text: "Pro and sync code belongs in nodespace-sync (ADR-081); core may only expose a generic extension point. A test that asserts Pro code is absent builds its needle from fragments or gets an EXEMPTIONS entry. Only the accepted raise classes in CLAUDE.md ('Pro / Sync Boundary') may raise a baseline, and the PR description must name them."
-
CLI.
- With no arguments, print a table of marker, count and baseline, then any
exemptionProblemsandbaselineFailures. Exit 1 if there are any, otherwise exit 0. --list <marker>prints every hit for that marker, grouped by file. Migration PRs use it to find what they are removing.--changedprints, per marker, the hits in files this branch changed. PR descriptions quote it for any raise.
- With no arguments, print a table of marker, count and baseline, then any
-
-
Write
scripts/check-pro-boundary.test.ts, as described in "Tests and verification" below. -
Set the baselines. Run
bun run scripts/check-pro-boundary.tsand paste the printed block overBASELINES. -
Add the CLAUDE.md section:
## Pro / Sync Boundary (CRITICAL) Core is the complete free product. NodeSpace Pro is a separate app that nodespace-sync builds on top of core; it replaces the installed app and keeps the same local database ([ADR-081](../nodespace-docs/decisions/081-<slug>.md)). - **Pro and sync features go in nodespace-sync, not here:** Pro UI (components, stores, settings sections, modals), Pro Tauri commands and their client, the Pro proto, tenant / invite / admission logic, cloud identity, and the Pro build config, installer and update channel. - **Core may contain only what ADR-081 lists:** generic extension points, the "Share / Sync this database" entry that opens the website, and local features that sync also uses (echo suppression, event batching, OCC and the conflict journal, collections, `member_of`, the person model). Name an extension point for what it does, not for who uses it: no "Pro daemon", Supabase, tenant or nodespace-sync wording in new core code or comments. - **`scripts/check-pro-boundary.ts` enforces this.** It counts Pro markers in `packages/`, `scripts/` and `README.md`, and runs in `bun run test:scripts` (every merge gate). Its baselines are exact and only go down: a change that removes Pro code lowers them in the same PR. The check fails until it does, and prints the `BASELINES` block to paste. - **Never raise a baseline to land Pro code.** Only three kinds of change may raise one, and the PR description names the class, each raised marker (old → new) and its lines (`bun run scripts/check-pro-boundary.ts --changed`): 1. the core side of the ADR-084 upgrade flow: the "Share / Sync this database" entry and its copy, and the installer and CLI guards ADR-084 assigns to core; 2. a fix to Pro code that has not moved to nodespace-sync yet (prefer a net-zero edit); 3. a planned move of Pro code already in core, by a Pro-boundary migration issue, that adds no behaviour (for example, splitting Pro gating into its own file so a later issue deletes it whole). Name the issue that will delete the moved code. A false positive gets a narrow, tested fix in the checker (a pattern change or an `EXEMPTIONS` entry), never a raise. - **A test that asserts Pro code is absent must not contain the marker it looks for.** Build the needle from fragments (`["pro", "tier"].join("_")`, `new RegExp(["ten", "ant"].join(""), "i")`, `concat!("--edi", "tion")`). Where that is impractical in a test file, add a per-file, per-marker `EXEMPTIONS` entry with its reason. Fragments belong only in absence tests; in product code they hide Pro code, and review rejects them. - `bun run test:changed` skips the scripts tier for frontend-only and `.md`-only diffs, so run `bun run scripts/check-pro-boundary.ts` before pushing any change near Pro code.
-
Add the Finding Tasks paragraph, directly after "Never assign an issue at creation time":
Pro and sync issues belong in nodespace-sync (ADR-081): anything about Pro UI, Pro commands, tenants, membership invites or admission, Supabase, or the Pro installer or update channel. Don't file them here. A generic extension point that the Pro app uses is core work and is filed here.
In the skill, add
### Step 0: Confirm the issue belongs in nodespace-corewith the same routing, ending: "If it belongs in nodespace-sync, file it there and stop." -
Verify and open the PR. Run the verification and the mutation checks below. The PR description must list each mutation check and its result.
Acceptance criteria
-
scripts/check-pro-boundary.tsandscripts/check-pro-boundary.test.tsexist, export the API above, and passbun run quality:scripts:check(eslint and tsc). -
bun run scripts/check-pro-boundary.tsexits 0 on the PR branch and prints all 12 counts, each equal to its baseline. - Adding one Pro marker line anywhere in scope fails
bun run test:scripts. The message names the marker, shows the new line under "In files this branch changed", and points to the absence-test convention and the raise classes. - Removing one marker line fails with the "lower
BASELINES.<marker>to N" message and the paste block. Pasting the block makes the check pass, and changes only that marker's value line. - The
BASELINESliteral in the source equalsformatBaselines(BASELINES), with one summary comment line above each value line. - Gitignored files never change the counts: the staged
src-tauri/resources/skill/copy,src-tauri/binaries/,.svelte-kit/andtarget/. Untracked files that are not ignored do count. -
CLAUDE.mdand the checker's own two files are not counted.packages/agentis counted. -
EXEMPTIONSholds exactly one entry:packages/agent/tests/it/live_embedding_prefix_measurement.rs, exempt fromtenantWordingonly. -
exemptionProblems()is empty on the real repo, and a fixture catches each kind of problem. - Fragment-built needles count 0 for every marker, and the same needles written literally do count.
-
bun run scripts/check-code-references.tsstill passes: the new files add no issue-number or docs-path references. - CLAUDE.md has the new section, including the three raise classes and the absence-test convention, and the Finding Tasks paragraph. It links ADR-081 by its merged filename. The skill has Step 0.
- No product code changed.
git diff --stat origin/mainlists only the two new scripts,CLAUDE.mdand the skill file.
Tests and verification
scripts/check-pro-boundary.test.ts uses bun:test, with a temporary directory per test. The discovery, exemption and layout tests run git init in that directory, as scripts/merge-queue.test.ts already does.
Pattern tests. Each marker gets a table of lines that must match and lines that must not. Build any fixture that contains regex-special characters in code.
| Marker | Must match | Must not match |
|---|---|---|
proCommands |
invoke('pro_list_members'), commands::pro_sync::pro_tier,, pub mod pro_client; |
is_pro_build(), approve_request, macro_rules! |
proSyncModule |
import { proSync } from '$lib/stores/pro-sync.svelte', resolveProSyncVariant() |
project-sync, prosync |
proProtocol |
tonic::include_proto!("nodespace.pro.v1"), CloudSyncServiceClient, app.try_state::<ProClient>(), "https://pro.nodespace.ai" |
use nodespace_proto::socket;, ProcessTier |
proEvents |
listen('pro:tier-detected', cb), app.emit("sync:status", p) |
unquoted prose sync:status updates |
membershipService |
import { membershipService } from '$lib/services/membership-service' |
collection membership, member_of |
editionBranching |
is_pro_build(), fn f(is_debug: bool, is_pro: bool), option_env!("NODESPACE_PRO_SUPABASE_URL"), NODESPACED_PRO_ANON_KEY, cfg!(feature = "pro"), "daemon-dev-pro.sock", "ui-pro.pid", "incompatible-database-pro.json", app.nodespace.daemon.pro, tauri.pro.conf.json, nodespaced --edition, NODESPACE_FORCE_COMMUNITY |
rustfmt --edition 2021, edition = "2021", "daemon-dev.sock", app.nodespace.daemon.dev |
cloudBindState |
bound_tenant_schema, boundTenantCollection, sync_enabled, labsFlags.syncEnabled, auth_status, authStatus |
synced, authenticate |
cloudSyncHooks |
each of the three names | upsert_embeddings |
cloudWording |
Supabase, supabase, Postgres RLS, pgvector, nodespace-sync, nodespace_sync::, the Pro daemon |
URLS, sync service |
tenantWording |
tenant, TENANT_ADMIN_ROLES, boundTenant |
maintenance |
proWording |
// the Pro build, NodeSpace Pro, Pro-only |
M2 Pro, DeepSeek V4 Pro, MacBook Pro, Protocol, Provider, lowercase pro, NodeSpaceProduct |
isProNamedFile |
pro-plugin.ts, pro_sync.rs, tauri.pro.conf.json, nodespace_pro.proto, first-pro-consent-modal.svelte, pro-sync.svelte.ts |
provider.ts, process.rs, node_service.proto, protocol.ts, project-sync.ts, approve.ts, repro.ts |
Discovery tests, in a temporary git repo:
- Tracked files, and untracked files that are not ignored, are counted.
- A path listed in
.gitignoreis not counted. Cover both a directory, such asresources/skill/, and an extensionless binary name, such asbinaries/nodespaced-pro-x. - Files outside
packages/andscripts/are not counted, exceptREADME.md. ACLAUDE.mdfull of markers counts 0. .proto,.md,.json, extensionless files and dotfiles are scanned;.pngis not.- The checker's own two paths are skipped.
- A file deleted from the working tree but still in the index does not throw.
- A directory that isn't a git repo throws a clear error.
Counting tests:
- Each line counts once per marker. Two markers on one line count once each.
- Hits are formatted as a repo-relative
path:line: text.
Exemption tests:
- An entry hides only its own markers, in its own file. In that file a
proWordingline still counts, and atenantline in another file still counts. exemptionProblemsreports each problem, each tested in its own fixture:- a file missing from the scan;
- a path that isn't a test path, such as
packages/x/src/lib.rs; - an empty reason;
- an empty marker list, an unknown marker, or
proNamedFiles; - a marker with no raw hit left in the file.
TEST_PATHmatchessrc/tests/stores/x.test.ts,packages/core/tests/it/a.rs,scripts/a.test.ts,src/models/foo_test.rsandsrc/x/tests.rs.TEST_PATHdoes not matchsrc/lib/stores/x.svelte.ts,packages/daemon/src/main.rsorsrc/contest.rs.
Absence-convention tests:
- A fixture test file whose needles are built from fragments counts 0 for every marker. It uses each form listed in the convention.
- The same file with the needles written literally counts under
proCommands,tenantWording,proEventsandeditionBranching. This control keeps the first test from passing vacuously.
Layout tests:
- The checker's source contains
formatBaselines(BASELINES)verbatim. formatBaselinesputs exactly one summary comment line before each value line.- In a temporary git repo holding
formatBaselines(counts):- a branch that lowers
proCommandsand a branch that lowersproSyncModule, which are adjacent in order, cherry-pick onto each other without conflict; - two branches that set
proCommandsto different values do conflict.
- a branch that lowers
baselineFailures tests:
- Above the baseline: the message names the marker, mentions the absence convention and the raise classes, and lists hits in changed files before the full list.
- Below the baseline: the lower-it message.
- Equal to the baseline:
[]. - A baseline of 0 gets the "fully removed" wording.
- The paste block equals
formatBaselines(counts).
Real-repo tests:
- Both
baselineFailures(countMarkers(listScannedFiles()).counts, BASELINES, changedFilesSinceMain())andexemptionProblems()are empty. Otherwise the test throws the joined messages, as the template does. Object.keys(BASELINES)equals the line-marker names plusproNamedFiles, inMARKERSorder.
Commands to run:
bun run test:scriptsbun run quality:scripts:checkbun run scripts/check-pro-boundary.tsbun run scripts/check-pro-boundary.ts --list proNamedFilesbun run scripts/check-pro-boundary.ts --changedbun run scripts/check-code-references.tsbun run test:changed. The diff isscripts/plus inert.mdand.claudefiles, so only the scripts tier runs.
Mutation checks. Run each one, confirm it fails as described, then revert it.
- Add
await invoke('pro_example');to any non-Pro frontend file. The real-repo test fails onproCommandsand shows that line under "In files this branch changed". - Delete the README's
nodespaced-prosentence. You get lower-it failures foreditionBranching,proWordingandtenantWording. Pasting the printed block passes, andgit diffshows only those three value lines. - Run
touch packages/desktop-app/src/lib/components/pro-upsell.svelte.proNamedFilesfails. - Remove the
\bfromnodespace_pro\b. Thenodespace_protopattern test fails. - Delete the agent
EXEMPTIONSentry. The real-repotenantWordingcount rises to 508 and fails. - Change the agent entry's markers to
["proWording"].exemptionProblemsreports it as stale, andtenantWordingrises to 508. - Replace one fragment needle in the absence fixture with its literal. The absence-convention test fails.
- Make
formatBaselinesdrop the comment lines. The source-layout test and the cherry-pick test both fail. - Put a
.mdfile with markers under the gitignoredpackages/desktop-app/src-tauri/resources/skill/. The counts don't change.
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.
Risks and rollback
- A false positive blocks an unrelated PR. Fix it in the checker with a pattern change, or with an
EXEMPTIONSentry if the file is a test, plus a test for the fix. Never raise the baseline for it. - Exact baselines and parallel PRs. Thanks to the comment-line layout, only PRs that change the same marker conflict on
BASELINES. The merge queue ejects the second one; rebase it, rerun the CLI and paste the block. - Relocation raises are enforced by review, not by the checker. The PR description must name the sub-issue doing the move and the one that deletes the moved code. The reviewer checks that the raise covers only what the move itself adds.
- Transitional Pro hotfixes. A fix to Pro code that still lives in core may need a raise under class 2. Prefer net-zero edits.
packages/agentis counted. A newtenantorProline in the agent lane fails the check. The directive intends this, but the owners of that lane should know.- Rollback. Revert the PR. It touches only tooling and docs: no product code, no build output and no data.
Plan key: C1.1 (pro-boundary DAG).
🤖 Generated with Claude Code
Activity
18 remaining items
Add the Pro-boundary ratchet check and the Pro/sync placement rule (c…
Add the Pro-boundary ratchet check and the Pro/sync placement rule (c…
Add the Pro-boundary ratchet check and the Pro/sync placement rule (c…
Add the Pro-boundary ratchet check and the Pro/sync placement rule (c…