Skip to content

[SDK] Ship per-platform native binaries via optional-dependency packages (#512) - #567

Closed
Gudge (MGudgin) wants to merge 6 commits into
mainfrom
user/gudge/mxc-512-phase6-tests-docs
Closed

Gudge (MGudgin) wants to merge 6 commits into
mainfrom
user/gudge/mxc-512-phase6-tests-docs

Conversation

@MGudgin

@MGudgin Gudge (MGudgin) commented Jun 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Makes @microsoft/mxc-sdk install only the host platform's native binaries by
splitting the executor payload into five per-platform packages
(@microsoft/mxc-sdk-<os>-<arch>) referenced as exact-pinned, os/cpu-filtered
optionalDependencies of a binary-free meta package. An install pulls just the
matching host's payload instead of every platform's binaries.

Presented as six reviewable commits (scaffold → discovery → build scripts →
meta/manifest → pipeline → tests/docs), intended to land as a single
squash-merge: the phases are a review-time decomposition, not independently
shippable units — dropping the bundled bin/ for optionalDependencies is only
safe alongside the publishing pipeline, so the series must merge atomically to
avoid a binary-less main.

Closes #512

Details

  • Five platform packages: win32-x64, win32-arm64, linux-x64,
    linux-arm64, darwin-arm64. Intel macOS (darwin-x64) is intentionally not
    shipped. The win32-arm64 manifest ships only the arch-independent payload —
    the micro-VM payload (nanvixd + kernel assets) is x64-only because nanvixd
    is an x64 binary.
  • Fixes a pre-existing wslc_common/build.rs path bug (the committed WSLC SDK
    nupkg at repo-root external/wslc-sdk was resolved two levels too shallow
    after the crate moved under src/backends/wslc/common, so wslcsdk.dll was
    silently never built). With the path corrected the wslc feature build now
    stages wslcsdk.dll into the release dir so it ships in the win32 packages.
  • Fail-closed runtime resolver (platform.ts): in an installed tree (root under
    node_modules, case-insensitive) the executor is sourced ONLY from
    MXC_BIN_DIR or the identity/version-validated installed platform package —
    planted binaries in legacy bin/<arch> or src/target paths are never
    executed, and a planted ../src/Cargo.toml cannot re-enable dev mode. The
    bundler/CJS sibling fallback fails closed when the meta version is unreadable
    (a name-only match is not trusted). SUPPORTED_TUPLES is the single source of
    truth. An explicit executablePath is honored before the unsupported-platform
    gate (both the low-level resolver and the public resolveExecutableAndArgs).
  • Build scripts stage each host's binaries into its platform package and
    fail-fast on a missing mandatory component. The Windows CI build derives the
    shipped payload from the manifest files allowlist
    (scripts/platform-package-payload.js), stages it preserving the
    bin/+snapshots/ substructure from an absolute workspace-rooted target path,
    and hard-fails on a missing artifact. The official ADO Windows build stages the
    same manifest payload (manifest-driven, node-free), closing the gap where it
    previously copied only signPattern + wslcsdk.dll. Dev/test-only helpers
    (proxies, diagnostic console) are excluded from packages.
  • The meta package drops bundled bin/, gains the five optionalDependencies,
    and ships a non-failing postinstall that warns when the host's platform
    package is absent OR installed without its native binary.
    sync-platform-package-versions.js keeps manifests + pins in lockstep
    (CI --check).
  • Release pipeline builds, packs, and publishes the five platform packages plus
    the meta package. The filesystem-canonical release-completeness gate treats
    sdk/platform-packages as the source of truth: rejects an empty set, requires
    the meta to pin exactly those packages at their versions, requires every
    expected tarball, verifies every manifest files payload entry is actually
    staged on disk
    (so npm pack cannot silently omit a binary), hard-fails on
    a malformed platform manifest
    , and rejects ANY stray .tgz (recursive scan).
  • The builtin test-proxy resolver
    (linux_proxy_coordinator::resolve_sibling_binary) now honors
    MXC_TEST_PROXY_DIR before falling back to a sibling of the executor, so the
    builtinTestServer E2E proxy can be sourced out-of-band on Linux — the
    dev/test-only linux-test-proxy is intentionally NOT shipped in the
    per-platform package, and co-locating it would trip the package-hygiene tests.
  • Docs (sdk/README.md, copilot-instructions.md, playground) describe the
    per-platform delivery model, cross-arch install via npm --os/--cpu, and the
    production-vs-dev resolver order.

Tests

  • SDK unit suite: 276 tests, 269 pass / 7 skip / 0 fail — resolver
    fail-closed paths (planted-competing-binary, unreadable-version, dev preference
    order, identity/version validation, sibling fallback), packaging matrix bound
    bidirectionally to SUPPORTED_TUPLES, micro-VM x64-only payload assertions,
    postinstall warn/skip/unsupported + installed-but-binary-less warning +
    runPostinstall CLI seam, explicit-executablePath escape hatch on an
    unsupported host (both resolver entry points), proxy-availability fail-closed.
  • Script tests: release-completeness incl. nested-stray-.tgz, on-disk payload
    verification, malformed-manifest hard-fail, payload helper, version-sync.
    sync --check OK. tsc --noEmit clean.
  • Not verified locally (CI-only): the ADO Rust.Build.Job.yml
    manifest-driven payload-staging step (ESRP/agent environment is pipeline-only).
    The on-disk release-completeness gate is the safety net — a deficient package
    fails the release loudly rather than publishing silently.

Copilot AI balanced review requested due to automatic review settings June 24, 2026 23:49
@MGudgin
Gudge (MGudgin) requested a review from a team as a code owner June 24, 2026 23:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the @microsoft/mxc-sdk distribution model so the meta package ships no native executors, and instead pulls exactly one host-matching per-platform package (@microsoft/mxc-sdk-<os>-<arch>) via optionalDependencies. It also updates runtime binary resolution to be fail-closed in production installs and updates build/CI/release validation to ensure platform packages are correctly staged and published.

Changes:

  • Split native payload into five per-platform npm packages and pin them as optionalDependencies from the meta SDK package.
  • Update SDK binary discovery (platform.ts/helper.ts) to trust only MXC_BIN_DIR or an identity/version-validated platform package in production.
  • Update build scripts, CI pipelines, tests, and docs to stage/pack/verify per-platform artifacts (including release-completeness gates).
Show a summary per file
File Description
tests/playground/src/main/main.ts Updates microvm binary search path to the new sdk/platform-packages/<tuple> layout.
sdk/tests/unit/sandbox.test.ts Adds unit tests for missing-binary diagnostics and executablePath escape hatch behavior.
sdk/tests/unit/proxy-availability.test.ts Adds unit coverage for proxy availability decision logic.
sdk/tests/unit/postinstall.test.ts Adds unit coverage ensuring postinstall tuple set stays in sync and warnings behave as intended.
sdk/tests/unit/platform.test.ts Adds extensive unit coverage for per-platform package resolution, dev-vs-prod behavior, and fail-closed guarantees.
sdk/tests/unit/packaging.test.ts Adds packaging-matrix tests binding on-disk platform packages to SUPPORTED_TUPLES and validating meta/package manifests.
sdk/tests/integration/windows-process-container.test.ts Skips proxy E2E tests when proxy binaries are not available post-split.
sdk/tests/integration/test-helpers.ts Refactors integration test helpers to separate shipped executors from test-only proxy binaries.
sdk/tests/integration/proxy-availability.ts Introduces pure proxy-availability evaluation used by integration tests (and unit-tested).
sdk/tests/integration/package.test.ts Updates integration packaging assertions for per-platform packages and ensures meta has no bin/.
sdk/tests/integration/linux-bubblewrap.test.ts Adds proxy availability gating for Bubblewrap proxy E2E tests.
sdk/src/platform.ts Implements per-platform package resolution, tuple support gating, dev/prod modes, and platform-package identity/version validation.
sdk/src/helper.ts Improves missing-binary errors, and adjusts platform gating to honor explicit executablePath earlier.
sdk/scripts/postinstall-check.cjs Adds non-failing postinstall warning logic for missing/unsupported platform package scenarios.
sdk/README.md Documents per-platform binary delivery model and resolver precedence (dev vs production).
sdk/platform-packages/win32-x64/README.md Adds platform-package readme (win32-x64).
sdk/platform-packages/win32-x64/package.json Adds platform-package manifest with explicit files allowlist and prepack guard (win32-x64).
sdk/platform-packages/win32-arm64/README.md Adds platform-package readme (win32-arm64).
sdk/platform-packages/win32-arm64/package.json Adds platform-package manifest with explicit files allowlist and prepack guard (win32-arm64).
sdk/platform-packages/linux-x64/README.md Adds platform-package readme (linux-x64).
sdk/platform-packages/linux-x64/package.json Adds platform-package manifest (linux-x64) including libc: glibc.
sdk/platform-packages/linux-arm64/README.md Adds platform-package readme (linux-arm64).
sdk/platform-packages/linux-arm64/package.json Adds platform-package manifest (linux-arm64) including libc: glibc.
sdk/platform-packages/darwin-arm64/README.md Adds platform-package readme (darwin-arm64).
sdk/platform-packages/darwin-arm64/package.json Adds platform-package manifest (darwin-arm64).
sdk/platform-packages/.gitignore Ensures only manifests/READMEs are tracked and binaries remain uncommitted.
sdk/package.json Removes bin/ from shipped files, adds postinstall check, and introduces platform-package optional deps.
sdk/package-lock.json Records optional dependency stubs and marks the package as having an install script.
scripts/sync-platform-package-versions.test.js Adds unit tests for platform-package version/pin syncing.
scripts/sync-platform-package-versions.js Adds tooling to stamp/check platform package versions and meta optionalDependency pins.
scripts/platform-package-payload.test.js Adds unit tests for deriving staged payload file lists from platform manifests.
scripts/platform-package-payload.js Adds helper to derive payload files from a platform package’s files allowlist.
scripts/check-release-completeness.test.js Adds unit tests for release completeness checks (pins, tarballs, malformed manifests, payload staging).
scripts/check-release-completeness.js Adds a canonical release-completeness gate for platform packages and produced tarballs.
README.md Updates build output description to reflect staging into sdk/platform-packages/<tuple>/.
docs/macos-support/seatbelt-backend.md Updates macOS dev binary discovery docs to the new platform-packages layout.
build.sh Stages Linux executors into sdk/platform-packages/linux-<arch> and adds version-sync check/stamp.
build.bat Stages Windows executors into sdk/platform-packages/win32-<arch> and adds version-sync check/stamp.
build-mac.sh Stages macOS executor into sdk/platform-packages/darwin-<arch> (when shipped) and adds version-sync check/stamp.
.github/workflows/Versioning.Checks.Job.yml Adds CI validation/tests for version-sync and release-completeness logic.
.github/workflows/SDK.Integration.Test.Job.yml Updates CI to install meta + host platform tarballs explicitly and wires proxy artifacts for Linux.
.github/workflows/Package.NpmSdk.Job.yml Packs meta and platform packages separately and adds a release-completeness verification step.
.github/workflows/Build.Windows.Job.yml Stages shipped payload from platform manifest allowlist and uploads manifest-driven artifacts.
.github/copilot-instructions.md Documents the new SDK packaging model, resolver behavior, and version-sync tooling.
.azure-pipelines/templates/SDK.Integration.Test.Job.yml Updates ADO integration tests to install meta + platform tarballs and provide proxy artifacts on Linux.
.azure-pipelines/templates/Rust.Build.Job.yml Adds manifest-driven staging for Windows payload to avoid silent omissions.
.azure-pipelines/templates/Package.NpmSdk.Job.yml Updates ADO packaging to stage/pack per-platform packages and run release completeness gate.
.azure-pipelines/templates/1ES.Build.Stages.yml Wires per-platform packaging parameters through the 1ES stage template.
.azure-pipelines/README.md Documents the new platform-first/meta-last publishing flow and operational constraints.
.azure-pipelines/1ES.Release.yml Publishes platform packages before the meta package in ESRP.

Copilot's findings

Files not reviewed (1)
  • sdk/package-lock.json: Generated file
  • Files reviewed: 49/50 changed files
  • Comments generated: 3

Comment thread sdk/node/src/helper.ts Resolved
Comment thread sdk/tests/integration/test-helpers.ts Resolved
Comment thread sdk/node/package.json Resolved
Comment thread sdk/src/platform.ts Resolved
Comment thread sdk/src/platform.ts Resolved
Comment thread sdk/src/platform.ts Resolved
Comment thread sdk/tests/unit/platform.test.ts Resolved
Comment thread sdk/tests/unit/platform.test.ts Resolved

@dhoehna Darren Hoehna (dhoehna) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking through this PR I feel that some of the code can be de-duplicated. However, I don't know enough of the build system to understand where or how to make that happen.

Otherwise the code looks sound to me. Just a few comments.

@bbonaby

Copy link
Copy Markdown
Collaborator

Gudge (@MGudgin) I'm thinking we should split this up a bit. Perhaps it would be good for us to have a design of how we want this to look like first. When I initially thought about the optional-dependency packages, my thought was that we wouldn't need this much change.

That said we currently use ESRP release publishing to publish a single npm package. I'd have to check if we can publish multiple packages through that service or if there is anything extra they need to configure for us on the backend to do that.

@MGudgin

Copy link
Copy Markdown
Member Author

Gudge (@MGudgin) I'm thinking we should split this up a bit. Perhaps it would be good for us to have a design of how we want this to look like first. When I initially thought about the optional-dependency packages, my thought was that we wouldn't need this much change.

That said we currently use ESRP release publishing to publish a single npm package. I'd have to check if we can publish multiple packages through that service or if there is anything extra they need to configure for us on the backend to do that.

This PR is a squash of the following branches;

https://github.com/microsoft/mxc/tree/user/gudge/mxc-512-phase1-scaffold
https://github.com/microsoft/mxc/tree/user/gudge/mxc-512-phase2-discovery
https://github.com/microsoft/mxc/tree/user/gudge/mxc-512-phase3-build-scripts
https://github.com/microsoft/mxc/tree/user/gudge/mxc-512-phase4-meta-manifest
https://github.com/microsoft/mxc/tree/user/gudge/mxc-512-phase5-pipeline
https://github.com/microsoft/mxc/tree/user/gudge/mxc-512-phase6-tests-docs

if you want to see smaller diffs.

@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/mxc-512-phase6-tests-docs branch from 2638e49 to 0ddf92c Compare July 2, 2026 16:55
@dhoehna

Darren Hoehna (dhoehna) commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for addressing all my comments. I am concerned with the empty catch. We can discuss options around it.

@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/mxc-512-phase6-tests-docs branch from 0ddf92c to 7cb3760 Compare July 11, 2026 20:47
Comment thread sdk/node/src/helper.ts Resolved
Comment thread .azure-pipelines/1ES.Release.yml Resolved
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/mxc-512-phase6-tests-docs branch from 7cb3760 to a317cc0 Compare July 23, 2026 17:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

Files not reviewed (1)
  • sdk/node/package-lock.json: Generated file
Suppressed comments (6)

.azure-pipelines/README.md:74

  • Both lockfile paths are missing the node/ component. The changed package and lockfile live in sdk/node, so the documented bootstrap command from sdk/ targets the wrong directory.
  packages exist on the registry, `sdk/package-lock.json` records them as stubs
  with no `resolved`/`integrity` (you cannot hash an unpublished tarball). After
  the **first** successful publish, run `npm install --package-lock-only` in
  `sdk/` and commit the lockfile so the optional-dep entries gain

sdk/node/tests/integration/test-helpers.ts:156

  • When the helper discovers a local proxy under src/target, it reports the proxy as available but never exposes that directory to the executor. Because the dev resolver now prefers the staged platform-package executor, unix-test-proxy is no longer its sibling; builtin proxy tests therefore start and then fail unless the user manually set MXC_TEST_PROXY_DIR. Propagate the discovered directory before spawning so a normal local build remains sufficient.
    sdk/node/tests/integration/windows-process-container.test.ts:132
  • This availability gate now lets the suite run with wxc-test-proxy.exe supplied out of band, but the builtin test below still launches it through process_util::resolve_sibling_binary, which only searches beside wxc-exec.exe. Since this PR moves the executor into the platform package and intentionally excludes the proxy, the builtin test fails even when MXC_TEST_PROXY_DIR is set. Extend the Windows/AppContainer proxy resolver to honor that variable as the Unix resolver now does.
    .github/workflows/Versioning.Checks.Job.yml:27
  • The new platform-package-payload.test.js suite is not invoked by this workflow (or any other test command), so its manifest-validation tests never run in CI. Add it alongside the other new script suites.
      - name: Test release-completeness logic
        run: node --test scripts/check-release-completeness.test.js

.azure-pipelines/README.md:51

  • The pipeline actually stages packages under sdk/node/platform-packages; this path omits node/ and contradicts the updated build scripts.

This issue also appears on line 71 of the same file.

- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
  `sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync
  (`scripts/sync-platform-package-versions.js --check`), packs the meta package

sdk/node/README.md:22

  • This dev-layout path omits the node/ directory; the packages are staged under sdk/node/platform-packages, so following this documented resolver order points developers at a nonexistent location.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →
> `src/target/<triple>/{release,debug}` → the installed package, so a fresh
  • Files reviewed: 51/52 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/mxc-512-phase6-tests-docs branch from e0055c2 to fff31c8 Compare August 1, 2026 18:56
Copilot AI review requested due to automatic review settings August 3, 2026 14:15
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/mxc-512-phase6-tests-docs branch from fff31c8 to eae492f Compare August 3, 2026 14:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

Files not reviewed (1)
  • sdk/node/package-lock.json: Generated file
Suppressed comments (5)

.azure-pipelines/README.md:75

  • Both the lockfile path and the directory for the refresh command are missing node/. The changed files are sdk/node/package-lock.json and sdk/node/, so this recovery procedure currently directs release operators to the wrong location.
- **Lockfile integrity is bootstrapped at first publish.** Until the platform
  packages exist on the registry, `sdk/package-lock.json` records them as stubs
  with no `resolved`/`integrity` (you cannot hash an unpublished tarball). After
  the **first** successful publish, run `npm install --package-lock-only` in
  `sdk/` and commit the lockfile so the optional-dep entries gain
  `resolved`/`integrity`; subsequent `npm ci` then verifies the native-binary

sdk/node/tests/integration/windows-process-container.test.ts:133

  • This single gate treats a proxy found via MXC_TEST_PROXY_DIR as sufficient for both tests, but only the external-proxy test launches that path directly. The built-in test asks wxc-exec to launch wxc-test-proxy.exe, and src/backends/appcontainer/common/src/proxy_coordinator.rs:354 still uses process_util::resolve_sibling_binary, which searches only beside the executor. With the proxy intentionally absent from the installed platform package, builtinTestServer therefore fails even though this gate enabled the suite. Teach the Windows built-in resolver to honor the test-proxy directory, or gate that test separately.
    .github/workflows/Versioning.Checks.Job.yml:27
  • The new platform-package-payload.test.js suite is not invoked by this workflow (and no other CI reference exists), so its manifest-validation tests never run. Add it alongside the other script test suites.
      - name: Test release-completeness logic
        run: node --test scripts/check-release-completeness.test.js

sdk/node/README.md:21

  • This documented dev path omits the node/ component. The resolver and build scripts use sdk/node/platform-packages/<os>-<arch>, so following this path points users to a directory that does not exist.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →

.azure-pipelines/README.md:50

  • The pipeline stages packages under sdk/node/platform-packages, not sdk/platform-packages; this path conflicts with the implementation and the root README.

This issue also appears on line 70 of the same file.

- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
  `sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync
  • Files reviewed: 51/52 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings August 3, 2026 15:53
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/mxc-512-phase6-tests-docs branch from eae492f to d6779e2 Compare August 3, 2026 15:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

Files not reviewed (1)
  • sdk/node/package-lock.json: Generated file
Suppressed comments (5)

.azure-pipelines/README.md:80

  • These first-publish and recovery instructions point to sdk/package-lock.json / sdk/package.json and tell users to run npm in sdk/, but the npm package is rooted at sdk/node. Following this runbook will not update the actual SDK lockfile or manifest.
- **Lockfile integrity is bootstrapped at first publish.** Until the platform
  packages exist on the registry, `sdk/package-lock.json` records them as stubs
  with no `resolved`/`integrity` (you cannot hash an unpublished tarball). After
  the **first** successful publish, run `npm install --package-lock-only` in
  `sdk/` and commit the lockfile so the optional-dep entries gain

sdk/node/src/helper.ts:374

  • MicroVM is now shipped only for Windows x64, but this path still accepts native Windows ARM64 and tries to resolve the x64-only companion package. That package cannot install on win32-arm64, and nanvixd.exe cannot run there, so fail at the SDK boundary with an accurate platform error instead of the misleading “install ...-win32-x64” diagnostic.
    sdk/node/README.md:21
  • The staged development packages live under sdk/node/platform-packages, not sdk/platform-packages. This public resolver-order documentation currently sends developers to a nonexistent path.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →

.azure-pipelines/README.md:55

  • The pipeline stages into sdk/node/platform-packages (Package.NpmSdk.Job.yml), so this runbook path is missing the node component.

This issue also appears on line 76 of the same file.

- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
  `sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync

sdk/node/scripts/postinstall-check.cjs:66

  • On an unsupported host, setting MXC_BIN_DIR alone does not avoid the platform gate in resolveExecutableAndArgs; callers must also set skipPlatformCheck (or provide options.executablePath). As written, this install-time recovery instruction still leads to the same exception.
  • Files reviewed: 55/56 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings August 11, 2026 15:16
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/mxc-512-phase6-tests-docs branch from d6779e2 to 0833d4b Compare August 11, 2026 15:16
@MGudgin
Gudge (MGudgin) requested a review from a team August 11, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

Files not reviewed (1)
  • sdk/node/package-lock.json: Generated file
Suppressed comments (7)

.azure-pipelines/README.md:80

  • These lockfile instructions point to sdk/package-lock.json and sdk/, but the npm project and lockfile are under sdk/node/. Following the current runbook executes in the wrong directory and cannot refresh the platform-package integrity entries.
- **Lockfile integrity is bootstrapped at first publish.** Until the platform
  packages exist on the registry, `sdk/package-lock.json` records them as stubs
  with no `resolved`/`integrity` (you cannot hash an unpublished tarball). After
  the **first** successful publish, run `npm install --package-lock-only` in
  `sdk/` and commit the lockfile so the optional-dep entries gain

.azure-pipelines/README.md:87

  • The version-bump path is sdk/node/package.json, not sdk/package.json. The current recovery command references a nonexistent manifest.
  is not atomic: if it fails after publishing some platform packages, those
  versions are immutable (re-publishing the same version returns `403`). Recover
  by bumping the version (`src/Cargo.toml` + `sdk/package.json`, then
  `node scripts/sync-platform-package-versions.js`) and re-running the release.

sdk/node/src/helper.ts:374

  • On a Windows ARM64 host, the tuple is considered supported and the abstract microvm intent bypasses the concrete-backend availability check, so this routes the request to the x64-only NanVix companion and ultimately tells the user to install a package npm cannot install on ARM64. Reject non-x64 MicroVM requests before selecting the NanVix runtime.
    sdk/node/src/platform.ts:920
  • This accepts any wxc-exec.exe from MXC_BIN_DIR or the dev src/target candidates without checking that the required NanVix payload is co-located. A normal build.bat build has such an executor but is compiled without microvm, so a MicroVM request bypasses the intended “install the companion/build with --with-microvm” diagnostic and instead fails later as unsupported (or during native preflight). Only return candidates containing the required NanVix files/subdirectories.
    .github/workflows/Versioning.Checks.Job.yml:34
  • The new scripts/platform-package-payload.test.js suite is not invoked by any workflow; this job only runs the sync and release-completeness suites. As a result, regressions in the helper’s malformed-manifest validation can pass CI. Add the payload suite here.
      - name: Test release-completeness logic
        run: node --test scripts/check-release-completeness.test.js

sdk/node/README.md:21

  • The documented dev path does not exist: the staged packages live under sdk/node/platform-packages, as used by the build scripts and resolver. Correcting this avoids sending contributors to the wrong directory.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →

.azure-pipelines/README.md:55

  • The pipeline stages packages under sdk/node/platform-packages, not sdk/platform-packages; this path should match the actual package job layout.

This issue also appears in the following locations of the same file:

  • line 76
  • line 84
- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
  `sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync
  • Files reviewed: 55/56 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Gudge and others added 6 commits August 11, 2026 08:24
This PR adds the npm package skeletons that separate core host executors from the opt-in NanVix MicroVM runtime without changing binary discovery yet.

Details

* Add five host platform packages for win32, Linux, and macOS with strict payload allowlists and prepack guards.
* Add an explicit win32-x64 NanVix companion package containing a compatible executor and the MicroVM runtime payload.
* Keep the large NanVix artifacts out of the automatically installed win32-x64 platform package.
* Document package ownership and keep generated payloads out of source control.

Tests

* Validated all package manifests, payload allowlists, OS/CPU constraints, and repository paths.
* Verified package tracking and ignore rules.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR changes SDK binary discovery to resolve core executors from host platform packages and MicroVM requests from the explicitly installed NanVix companion package.

Details

* Add fail-closed production resolution with package identity and exact SDK-version validation.
* Select the NanVix package's co-located wxc-exec for microvm requests and provide an actionable installation error when it is absent.
* Centralize supported platform tuples and executable naming, including explicit unsupported-host behavior.
* Preserve development resolution through staged packages and Rust target outputs.
* Stage the IsolationSession test executor in the current win32-x64 package layout.

Tests

* Exercised production and development discovery, environment overrides, package validation, unsupported tuples, and NanVix opt-in resolution in SDK unit tests.
* Verified the IsolationSession bundle no longer references the retired SDK bin layout.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR updates build scripts to stage core executors into host platform packages and the opt-in MicroVM runtime into its NanVix companion package.

Details

* Clean package destinations before staging so stale optional payloads cannot leak into releases.
* Stage a compatible wxc-exec and all required MicroVM files into nanvix-win32-x64 when --with-microvm is selected.
* Fail when requested Windows MicroVM or WSLC payloads are missing and stage PLM beside the core Windows executor.
* Keep test-only proxies outside publishable packages.
* Version-lock both platform and companion packages to the SDK meta version.

Tests

* Passed package-version synchronization tests, including companion-package drift and stamping.
* Validated shell and batch script syntax and staging paths.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR makes the meta SDK package binary-free, installs core native payloads through exact-pinned optional dependencies, and keeps explicit companion packages version-compatible.

Details

* Remove bundled native binaries from the meta package and pin all five host platform packages.
* Keep the NanVix package opt-in rather than adding it as an automatic optional dependency.
* Require the NanVix companion package to declare an exact peer dependency on the matching SDK version.
* Add a non-failing postinstall diagnostic for missing or incomplete host platform packages.
* Reconcile platform dependency pins and companion peer pins from the filesystem source of truth.
* Regenerate the npm lockfile and wire consistency checks into CI.

Tests

* Passed the Node SDK build and unit suite, including postinstall and package-version coverage.
* Verified a dry-run meta package contains no native binaries and does not install NanVix automatically.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR updates GitHub Actions and Azure Pipelines to build, validate, package, test, and publish core platform packages plus explicit companion packages before the meta SDK package.

Details

* Stage the union of core and NanVix payload manifests from Windows x64 builds without adding NanVix files to the automatic host package.
* Pack the opt-in NanVix companion alongside the five platform packages and publish all binary packages before the meta SDK.
* Add fail-closed release completeness checks for platform optional-dependency pins, companion peer compatibility, payload presence, and stray tarballs.
* Migrate SDK packaging and integration lanes to the platform-package install model.
* Require proxy integration coverage where the sandbox is runnable while keeping test proxies out of production packages.

Tests

* Passed release-completeness, payload, version-sync, SDK build, and SDK integration tests.
* Validated GitHub Actions and Azure Pipelines staging and package flows.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR completes the binary-package delivery model with package invariants, resolver coverage, NanVix opt-in tests, and updated user and developer documentation.

Details

* Validate every platform package against the runtime support matrix and verify NanVix is excluded from automatic host packages.
* Validate the NanVix companion identity, exact SDK peer, complete payload, prepack guard, and explicit-install behavior.
* Add resolver diagnostics for missing NanVix installations and retain package source-hygiene checks.
* Update SDK, repository, NanVix, pipeline, and contributor documentation for explicit MicroVM installation.
* Update the playground to select the companion package's co-located executor for MicroVM runs.

Tests

* Passed the Node SDK build and unit suite, including package, resolver, and NanVix diagnostics coverage.
* Passed binary-package script tests and the playground main-process TypeScript build.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
Copilot AI review requested due to automatic review settings August 11, 2026 15:39
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/mxc-512-phase6-tests-docs branch from 0833d4b to 09b43a3 Compare August 11, 2026 15:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

Files not reviewed (1)
  • sdk/node/package-lock.json: Generated file
Suppressed comments (5)

sdk/node/src/helper.ts:373

  • microvm is now backed only by the win32-x64 companion, but this routes Windows ARM64 requests to it after the existing guard checks only the OS. Since win32-arm64 is otherwise a supported tuple, ARM64 callers reach findNanvixExecutable() and are told to install a package that npm rejects via its cpu: ["x64"] filter (or may pick a staged x64 payload in dev). Reject non-x64 process architectures before selecting this runtime.
    sdk/node/src/platform.ts:943
  • The dev fallback accepts any wxc-exec.exe, including one from an ordinary build without the microvm feature or NanVix payload. In a normal checkout that binary commonly exists, so an absent companion is treated as resolved and the request later fails with a native “not compiled in”/missing-payload error instead of the actionable companion-package diagnostic. Require at least the co-located nanvixd.exe when selecting these candidates.
    sdk/node/scripts/postinstall-check.cjs:66
  • This unsupported-host warning suggests that setting MXC_BIN_DIR alone avoids the spawn failure, but both public resolver gates still require skipPlatformCheck when no explicit executablePath is supplied. Update the recovery text to mention that required option (or recommend executablePath), otherwise users following the warning still receive MXC is not supported on this platform.
    sdk/node/README.md:21
  • The documented dev path omits the node directory. The resolver actually checks sdk/node/platform-packages/<os>-<arch> (src/platform.ts:888), so this command/path guidance sends contributors to a nonexistent location.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →

.azure-pipelines/README.md:56

  • This pipeline path is missing the node component. The package job stages under sdk/node/platform-packages/<os>-<arch> (Package.NpmSdk.Job.yml:34,67), so the documented source-of-truth location is incorrect.
- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
  `sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync
  (`scripts/sync-platform-package-versions.js --check`), packs the meta package
  • Files reviewed: 55/56 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@bbonaby

Copy link
Copy Markdown
Collaborator

Thinking about this some more I think it would be best if we came up with a design to move the npm SDK to an in proc one rather than using the executables. Likely would be to use the mxc_ffi native library. We cal probably also do something using https://napi.rs/ as a small wrapper

@shschaefer shschaefer closed this Aug 28, 2026
@MGudgin
Gudge (MGudgin) deleted the user/gudge/mxc-512-phase6-tests-docs branch October 23, 2026 14:38
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.

Unnecessary platform binaries are shipped inside @microsoft/mxc-sdk

5 participants