Repository navigation
Move the Pro variant machine and DATABASE_SETTINGS_NODE_ID out of the generic registry files - #3374
Conversation
Pragmatic Code Review (medium) - Initial ReviewReview Type: Initial Review Requirements Check:
Code Review Findings: No 🔴 Critical or 🟡 Important findings. What I checked and found sound:
🟢 Suggestion (informational, no action needed): 🟢 Nit (📁 🟢 Nit (PR body only): the itemized Recommendation: APPROVE |
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment, GitHub blocks self-approval). Full findings in the review comment above.
Address Review - PR #3374The pragmatic review (medium, initial) returned APPROVE with no critical or important findings. Triage of what it did raise: Addressed: 1
Skipped: 2 (informational or nit, no code change)
Verification state (unchanged, nothing pushed since review): head Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: No code, test or comment changed after the review; the only change is the PR description text. The review was already an APPROVE. Merge-order note (also in the PR body): the ratchet is not on |
… generic registry files DATABASE_SETTINGS_NODE_ID moves to a neutral constants module, since core's database store uses it and it is not a Pro concept. The Pro variant machine (ProSyncVariant, DatabaseSettings, activeDatabaseSettings, resolveProSyncVariant, isProSyncActive) moves verbatim into pro-sync-variant.svelte.ts, which belongs to the built-in Pro extension. The Pro test file is renamed to pro-sync-variant.test.ts. Importers, vi.mock paths and the pin-guard exemption key follow the moved code. No logic or expectation changes. Co-Authored-By: Claude Sonnet 5 <[email protected]>
3eb39e1 to
bc8d94b
Compare
Closes #3309
Summary
A pure move, with no behaviour change. It empties the generic registry files of Pro logic, so that #3310 can change the registry contract in files that no longer hold any.
DATABASE_SETTINGS_NODE_IDmoves to a new neutral module,src/lib/constants/database-settings.ts(re-exported fromconstants/index.ts), with a new doc: the id of the per-database settings singleton that core seeds in every database, mirroring Rust's constant, properties flat onproperties, schema slugdatabase-settingsdistinct from the instance id.src/lib/plugins/pro-sync-variant.svelte.ts(ProSyncVariant,DatabaseSettings,activeDatabaseSettings(),resolveProSyncVariant(),isProSyncActive()), with a header saying it is the variant machine of the built-in Pro extension, not part of the extension API, and leaves core with the Pro UI.ui-extensions.tsandui-extensions.svelte.tslose the moved code and the imports only it used.ui-extensions.tskeeps a type-only import ofProSyncVariantso thevariantfields still type-check (Adopt ADR-082's contribution contract: ids, when() predicates, keyed and isolated outlets #3310 deletes it).ui-extensions.svelte.tskeepsimport './pro-plugin'and importsresolveProSyncVariantfor the unchangedgetActive*filters.vi.mockpaths and the pin-guard exemption key follow the moved code.src/tests/plugins/ui-extensions.test.tsis renamed withgit mvtopro-sync-variant.test.ts. Only its imports and the first header line change; no expectation changed.Pure-move evidence
git diff -M --stat origin/mainshows the test file as a rename (ui-extensions.test.ts => pro-sync-variant.test.ts).diffonorigin/main:ui-extensions.svelte.tsL34-106 andui-extensions.tsL41-47 against the new file).Deviations from the issue text
ui-extensions.ts. It said the variant reactivity "lives in the siblingui-extensions.svelte.tswrapper", which is no longer true for resolution. I reworded that one sentence in place ("filters contributions by the resolved variant") instead of adding a new line pointing at the moved file, so it adds no marker line.proSync.tieraxis description there, to avoid adding a marker line that is not a relocation.Pro-boundary ratchet (#3299)
scripts/check-pro-boundary.tsis not onorigin/mainyet (it is in PR #3376, the ratchet PR), soBASELINEScannot be lowered or raised in this PR. I ran the committed #3299 script (99caa1da, based on the sameaf8ddb61) overlaid on this branch in a throwaway checkout, with baselines taken from that script ataf8ddb61. It prints:Relocation raise, class 3 ("a planned move of Pro code already in core, by a Pro-boundary migration issue, that adds no behaviour"). #3332 deletes the moved code (
pro-sync-variant.svelte.ts, its test, and the Pro UI) whole.proNamedFiles+2: the two newpro-sync-variant.*files (the oldui-extensions.test.tswas not Pro-named).proSyncModule+10 (net; the itemized lines below are gross, because some rewritten lines already matched the marker before the move, such as theresolveProSyncVariantimport lines, and net out): each increase is a new import line or a renamed path string of the moved module: theresolveProSyncVariantimport and the module-doc line inui-extensions.svelte.ts, the type-only import inui-extensions.ts, thepro-plugin.tsanddatabase.svelte.tsdoc references, thepro-sync-variant.test.tspath in two test comments, thevi.mockpath inmembership.test.ts, the eviction test comment, and the pin-guard key plus its three prose lines.proWording+2: the two "Pro" lines in the new file's mandated header ("built-in Pro extension", "Pro UI"). The movedProSyncVariantdoc lines move 1:1 out ofui-extensions.ts.cloudBindState-1: the rewrittenDATABASE_SETTINGS_NODE_IDdoc no longer listssync_enabled/auth_status.Merge-order note for the coordinator. If #3376 lands first, this PR must be rebased and its
BASELINESset to the table above (proSyncModule: 370,proWording: 316,proNamedFiles: 18,cloudBindState: 321, others unchanged from whatever main holds) before it can pass the gate. If this PR lands first, #3376's baselines need the same four adjustments.Tests
No new tests: nothing about behaviour changes, so the moved tests passing unchanged are the proof.
bun run test:changedpassed (frontend Happy-DOM + browser tiers; rust/skill/scripts skipped for a frontend-only diff).bun run --cwd packages/desktop-app test src/tests/plugins src/tests/stores src/tests/services/shared-node-store-pin-guard.test.ts src/tests/services/shared-node-store-eviction.test.ts src/tests/components/settings: 43 files, 796 tests passed.bun run --cwd packages/desktop-app test:free-users: 9/9 passed.bun run --cwd packages/desktop-app quality:fix: eslint, design-token check and svelte-check clean (0 errors, 0 warnings).Mutation checks of the two retargets the issue names as risks:
lib/plugins/ui-extensions.svelte.ts: the guard fails, naminglib/plugins/pro-sync-variant.svelte.tsas an unpinned, unexempted reader.membership.test.tsvi.mockreverted to$lib/plugins/ui-extensions.svelte: the real variant machine loads and the roster tests stop controllingisPro(10+MembershipStoretests fail).Both were restored; the tests pass again.
Rollback
Revert the PR. No data, schema or Rust change.
🤖 Generated with Claude Code