study-distribute-wg

Study: distribute wg as a platform-agnostic binary via npm

Metadata

Statusdone
Assignedagent-799
Agent identity02e879681e52e0a384106169be043416c4d946e850ab26b2269c57681b52a6e7
Created2026-07-25T13:24:03.025895581+00:00
Started2026-07-25T20:37:01.544822661+00:00
Completed2026-07-25T20:48:18.816667947+00:00
Tagsresearch, design, packaging, distribution
Tokens1235591 in / 21355 out

Description

Objective

Study whether and how the WG Rust binary can be cross-compiled to per-target platform binaries and distributed via npm, so users can install/run WG without a Rust toolchain.

Research questions

  • Cross-compile targets: the set of host triples to ship (macOS arm64/x64, Linux x64/arm64, Windows x64, maybe musl). Tooling: cargo-zigbuild / cross / cargo-dist / GitHub Actions matrix. Static vs dynamic linking (glibc/musl); code-signing + notarization for macOS; Authenticode/Sigstore for Windows.
  • npm packaging shape: an npm driver package that detects the host triple and dispatches to an optional-dependencies per-platform package (the common @scope/cli pattern), vs a postinstall binary download, vs a single package bundling all binaries. Pros/cons, offline use, integrity verification (checksums, provenance/SLSA), supply-chain safety.
  • Precedent: the pi-worksgood embed model (worksgood-pi/embedded committed bytes) — can the same idea carry a binary, or does npm need real per-platform artifacts?
  • Versioning/release: how wg version + compat consts map to npm semver; how cargo install --path . --locked relates to an npm-distributed binary; CI to publish on tag.
  • Tradeoffs vs current cargo install: first-run speed, update cadence, signature/trust, size, and whether the npm binary is the same artifact or a thin wrapper.

Inputs

  • Cargo.toml, .github/workflows/ci.yml (current build/release), rust-toolchain.toml
  • worksgood-pi/embedded (byte-embed precedent)
  • npm/cross-compile tooling docs (cargo-zigbuild, cross, cargo-dist, per-platform optional-dependencies pattern) — web research

Deliverable

docs/studies/wg-npm-distribution-design.md

Validation

  • Design doc committed at docs/studies/wg-npm-distribution-design.md
  • Enumerates target triples + chosen cross-compile toolchain with rationale
  • Picks an npm packaging shape (per-platform optional-deps vs postinstall vs single) with pros/cons and an integrity-verification story
  • Addresses signing/notarization and supply-chain provenance
  • Defines the CI release flow on tag and how wg version/compat maps to npm semver

Depends on

Required by

Log