prime-agent icon indicating copy to clipboard operation
prime-agent copied to clipboard

packages/coding-agent: track official Homebrew core submission readiness

Open fettpl opened this issue 3 months ago • 10 comments

Summary

Prime Agent already has an official homebrew/core submission for v0.7.0. The formula passed the current Homebrew macOS and Linux CI matrix, but review is blocked on the vendored ZeroMQ dependency. This issue tracks the remaining upstream and packaging work through merge and final installation verification.

homebrew/core is the correct route because Prime Agent is open-source, command-line-only software. Homebrew normally requires that category to be built from source as a formula; a rejected core formula would not automatically become eligible for homebrew/cask.

Current state

  • Homebrew/homebrew-core#297372 is open and remains the canonical submission.
  • Its current CI passed on Linux arm64, Linux x86_64, macOS arm64, and macOS x86_64.
  • Homebrew review requested use of the existing zeromq formula instead of the native library vendored by the zeromq npm package.
  • zeromq/zeromq.js#736 now tracks that request. A ZeroMQ maintainer says the zmq_shared npm option exists but has not been tested recently.
  • The formula installs the published prime-agent-0.7.0.tgz asset with SHA-256 88b6578518c72cd51a825bc80f28e0fef9a64c67de4a7d6fd7afd7ca1b34da0b.
  • #751 reports that this exact v0.7.0 tarball is missing dist/bundle/amazon-bedrock.js, so --version passing is not enough to establish that the release artifact is suitable for Homebrew.

Work required before merge

1. Build the Node binding against Homebrew ZeroMQ

  • Test the exact [email protected] package used by Prime Agent with its zmq_shared configuration.
  • Declare the Homebrew zeromq formula and only the build dependencies demonstrated by a clean build.
  • Verify the installed native module with otool -L on macOS and ldd on Linux.
  • Confirm no private libzmq copy remains in the keg.
  • If the existing option is broken, prepare a focused zeromq.js fix linked to zeromq.js#736.

2. Use a complete stable release artifact

  • Resolve #751 and publish a corrected stable release rather than asking Homebrew to merge a formula around a known-broken tarball.
  • Update the formula URL and checksum if a new release is required.
  • Validate representative provider/runtime assets in addition to prime-agent --version.

3. Verify formula reproducibility and native dependencies

  • Confirm the formula does not resolve moving dependency versions during installation. The published package tarball does not contain the repository lockfile.
  • If necessary, use the immutable GitHub source archive and the repository lockfile instead of the npm-style release tarball.
  • Inventory ZeroMQ, Koffi, clipboard, Photon/WASM, and other native or platform-specific dependencies as source-built, Homebrew-linked, portable output, or an explicit vendoring exception.

4. Verify Homebrew-owned updates

  • Confirm prime-agent update cannot mutate a Homebrew-managed keg.
  • Confirm it directs Homebrew users back to their package manager.
  • Confirm startup notices do not encourage a Homebrew installation to bypass Homebrew upgrades.

Validation gates

The actual submitted formula revision should pass:

HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source prime-agent
brew test prime-agent
brew audit --strict --new --online prime-agent
brew style --fix --formula prime-agent
brew lgtm --online
prime-agent --version
prime-agent --help
prime-agent doctor
prime-agent update
brew linkage --test prime-agent
brew uninstall prime-agent

Local results will be reported with their platform limits. The updated Homebrew pull request must also pass its complete supported macOS and Linux matrix.

Maintainer support

@kennethnym @badlogic — I can own the Homebrew preflight, shared-ZeroMQ experiment, formula validation, review tracking, and final public-install verification. Support may be needed from you for:

  • resolving #751 and publishing a corrected stable release;
  • reviewing any small Prime Agent source change needed for Homebrew-owned update behavior;
  • updating the existing Homebrew contributor branch with the tested formula changes;
  • creating and applying the pkg:coding-agent label required by this repository's contribution instructions; that label is currently absent and the filing account cannot create repository labels.

I will keep tested findings and state changes in this issue and avoid duplicate Homebrew submissions or status-only comments.

Completion criteria

  • [ ] Shared ZeroMQ handling is accepted by Homebrew review.
  • [ ] The formula uses a complete, immutable, reproducible stable release input.
  • [ ] Native dependencies and self-update ownership are verified.
  • [ ] The canonical Homebrew pull request is merged.
  • [ ] A clean API-backed brew install prime-agent passes runtime and linkage checks.
  • [ ] The verified result is reported here and this issue is closed.

References

fettpl avatar Aug 07 '26 10:08 fettpl

Preflight update (2026-08-07):

  • Reproduced the current Homebrew formula on macOS 26 arm64. The baseline passes brew test, brew linkage --test, strict online audit, and style.
  • Confirmed npm --build-from-source did not guarantee a source build: without an explicit Ninja dependency, cmake-ts logged ninja not found, exited successfully, and left the packaged prebuilt ZeroMQ addon in place.
  • Confirmed that addon statically embeds libzmq (otool -L showed no libzmq dylib).
  • Confirmed the v0.7.0 artifact still lacks dist/bundle/amazon-bedrock.js (#751), contains no lockfile/shrinkwrap, and resolves dependency versions beyond the repository lock during formula installation.
  • Confirmed the current release would construct npm --prefix /opt/homebrew/Cellar/prime-agent/0.7.0/libexec install -g prime-agent for self-update with normal permissions.

Delivered fixes:

  • Prime Agent self-update ownership: #846 (fixes #844).
  • Shared system libzmq support: zeromq/zeromq.js#737 (fixes zeromq/zeromq.js#736).

I also validated a local formula prototype with cmake, ninja, and pkgconf build dependencies plus zeromq. It builds zeromq.js with npm_config_zmq_shared=true, loads a Pair socket, and links /opt/homebrew/opt/zeromq/lib/libzmq.5.dylib. After removing CMake staging files and sanitizing the required runtime manifest, it passes brew test, brew linkage --test, brew audit --strict --new --online, and brew style.

Required next actions:

  • @badlogic: merge #846, resolve #751, consume the released zeromq.js shared-link fix, and cut a corrected stable Prime Agent release. Please also decide whether to publish an npm shrinkwrap or another deterministic dependency record for the release tarball.
  • @kennethnym: after those releases, update Homebrew/homebrew-core#297372 to the corrected Prime Agent artifact, add the four formula dependencies above, enable npm_config_zmq_shared, and retain only the compiled platform addon plus its sanitized manifest.

fettpl avatar Aug 07 '26 11:08 fettpl

Status update (2026-08-08):

  • #846 merged with all checks passing, closing #844. Its change remains under Unreleased.
  • I inspected the published v0.7.1 asset (sha256:d68612c83239caafab72cc76c55ac572bfd07a059ea8fbd2a3ddbe1f2b55dcdb). It still lacks dist/bundle/amazon-bedrock.js, so #751 remains unresolved.
  • The v0.7.1 tag targets 95afd319, while #846 merged afterward as 10fb172b; therefore that release also lacks Homebrew install detection and the brew upgrade prime-agent guidance.
  • zeromq/zeromq.js#737 now passes every job that obtained a runner. I replaced retired windows-2019 and macos-13 labels in 52555d6; the replacement matrix awaits maintainer approval.

@badlogic Homebrew remains blocked on a stable release after #846 that also includes the missing Bedrock bundle. @kennethnym please keep Homebrew/homebrew-core#297372 on hold until that release and a zeromq.js release containing #737 are available.

fettpl avatar Aug 08 '26 07:08 fettpl

Full status update — 2026-08-09

Current disposition

Homebrew/homebrew-core#297372 remains the single official submission. It is open and mergeable but correctly blocked; no duplicate formula should be opened. The current v0.7.0 formula must not merge because it ships the broken Bedrock bundle, predates Homebrew ownership handling, and retains the statically linked packaged ZeroMQ addon.

Completed Prime Agent work

  • #846 merged with all checks passing and closed #844. Homebrew Cellar installs are now detected as Homebrew-managed, self-update is suppressed, and users are directed to brew upgrade prime-agent.
  • This fix is not in v0.7.1: the v0.7.1 tag targets 95afd319, while #846 merged afterward as 10fb172b.
  • A local formula prototype has already passed brew test, brew linkage --test, brew audit --strict --new --online, and brew style. It builds zeromq.js against Homebrew zeromq, loads a Pair socket, and links /opt/homebrew/opt/zeromq/lib/libzmq.5.dylib.

Remaining Prime Agent release blocker

  • #751 affects both v0.7.0 and v0.7.1. The published v0.7.1 asset (sha256:d68612c83239caafab72cc76c55ac572bfd07a059ea8fbd2a3ddbe1f2b55dcdb) still lacks dist/bundle/amazon-bedrock.js.
  • The confirmed cause is structural rather than the resolved registry incident in #651: importNodeOnlyProvider(specifier) hides the Bedrock import from esbuild, so rebuilding the same source would not emit the missing entry.
  • #860 implements the source fix by adding Bedrock as an explicit esbuild entry and checking emitted node-only provider assets. It is open and mergeable, but review is required and its fork-originated CI run is awaiting approval: run 31189426821.
  • #751 should remain open until a new stable artifact is published and verified, not merely until #860 merges. Closure evidence should confirm that the release tarball contains dist/bundle/amazon-bedrock.js, imports streamBedrock and streamSimpleBedrock, includes #846, and is immutable across the GitHub and R2 distribution paths.

zeromq.js dependency

  • zeromq/zeromq.js#737 restores zmq_shared=true, skips vcpkg for system libzmq, and links through pkg-config.
  • Its CI stabilization also pinned vcpkg and pnpm, replaced retired GitHub runner labels, and stopped the Package job from redundantly rebuilding native code.
  • The final CI run is fully green across all Build, Package, and SmokeTest jobs. @aminya approved the PR; it is clean and mergeable.
  • #737 still needs to merge and be published. The latest zeromq.js release remains v6.5.0, which does not contain this fix; zeromq/zeromq.js#736 therefore remains open.

Homebrew formula changes after both releases

@kennethnym can then update Homebrew/homebrew-core#297372 to:

  • use the corrected stable Prime Agent version and immutable SHA256;
  • add cmake, ninja, and pkgconf as build dependencies plus zeromq as a runtime dependency;
  • build with npm_config_zmq_shared=true and the required macOS deployment target;
  • remove CMake staging output and retain the compiled platform addon with its sanitized runtime manifest;
  • rerun the full Homebrew CI matrix and local strict audit, style, test, linkage, and runtime checks.

Required maintainer actions

  1. @badlogic: approve CI for #860, review and merge it, then publish a corrected stable Prime Agent release containing both #846 and #860. Please also decide whether release artifacts should include an npm shrinkwrap or another deterministic dependency record; the current release tarball contains neither.
  2. @aminya: merge zeromq.js#737 and publish a release that downstream packaging can consume.
  3. @kennethnym: update the existing Homebrew PR after those releases; please keep the current formula on hold until then.

After the formula merges, the final acceptance pass will install the official formula cleanly and verify version/help output, runtime Pair socket behavior, linkage to Homebrew libzmq, brew test, audit/linkage behavior, and package-manager-owned updates. Results will be reported here before the coordination issue is closed.

fettpl avatar Aug 09 '26 08:08 fettpl

Status delta — 2026-08-09

The zeromq source-side blocker is resolved. Downstream consumption still requires a zeromq.js release newer than v6.5.0 containing 13aa9265.

@aminya please publish that release when ready. After it is available, Prime Agent can consume it and @kennethnym can update Homebrew/homebrew-core#297372 alongside the corrected Prime Agent release. The remaining Prime Agent blocker is #860 / #751.

fettpl avatar Aug 09 '26 14:08 fettpl

Status delta — 2026-08-10

  • A new #751 report independently confirms the v0.7.1 defect on Windows using the published artifact checksum: dist/bundle/amazon-bedrock.js is absent there as well.
  • The impact is broader than explicit Bedrock configuration. With no provider selected, the presence of an AWS credential environment variable such as AWS_PROFILE can auto-detect Bedrock and make an otherwise unrelated invocation fail while loading the missing bundle asset.
  • The implementation gate is unchanged: #860 remains open and mergeable, but review is required and run 31189426821 remains action_required.
  • No corrected Prime Agent release or zeromq.js release has appeared. The latest versions remain Prime Agent v0.7.1 and zeromq.js v6.5.0. Homebrew/homebrew-core#297372 is unchanged at v0.7.0 and remains on hold.

@badlogic please approve the fork workflow, review and merge #860, and publish the corrected stable release. Release acceptance should keep #751 open until the published archive contains and imports the Bedrock entry; the new report also makes a no-explicit-provider startup with an AWS environment variable a useful regression smoke test.

fettpl avatar Aug 10 '26 07:08 fettpl

I will publish the new zeromq by tomorrow. I'll use the binaries from the last release to de-risk the release. Only the cmake change will ship to the users.

aminya avatar Aug 10 '26 07:08 aminya

Status delta — 2026-08-11

  • @aminya confirmed that a new zeromq.js release is planned, reusing the previous release binaries while shipping the CMake shared-build change. The latest published release is still v6.5.0 at this check.
  • Reusing upstream prebuilds does not block the Homebrew path because the formula will force a source build. After publication, acceptance will verify that the released package contains the 13aa9265 CMake change, honors npm_config_zmq_shared=true, and produces an addon dynamically linked to Homebrew libzmq.
  • #751's title now correctly covers both v0.7.0 and v0.7.1. Its implementation state is unchanged: #860 is open and mergeable, review is required, and its fork workflow remains action_required.
  • Prime Agent v0.7.1 remains the latest release, and Homebrew/homebrew-core#297372 remains unchanged at v0.7.0.

Next actions remain with @aminya to publish the zeromq.js release and @badlogic to approve, review, and merge #860 before publishing a corrected Prime Agent release. @kennethnym should keep the existing Homebrew PR on hold until both released artifacts pass verification.

fettpl avatar Aug 11 '26 07:08 fettpl

Status delta — 2026-08-12

  • zeromq.js v6.6.0 is published. The release includes merge commit 13aa9265, and the npm registry now serves [email protected] with integrity sha512-jo4gsieYiiAoETZnNd1x932QOyMJUY/ixLQZ10dAO5VxIu1PSWbKq+a2EdO1MJAgYjmrscwpm8LU5PvU7edIXQ==.
  • I inspected the published npm tarball. Its CMakeLists.txt defines ZMQ_SHARED, reads npm_config_zmq_shared, skips vcpkg when enabled, resolves libzmq through pkg-config, and links PkgConfig::ZeroMQ. The zeromq release blocker is resolved.
  • Prime Agent v0.7.2 is also published from 83a0f9f. It includes #846, so the Homebrew ownership fix is now released.
  • The v0.7.2 Prime Agent artifact is still not acceptable for Homebrew. The GitHub and R2 tarballs are byte-identical (sha256:bc5471f2a626d727b88a45eb745fff93b10c554a3c4fc5912f25d8c64b987f5e), but both omit dist/bundle/amazon-bedrock.js while chunk-PMFPRFOT.js still calls importNodeOnlyProvider("./amazon-bedrock.js"). #751 therefore also affects v0.7.2.
  • #860 remains open and mergeable but blocked on review; run 31189426821 is still action_required. Homebrew/homebrew-core#297372 is unchanged at v0.7.0 and remains blocked.

@badlogic please approve the fork workflow, review and merge #860, and publish a new stable release containing it. That release must be artifact-verified before #751 closes. @kennethnym can then update the existing Homebrew PR to the corrected Prime Agent release and build its now-available [email protected] dependency with npm_config_zmq_shared=true.

fettpl avatar Aug 12 '26 07:08 fettpl

Hi, thanks for taking the time to report this! Since open sourcing Prime Agent, we’ve received far more Issues than we can reliably triage and maintain. Rather than leave a large backlog that we cannot meaningfully work through, we’re closing the current Issue queue and moving to a discussion-first process.

We have established new contribution guidelines to help us continue iterating on Prime Agent and better manage contributions from the community. Going forward, GitHub Issues will be our maintainer work queue rather than the initial place for public reports and requests. Bug reports, feature requests, questions, and other feedback should begin in GitHub Discussions. Please read the full process documented in our contribution guidelines. Security vulnerabilities should continue to be reported privately according to our security policy.

While we’re closing this backlog, we’re still reviewing it at a high level to identify recurring bugs, useful ideas, and important problems that we should address ourselves. Thanks again for the time you put into this!

kevinjosethomas avatar Aug 15 '26 01:08 kevinjosethomas

Status delta — 2026-08-15

  • Prime Agent's issue/PR queue migration closed this coordination issue, #751, and #860. The closures are administrative, not resolutions: v0.7.2 still omits dist/bundle/amazon-bedrock.js, and #860 was closed without merging its fix.
  • The new contribution guidelines require public reports and implementation proposals to begin in GitHub Discussions.
  • I searched the active Discussions and found no existing Bedrock bundle report, then opened Discussion #1410 with the v0.7.0-v0.7.2 artifact evidence, cross-platform impact, #860 root cause and patch, Homebrew dependency, and release acceptance criteria.
  • [email protected] remains ready. Homebrew/homebrew-core#297372 is still open and unchanged at v0.7.0; it remains blocked on a corrected Prime Agent release.

Active coordination now moves to Discussion #1410. @badlogic @kevinjosethomas need to accept the bug into the maintainer work queue and either invite the existing focused patch or implement it internally. @kennethnym should keep the existing Homebrew PR on hold until a corrected release passes artifact verification.

fettpl avatar Aug 15 '26 07:08 fettpl