Repository navigation
Refuse nodespace uninstall when the installed app is not the free NodeSpace - #3411
mstomar125 wants to merge 2 commits into
Conversation
…eSpace (closes #3351) On macOS, `run` first checks /Applications/NodeSpace.app. If the bundle exists and its Info.plist (XML or binary) does not declare NodeSpaceProduct = community, it returns ADR-084's message before stopping the daemon or removing anything. No bundle, or a community bundle, uninstalls as before. The check is the pure `uninstall_blocker(app_bundle)`, compiled for macOS and tests and unit-tested on tempdir bundles. It reads the plist with the `plist` crate, which is already in the lockfile through Tauri. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pragmatic Code Review: PR #3411 (closes #3351)Review Type: Initial Review (reviewed at SummaryThe change is small and does what it should. The
There is one thing to fix before merge: the message text no longer matches the accepted ADR-084. Requirements Check
Findings🟡 Important: the refusal message says "uninstall", but the accepted ADR-084 says "uninstaller"📁 The constant copies the issue's text: "…Use that product's own uninstall, or update NodeSpace first; …". The issue was written from the proposed ADR (nodespace-docs
The ADR is now Accepted and merged on main via nodespace-docs#95; the issue's "#94" link is stale. The issue says "The message is ADR-084's", so the accepted wording is the contract. "Uninstaller" also matches the Fix: change Principle: user-facing text that an ADR pins is a contract. Keep one source of truth, so that the guards across channels read the same. 🟡 Merge order: land with or after #3381This is not a code defect; the PR body already says it. Until #3381 ( Observations (no action in this PR)
Recommendation: REQUEST CHANGESThe only blocking item is the one-word message change. The rest is ready to approve. Re-review only needs to confirm the constant. |
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: REQUEST CHANGES (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Accepted ADR-084 section 5 says "Use that product's own uninstaller"; the constant had the proposed draft's "own uninstall". Co-Authored-By: Claude Opus 5.5 <[email protected]>
Address review: summaryAddressed (1)
No code change (1)
Skipped (1 observation)
Re-Review DecisionDecision: NO RE-REVIEW NEEDED. The fix is a one-word change to a string literal, with no logic change. A short confirmation pass on 74f394a follows anyway, so the PR carries a current verdict instead of the earlier REQUEST CHANGES. |
Pragmatic Code Review: PR #3411, re-reviewReview Type: Re-Review. Only new commit Previous Review Summary:
Verification
Code Review FindingsNone. Recommendation: APPROVEOne reminder carries over: land this with or after #3381, and don't cut a release from a main that has this PR without #3381. |
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval).
|
Superseded by #3606, which carries all of the coexistence work for the issue in one PR, reworked to the accepted ADR-084: every check compares 🤖 Generated with Claude Code |
Closes #3351
Summary
ADR-084 §5 (now Accepted on nodespace-docs main), CLI side:
nodespace uninstallnow runs only when the installed app is the free NodeSpace. On macOS, if/Applications/NodeSpace.appexists and itsInfo.plistdoes not declareNodeSpaceProduct = community, the command prints ADR-084's message and exits non-zero. It refuses before it stops the daemon or removes anything. With no app (a headless install), or with a community app, it uninstalls exactly as before.Changes
packages/cli/src/commands/uninstall.rsuninstall_blocker(app_bundle: &Path) -> Option<String>:Nonewhen the bundle doesn't exist;NonewhenContents/Info.plist(XML or binary) declaresNodeSpaceProduct=community;Some(message): another value, no key, a non-string value, a missing or unparseable plist.any(target_os = "macos", test).runis a#[cfg(target_os = "macos")]block that checks/Applications/NodeSpace.appand bails with the message.packages/cli/Cargo.tomlplist = "1.10"under the macOS target dependencies, and under[dev-dependencies]so the pure function is tested on every platform.plist1.10.0 is already inCargo.lockthrough Tauri. The lockfile diff only addsplisttonodespace-cli's dependency list; no new package.Deviations from the issue
.pkgguard's "Uninstall it with its own uninstaller first". The constant now matches the accepted text character for character (found in review).try_existserrors) refuses rather than proceeding. That matches the issue's "Some(message)in every other case". A dangling symlink at the app path counts as no app.Info.plist, and aNodeSpaceProductthat isn't a string.Dependency note
The CLI side doesn't depend on #3349 (PR #3381, still open) to build. At runtime it relies on the app declaring the key, which #3381 adds; it uses the same key/value (
NodeSpaceProduct/community). Until #3381 merges, every core app on disk lacks the key and this guard refuses it. ADR-084 accepts that for mixed releases. Both should ship in the same release.Ratchet
bun run scripts/check-pro-boundary.tspasses, and no marker moves: 0 delta on every marker.--changedlists oneproWordinghit inuninstall.rs, the existingremove_sockdoc comment, which is unchanged.BASELINESis unedited.BASELINES (unchanged)
Tests
Unit tests (
commands::uninstall::tests, tempdir bundles whoseInfo.plistthe test writes withplist; none reads/Applications):Noneuninstall_blocker_allows_no_appcommunity(XML)Noneuninstall_blocker_allows_an_app_declaring_communitycommunity(binary plist, assertsbplist00header)Noneuninstall_blocker_allows_a_binary_plist_declaring_communitypro,otherSomeuninstall_blocker_refuses_an_app_declaring_another_productSomeuninstall_blocker_refuses_an_app_without_the_keySomeuninstall_blocker_refuses_an_unparseable_info_plistInfo.plistSomeuninstall_blocker_refuses_an_app_without_an_info_plistSomeuninstall_blocker_refuses_a_product_that_is_not_a_stringMutation checks (each run against only the
uninstall_blockertests):==→!=): 7 of 8 fail. The no-app test passes because it never reaches the comparison.allows_no_appfails.from_reader_xml): the binary-plist test fails.End-to-end wiring check (manual, sandboxed). I built the
nodespacebinary and rannodespace uninstallwith:HOMEholding stand-ins for~/.nodespace/bin, the per-user LaunchAgent plist and a socket;launchctl/bun/nodefirst onPATH, which log their calls;sandbox-execdenying writes to the real~/.nodespace,~/Library,/Applicationsand~/.claude, and exec of/bin/launchctl.Only the real
/Applications/NodeSpace.app/Contents/Info.plistwas read. It is a current core app with noNodeSpaceProductkey.Results:
Error: The NodeSpace app on this Mac is a different NodeSpace product, …, no tool calls (nolaunchctl bootout), and the scratch HOME was byte-identical afterwards.run: exit 0, the fakelaunchctl bootout gui/502 app.nodespace.daemonand the skill uninstall ran, and the scratch HOME files were deleted. So the probe catches a missing guard.The community-app and no-app paths of the binary weren't run end to end: that would need a community bundle at the real
/Applicationspath, or a real uninstall. The unit tests coveruninstall_blockerreturningNonethere, andrunis unchanged after the guard.Commands:
cargo fmt -p nodespace-cli: clean.cargo clippy -p nodespace-cli --all-targets -- -D warnings -D clippy::unused-async: 0 warnings.bun run test:changed: rust + scripts tiers passed; the workspace nextest ran 4155 tests, all passed.bun run scripts/check-pro-boundary.ts: passes.🤖 Generated with Claude Code