Skip to content

Strip the Pro Tauri layer and edition branching from app-lib, proto, daemon and CLI - #3422

Merged
mstomar125 merged 2 commits into
mainfrom
issue-3412-strip-pro-tauri-edition
Oct 1, 2026
Merged

mstomar125 merged 2 commits into
mainfrom
issue-3412-strip-pro-tauri-edition

Conversation

@mstomar125

@mstomar125 mstomar125 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Part of #3412

Slice S1 of the one-pass strip (ADR-081 §4 tables A and B3, §7 step 2; ADR-082 §4.5, §5; ADR-084 §4, §5): the Pro Tauri layer and every edition branch in app-lib, proto, daemon, CLI and the .pkg postinstall.

Acceptance items done

  1. Deleted: app-lib/src/commands/pro_sync.rs (27 pro_* commands), app-lib/src/services/pro_client.rs, app-lib/proto/nodespace_pro.proto, the Pro compile step and its tonic-build/protoc-bin-vendored build dependencies, scripts/refresh-pro-proto.ts, src-tauri/tauri.pro.conf.json, the startup tier probe and pro:tier-detected, ProClient::rebind, and the Pro arm of update_check.rs.
  2. is_pro_build(), the NODESPACE_PRO_* reads, the Pro binary name, the .pro launchd labels and the Pro plist environment are removed from app-lib.
  3. nodespace_proto::socket holds only debug/release rows. No is_pro parameter, daemon-pro.sock, ui-pro.pid or incompatible-database-pro.json remains, and marker_path takes no edition flag.
  4. The CLI no longer probes or cleans up Pro sockets. The --edition check is removed from scripts/pkg-resources/postinstall; its replacement is a step-5 issue.
  5. ADR: DaemonProfile is only {binary_name, service_env}; remove product (daemon_profile.rs:28, the 'pro' value at daemon_setup.rs:127).
  6. ADR: the --socket clap doc (packages/cli/src/lib.rs:102-108), the discover_socket doc (lib.rs:222-224) and the uninstall.rs:129 comment name no Pro variant. Regenerate the GENERATED cli-surface region of packages/skill/references/cli.md with bun run skill:gen, so that bun run skill:check passes.
  7. ADR: no Pro, Supabase, nodespace-sync or tenant wording remains in any file you own (ADR-081 §2a).

Notes on these:

Ratchet (bun run scripts/check-pro-boundary.ts)

Counts only fall; BASELINES is not edited. "Before" is main at df1077b (after #3417).

Marker Before After
proCommands 261 165
proSyncModule 368 367
proProtocol 91 12
proEvents 77 61
membershipService 54 54
editionBranching 97 6
cloudBindState 196 194
cloudSyncHooks 0 0
cloudWording 37 13
tenantWording 428 291
proWording 233 137
proNamedFiles 18 13

--list editionBranching now shows only README.md, packages/core/tests/it/playbook_engine_integration_test.rs and two frontend files (add-synced-database-dialog.svelte, pro-sync.svelte.ts) that the frontend slices delete. --changed reports no added hit; its only hits in changed files are the two pre-existing bound_tenant_* fixture lines in tray.rs (S3).

Tests

Deleted (Pro-only): the pro_client inline tests (with the file); the daemon_setup Pro profile, service-env and edition-agreement tests; the (_, true) rows of the socket.rs, daemon main.rs and grpc_client tables; the CLI dev-Pro discovery row; the update_check Pro-arm test; the marker_path(true) case. lib.rs had no source-text assertions about the probe on main, so none were removed there.

Rewritten to exactly the debug and release rows: socket.rs (socket, UI pid and marker tables), the daemon's socket_fallback_variant_tests, the app's each_flavour_dials_the_socket_its_daemon_binds, the CLI's discovery test.

Added: DaemonProfile::community() equals {binary_name: "nodespaced", service_env: []} (whole-struct equality, so a new field fails to compile until the test states core's value); builtin_update_source() is GitHubLatestRelease for NodeSpaceAI/nodespace-core; the socket-name list holds only the two core names (also the UI pid and marker lists); the build default profile is the community profile; the daemon marker is the shared name for the build flavour; the launchd label is exactly app.nodespace.daemon / app.nodespace.daemon.dev (review). The app's marker test now asserts this flavour's exact name rather than any table entry (review).

Mutation checks

Each mutation applied alone, the named test run, then reverted. All 19 killed.

# Mutation Killed by
M1 community() binary name "nodespaced-other" community_profile_is_the_core_daemon_with_no_service_env
M2 community() gains a service env entry same
M3 profile_for_this_build() returns another binary the_build_default_is_the_community_profile
M4 builtin_update_source() returns a VersionEndpoint builtin_source_is_the_core_repositorys_latest_github_release
M5 builtin_update_source() reads another repo same
M6 DAEMON_SOCKET_NAMES[1] renamed socket_table_holds_exactly_the_release_and_debug_names
M7 DAEMON_SOCKET_NAMES grows a third entry same (compile error)
M8 daemon_socket_name ignores the flavour same
M9 UI_PID_NAMES[1] renamed ui_pid_table_holds_exactly_the_release_and_debug_names
M10 INCOMPATIBLE_DATABASE_NAMES[1] renamed marker_table_holds_exactly_the_release_and_debug_names
M11 daemon_socket_relative ignores the flavour relative_path_is_state_dir_joined_to_name
M12 daemon fallback ignores the flavour every_flavour_falls_back_to_its_own_scoped_socket, flavours_do_not_collapse_onto_one_socket
M13 daemon marker_path uses the other flavour the_marker_is_the_shared_name_for_this_build_flavour
M14 app fallback ignores the flavour each_flavour_dials_the_socket_its_daemon_binds
M15 CLI probes only the canonical socket discover_socket_prefers_canonical_then_falls_back_to_dev
M16 nodespace uninstall keeps the dev socket remove_sock_removes_both_flavours_sockets_and_lock_files_only
M17 launchd labels swapped the_label_is_exactly_the_release_or_the_dev_label
M18 launchd label ignores the flavour same
M19 app marker uses the other flavour the_marker_lives_in_the_state_directory_under_this_flavours_name

Runs

  • cargo clippy -p nodespace-proto -p nodespace-daemon -p nodespace-cli -p nodespace-app-lib --all-targets -- -D warnings: clean.
  • bun run skill:check, clippy and the verify greps re-run after the rebase: clean.
  • Targeted nextest: proto socket:: 8/8, daemon socket/marker/arg tests 15/15, CLI discovery/uninstall 2/2, app-lib changed modules 51/51, app-lib extensions:: 24/24 (they import builtin_update_source()).
  • bun run skill:check: up to date.
  • bun run quality:fix: passed, no changes.
  • bun run test:changed (on ad414c9, rebased onto df1077b): passed. Tiers run: scripts (25s), skill (2s), Rust workspace nextest (57s); frontend skipped, the diff does not reach it. (Also passed on the pre-rebase 580aa40.)

DB reset note

No database-file reset. Dev machines that ran internal Pro builds should remove leftover daemon-pro.sock, daemon-dev-pro.sock, ui-pro.pid and incompatible-database-pro.json files from ~/.nodespace, and boot out the .pro launchd jobs, by hand. Core no longer knows those names and does not clean them up.

Until the pre-install check (#3415) lands, a core .pkg replaces an installed internal Pro app without a guard. No Pro build is distributed, so this is acceptable (ADR-081 §7).

Extension API

For S4's release-notes heading (S4 makes the single EXTENSION_API_VERSION bump):

  • DaemonProfile.product is removed; DaemonProfile is {binary_name, service_env} (ADR-082 §4.5).
  • nodespace_proto::socket::{daemon_socket_name, daemon_socket_relative, ui_pid_name, ui_pid_relative, incompatible_database_name} take only is_debug, and DAEMON_SOCKET_NAMES, UI_PID_NAMES and INCOMPATIBLE_DATABASE_NAMES hold two entries (release, dev). The shared names themselves are unchanged.
  • nodespace_daemon::incompatible_database::marker_path() takes no argument.

🤖 Generated with Claude Code

@mstomar125 mstomar125 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review (medium depth): APPROVE

Posted as a comment review because GitHub blocks self-approval.

Review Type: Initial Review

Requirements Check

  1. ✅ Deletions. pro_sync.rs, pro_client.rs, nodespace_pro.proto, the Pro step in build.rs, the tonic-build/protoc-bin-vendored/prost deps (Cargo.lock updated; nodespace-proto still uses them), refresh-pro-proto.ts, tauri.pro.conf.json, the probe and pro:tier-detected emit, the 27 command registrations, ProClient::rebind, and PRO_LATEST_URL with builtin_update_source_for are all gone. builtin_update_source() is still pub(crate). Outside the frontend, README and packages/core (other slices), nothing refers to the deleted items, and no workflow or package script does either.
  2. ✅ Edition branching in app-lib. is_pro_build, the compile-time Pro env reads, the Pro binary name, profile_for_build_env and the .pro labels are removed. launch_agent_label() returns only app.nodespace.daemon or app.nodespace.daemon.dev.
  3. ✅ nodespace_proto::socket. All three tables are [&str; 2] and every function takes only is_debug. The daemon's marker_path() takes no argument.
  4. ✅ CLI and postinstall. CLI discovery and uninstall use the two-entry table: release first, then dev, and both sockets plus their lock files are removed. postinstall passes bash -n and shellcheck, nothing refers to the removed variable, and no preinstall was added.
  5. ✅ DaemonProfile. It is now {binary_name, service_env}. Nothing else read product.
  6. ✅ CLI docs. The --socket doc, the discover_socket_in doc and the uninstall.rs comment are reworded, and the regenerated cli.md line matches the clap doc.
  7. ✅ Wording. No added line hits a ratchet marker. --changed reports only the tray.rs:806-807 registry fixtures, which belong to S3.

Code Review Findings

🔴 Critical: none.

🟡 Important

  • The rebase onto #3417 will break the build even though the text merges cleanly.
    • 📁 packages/desktop-app/app-lib/src/lib.rs:553
    • Issue: this PR deletes the block-level use tauri::Emitter; because the Pro emit was the block's only .emit. #3417 adds app_handle.emit(DATA_PLANE_READY_EVENT, ()) in the same block and leaves the import's hunk untouched. Git therefore applies the removal without a conflict, and the result fails with E0599.
    • Recommendation: keep use tauri::Emitter; when rebasing, then rerun clippy.
    • Principle: an atomic, buildable change after rebase.
  • The rewritten launchd label has no test.
    • 📁 packages/desktop-app/app-lib/src/daemon_setup.rs:109-116
    • Issue: launch_agent_label() reads cfg!(debug_assertions) directly, so no test pins either value. Swapping the two strings would pass every test, yet the label is part of the shared service identity (ADR-084 §4).
    • Recommendation: split out launch_agent_label_for(is_debug), gated #[cfg(any(target_os = "macos", test))], and pin both rows literally, matching how this PR treats sockets, pids and markers.
    • Principle: test coverage proportional to criticality.

🟢 Suggestion / Nit

  • The app-side marker test checks less than its name claims.
    • 📁 packages/desktop-app/app-lib/src/incompatible_database.rs:419-424
    • Issue: the test only checks that the name is one of the table's entries, so the wrong flavour would pass.
    • Recommendation: assert equality with incompatible_database_name(cfg!(debug_assertions)).
  • Nit: profile_for_this_build() (📁 daemon_setup.rs:83-85) is now a one-line wrapper; consider calling DaemonProfile::community directly.
  • Nit: canonical_name_is_the_release_socket (📁 socket.rs:203) is covered by the exact-table test.
  • Nit: a few places still say "variant" where the rest says "flavour":
    • socket.rs:5, :81
    • main.rs:2153 and the socket_fallback_variant_tests module
    • the uninstall.rs:153 test name
  • Nit (outside S1's file list): the label comment in scripts/pkg-resources/app.nodespace.daemon.plist:7, and the daemon_setup.rs:2874 assertion message, say "community build".

Cross-slice notes (not findings against this PR)

  • scripts/check-pro-boundary.ts keeps postinstall in EXEMPTIBLE_NON_TEST_FILES only until its guard is gone. The checker's owner can now drop that entry.
  • Draft PR #3381 also edits scripts/pkg-resources/postinstall.
  • Until the frontend slices land, the frontend still invokes the removed commands. Those calls are wrapped in try/catch and only log a warning.

Recommendation: APPROVE. The strip is complete, correct and in scope. Two conditions: keep use tauri::Emitter; on the rebase onto #3417, and record the test:changed result in the body (now done).

@mstomar125
mstomar125 force-pushed the issue-3412-strip-pro-tauri-edition branch from 580aa40 to ad414c9 Compare October 1, 2026 10:12
@mstomar125

Copy link
Copy Markdown
Contributor Author

Address-review summary

Branch rebased onto main at df1077b (#3417) and force-pushed; head is ad414c9.

Addressed

  • 🟡 Rebase import. Rebasing onto Emit a neutral daemon:data-plane-ready event and reload on it instead of the capability-probe event #3417 dropped the block's use tauri::Emitter; without a textual conflict, as predicted. The import is restored, so Emit a neutral daemon:data-plane-ready event and reload on it instead of the capability-probe event #3417's app_handle.emit(DATA_PLANE_READY_EVENT, ()) builds. The lib.rs diff against main is now only the probe, its emit, the channel binding, the pro_* registrations and two comment lines. The one textual conflict, let socket_reachable = {, was resolved to Emit a neutral daemon:data-plane-ready event and reload on it instead of the capability-probe event #3417's version.
  • 🟡 launchd label test. launch_agent_label() now delegates to launch_agent_label_for(is_debug), gated any(target_os = "macos", test). the_label_is_exactly_the_release_or_the_dev_label pins both strings literally. Two mutations are killed: M17 (labels swapped) and M18 (flavour ignored).
  • 🟢 App marker test. It now asserts incompatible_database_name(cfg!(debug_assertions)) exactly. M19 (the other flavour) is killed.
  • Nit: "variant" wording. The changed text:
    • socket.rs module doc and pipe doc;
    • the daemon's socket_fallback_variant_tests module, renamed socket_fallback_flavour_tests, plus the grpc_client doc that names it;
    • main.rs "flavour-scoped";
    • the uninstall test, renamed remove_sock_removes_both_flavours_sockets_and_lock_files_only.
  • Nit: assertion message. The daemon_setup.rs assertion now says "release-build app".
  • test:changed result recorded in the PR body.

Skipped

  • Nit: profile_for_this_build() wrapper. The slice design keeps profile_for_this_build() as the one place the build's default profile is chosen, returning DaemonProfile::community(). Its two tests cost nothing.
  • Nit: canonical_name_is_the_release_socket. It states the CLI's reliance on index 0 of the table, which the exact-table test does not say. Kept as documentation.
  • Nit: plist comment. scripts/pkg-resources/app.nodespace.daemon.plist is outside this slice's files.
  • Cross-slice notes. These go to the coordinator rather than this PR:

Verification after the fixes and the rebase

  • clippy -D warnings on the four crates: clean.
  • bun run skill:check: up to date.
  • The verify greps: 0 hits. The only wording-grep hits are S3's tray.rs fixtures.
  • Ratchet: no count above its baseline; editionBranching 97 → 6.
  • bun run test:changed on ad414c9: passed.
  • Mutations: 19 of 19 killed.

Re-Review Decision

Decision: RE-REVIEW NEEDED, for the new commits and the rebase resolution only.

Rationale: the rebase needed a manual, build-affecting fix in lib.rs (the restored import), and the label function was restructured. Both are small, but a second look at exactly those changes is cheap.

@mstomar125 mstomar125 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review, re-review (medium depth): APPROVE

Posted as a comment review because GitHub blocks self-approval. Head reviewed: ad414c9, on main df1077b (#3417).

Previous Review Summary: 8 recommendations (2 Important, 1 Suggestion, 5 Nits).

  • Addressed: 5.
  • Skipped with an acceptable reason: 3 (the profile_for_this_build() choke point, the canonical-socket documentation test, and the plist comment outside the slice).
  • New issues: 0 blocking, 1 nit.

Rebase resolution: confirmed clean.

  • The lib.rs diff against main is exactly four changes: the channel binding, the probe and its emit, the 27 command registrations, and two reworded comments.
  • use tauri::Emitter; is present in the startup block.
  • #3417's code is identical to main: the reachability check, the data-plane round trip, the DATA_PLANE_READY_EVENT emit and its branches.
  • commands/nodes.rs, services/mod.rs and commands/mod.rs change only by the removals of the deleted client and commands.

New commit.

  • The launch_agent_label_for cfg gating is correct on macOS and non-macOS, in test and non-test builds.
  • The label test pins both rows literally.
  • The app marker test now fails on the wrong flavour, and the table itself is pinned literally in socket.rs.
  • No stale references to the renamed tests remain.
  • No added line hits a ratchet marker.

Findings

  • 🔴 Critical: none.
  • 🟡 Important: none.
  • 🟢 Nit: the one-line launch_agent_label() delegation itself is not pinned (daemon_setup.rs:110-112). No change is recommended: a single-expression delegation is not worth another test.
  • 🟢 Nit (carried over): the plist comment says "community build". It is outside this slice.

Recommendation: APPROVE.

@mstomar125

Copy link
Copy Markdown
Contributor Author

Address-review (after the re-review)

The re-review raised no Critical or Important findings, so there is no code change.

  • ⏭️ Nit: the one-line launch_agent_label() delegation is not pinned. Skipped. The reviewer itself recommends no change: the delegation is a single expression, and both of its rows are pinned by the_label_is_exactly_the_release_or_the_dev_label.
  • ⏭️ Nit: the plist comment. Skipped. scripts/pkg-resources/app.nodespace.daemon.plist is outside this slice's files.

Re-Review Decision

Decision: NO RE-REVIEW NEEDED.

Rationale: nothing changed since the approved re-review of ad414c9. The PR is review-clean and is not to be merged here: the coordinator merges in slice order.

mstomar125 and others added 2 commits October 1, 2026 12:21
…daemon and CLI

Delete the Pro Tauri commands (pro_sync.rs), the Pro daemon client
(pro_client.rs), the Pro proto with its tonic-build/protoc-bin-vendored
build step and refresh script, and the Pro bundle overlay. The startup
task no longer probes for a Pro daemon or emits pro:tier-detected, and
probe_and_recover no longer rebinds a Pro client.

Remove edition branching: is_pro_build(), the NODESPACE_PRO_* reads,
the Pro binary name, the .pro launchd labels and the Pro plist
environment leave daemon_setup; profile_for_this_build() returns
DaemonProfile::community(), and DaemonProfile loses its product field.
nodespace_proto::socket keeps only the release and debug rows and its
functions take only is_debug; the daemon's marker_path() takes no
argument. The built-in update source is the core repository's GitHub
releases. The CLI probes and removes only the release and dev sockets,
and the .pkg postinstall drops its --edition guard.

Part of #3412

Co-Authored-By: Claude Opus 5.5 <[email protected]>
launch_agent_label() now delegates to launch_agent_label_for(is_debug),
so a test pins both the release and the dev label literally. The app's
marker test asserts this flavour's exact marker name instead of any
entry of the table. Leftover "variant" wording in the socket tables,
the daemon's fallback tests and the CLI uninstall test now says
"flavour".

Part of #3412

Co-Authored-By: Claude Opus 5.5 <[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