Repository navigation
Skill installer: find app-bundle/symlinked layouts, no build path in error - #3861
Merged
Merged
Conversation
mstomar125
commented
Oct 20, 2026
mstomar125
left a comment
Contributor
Author
There was a problem hiding this comment.
Verdict: APPROVE WITH NITS
Independent review of #3861 (Refs #3831). I ran cargo test -p nodespace-cli --lib commands::skill::tests::compiled, and all 5 pass. Findings below.
Acceptance criteria
- Not-found message lists the searched directories and has no build-time path in release: met.
skill.rs:1297-1306only passes the hint whencfg!(debug_assertions). - Canonicalized exe dir and app-bundle layout accepted: met (
exe_dirs,resource_root_candidates). - Tests for message, bundle and symlink: met.
- Optional
~/.nodespace/bincopy: NOT done. See finding 1.
Layouts and safety (verified by reading the code and tests)
- A Homebrew or
/usr/local/binsymlink to a real binary resolves. The plain sibling dir is tried first, then the canonical dir.current_exe()is kernel-supplied and absolute on macOS, so relative argv0 and path traversal do not apply. - A canonicalize failure is handled:
.ok().and_then(...)falls back to the plain dir only. - The sidecar that gets executed and the resource root come from the same trust domain as the running
nodespacebinary itself (its own dir or its real dir, or../Resources/resources/skillwithin the same.app). The bundle branch only fires when the dir is literallyContents/MacOS. It adds no new directory an attacker could choose. A world-writable exe dir is a pre-existing exposure. The code never searchesPATH, cwd, or any other directory. Installer::Compiledrunsbinarywithresource_rootas an argument (skill.rs:1326-1333). That is unchanged.
Findings
- (non-blocking)
skill.rs:1297-1306: the~/.nodespace/bin/nodespacestaging copy still cannot find the installer, because it has no sidecar beside it. A canonical dir equals itself for a copy, and a copy is not a symlink. That scenario is the second bullet of the issue's "What happens". The message now says clearly what to do, but the optional AC is open, so do not let #3831 auto-close on it. The PR saysRefs, which is correct. Please file a follow-up or note it in the PR. - (non-blocking)
skill.rs:1294-1306: "directories searched" lists only the exe dirs. The bundleResources/resources/skillroot and theskill/subdirs probed are not named. The message does say "and itsskill/resources in: {dirs}", so it is not wrong, but for a bundle the listed dir (Contents/MacOS) hides the second location. Consider listing the roots fromresource_root_candidates. - (non-blocking, test gap) The debug-only gating of the CARGO_MANIFEST_DIR hint (
skill.rs:~1303) is untested. Mutation: I changedcfg!(debug_assertions)totrue, so the release build would print the CI path again. All tests still passed (the only failure in that run was my other mutation). The unit test covers only the pure helper withNoneandSome. A cheap guard is a test that asserts the caller passesNonewhen!cfg!(debug_assertions), or extractfn source_hint(path) -> Option<&Path>and test it under#[cfg(not(debug_assertions))]. This is the PR's headline guarantee, so it deserves a regression test. - (non-blocking) Mutation of the other logic: disabling the canonical-dir push is killed by the symlink test. I did not find a surviving mutant in the bundle logic. Removing the bundle branch would fail the bundle test.
- (non-blocking nit) Windows:
canonicalize()returns\\?\verbatim paths, sodirs.containswill not dedupe and the message shows the\\?\form. Harmless, since the bundle layout is macOS-only. - (non-blocking nit)
cfg!(debug_assertions)is the right switch. Release profile (Cargo.toml:77) does not enable debug-assertions, and no feature is involved.env!("CARGO_MANIFEST_DIR")is still compiled into the binary as thepath.exists()probe, but is never printed in release. Note that in a release build on a dev machine where that path exists, the script is still executed. That behaviour is unchanged and the issue allowed "or when that path exists", so this is stricter than the issue. Fine.
No blocking issues.
…; list searched dirs in not-found error compiled_installer_beside now tries the exe directory then its canonicalized directory, and resolves resources from skill/ or, inside Contents/MacOS, ../Resources/resources/skill. The not-found message names the searched directories and omits the build-time CARGO_MANIFEST_DIR path outside debug builds. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… list bundle resource roots searched Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
fix/3831-skill-installer-error
branch
from
October 20, 2026 14:32
5f2c335 to
659ddb2
Compare
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.
Refs #3831
Changes
compiled_installer_besidetries the exe dir, then the canonicalized exe dir (symlinked CLI); resources fromskill/or, inContents/MacOS,../Resources/resources/skill.CARGO_MANIFEST_DIRpath andbuild:skillhint appear only in debug builds.Not done
~/.nodespace/binstaging copy find the installer (copy sidecar +skill/). The staged binary's own lookup is unchanged, so it still fails from there. Issue stays open.Testing
cargo test -p nodespace-cli installer: 15 passed (new: app-bundle, symlink, message tests).cargo clippy -p nodespace-cli --all-targets -- -D warningsandcargo fmt --checkclean.🤖 Generated with Claude Code