fix(desktop): arch-scope managed node-tools and self-repair adapters - #5
Merged
Merged
Conversation
Close #4: scope the npm prefix by platform, isolate product dirs, purge+reinstall on arch mismatch with a guarded delete, pin managed adapter PATH to an existing Node binary, and replace upstream npm -g advice with an in-app repair hint. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: oscarlehuu <oscar.lehuu@gmail.com> Signed-off-by: oscarlehuu <oscar.lehuu@gmail.com>
Reject `..` components and the node-tools root itself before purge, make the guard injectable for hermetic fixtures, and run arch self-repair even when plan_adapter_install skips because an adapter already looks current. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: oscarlehuu <oscar.lehuu@gmail.com> Signed-off-by: oscarlehuu <oscar.lehuu@gmail.com>
Split managed adapter install into modules for the file-size ratchet, match arch per adapter family, reinstall purged siblings as visible non-fatal steps, and gate PATH/spawn on the managed Node version probe. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: oscarlehuu <oscar.lehuu@gmail.com> Signed-off-by: oscarlehuu <oscar.lehuu@gmail.com>
Keep sibling repair accounting after primary failure, ignore orphan optionals, serialize the shared npm prefix, and memoize Node readiness as true-only so install can observe missing→ready. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: oscarlehuu <oscar.lehuu@gmail.com> Signed-off-by: oscarlehuu <oscar.lehuu@gmail.com>
Keep primary install success:true while UI shows failed sibling adapter-repair steps, and clear the positive Node probe memo at managed-adapter spawn so a stale true cache cannot pass a missing binary. Hermetic tempfile seam replaces app data_dir rename tests. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: oscarlehuu <oscar.lehuu@gmail.com> Signed-off-by: oscarlehuu <oscar.lehuu@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
node-tools/<platform>/, share one(os,arch)→platformhelper with the Node runtime, and seed product dir from TauriproductName(fallback"Buzz") so forks no longer share one poisoned tree.node-tools/contents after success; pass npm--cpu/--os(aarch64→arm64,macos→darwin,windows→win32).npm install -goptional-dep advice with Settings → Agent runtimes Install guidance (install stderr, agent log parse, buzz-acp init errors).Closes #4.
Plan:
plans/20260731-0009-managed-node-tools-arch-scoping/Buzz channel:
9fcd2dc3-5f3e-4f7e-9cb3-3409f33ba7faNuncioCrew / fork note (disk reclaim)
Legacy unscoped reclaim targets
data_dir()/<productName>/node-tools(e.g.NuncioCrew/node-tools). Older NuncioCrew builds stored managed Node/npm under the literalBuzz/product dir, so those trees are not auto-reclaimed after this change — by design: deletingBuzz/node-toolsorBuzz/runtimes/node/…could remove a live stock Buzz install sharing the same machine.If you use NuncioCrew only (no stock Buzz), you may manually remove leftover disk under:
~/Library/Application Support/Buzz/node-tools/~/Library/Application Support/Buzz/runtimes/node/(e.g.v24.18.0/darwin-x64/)Test plan
cargo clippy --workspace --all-targets -- -D warnings./scripts/run-tests.sh unitjust desktop-tauri-checkjust desktop-tauri-test(1905 passed) including arch/purge/hint/probe fixturesReviewer notes
is_safe_to_purge_node_tools_path+ tests refusing outsidenode-tools.require_managed_node_for_adapterclears positive probe memo then fresh-probes; no download on spawn.--cpu=arm64|x64,--os=darwin|linux|win32(windows→win32, not pass-through).adapter-repairsurfaces as warning while primarysuccess:true.NoAdaptersInstalled(no phantom reinstall).Made with Cursor