Skip to content

Drive every Pro-boundary ratchet count to zero and make the check a hard ban #3371

Closed as not planned

Description

@mstomar125

Summary

This is the last Pro-boundary PR in core. It does four things:

  • fixes whatever Pro, cloud or tenant wording is still left;
  • turns the ratchet into a hard ban: every BASELINES entry 0, with the few ADR-sanctioned lines held in pinned, per-file allowances;
  • makes the issue-number check scan .proto files;
  • updates CLAUDE.md so the boundary reads as enforced rather than in progress.

Context

Scope

  • scripts/check-pro-boundary.ts:
    • Set every BASELINES entry to 0.

    • Pinned allowances. Add ALLOWANCES: readonly { file: string; marker: MarkerName; count: number; reason: string }[], unless Guardrail: stop new Pro code from landing in core #3302 already provides an equivalent; if it does, use Guardrail: stop new Pro code from landing in core #3302's.

      • A hit in an allowance's file for its marker counts against that allowance, not against the global count.
      • An allowance fails above its count (new Pro wording in a sanctioned file) and below it ("lower the allowance"), with the same paste block as the baselines.
      • Each reason cites the ADR section.
    • Expected allowances (confirm at pickup, and list each in the PR):

      File Marker(s) Reason
      C9.1's Share / Sync entry-point component, and its test proWording ADR-081 §2b, ADR-084 §1: the one place core's UI names the paid product
      README.md proWording, plus any marker Add the "Share / Sync this database" entry point that opens nodespace.ai #3362's approved pointer trips ADR-081 §2b: a plain website pointer
      scripts/build-pkg.sh, scripts/pkg-resources/preinstall, scripts/update-homebrew-cask.ts, and their tests editionBranching (NODESPACE_FORCE_COMMUNITY, and nodespaced-pro in the key-absent fallback), proWording (the refusal message) ADR-081 §2d and §8, ADR-084 §5. Only if ADR-084's guards have landed. Lower the nodespaced-pro part when ADR-084 retires the fallback

      If ADR-084 keeps no community installer guard (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 default), there is no installer allowance, and NODESPACE_FORCE_COMMUNITY counts 0.

    • Absence guards. Confirm that every guard listed under Context follows Guardrail: stop new Pro code from landing in core #3302's absence-guard convention, so the guard's own strings do not count. Convert any guard written before the convention existed.

    • A productKey marker. ADR-081 §8 allows the NodeSpaceProduct bundle key only in its allowlist:

      • scripts/build-pkg.sh and scripts/pkg-resources/preinstall;
      • scripts/update-homebrew-cask.ts;
      • packages/cli/src/commands/uninstall.rs;
      • the desktop app file that declares community.

      If ADR-084's guard work has landed and no earlier issue added this marker, add it at 0 outside those files.

    • Header comment: every count is zero; any hit outside a pinned allowance or an absence guard fails.

    • Drop the "accepted raises" wording. No Pro code is left in core to fix in place.

  • scripts/check-pro-boundary.test.ts:
    • a test that every BASELINES value is 0;
    • tests for allowances: over, under, and equal;
    • a test that every allowance's file exists and its reason cites an ADR section;
    • keep the real-repo test.
  • Optional, on the reviewer's call: a syncVocabulary marker at 0 that locks in Remove Pro, Supabase and nodespace-sync wording from core comments, docs and the skill #3372's rewording, for example:
    /cloud[- ]?sync|cloud[- ](?:push|pull)|\bto cloud\b|sync-apply|cold[- ]?sweep|\bcommunity (?:build|install|mode|tier|default)s?\b|\bnon-pro\b|pro-gated/i
    
    It needs a commented exemption for packages/skill/src/mcp-clients.ts ("Linux community builds of Claude Desktop"). Add it only if its count is 0 after exemptions, with pattern tests in the style of Guardrail: stop new Pro code from landing in core #3302's.
  • scripts/check-code-references.ts:
    • add .proto to EXTENSIONS, and extend the comment above it;
    • in scripts/check-code-references.test.ts, extend "only scans the requested extensions" with a scripts/a.proto fixture, and update its title and expected count.
  • CLAUDE.md, the "Pro / Sync Boundary" section Guardrail: stop new Pro code from landing in core #3302 added:
    • "scripts/check-pro-boundary.ts holds every count at zero; any Pro marker outside a pinned ADR allowance fails the push and the merge gate";
    • list the allowances by ADR section, and the absence-guard convention;
    • remove the "the only accepted raises" sentence.
  • Stragglers. Any wording line the CLI or the grep below still finds in a file no other parent owns. Reword it per the parent's wording guide.
  • README.md. Verify, without editing unless something is wrong, that only Add the "Share / Sync this database" entry point that opens nodespace.ai #3362's website pointer remains (ADR-081 §2b). Don't reword Add the "Share / Sync this database" entry point that opens nodespace.ai #3362's approved copy.

Out of scope

  • Deleting or moving any Pro code. See Context: reopen the owning parent instead.
  • ADR-084's guards themselves: the product key, the pre-install check, the cask preflight and the CLI refusal. If they land after this PR, the issue that adds them adds its own allowances and the productKey marker in the same change.
  • nodespace-sync's own mirror check (a later SYNC item).
  • nodespace-docs updates (the separate docs tracking issue).

Steps

  1. Follow CLAUDE.md's startup sequence:
    • pull main;
    • EnterWorktree({name: "issue-<N>-pro-boundary-zero"});
    • bun install, then the bun run test baseline;
    • self-assign at pickup and set In Progress.
  2. Confirm Move the Pro Tauri layer out of core: pro_* commands, ProClient, proto, update source #3336, Move the Pro account, admission and synced-database settings out of core #3327, Remove Pro edition branching from the core app, daemon, CLI and installer #3357, Add the "Share / Sync this database" entry point that opens nodespace.ai #3362, Remove Pro and cloud-sync wording from frontend comments, tests and the fly-out tooltip #3366, Sweep the Pro and sync wording C7 leaves around replicated writes and AI-chat privacy #3367 and Move the Pro shared-workspaces agent guidance out of core's skill #3370 have merged. That covers Turn the UI-extension registry into ADR-082's build-time frontend extension API #3317, Move the Pro sync and collaboration UI out of core #3333, Move Pro-owned data out of core's data model (ADR-083) #3345, Describe core's access gate and daemon seams without naming the Pro daemon #3363 to Reword core data-model and identity docs that cite Pro, Supabase, RLS or tenants #3365, Install skill references from the staged directory and record installed files #3368 and Add the NODESPACE_SKILL_EXTENSIONS build input to core's skill build #3369 transitively.
  3. Measure:
    bun run scripts/check-pro-boundary.ts
    for m in proCommands proSyncModule proProtocol proEvents membershipService editionBranching cloudBindState cloudSyncHooks cloudWording tenantWording proWording proNamedFiles; do bun run scripts/check-pro-boundary.ts --list $m; done
    git grep -n -I -P '(?i:supabase|pgvector|nodespace[-_]sync|nodespaced-pro|\bpro daemon|\btenant|cloud[- ]?sync|cloud[- ](?:push|pull)|\bto cloud\b|reach cloud|sync-apply|cold[- ]?sweep|\bcommunity (?:build|install|mode|tier|default|path)|\bnon-pro\b|pro-gated)|\bRLS\b|\bNodeSpace Pro\b' -- packages scripts README.md
  4. Classify every hit, and list every (b), (c) and (d) hit in the PR description:
  5. Set BASELINES to all zeros. Add the allowances and their tests, the zero-baseline test and, if agreed, the optional vocabulary marker.
  6. Add .proto to check-code-references.ts, update its test, and run it. The issue-number count must not rise; if it does, reword the offending proto comments rather than raising the baseline.
  7. Update CLAUDE.md.
  8. Verify, then finish:
  9. After merge, ask nodespace-sync to build a Pro release against the new core revision and run its release checks. Record the result on the parent issue. This is ADR-081's completion criterion; it does not block merging this PR.

Acceptance criteria

  • Every BASELINES value is 0, a test asserts it, and bun run scripts/check-pro-boundary.ts exits 0.

  • Every remaining hit is one of these:

    No directory-wide or marker-wide exemption exists.

  • The grep in step 2 prints only lines in those files, plus packages/skill/src/mcp-clients.ts ("Linux community builds of Claude Desktop", unrelated to Pro).

  • scripts/check-code-references.ts scans .proto, its test covers that, and its issue-number baseline did not rise.

  • CLAUDE.md's Pro / Sync Boundary section describes the zero state, the allowances and the absence-guard convention.

  • The step-3 classification is in the PR description, and no (d) hit was fixed in this PR.

  • bun run test:scripts, bun run quality:scripts:check and bun run test:changed pass.

Tests and verification

  • bun run test:scripts. It covers check-pro-boundary.test.ts, including the new zero and allowance tests, and check-code-references.test.ts.
  • Mutation checks. Run each one, confirm it fails as described, then revert it.
    1. Add // the Pro daemon to any core .rs file. The ratchet fails on cloudWording and proWording.
    2. Add one more NodeSpace Pro line to an allowance's file. That allowance fails.
    3. Add // see core#1 to a .proto file. check-code-references fails.
    4. If the vocabulary marker was added, add // cloud-sync to a .ts file. It fails.
  • bun run quality:scripts:check
  • bun run test:changed. The diff reaches scripts/, and possibly Rust or the frontend for stragglers.
  • bun run scripts/check-code-references.ts

Dependencies

Risks and rollback

  • A marker still finds real Pro code. Step 3(d) routes it back to its parent, and this PR waits.
  • A hard ban makes any false positive block pushes. Fix it with a narrow, tested exemption or a pattern tweak in the checker. Never with a baseline.
  • ADR-084's guards may land after this. Their issue must add its allowances in the same PR, or its push fails. That failure is intended.
  • Rollback. Revert the PR. The baselines and CLAUDE.md go back to the last ratchet state, and the wording fixes are comments only.

Plan key: C10.7 (pro-boundary DAG).

🤖 Generated with Claude Code

Activity

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

    @mstomar125
    ContributorAuthor

    Folded in from #3300's review: when the ratchet fails in the gate, only the last 40 lines of the stage log are shown, and the checker prints failures first and the optional lower-it notices last — so the visible tail shows notices, not the offending line. When making the check strict here, print the failure headlines and changed-file hits LAST (or notices first) so the gate tail and the merge-queue eject comment name the offending line.

  4. 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