Skip to content

Make nodespace uninstall refuse when the installed app is not the free NodeSpace #3351

Closed as not planned

Description

@mstomar125

Summary

Core's side of ADR-084 §5 (proposed) for the CLI: nodespace uninstall refuses to run when the installed app is not the free NodeSpace.

  • When it refuses. On macOS, /Applications/NodeSpace.app exists and its Info.plist does not declare NodeSpaceProduct = community. A bundle with no key counts as not community.
  • What it does then. It prints the ADR message and exits non-zero before it touches anything.
  • Without an app. On a headless install with no app, it proceeds as today.
  • Naming. The guard names no other product.

Context

  • What uninstall does today. run (packages/cli/src/commands/uninstall.rs 18-30) calls, in order:
    1. stop_daemon (84-98), which boots out app.nodespace.daemon and deletes the per-user plist;
    2. remove_bin_dir;
    3. remove_sock;
    4. the skill removal.
  • Why a Pro install needs the guard. Over Pro, uninstall would stop the Pro daemon and delete the per-user registration and ~/.nodespace/bin. It would leave behind the app, the machine-wide registration and the credentials: a partial uninstall.
  • Older core apps. A core app from before the key existed is refused as well. That only happens when the CLI was updated separately from the app, for example through the nodespace-cli formula, and the message tells the user to update NodeSpace first. ADR-084 accepts this. This issue depends on Move the .pkg guard to a static pre-install check and declare NodeSpaceProduct #3349, so every core app from that release on declares the key.
  • Reading the plist. Use the plist crate: 1.10.0 is already in Cargo.lock as a Tauri dependency, and it reads both XML and binary plists.
    • Add it to the CLI under [target.'cfg(target_os = "macos")'.dependencies].
    • Add it under [dev-dependencies] too, so the pure function is tested on every platform.
    • Don't shell out.

Scope

  • uninstall.rs:
    • Add a pure fn uninstall_blocker(app_bundle: &Path) -> Option<String>:
      • None when the bundle doesn't exist;
      • None when Contents/Info.plist declares NodeSpaceProduct = community;
      • Some(message) in every other case, including an unreadable plist.
    • The message is ADR-084's: "The NodeSpace app on this Mac is a different NodeSpace product, or an older NodeSpace that does not say which product it is. Use that product's own uninstall, or update NodeSpace first; this command removes only the free NodeSpace."
    • At the start of run, add a #[cfg(target_os = "macos")] block that calls uninstall_blocker(Path::new("/Applications/NodeSpace.app")). On Some, return the error before anything else runs.
    • Compile the pure function for any(target_os = "macos", test).
  • packages/cli/Cargo.toml: add the plist dependency, with a one-line comment that it is already in the lockfile.

Out of scope

Steps

  1. Run the startup sequence, and assign the issue at pickup.
  2. Add the function, the call and the dependency.
  3. Add the tests.
  4. Run bun run scripts/check-pro-boundary.ts. No marker should move; if one does, paste BASELINES.
  5. Run bun run test:changed and bun run quality:fix, push, and open the PR. Code comments must not cite GitHub issue numbers.

Acceptance criteria

  • On macOS, with a non-community /Applications/NodeSpace.app, nodespace uninstall exits non-zero, prints the message, and changes nothing on disk or in launchd.
  • A community app, or no app, uninstalls exactly as before.
  • Neither the message nor the code names another product.
  • bun run scripts/check-pro-boundary.ts passes, with BASELINES pasted.

Tests and verification

  • Unit tests on tempdir bundles, whose Info.plist files the test writes with the plist crate:

    Bundle Expected
    absent None
    community None
    pro Some
    other Some
    key missing Some
    unparseable plist Some
    binary-format plist declaring community None
  • Mutation check: flip the comparison, and the tests must fail.

  • No test touches the real /Applications.

  • Commands:

    • bun run test:changed
    • cargo clippy -p nodespace-cli --all-targets -- -D warnings -D clippy::unused-async
    • .tools/bin/cargo-nextest nextest run -p nodespace-cli --lib

Dependencies

Risks and rollback

  • Mixed releases. A user who updated only the CLI is refused until they update the app, as ADR-084 intends.
  • Rollback: revert the PR.

Plan key: C8.8 (pro-boundary DAG).

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Sep 30, 2026
  2. added
    pro-boundary
    on Sep 30, 2026
  3. mstomar125 commented on Oct 1, 2026

    @mstomar125
    ContributorAuthor

    Superseded by #3415 (umbrella against the final ADR-081–085)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

pro-boundary

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions