Skip to content

Staged CLI finds the skill installer through a recorded app bundle - #3867

Merged
mstomar125 merged 1 commit into
mainfrom
issue-3831-staged-cli-installer
Oct 22, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-3831-staged-cli-installer

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Refs #3831

Finishes the remainder #3861 left: the copy of the CLI staged in ~/.nodespace/bin now finds the skill installer.

Design

When the app stages the CLI it also records the path of the bundled nodespace it copied from, in ~/.nodespace/bin/.nodespace.bundle. The CLI keeps its existing lookup (own directory, canonicalized directory, app-bundle resource layout) and, if that finds nothing, reads the marker beside it and runs the same lookup on the recorded bundle directory. The installer sidecar and skill/ resources are used where they already are; nothing is copied.

Why this over copying the sidecar and skill/ next to the staged CLI: nothing new is staged, signed, stamped or quarantine-cleared, so the daemon/launcher path (source stamp, restart decision from #3835/#3853/#3863) is not touched. The marker is written only when its content differs, never touches the staged binary or its stamp, and a failure to write it is logged and ignored, so it cannot restart an unchanged daemon or block start-up. The skill resources also always match the installed app instead of a second copy that could go stale.

The not-found message now also lists the recorded bundle directories searched. A marker pointing at a moved or deleted app, or a relative path, is ignored and the existing error is shown.

Tests (each mutation-checked: removing the behavior makes it fail)

  • CLI: staged copy resolves installer and resources through the recorded app bundle; no marker, dangling marker and relative marker find nothing; searched directories include the recorded bundle.
  • App: marker holds the bundled CLI path, is not rewritten when unchanged (mtime), is rewritten when the path changes; staged binary and stamp are untouched and no temp file is left; the marker file name matches the CLI's constant.
  • cargo test -p nodespace-cli --lib skill:: (45 pass), cargo test -p nodespace-app-lib --lib daemon_setup:: (104 pass), clippy -D warnings and fmt on both crates.

Not done

  • Not verified against a real .pkg or .app install (no app launch on the build machine); only synthetic directory layouts.
  • A .pkg install registers the daemon machine-wide and the app returns before staging, so no staged CLI is written there; unchanged and out of scope.
  • Windows and Linux layouts use the same marker but are untested.

🤖 Generated with Claude Code

The app records the bundled nodespace path in ~/.nodespace/bin/.nodespace.bundle
and the CLI, when its own directory has no installer, looks in that bundle
(sidecar beside it, skill resources under Contents/Resources).

Refs #3831

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant