Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
pro-boundaryPro/core boundary: Pro code moves to nodespace-sync (ADR-081..085)
Description
Summary
Core's side of the two notices in ADR-084 §4.3 (proposed). Both are generic, and neither names a product.
- Another daemon is still serving the socket.
- When it happens: Check the running daemon's executable against the app's DaemonProfile at startup #3353 re-registers the app's daemon, but the socket is still served by a daemon whose executable doesn't match the profile. That daemon is outside the app's registration, such as a Homebrew service or one started by hand.
- What the backend does: it records the daemon and reports a new status,
foreign_daemon, with that daemon's executable path. - What the app shows: a non-blocking banner with a Retry button: "Another NodeSpace background service is running (‹executable path›). Stop it, then choose Retry."
- Another daemon is registered for every user (macOS only).
- When it happens:
/Library/LaunchAgents/app.nodespace.daemon.plistexists, and itsProgramArguments[0](orProgram) has a file name other than the profile'sbinary_name. - What the app shows: "Another NodeSpace product's background service is registered for all users of this Mac and starts at login. To remove it, run that product's uninstall, or install NodeSpace with its installer package."
- The file is owned by root, so the app can't delete it.
- When it happens:
Context
- Backend today.
check_daemon_statusanddaemon_status_body(lib.rs88-122) returnhealthy,starting,not_runningorincompatible_database.- The startup task (
lib.rs~500-535) emitsdaemon-status.
- The pattern to follow. The incompatible-database state already works end to end:
- backend:
incompatible_database.rs, withget_incompatible_database, andreset_incompatible_database, which re-runsensure_daemon_running; - frontend:
services/daemon-status.ts(theincompatibleDatabaseflag andrefreshDaemonStatus) andcomponents/layout/incompatible-database-banner.svelte, with its test; - test helper:
src/tests/helpers/mock-tauri-core.ts.
- backend:
- The banner is non-blocking by design. The app keeps working against the running daemon, as it does today. Blocking would lock free users out whenever an older Homebrew-service daemon holds the socket.
- Core's own
.pkgregistration never triggers the notice.scripts/pkg-resources/app.nodespace.daemon.plistruns/usr/local/bin/nodespaced, which matches the community profile. - Push-time checks.
- The design-tokens check runs at push time. A new component must pass
bun run --cwd packages/desktop-app quality:design-tokens; reuse the incompatible-database banner's tokens. - Frontend text must not name Pro, because the ratchet counts that word.
- The design-tokens check runs at push time. A new component must pass
Scope
Backend (packages/desktop-app/src-tauri/src)
- New module
foreign_daemon.rs. It holds:- the in-memory record of a foreign serving daemon (its path);
#[tauri::command] get_foreign_daemon_notices() -> ForeignDaemonNotices { running_executable: Option<String>, machine_wide_program: Option<String> };#[tauri::command] retry_foreign_daemon(app) -> String, which re-runsensure_daemon_runningand returns the resulting status, asreset_incompatible_databasedoes.
- Re-check after registering. In
daemon_setup::ensure_daemon_running, after the register path'swait_for_daemon_or_refusalreturnsHealthy, re-run Check the running daemon's executable against the app's DaemonProfile at startup #3353's check (unix only).- On
Mismatch, record the path. - On
Match, clear the record.
- On
- Report the status.
daemon_status_bodyreturnsforeign_daemonwhile the socket is healthy and the record stands.- In that case the startup task emits
foreign_daemoninstead ofhealthy.
- Machine-wide registration (macOS). Read the plist with the
plistcrate. Add it as a direct dependency; it is already inCargo.lock. - Register both commands in the core command list.
Frontend (packages/desktop-app/src)
services/daemon-status.ts:- Add
foreignDaemon: booleantoDaemonStatusState, set by theforeign_daemonstatus. - For gRPC readiness, treat it like
healthy: data calls go ahead. - Add the wrappers
getForeignDaemonNotices()andretryForeignDaemon().
- Add
- New banner
components/layout/foreign-daemon-banner.svelte, rendered inapp-shell.sveltenext to the incompatible-database banner:- the running-daemon message, with the path and Retry;
- the machine-wide notice, which the user can dismiss for the session.
- Test helper: update
mock-tauri-core.ts.
Out of scope
- Removing the other product's registration. That is the job of that product's uninstall.
- Windows.
Steps
- Run the startup sequence, and assign the issue at pickup.
- Build the backend module, the status and the commands, with their Rust tests.
- Build the frontend state and the banner, with their tests.
- Run
bun run --cwd packages/desktop-app quality:fix, which includes the design-tokens check. - Run
bun run scripts/check-pro-boundary.tsand pasteBASELINES. - Run
bun run test:changed, push, and open the PR.- Code comments must not cite GitHub issue numbers.
- Add a neutral daemon:data-plane-ready event and stop reloading on pro:tier-detected #3318 and Move the Pro sync and collaboration UI out of core #3333 also edit
app-shell.svelte, so rebase onto whichever landed first.
Acceptance criteria
- When a mismatched daemon is still serving after re-registration, the status is
foreign_daemonand the banner shows the daemon's path. - Retry re-runs setup, and the banner clears once the daemon matches.
- A foreign machine-wide registration shows the notice. Core's own
.pkgregistration does not. - With no foreign daemon and no foreign registration, the free app's flows are unchanged.
-
bun run scripts/check-pro-boundary.tspasses, withBASELINESpasted. No change is expected.
Tests and verification
- Rust:
- the pure machine-wide-registration check, against fixture plists: matching program, other program,
Programkey only, file absent, and unparseable; - the status mapping: a healthy socket plus a record gives
foreign_daemon.
- the pure machine-wide-registration check, against fixture plists: matching program, other program,
- Frontend (Vitest, Happy-DOM), following
incompatible-database-banner.test.ts:- in
daemon-status.test.ts, theforeign_daemonstatus; - a new
foreign-daemon-banner.test.ts: it renders the path, Retry calls the command, and the notice can be dismissed.
- in
- Commands:
bun run test:changedbun run --cwd packages/desktop-app quality:fix
- Optional manual check: on a dev Mac, start a second
nodespacedby hand on the dev socket before you launch the dev app. The banner must appear.
Dependencies
- Check the running daemon's executable against the app's DaemonProfile at startup #3353: the product check these notices report on.
Risks and rollback
- Banner noise for users with an older Homebrew-service daemon. This is intended, and the text tells them what to do.
- Rollback: revert the PR.
Plan key: C8.11 (pro-boundary DAG).
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
pro-boundaryPro/core boundary: Pro code moves to nodespace-sync (ADR-081..085)
Activity
mstomar125 commentedon Oct 1, 2026
Superseded by #3415 (umbrella against the final ADR-081–085)