Skip to content

Guide the CLI-missing skill failure to install.sh; wire its version pin into the release pipeline - #2160

Merged
mstomar125 merged 2 commits into
mainfrom
issue-2146-install-bootstrap
Aug 19, 2026
Merged

mstomar125 merged 2 commits into
mainfrom
issue-2146-install-bootstrap

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Summary

Part of #2146 (the nodespace-core third of a 3-repo change; the other two — nodespace-website's install.sh/_headers/_redirects and homebrew-nodespace's new nodespace-cli formula — are separate PRs against those repos, opened from a fork since this account has read-only access there).

  • packages/skill/SKILL.md's command not found: nodespace failure-recovery row no longer dead-ends ("Do not proceed"). It now proposes curl -fsSL https://nodespace.ai/install.sh | sh -s -- --no-gui, gated on explicit user confirmation, reusing the same script every other entry point uses rather than a second implementation.
  • The same stale "DMG or cargo install nodespace-cli" guidance is updated in packages/skill/src/installer.ts's WARNING text and skill_setup.rs's cli_warning() (shown in the GUI when nodespace isn't on $PATH) — all three surfaces now point at the same one-liner.
  • skill_setup.rs gains a module-doc section documenting how the GUI's first-launch skill installer and install.sh's skill-triggered CLI install coexist: install.sh never touches SKILL.md/agent skill directories, and the only shared state between the two is ~/.nodespace/setup.json's skill_installed flag, already guarded by this module's existing idempotency check.
  • New scripts/publish-install-script.ts (sibling of scripts/update-homebrew-cask.ts): after a release's headless CLI binaries are confirmed uploaded, pins nodespace-website's install.sh to that release rather than "latest" (which can point at a release whose assets haven't finished uploading — release.yml's release: created trigger fires before any build job starts). Wired in as a new sync-install-script job in release.yml, gated on a WEBSITE_DEPLOY_TOKEN secret that still needs to be provisioned (same situation HOMEBREW_TAP_TOKEN was in before Homebrew tap is two months stale (v0.1.6 vs v0.2.0): cask is hand-maintained instead of generated on release #2114).

Testing

  • bun run --cwd packages/desktop-app test — 222 files / 4743 tests pass
  • cargo test -p nodespace-app --lib skill_setup — 5/5 pass (2 new: cli_warning_mentions_install_script, cli_warning_is_none_when_cli_on_path)
  • cargo clippy --all-targets --package nodespace-app -- -D warnings — clean
  • cargo fmt --check on the touched file — clean (pre-existing drift exists elsewhere in packages/agent/, untouched by this PR, out of scope)
  • bun test scripts/ — 111/111 pass (8 new in publish-install-script.test.ts, including a caught-and-fixed regex bug where \s*$ was swallowing the pin line's trailing newline)
  • bun run scripts/publish-install-script.ts 0.2.0 (dry run against the real v0.2.0 release) — correctly verifies the release's headless CLI assets, then fails cleanly with an HTTP 404 fetching nodespace-website's install.sh (expected — that file doesn't exist on main there yet, pending the sibling PR)
  • Pre-push gate (test-gate.ts): full test:all + cargo build --bin nodespaced + test:e2e — all green

Acceptance criteria (from #2146, this repo's slice)

  • SKILL.md's command not found: nodespace row offers a guided install instead of dead-ending
  • Skill path invokes the same script (non-interactively) — not a second implementation
  • Skill never installs without explicit user confirmation
  • Script is published as part of the release process, pinned to a release — not hand-copied (this PR is the nodespace-core half; needs WEBSITE_DEPLOY_TOKEN provisioned to actually run end to end)
  • App-launch skill installer and skill-triggered CLI install coexist without clobbering each other (documented contract + no shared mutable state beyond the existing idempotency flag)

🤖 Generated with Claude Code

mstomar125 and others added 2 commits August 19, 2026 10:29
…version pin into the release pipeline

SKILL.md's `command not found: nodespace` failure-recovery row dead-ended
("Do not proceed") -- it now proposes the curl | sh --no-gui one-liner and
requires explicit user confirmation before running it, reusing the same
script the copy-paste one-liner and `brew install --cask nodespace` both
rely on rather than inventing a second install path. The same stale
`cargo install`/DMG-only guidance is updated in packages/skill's installer
warning and the desktop app's cli_warning() (shown when the GUI can't find
`nodespace` on $PATH), so all three surfaces tell an agent or user the same
thing for the same underlying problem.

skill_setup.rs gains a module-doc section documenting how the GUI's
first-launch skill installer and install.sh's skill-triggered CLI install
coexist: install.sh never touches SKILL.md or an agent's skill directory,
and the only shared state is ~/.nodespace/setup.json's skill_installed
flag, already guarded by this module's existing idempotency check.

Adds scripts/publish-install-script.ts, a sibling of
update-homebrew-cask.ts: after a release's build-headless job confirms the
headless CLI binaries actually uploaded, it pins nodespace-website's
install.sh to that release rather than leaving it hand-edited or floating
to "latest" (which can point at a release whose assets haven't finished
uploading yet, since release.yml's `release: created` trigger fires before
any build job starts). Wired into release.yml as sync-install-script, a
sibling of sync-homebrew-cask, gated on a WEBSITE_DEPLOY_TOKEN secret that
still needs to be provisioned (same situation HOMEBREW_TAP_TOKEN was in
before #2114).

Co-Authored-By: Claude <[email protected]>
…markdown, and script robustness

- release.yml: sync-install-script no longer gates on build-headless's
  aggregate matrix result (a 5-leg fail-fast:false matrix where only 3
  legs are actually required by publish-install-script.ts). An unrelated
  leg failing (e.g. windows-x86, which install.sh never downloads) was
  silently skipping the whole job with no signal. Now runs whenever
  build-headless finished at all and lets publish-install-script.ts's own
  checkReleaseAssets() -- which re-verifies the specific assets this job
  needs -- be the real gate, failing loudly and specifically if any are
  missing.

- installer.ts / cli_warning() / SKILL.md: the three "CLI not on PATH"
  surfaces had drifted from each other (one still said `cargo install
  nodespace-cli`, the others didn't; the brew suggestions were a bare
  `brew install --cask nodespace`, which requires a tap step this repo's
  own Homebrew tap README documents as necessary -- the fully-qualified
  `nodespaceai/nodespace/nodespace` form used elsewhere auto-taps and
  needed to be used here too). All three now agree.

- SKILL.md: the failure-recovery table cell embedded a raw `|` inside an
  inline code span, escaped for GFM table parsing (`\|`) -- but backslash
  escapes aren't processed inside code spans per CommonMark, so an agent
  reading the raw file (SKILL.md's actual consumption mode) would copy a
  literal backslash into the command, breaking the pipe. Restructured to
  the `sh -c "$(curl ...)" -- --no-gui` form, which needs no pipe
  character at all. Also added guidance for the case where the retried
  command still fails because the current shell hasn't picked up the
  updated $PATH.

- publish-install-script.ts: pushInstallScriptUpdate now reads and patches
  install.sh from its own fresh `git clone` rather than reusing an earlier
  CDN-cached preview read, closing a window where a concurrent legitimate
  edit could be silently overwritten by a patch built from stale content.
  The version-pin regex gained a `g` flag so a second, stray pin line is
  *detected* (and refused) rather than left stale after only the first
  occurrence is patched. The two independent network calls in main() now
  run concurrently via Promise.all. Removed GitHub issue-number references
  from comments per this repo's documentation convention (describe the
  constraint directly).

Co-Authored-By: Claude <[email protected]>
@mstomar125

Copy link
Copy Markdown
Contributor Author

Update after adversarial review (10-angle pass)

Fixed all real findings:

  1. CI matrix-gate bug: sync-install-script gated on needs.build-headless.result == 'success', but that's a 5-leg fail-fast:false matrix where only 3 legs are actually required — an unrelated leg failing (e.g. windows-x86) would silently skip the whole sync with no signal. Now runs whenever build-headless finished at all and relies on checkReleaseAssets()'s own targeted verification to fail loudly/specifically if the assets it actually needs are missing.
  2. Message drift: installer.ts's WARNING still said cargo install nodespace-cli while cli_warning()/SKILL.md had moved on — fixed to agree. Also fixed a real usability bug in all three: brew install --cask nodespace requires a brew tap nodespaceai/nodespace step first (per the tap's own README) that none of the messages mentioned — switched to the fully-qualified brew install --cask nodespaceai/nodespace/nodespace form (auto-taps, no separate step, matches what install.sh itself uses).
  3. SKILL.md markdown bug: the table cell escaped a literal | inside inline code (\|) for GFM table parsing, but CommonMark doesn't process backslash escapes inside code spans — an agent reading the raw file (SKILL.md's actual consumption mode) would copy the literal backslash into the command, breaking the pipe. Restructured to sh -c "$(curl ...)" -- --no-gui, which needs no pipe character at all.
  4. publish-install-script.ts robustness: pushInstallScriptUpdate now reads/patches install.sh from its own fresh clone rather than an earlier CDN-cached preview (closes a race where a concurrent legitimate edit could get silently overwritten). The version-pin regex now detects (and refuses) a stray duplicate pin line instead of silently patching only the first. The two independent network calls in main() now run concurrently.
  5. Removed GitHub issue-number references from new comments per this repo's own documented convention (describe the constraint directly, not by issue number).

All tests re-verified green after the fixes (bun test scripts/ 111/111, packages/skill 24/24, cargo test -p nodespace-app --lib skill_setup 5/5, cargo clippy --all-targets --package nodespace-app -- -D warnings clean, cargo fmt --check clean on touched files). Pre-push gate (full test:all + cargo build --bin nodespaced + test:e2e) green on push.

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