Repository navigation
Description
Summary
Delete labsFlags.syncEnabled from core once its last readers are gone:
- Move the Pro account, admission and synced-database settings out of core #3327 removes the Account, settings-pane, settings-category and Database settings readers;
- Move the Pro sync and collaboration UI out of core #3333 removes the extension-registry reader (
pro-sync-variant.svelte.ts, created by 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) andpro-sync-settings-refresh.test.ts; - Make the Share / Sync website action the sync-entry default; remove the Labs card #3359 removes the Labs card.
Then add a guard test proving that the free app's settings expose exactly one sync-related control, core's entry action, and no other Pro or sync surface.
Context
-
The flag. In
packages/desktop-app/src/lib/stores/labs-flags.svelte.tsataf8ddb61:- the
syncEnabledfield and its doc are at 15-16; - its default is at 23;
- its getter and setter are at 60-67.
It is persisted under the localStorage key
nodespace-labs-flags. - the
-
What is left 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 and Make the Share / Sync website action the sync-entry default; remove the Labs card #3359:
- the store itself;
src/tests/stores/labs-flags.test.ts: its doc (2-5) and lines 34, 66, 69, 73, 77, 82 and 91;- the reset lines
settings-pane-labs-gating.test.ts:31andsettings-sidebar-labs-gating.test.ts:17.
-
The Pro package can't read the flag.
- ADR-082 §2.3 keeps
labsFlagsout of the host API. - ADR-082 §2.6's lint rule forbids
$libimports in the Pro frontend. - Under the pin gate, any stray use would surface in nodespace-sync's pin-bump change, not in a shipped Pro app.
So this issue needs no nodespace-sync gate.
- ADR-082 §2.3 keeps
-
A stale stored value is harmless. A
syncEnabledkey already in localStorage is spread intoflagsat load, but nothing reads it. CLAUDE.md forbids migration or clean-up code for it. -
This guard replaces nothing. Move the Pro sync and collaboration UI out of core #3333 deletes
free-user-guardrail.test.ts, and ADR-082 §8 moves its "no contribution renders while the virtual module is empty" check into the fixture-extension suite. This guard covers the settings surfaces instead. -
Guardrail: stop new Pro code from landing in core #3302's absence-test convention. A test that asserts Pro strings are absent must build its needles from fragments. Otherwise its own source raises the ratchet: a literal
tenantorNodeSpace Proin the regex adds a tenantWording and a proWording line.
Scope
-
labs-flags.svelte.ts: delete thesyncEnabledfield and its doc, its default, and its getter and setter. Keep the class doc, which is still accurate. -
src/tests/stores/labs-flags.test.ts:- Rewrite the file doc (2-5) so it no longer mentions "the companion Team synchronization toggle".
- Delete the
syncEnabledassertion in the defaults test. - Rewrite "setting one flag does not clobber the other" to use
aiChatEnabledandplaybooksEnabled. It expects{ aiChatEnabled: true, playbooksEnabled: true }, then{ aiChatEnabled: false, playbooksEnabled: true }. - In the reload test, store
{ aiChatEnabled: true, playbooksEnabled: false }and assertplaybooksEnabledis false. - In the corrupt-JSON test, assert
playbooksEnabledis false. - Add a test: on a fresh profile,
Object.keys(labsFlags.flags).sort()equals['aiChatEnabled', 'playbooksEnabled'].
-
src/tests/components/settings/settings-pane-labs-gating.test.tsandsettings-sidebar-labs-gating.test.ts: delete thelabsFlags.syncEnabled = false;line in each reset. -
New
src/tests/components/settings/free-app-sync-surface.test.ts.- Mock the logger,
@tauri-apps/plugin-dialogand$lib/utils/external-links, and register no extension. - Build every forbidden needle from fragments, for example:
new RegExp([['ten', 'ant'].join(''), 'Add synced', 'Syncs to', 'not synced', 'NodeSpace ' + 'P' + 'ro'].join('|'), 'i'). - Keep test names free of those words.
It asserts:
- Sidebar.
SettingsSidebar, withaiChatEnabledandplaybooksEnabledon, lists exactly the core categories, in order.- The list is
CORE_SETTINGS_CATEGORIESafter Delete the Pro Account section, workspace-members card and tenant-admission calls #3325, written out as a literal. Ataf8ddb61, minus Account, it is: Database, Display, AI Models, Import Sources, Integrations, Playbooks, Labs, About. - "Account" is absent.
- A comment says that a new core category is added to this list on purpose.
- The list is
- Labs.
LabsSettingsrenders exactly two switches. - Database settings. In
DatabaseSettings:- exactly one button's text matches
/sync/i, and it isSYNC_ENTRY_LABEL; - no text matches the fragment-built needle;
- clicking the button opens
syncEntryDialog.
- exactly one button's text matches
- Mock the logger,
Out of scope
- Removing any other reader of the flag. Move the Pro account, admission and synced-database settings out of core #3327 and Move the Pro sync and collaboration UI out of core #3333 own them.
- Deleting the stale localStorage key.
- The ratchet's marker set, beyond lowering its baselines.
Steps
- Run the startup sequence from CLAUDE.md, with
EnterWorktree({name: "issue-<N>-drop-sync-labs-flag"}):bun install;bun run testfor a baseline;gh:comment,gh:assign @me,gh:status "In Progress".
- Pre-check.
git grep -n "syncEnabled" -- packages/desktop-appmust list onlylabs-flags.svelte.ts,labs-flags.test.tsand the two reset lines. Any other hit means Move the Pro account, admission and synced-database settings out of core #3327, Move the Pro sync and collaboration UI out of core #3333 or Make the Share / Sync website action the sync-entry default; remove the Labs card #3359 is incomplete: stop and report it. - Make the edits in Scope 1-3, then add the guard from Scope 4.
- Finish:
bun run test:changed;bun run scripts/check-pro-boundary.ts, then paste the printedBASELINES;bun run --cwd packages/desktop-app quality:fix(svelte-check catches any leftover reader), then commit;git push origin HEAD:issue-<N>-drop-sync-labs-flag;gh pr create --repo NodeSpaceAI/nodespace-core --base main --head issue-<N>-drop-sync-labs-flag.- After approval:
bun run merge <PR#>in the background, thenExitWorktree({action: "remove", discard_changes: true}).
Standards:
- Use
bun run test, neverbun test. - No lint suppression.
- No clean-up code for the stale key.
- Comments cite ADR-081 and ADR-084, never issue numbers.
Acceptance criteria
-
git grep -n "syncEnabled" -- packages/desktop-appreturns nothing. -
LabsFlagshas exactlyaiChatEnabledandplaybooksEnabled, and a fresh profile persists only those. - The guard passes, and fails if any of these is re-added (mutation-check each):
- an "Account" category;
- a third Labs switch;
- an "Add synced database…" button;
- tenant copy in Database settings;
- a second button containing "sync".
- The guard's own source adds no ratchet marker.
- The AI Models and Playbooks Labs gating tests pass unchanged, apart from the removed reset lines.
-
bun run scripts/check-pro-boundary.tsexits 0, andBASELINESare lowered to the printed counts. cloudBindState should fall by about 16. -
bun run test:changedandquality:fixare clean.
Tests and verification
bun run --cwd packages/desktop-app test src/tests/stores/labs-flags.test.ts src/tests/components/settingsbun run test:changedbun run --cwd packages/desktop-app quality:fixbun run scripts/check-pro-boundary.ts- Manual check with an isolated
NODESPACE_HOME:- Put
{"aiChatEnabled":true,"syncEnabled":true}intolocalStorage['nodespace-labs-flags']through devtools. - Reload.
- Confirm that AI Models shows, there is no Account section, and there are no errors.
- Put
Dependencies
- Make the Share / Sync website action the sync-entry default; remove the Labs card #3359: it removes the Labs card, which is the flag's
labs-settings.sveltereader. It also providesSYNC_ENTRY_LABELandsyncEntryDialog. - Move the Pro account, admission and synced-database settings out of core #3327: it removes the Account, settings-category, settings-pane and Database settings readers.
- Move the Pro sync and collaboration UI out of core #3333: it deletes
pro-sync-variant.svelte.tsand its test, andpro-sync-settings-refresh.test.ts.
Risks and rollback
- A brittle category list. The guard's exact list is strict on purpose. A new core settings category has to be added to it deliberately.
- Rollback. Revert the PR. This restores the field and its tests, and stored values are untouched.
Plan key: C9.3 (pro-boundary DAG).
🤖 Generated with Claude Code
Activity
mstomar125 commentedon Oct 1, 2026
Superseded by #3412 and #3413 (umbrella against the final ADR-081–085)