Repository navigation
Bump cask to v0.2.0 with verified per-arch digest - #1
Merged
Merged
Conversation
The cask was pinned to v0.1.6 (2026-05-05) while the current GitHub release is v0.2.0 (2026-06-25) -- brew install has been serving a two-month-stale build. v0.2.0's release only publishes an Apple Silicon .dmg (NodeSpace_0.2.0_aarch64.dmg); no Intel/x64 macOS .dmg exists in that release despite the on_intel branch the cask previously pointed at, so the cask is rewritten as arm64-only with depends_on arch: :arm64 rather than referencing a URL that 404s. See NodeSpaceAI/nodespace-core#2154 for tracking restoration of the Intel build. sha256 computed with `shasum -a 256` against the actual downloaded NodeSpace_0.2.0_aarch64.dmg, cross-checked against the digest GitHub's release API reports for that asset. Fixes a real broken install, caught by actually running `brew install --cask` (not just style/audit) against the .dmg's real contents: the CLI binary is bundled at Contents/MacOS/nodespace in this release, not Contents/Resources/bin/nodespace, which is what both the old v0.1.6 cask and my first draft of this fix pointed at. The `binary` stanza is updated to the path that actually exists in the mounted .dmg. Also, per `brew audit --cask --online`: - Adds `depends_on macos: :sonoma` -- the bundled .app is built with MACOSX_DEPLOYMENT_TARGET=14.0, so audit flagged the cask for declaring no minimum OS matching the artifact's actual requirement. - Adds an explicit `livecheck` block using the `github_latest` strategy. Without it, brew's default tag-scanning livecheck was picking up unrelated `review-*` tooling tags from the repo instead of the actual latest release. Applies `brew style --fix` corrections (stanza order/grouping, homepage trailing slash, zap array alphabetization) so the file passes `brew style` and `brew audit --cask --online` clean. Verified end to end: `brew install --cask nodespace` succeeds against an isolated Homebrew prefix tapping this branch, installs NodeSpace.app + the `nodespace` CLI symlink, and `nodespace --version` reports 0.2.0. Closes NodeSpaceAI/nodespace-core#2114.
Collaborator
Author
|
Self-review: APPROVE GitHub won't let an author formally approve their own PR, so noting it here instead. This is a small, mechanical, easily-verified change:
Merging. |
mstomar125
added a commit
to NodeSpaceAI/nodespace-core
that referenced
this pull request
Aug 19, 2026
* Automate Homebrew tap sync + drift guard (closes #2114) homebrew-nodespace's cask was hand-maintained: version and two per-architecture sha256 digests, edited by hand in a separate repo on every release, with nothing checking or reminding. It silently drifted for two months (v0.1.6 while v0.2.0 shipped) before anyone noticed. Adds scripts/update-homebrew-cask.ts: - Resolves per-architecture digests from the actual release assets (gh release view --json assets), downloads each .dmg, and hashes it with node:crypto -- never types or copies a digest. - Renders Casks/nodespace.rb in either shape depending on what the release actually published: on_arm/on_intel when both macOS architectures exist, or a single depends_on-arch-scoped cask when only one does (the current real case -- v0.2.0 has no Intel .dmg, see #2154). Missing architectures are a loud warning, not a crash. - `<version> [--push]`: dry run by default (prints the generated cask); --push commits and pushes it to homebrew-nodespace's main branch, gated on HOMEBREW_TAP_TOKEN (a token scoped to that repo -- secrets.GITHUB_TOKEN can't push cross-repo). - `drift-check`: compares the tap's live cask version (fetched from the tap's raw Casks/nodespace.rb) against the latest published release (via `gh release list --json isLatest`, not a raw tag scan -- the naive default trips over this repo's own review-* tooling tags). Exits non-zero with the exact fix command on drift. Wires it into release.yml as `sync-homebrew-cask`, gated on the ARM macOS build (the one leg that must succeed -- Intel is best-effort per #2154) and `github.event_name == 'release'`. Added to notify-failure's needs so a failed push also opens a GitHub issue, not just a red run. Not exercised by this PR -- HOMEBREW_TAP_TOKEN doesn't exist as a repo secret yet; someone with admin on this repo needs to add one (a PAT with contents:write on homebrew-nodespace) before the job can succeed. Until then it fails loudly and notify-failure surfaces it, which is a correct, visible failure mode rather than a silent no-op. Adds .github/workflows/homebrew-drift-check.yml: a standalone daily + workflow_dispatch check, independent of the release flow, per the issue's ask for drift to be "detectable even if a sync step is bypassed." Opens a GitHub issue on drift, same pattern as release.yml's notify-failure. scripts/update-homebrew-cask.test.ts covers the offline, deterministic logic (digest hashing against a known fixture, cask rendering for both single- and dual-architecture shapes, the drift comparison predicate) -- the GitHub-talking functions are intentionally untested here since this suite runs as part of the pre-push gate and must stay network-free. Verified live against the real repos (read-only): drift-check correctly reports the tap's actual current drift (v0.1.6 vs v0.2.0, exit 1); a dry run against v0.2.0 reproduces the exact sha256 (b19edf95...) computed by hand for NodeSpaceAI/homebrew-nodespace#1, and its rendered cask passes `brew style` clean in an isolated Homebrew prefix. Companion fix (separate repo, already opened): NodeSpaceAI/homebrew-nodespace#1 bumps the cask to v0.2.0 by hand as the immediate one-off fix this automation would have produced. * Address adversarial review findings on the cask automation Three real bugs found by review, all verified against real tooling before and after the fix: - homebrew-drift-check.yml had no `permissions:` block, so its failure step's `gh issue create` would very likely 403 -- release.yml's sibling notify-failure job declares issues:write for the identical reason, this one didn't. Added contents:read + issues:write. - drift-check couldn't distinguish "genuine tap drift" from "the check itself failed to run" (network blip, gh/auth error) -- both hit the same exit-1 path with the same generic filed-issue body, so an operator triaging it couldn't tell which happened without opening the raw run log. checkTapDrift() is now wrapped so a thrown error produces a clearly distinct "DRIFT CHECK ERROR (not necessarily drift...)" message instead of reading as a TAP DRIFT report, and the workflow now tees the step's real output into the filed issue body instead of a fixed generic sentence. - The dual-architecture (on_arm/on_intel) render path in renderCask was unverified against real `brew style` -- unlike the single-arch path, which was checked against the actual hand-verified companion cask. Tested it directly: a real `brew style` run in the isolated Homebrew prefix flagged a missing blank line between the nested sha256/url stanzas (Cask/StanzaGrouping applies inside on_arm/ on_intel blocks too, not just at the top level). Fixed and re-verified clean. Added a regex assertion to the dual-arch test so this can't silently regress. Also, defense in depth on a lower-severity finding (HOMEBREW_TAP_TOKEN embedded in the git remote URL for the push): wrapped the clone call so any thrown error has the token scrubbed from its message before surfacing, and added a comment documenting the accepted residual risk (argv visibility on the runner during the clone/push window, and the temp credential URL living in workDir/.git/config until the existing finally-block cleanup runs) -- git's own error output already redacts credentials from URLs (verified empirically), so this closes the one gap that wasn't already covered. Added a top-level try/catch around main(), matching test-gate.ts's established error-handling convention in this repo -- previously any uncaught rejection printed a raw Bun stack trace/ShellError dump instead of an operator-facing message.
Apple Silicon is the only supported macOS target going forward -- there is no way to verify x86_64 (Intel) macOS builds, so none are produced, and this cask should stay arm64-only rather than being "fixed" back to a two-arch shape later.
This was referenced Aug 19, 2026
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.
Problem
Casks/nodespace.rbwas hand-pinned toversion "0.1.6"(2026-05-05) while the current published GitHub release isv0.2.0(2026-06-25) —brew install nodespacehas been serving a two-month-stale build. See NodeSpaceAI/nodespace-core#2114.What changed
versionto0.2.0.sha256with a digest computed by downloading the realNodeSpace_0.2.0_aarch64.dmgrelease asset and runningshasum -a 256on it locally, cross-checked against the digest GitHub's own release-assets API reports for that file..dmg— the previouson_intelblock pointed at a URL that 404s. Filed Drop Intel (x86_64) macOS from releases: remove CI targets, fix orphaned SHA256SUMS entries nodespace-core#2154 to track restoring the Intel build (CI built and uploaded it successfully at release time per the run logs, andSHA256SUMSstill has orphaned digests for the Intel binaries, but the assets are gone from the live release — looks like something removed them after the fact, not a build failure). Once that's resolved this cask should go back to a two-archon_arm/on_intelshape.binarystanza. It pointed atContents/Resources/bin/nodespace, which doesn't exist in this release's bundle — I mounted the actual.dmgand found the CLI lives atContents/MacOS/nodespaceinstead. This was caught by actually runningbrew install --cask, not just style/audit (see verification below).depends_on macos: :sonoma, perbrew audit --cask --online— the bundled.appis built withMACOSX_DEPLOYMENT_TARGET=14.0and audit flagged the cask for not declaring a matching minimum OS.livecheckblock (strategy :github_latest). Without it, brew's default tag-scanning livecheck picks up unrelatedreview-*tooling tags from thenodespace-corerepo instead of the actual latest release — also caught bybrew audit --cask --online.brew style --fix(stanza order/grouping, homepage trailing slash, zap array alphabetization).Verification
All done against an isolated Homebrew prefix (a separate
git cloneof Homebrew/brew outside/opt/homebrew, tapping this branch), so nothing here touched the machine's real Homebrew install:brew style Casks/nodespace.rb→ clean, no offenses.brew audit --cask --online nodespaceai/nodespace/nodespace→ clean, no problems detected (after the macos/livecheck fixes above).brew install --cask nodespaceai/nodespace/nodespace→ succeeds, installsNodeSpace.appand links thenodespaceCLI.nodespace --version→ reportsnodespace 0.2.0.Related