feat(publish): add the darwin-arm64 runtime package - #241
Conversation
Phase 2 of "package flows so it's frictionless": relayflowd-path.ts's attach-or-spawn resolution has always been able to find a @relayflows/runtime-<platform>-<arch> optional dependency (kernel/DAEMON-LIFECYCLE.md §3.1 step 3) but nothing published one for macOS, and — a separate, pre-existing gap found while wiring this up — nothing declared any runtime package as an actual dependency of the installed `relayflows` CLI at all, on any platform. `npm install -g relayflows` never fetched a relayflowd binary regardless of OS; it only ever worked from inside a source checkout with the kernel already built. - packages/runtime-darwin-arm64: mirrors runtime-linux-x64 (os/cpu-gated package.json, relayflowd + bun-compiled flows in bin/). - packages/relayflows/package.json now declares both runtime packages as optionalDependencies, pinned in lockstep with @relayflows/sdk. npm installs only the one matching os/cpu and silently skips the rest. - scripts/pack-release.mjs generalized from a runtime-linux-x64 special case to any runtime-<platform>-<arch> package; its execution smoke test only runs when the host actually matches — packing/asserting a foreign-platform tarball (e.g. re-verifying darwin-arm64's tarball from the linux publish job) checks shape only, since a foreign binary cannot be executed there. - .github/workflows/publish.yml: new build-darwin-arm64 job on a macos-14 runner (native aarch64-apple-darwin, no cross-compile), independently re-deriving the same new_version via version-packages.mjs against the same commit and inputs as the linux build job, so neither job depends on the other's output. publish-packages downloads both build artifacts and publishes all five packages. Verified locally end to end on this machine (darwin-arm64): built the real relayflowd release binary and bun-compiled flows executable, ran pack-release.mjs against them for real (pack, unpack, execute `relayflowd --help` and `flows check` against testdata/hello-deterministic.flow.yaml), and confirmed relayflowd-path.ts's existing resolution tests are unaffected. scripts/publish.test.mjs covers the generalized pack-release.mjs behavior including the foreign-host skip path. Not yet covered: darwin-x64 (Intel) and Windows still fall through to relayflowd-path.ts's source-checkout/PATH resolution steps. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Y8uLRUXqKSZsqeeUMNaS2
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedNext included review available in 47 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds a Darwin ARM64 runtime package, declares platform-specific optional dependencies, builds the package on macOS, extends release validation, publishes both runtimes, and updates versioning and tests. ChangesCross-platform runtime publishing
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The Darwin ARM64 runtime is consistently wired into installation and release packaging, with host-matched executable checks and foreign-artifact shape validation. The change is ready to merge after normal CI completes. Sequence Diagram(s)sequenceDiagram
participant ReleaseWorkflow
participant MacOSRunner
participant ArtifactStore
participant NpmRegistry
ReleaseWorkflow->>MacOSRunner: build and smoke-test Darwin ARM64 binaries
MacOSRunner->>ArtifactStore: upload runtime-darwin-arm64 package artifact
ReleaseWorkflow->>ArtifactStore: restore Darwin runtime artifact
ReleaseWorkflow->>NpmRegistry: publish runtime-darwin-arm64 package
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (5 skipped: 5 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit packs the Apple crate Comment |
Review swarm: maintainabilityNo fresh transcript was produced for run |
Review swarm: historyNo fresh transcript was produced for run |
Review swarm: structureNo fresh transcript was produced for run |
Review swarm: FAILED
Cloud run: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8836459b2d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "node": ">=20" | ||
| }, | ||
| "optionalDependencies": { | ||
| "@relayflows/runtime-darwin-arm64": "2.0.1", |
There was a problem hiding this comment.
Add the Darwin runtime package to the lockfile
The root lock stanza declares the new optional dependency, but packages has no corresponding node_modules/@relayflows/runtime-darwin-arm64 record, leaving the manifest and lockfile inconsistent. Running npm ci --prefix packages/relayflows --dry-run --ignore-scripts exits with status 1 and reports npm error code EUSAGE followed by npm error Missing: @relayflows/runtime-darwin-arm64@ from lock file, so clean installs of this package directory now fail on every platform until the lockfile contains the new package.
AGENTS.md reference: AGENTS.md:L90-L91
Useful? React with 👍 / 👎.
Found by actually running a full dry-run of publish.yml against this branch (triggered to validate the new build-darwin-arm64 job) — the existing "Build relayflows CLI wrapper against packed SDK" step only installed the SDK tarball. @relayflows/sdk depends on @relayflows/surface transitively, at the same freshly-bumped, never-published version, so npm fell through to resolving it from the real registry and got ETARGET: no version bump can ever be live there yet at build time. This step apparently has never been exercised end to end since it was added in #237 — no PR check runs publish.yml (workflow_dispatch only), so nothing caught it until this run. Same fix already used one step earlier for the SDK-against-surface case: install both tarballs together so the transitive dependency resolves locally instead of hitting the registry. Confirmed locally end to end (bumped versions, packed both tarballs, ran the fixed install, ran the wrapper's own check smoke test — all green) before pushing. The new build-darwin-arm64 job doesn't touch packages/relayflows, so it isn't affected — it already succeeded for real on a macos-14 runner in the dry-run that surfaced this. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Y8uLRUXqKSZsqeeUMNaS2
Summary
Phase 2 of "package flows so it's frictionless."
relayflowd-path.ts's attach-or-spawn resolution has always been able to find a@relayflows/runtime-<platform>-<arch>optional dependency (kernel/DAEMON-LIFECYCLE.md§3.1 step 3), but nothing published one for macOS —packages/runtime-linux-x64was the only platform. A separate, pre-existing gap turned up while wiring this: nothing declared any runtime package as an actual dependency of the installedrelayflowsCLI, on any platform.npm install -g relayflowsnever fetched arelayflowdbinary regardless of OS; it only ever worked from inside a source checkout with the kernel already built locally.packages/runtime-darwin-arm64: mirrorsruntime-linux-x64(os/cpu-gatedpackage.json,relayflowd+ bun-compiledflowsinbin/).packages/relayflows/package.jsonnow declares both runtime packages asoptionalDependencies, pinned in lockstep with@relayflows/sdk. npm installs only the one matchingos/cpuand silently skips the rest.scripts/pack-release.mjsgeneralized from aruntime-linux-x64special case to anyruntime-<platform>-<arch>package. Its execution smoke test only runs when the host actually matches — packing/asserting a foreign-platform tarball (e.g. re-verifyingruntime-darwin-arm64's tarball from the linuxpublish-packagesjob) checks shape only, since a foreign binary can't be executed there..github/workflows/publish.yml: newbuild-darwin-arm64job on amacos-14runner (nativeaarch64-apple-darwin, no cross-compile needed). It independently re-derives the samenew_versionby runningversion-packages.mjsagainst the same commit and the same workflow inputs as the linuxbuildjob —npm version <bump>is deterministic, so neither job depends on the other's output and they run in parallel.publish-packagesdownloads both build artifacts and publishes all five packages.Test plan
node --test scripts/publish.test.mjs— including new coverage for the generalized runtime-package packing and the foreign-host skip pathrelayflowdrelease binary and the bun-compiledflowsexecutable, ranpack-release.mjs runtime-darwin-arm64against them, which packs, unpacks, and executesrelayflowd --helpandflows check testdata/hello-deterministic.flow.yaml— real Mach-O binaries, real outputrelayflowd-path.ts's existing resolution tests (relayflowd-path.test.ts,daemon-lifecycle.test.ts) pass unmodifiedbuild-darwin-arm64CI job itself is new and unexercised by any prior run — this PR's own checks will be its first real run on amacos-14GitHub Actions runnerNot in scope
darwin-x64(Intel) and Windows still fall through torelayflowd-path.ts's source-checkout/PATHresolution steps — no runtime package for either yet.🤖 Generated with Claude Code
https://claude.ai/code/session_013Y8uLRUXqKSZsqeeUMNaS2
Summary by cubic
Adds a prebuilt darwin-arm64 runtime package and fixes
relayflowsnever shipping a runtime binary:npm install -g relayflowspreviously only worked from a source checkout, on any OS. Linux and darwin-arm64 runtime packages are nowos/cpu-gatedoptionalDependenciesofrelayflows, and the publish workflow builds the macOS runtime on native Apple Silicon in parallel with the Linux job.pack-release.mjsnow handles anyruntime-<platform>-<arch>package, executing a real smoke only on a matching host; foreign-host repacks assert shape only.@relayflows/sdk, and the lockfile records both platform variants sonpm cielsewhere resolves its own.relayflowd-path.tssource-checkout/PATHresolution until their runtime packages exist.Written for commit ade2a6d. Summary will update on new commits.