ReviewOS

home-lang/home

Finish native Bun publish and pack command activation

#186
Closed chris opened this 10 days ago ·
10 days ago

Parent: #66 Follow-up to #185.

The untouched Bun publish corpus is covered by Home's deterministic registry/runtime layer, but the copied native PublishCommand is not yet safe to expose as home publish.

Confirmed activation boundary

Routing the command from src/main.zig reaches Bun's copied publish and pack implementation, then compilation exposes its remaining pre–Zig 0.17 filesystem/writer dependencies:

  • PackCommand still names std.fs.Dir and std.fs.openDirAbsoluteZ
  • nested directory/file operations require conversion to Home's bun.FD / Zig 0.17 std.Io.Dir ownership model
  • publish request/header writers require explicit WriteFailed to OOM translation
  • native HTTP publish must be verified against a local registry, including auth, OTP, README metadata, lifecycle scripts, tarballs, and republish checks

The temporary top-level route was removed rather than shipping a command that compiles only partially or traps at runtime.

Acceptance

  • finish the pack/filesystem Zig 0.17 port without compatibility stubs
  • expose home publish and its help/error paths
  • execute publish against a real local registry path, not only the corpus model
  • cover workspace and tarball publication plus registry error handling
  • keep #185's exact 34/34 corpus result green
  • pass the full Home gate and update #66
10 days ago

Native pack is complete on main in eb386e92a.

The canonical home pm pack spelling now reaches PackageManagerCommand and the copied native PackCommand. The real bun:internal-for-testing readTarball host binding replaces its no-op stub, with its file access ported to Home's Zig 0.17 native file API. Bun's newer Rust archive-name hardening is also ported: package name/version values reject ./.. path components, backslashes, colons, and NUL before forming a destination filename.

Fresh validation:

  • ReleaseFast build: 46/46 steps
  • Unchanged cli/install/bun-pack.test.ts: 71/71 tests, 546 assertions
  • 0 failures, unsupported cases, skips, or TODOs
  • Coverage includes real archive contents/digests, traversal rejection, flags, workspaces, lifecycle scripts, bundled dependencies, files/ignore rules, bins, and Unicode
  • No corpus assertion, workload, timeout, skip, or expected outcome changed

#186 remains open for the publish half: real local-registry publication, authentication/OTP, workspace/tarball publication, metadata, lifecycle behavior, republish handling, and the unchanged publish corpus.

10 days ago

Completed on main in e4331122894230efdac36773dfcf03dee71c1f71 (fix(cli): complete native publish flow), authored and committed by Chris Breuer without coauthors.

The final activation ports Bun's complete generated CI-provider table into the native runtime, so publish user agents carry the same provider suffixes as Bun, and flushes the native publish/pack output buffer before the process returns. This builds on the already-landed native pm pack routing, real tarball reader, Zig 0.17 file ownership port, and current archive-name traversal validation.

Verification against pinned Bun source/artifacts at 4982b91e3702094330f3be3883354c52b8c01323:

  • ReleaseFast JSC build: 46/46 steps succeeded.
  • Unchanged cli/install/bun-publish.test.ts, using its real local Verdaccio registry: 34/34 tests, 224 assertions, zero failures. This covers auth and OTP flows, notices, CI user agents, directory/tarball/scoped/workspace publication, binary and dependency installs, dry-run, lifecycle scripts, prepublish version mutation, private-package rejection, access/tag behavior, npm lifecycle environment, README metadata, and republish handling.
  • Unchanged cli/install/bun-pack.test.ts with HOME_NATIVE_VM=1: 71/71 tests, 546 assertions, zero failures.
  • Unchanged cli/install/bun-upgrade.test.ts with HOME_NATIVE_VM=1: 7/7 tests, 16 assertions, zero failures.
  • git diff --check passed; the pushed SHA exactly matches origin/main.

No corpus assertion, workload, deadline, skip, snapshot, or expected outcome changed. The generated Verdaccio state was removed after verification. All acceptance items are complete, so this issue can close. Parent parity tracking continues in #66.

Sign in to comment on this issue.