Skip to content

feat(publish): add the darwin-arm64 runtime package - #241

Merged
khaliqgant merged 2 commits into
mainfrom
feat/darwin-arm64-runtime
Sep 8, 2026
Merged

khaliqgant merged 2 commits into
mainfrom
feat/darwin-arm64-runtime

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

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-x64 was the only platform. A separate, pre-existing gap turned up while wiring this: nothing declared any runtime package as an actual dependency of the installed relayflows CLI, 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 locally.

  • 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 runtime-darwin-arm64's tarball from the linux publish-packages job) checks shape only, since a foreign binary can't be executed there.
  • .github/workflows/publish.yml: new build-darwin-arm64 job on a macos-14 runner (native aarch64-apple-darwin, no cross-compile needed). It independently re-derives the same new_version by running version-packages.mjs against the same commit and the same workflow inputs as the linux build job — npm version <bump> is deterministic, so neither job depends on the other's output and they run in parallel. publish-packages downloads 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 path
  • Verified end to end, for real, on this machine (darwin-arm64): built the actual relayflowd release binary and the bun-compiled flows executable, ran pack-release.mjs runtime-darwin-arm64 against them, which packs, unpacks, and executes relayflowd --help and flows check testdata/hello-deterministic.flow.yaml — real Mach-O binaries, real output
  • relayflowd-path.ts's existing resolution tests (relayflowd-path.test.ts, daemon-lifecycle.test.ts) pass unmodified
  • The build-darwin-arm64 CI job itself is new and unexercised by any prior run — this PR's own checks will be its first real run on a macos-14 GitHub Actions runner

Not in scope

darwin-x64 (Intel) and Windows still fall through to relayflowd-path.ts's source-checkout/PATH resolution 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 relayflows never shipping a runtime binary: npm install -g relayflows previously only worked from a source checkout, on any OS. Linux and darwin-arm64 runtime packages are now os/cpu-gated optionalDependencies of relayflows, and the publish workflow builds the macOS runtime on native Apple Silicon in parallel with the Linux job.

  • pack-release.mjs now handles any runtime-<platform>-<arch> package, executing a real smoke only on a matching host; foreign-host repacks assert shape only.
  • Both runtime packages advance in lockstep with @relayflows/sdk, and the lockfile records both platform variants so npm ci elsewhere resolves its own.
  • The relayflows build step now installs the packed surface tarball alongside the SDK, since the SDK's transitive surface dependency would otherwise resolve from the registry and fail before anything is published.
  • Intel Macs and Windows still fall through to relayflowd-path.ts source-checkout/PATH resolution until their runtime packages exist.

Written for commit ade2a6d. Summary will update on new commits.

Review in cubic

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T08:11:31.315808Z 8836459 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c8501870-021a-497c-bd13-9f99ceced93a

📥 Commits

Reviewing files that changed from the base of the PR and between 8836459 and ade2a6d.

📒 Files selected for processing (1)
  • .github/workflows/publish.yml

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c975926b-766a-41e0-93e4-3ef36e486aff

📥 Commits

Reviewing files that changed from the base of the PR and between 5bbbe6e and 8836459.

⛔ Files ignored due to path filters (1)
  • packages/relayflows/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • .github/workflows/publish.yml
  • packages/relayflows/README.md
  • packages/relayflows/package.json
  • packages/runtime-darwin-arm64/README.md
  • packages/runtime-darwin-arm64/package.json
  • scripts/pack-release.mjs
  • scripts/publish.test.mjs
  • scripts/version-packages.mjs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Cross-platform runtime publishing

Layer / File(s) Summary
Runtime package contract
packages/runtime-darwin-arm64/..., packages/relayflows/..., scripts/version-packages.mjs
Defines the Darwin ARM64 runtime package, documents platform resolution, pins both runtime packages as optional dependencies, and includes the package in version updates.
Runtime packaging validation
scripts/pack-release.mjs, scripts/publish.test.mjs
Generalizes runtime package validation by platform and architecture. Tests cover version propagation, dependency pins, missing binaries, and Darwin packaging smoke behavior.
Native build and publication
.github/workflows/publish.yml
Builds and packages the Darwin ARM64 runtime on macOS, restores and validates its artifact, publishes it, checks lockfile entries, and stages its manifest in release commits.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 88364

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: adding the Darwin ARM64 runtime package for publishing.
Description check ✅ Passed The description is directly related to the changeset. It explains the new runtime package, optional dependencies, packaging changes, CI workflow updates, tests, and unsupported platforms.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/darwin-arm64-runtime

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.

❤️ Share

A rabbit packs the Apple crate
With tiny tools and binaries neat
The macOS runner builds with care
Two runtime paths now travel there
The release workflow checks each sign
And ships the Darwin package in line

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review swarm: maintainability

No fresh transcript was produced for run bd738888-e463-4007-b60c-ef59e619c54b (MISSING).

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review swarm: history

No fresh transcript was produced for run bd738888-e463-4007-b60c-ef59e619c54b (MISSING).

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review swarm: structure

No fresh transcript was produced for run bd738888-e463-4007-b60c-ef59e619c54b (MISSING).

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review swarm: FAILED

  • maintainability: MISSING
  • history: MISSING
  • structure: MISSING

Cloud run: bd738888-e463-4007-b60c-ef59e619c54b

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

Re-trigger cubic

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
@khaliqgant
khaliqgant merged commit b7460a8 into main Sep 8, 2026
6 of 7 checks passed
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