Skip to content

Add free-user guardrail test suite (test:free-users) - #1424

Merged
mstomar125 merged 1 commit into
NodeSpaceAI:mainfrom
mstomar125:free-user-guardrail-suite
Jun 18, 2026
Merged

mstomar125 merged 1 commit into
NodeSpaceAI:mainfrom
mstomar125:free-user-guardrail-suite

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

What

A single, always-runnable suite (src/tests/free-user-guardrail.test.ts + a bun run test:free-users script) that asserts every Pro/sync-gated frontend feature stays inert in the community (free) build — i.e. when proSync.isPro is false. It turns the open-core "Pro/sync work must keep the community build behaviorally unchanged" rule into a regression test you can run after any cross-repo or Pro-feature change.

Coverage

  • proSync.isPro is false for the community tier and the default unknown tier (fresh app, before any probe).
  • Recovered Items (core#1303): recoveredItems.load() is a no-op, never invokes the pro_list_recovered_items daemon command, and hasFor/itemFor report nothing — so no inline badge or snackbar can ever render in community.
  • Fix: Shift+Enter inline formatting splitting (Issue #185) #188 reconnect-replay coalescer: the community build still applies node:updated / node:deleted through the unchanged per-event path (no coalescing window engages), with no Pro daemon command invoked.

Notes

  • Test-only + one package.json script. No production code touched → free-user-safe by construction.
  • Extend this file whenever a new Pro feature adds a frontend surface, so the guarantee stays enforced in one place.
  • Full desktop suite: 3880 passing (3873 + 7 new). eslint + svelte-check clean. bun run test:free-users green.

A single always-runnable suite asserting every Pro/sync-gated frontend feature
stays inert in the community build (proSync.isPro === false), turning the
open-core "free users unaffected" rule into a regression test.

Covers:
- proSync.isPro is false for community and the default 'unknown' tier.
- Recovered Items (core#1303): load() is a no-op, never invokes the daemon
  command, and reports no item for any node (no badge/snackbar can render).
- #188 reconnect-replay coalescer: community still applies node:updated /
  node:deleted through the unchanged per-event path (no coalescing window),
  with no Pro daemon command invoked.

Run with `bun run test:free-users` after any cross-repo or Pro-feature change;
extend it whenever a new Pro feature adds a frontend surface.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE

Test-only (one suite + one package.json script, zero production code), so free-user-safe by construction — and it codifies the open-core "community build stays behaviorally unchanged" rule into a runnable regression. The assertions are real, not vacuous:

  • Recovered Items: mocks @tauri-apps/api/core's invoke and asserts recoveredItems.load() never calls it — this genuinely fails if the !proSync.isPro early-return in load() is ever removed, which is exactly the gate that keeps the daemon command (pro_list_recovered_items) and the badge/snackbar out of community. hasFor/itemFor checks lock in "no badge renders."
  • Covers both community and the default unknown tier (fresh app pre-probe) — good catch, since first-paint is where an ungated daemon call would leak.
  • Script is correctly scoped: bunx vitest run src/tests/free-user-guardrail.test.ts.

One minor note (non-blocking): the #188 coalescer community test asserts the node still lands in the store via getNode with no invoke — which prevents total breakage, but doesn't tightly prove the 16ms coalescing window was bypassed: the Pro path also ends in getNode+setNode (it just uses backendAdapter, not invoke), so this assertion would still pass if coalescing wrongly engaged in community. If you want the guardrail to actually catch a gating regression on #188, assert immediacy — e.g. the update is applied synchronously within the same tick rather than after the window. As written it's a "still works" test, not a "coalescer didn't engage" test.

Worth keeping this file the canonical place to extend per the PR note. Good to merge.

@mstomar125
mstomar125 merged commit b194cf0 into NodeSpaceAI:main Jun 18, 2026
malibio pushed a commit that referenced this pull request Jun 22, 2026
A single always-runnable suite asserting every Pro/sync-gated frontend feature
stays inert in the community build (proSync.isPro === false), turning the
open-core "free users unaffected" rule into a regression test.

Covers:
- proSync.isPro is false for community and the default 'unknown' tier.
- Recovered Items (core#1303): load() is a no-op, never invokes the daemon
  command, and reports no item for any node (no badge/snackbar can render).
- #188 reconnect-replay coalescer: community still applies node:updated /
  node:deleted through the unchanged per-event path (no coalescing window),
  with no Pro daemon command invoked.

Run with `bun run test:free-users` after any cross-repo or Pro-feature change;
extend it whenever a new Pro feature adds a frontend surface.

Co-authored-by: Mayank  Tomar <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant