Skip to content

Move contract-mapped v1 SDK types into V1 namespaces - #1355

Merged
Gudge (MGudgin) merged 1 commit into
mainfrom
user/gudge/sdk-v1-namespaces
Oct 2, 2026
Merged

Gudge (MGudgin) merged 1 commit into
mainfrom
user/gudge/sdk-v1-namespaces

Conversation

@MGudgin

@MGudgin Gudge (MGudgin) commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

This PR places the SDK types that map to the exact contract in an explicit
major-version namespace in each SDK: Microsoft.Mxc.Sdk.V1, mxc_sdk::v1,
and @microsoft/mxc-sdk/v1. These types evolve additively as 1.x contracts
are published, and a future v2 can add a V2 namespace alongside them.
Version-independent APIs stay at each package root.

Details

  • .NET: policy, request, discovery-fragment, lifecycle, MxcSandbox, and
    typed adapter types move to Microsoft.Mxc.Sdk.V1 in a V1\ source
    folder. The new root MxcPlatform holds NativeVersion,
    GetAvailableBackends, and GetPlatformSupport. V1-subject tests move to
    Microsoft.Mxc.Sdk.Tests.V1.
  • Rust: mxc_sdk::v1 holds the policy, config, request, containment, and
    typed lifecycle items plus run and spawn_sandbox; the root keeps
    errors, discovery, telemetry, process handles, and raw exact-JSON entry
    points.
  • Node: the @microsoft/mxc-sdk/v1 subpath holds policy, policy helpers,
    one-shot convenience, and typed lifecycle APIs; the root keeps raw config,
    discovery, errors, telemetry, and running-process surfaces. Both exports
    carry types, import, and default conditions so CommonJS require()
    works on Node 24, and typesVersions maps v1 for node10 resolution.
  • The playground loads V1 APIs from the subpath.
  • docs/versioning.md documents the per-major namespace convention, and
    docs and examples import V1 APIs from the V1 paths.

Tests

  • cargo fmt, check, and clippy for the workspace; cargo test for
    mxc-sdk, mxc_engine, and mxc_ffi; cargo doc with
    RUSTDOCFLAGS=-D warnings.
  • Node: build, unit tests (351 passed, 20 skipped), integration typecheck,
    and require()/import() of both entry points on Node 24.18.
  • .NET: dotnet test --solution Microsoft.Mxc.Sdk.slnx (244 passed,
    27 skipped).
  • C# API parity and bindings codegen checks; LXC and Seatbelt guide examples
    type-check; git diff --check.
Microsoft Reviewers: Open in CodeFlow

@MGudgin
Gudge (MGudgin) requested a review from a team as a code owner September 30, 2026 20:19
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/sdk-v1-namespaces branch 2 times, most recently from 1172f97 to 463a33c Compare September 30, 2026 20:31
@MGudgin
Gudge (MGudgin) added this pull request to stack #1356 September 30, 2026 21:26
@MGudgin
Gudge (MGudgin) requested a review from a team October 1, 2026 16:23
Base automatically changed from user/gudge/rust-sdk-phase14c to main October 1, 2026 18:25
Copilot AI balanced review requested due to automatic review settings October 1, 2026 18:57
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/sdk-v1-namespaces branch 2 times, most recently from 8978cff to ab229c2 Compare October 1, 2026 18:58

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.

Copilot review overview

🔵 Needs a closer look

Source-breaking API moves across three SDKs need human compatibility and packaging sign-off, and the CI validation regression remains unresolved.

Review effort: Balanced
Findings: None

What changed in this PR

Moves contract-mapped SDK APIs into explicit V1 namespaces, allowing future major versions to coexist while keeping version-independent APIs at package roots.

Changes:

  • Introduces V1 entry points across .NET, Rust, and Node.
  • Separates .NET platform discovery into MxcPlatform and adds Node subpath exports.
  • Updates consumers, tests, documentation, and examples.
File Description
tests/​playground/​src/​main/​main.ts Loads policy APIs from the V1 subpath.
src/​ffi/​mxc_ffi/​src/​streaming.rs Updates streaming imports and documentation.
src/​ffi/​mxc_ffi/​src/​request.rs Uses V1 request and policy types.
src/​ffi/​mxc_ffi/​src/​lib.rs Imports V1 execution APIs.
src/​core/​mxc-sdk/​tests/​streaming.rs Updates streaming tests to V1 imports.
src/​core/​mxc-sdk/​tests/​streaming_processcontainer.rs Updates Windows streaming imports.
src/​core/​mxc-sdk/​tests/​streaming_bubblewrap.rs Updates Linux streaming imports.
src/​core/​mxc-sdk/​tests/​state_aware.rs Updates lifecycle imports and test naming.
src/​core/​mxc-sdk/​tests/​sdk_helpers.rs Updates policy-helper imports.
src/​core/​mxc-sdk/​tests/​sandbox.rs Uses V1 sandbox execution APIs.
src/​core/​mxc-sdk/​tests/​isolation_session.rs Uses V1 IsolationSession APIs.
src/​core/​mxc-sdk/​src/​sandbox.rs Adjusts internal imports and API links.
src/​core/​mxc-sdk/​src/​lib.rs Introduces the Rust V1 API module.
src/​core/​mxc-sdk/​README.md Documents V1 Rust imports.
src/​core/​mxc_engine/​src/​policy.rs Updates documentation and assertion wording.
sdk/​node/​tests/​unit/​state-aware-types.test.ts Clarifies V1 test descriptions and comments.
sdk/​node/​tests/​unit/​inprocess-run.test.ts Clarifies the V1 routing test description.
sdk/​node/​tests/​integration/​wslc-state-aware.test.ts Imports lifecycle APIs from V1.
sdk/​node/​tests/​integration/​windows-process-container.test.ts Imports policy types from V1.
sdk/​node/​tests/​integration/​test-helpers.ts Combines root and V1 test helpers.
sdk/​node/​tests/​integration/​linux-process-container.test.ts Imports policy types from V1.
sdk/​node/​tests/​integration/​isolation-session-state-aware.test.ts Separates root errors from V1 lifecycle APIs.
sdk/​node/​src/​v1.ts Adds the Node V1 entry point.
sdk/​node/​src/​index.ts Separates root exports from V1 APIs.
sdk/​node/​README.md Updates Node examples to V1 imports.
sdk/​node/​package.json Adds V1 exports and type-resolution mapping.
sdk/​dotnet/​README.md Documents V1 APIs and root platform discovery.
sdk/​dotnet/​Microsoft.Mxc.Sdk/​V1/​StateAwareTypes.cs Moves lifecycle types into V1.
sdk/​dotnet/​Microsoft.Mxc.Sdk/​V1/​SandboxRequest.cs Moves request types into V1.
sdk/​dotnet/​Microsoft.Mxc.Sdk/​V1/​SandboxPolicyDiscovery.cs Moves policy discovery fragments into V1.
sdk/​dotnet/​Microsoft.Mxc.Sdk/​V1/​SandboxPolicy.cs Moves policy types into V1.
sdk/​dotnet/​Microsoft.Mxc.Sdk/​V1/​SandboxId.cs Moves sandbox identity into V1.
sdk/​dotnet/​Microsoft.Mxc.Sdk/​V1/​SandboxAdapters.cs Moves typed adapters and delegates platform discovery.
sdk/​dotnet/​Microsoft.Mxc.Sdk/​V1/​MxcSandbox.cs Moves execution APIs and extracts platform discovery.
sdk/​dotnet/​Microsoft.Mxc.Sdk/​V1/​MxcLifecycle.cs Moves lifecycle APIs into V1.
sdk/​dotnet/​Microsoft.Mxc.Sdk/​MxcPlatform.cs Adds root native-version and discovery APIs.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​V1/​SandboxPolicyTests.cs Relocates policy tests and updates discovery calls.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​V1/​SandboxPolicyDiscoveryTests.cs Relocates policy discovery tests.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​V1/​SandboxAdapterTests.cs Relocates typed adapter tests.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​V1/​MxcSandboxTests.cs Relocates execution tests and updates platform calls.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​V1/​MxcSandboxIsolationSessionE2ETests.cs Relocates one-shot IsolationSession tests.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​V1/​MxcLifecycleTests.cs Relocates lifecycle tests.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​V1/​MxcLifecycleE2ETests.cs Relocates lifecycle end-to-end tests.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​V1/​MxcLifecycleContractTests.cs Relocates and renames lifecycle contract tests.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​MxcTelemetryTests.cs Adds V1 imports for test requests.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​MxcSandboxProcessTests.cs Adds V1 imports for process tests.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​MxcExceptionTests.cs Adds V1 imports for exception tests.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Tests/​IsolationSessionHost.cs Uses root platform discovery.
sdk/​dotnet/​Microsoft.Mxc.Sdk.Sample/​Program.cs Uses V1 execution and root native-version APIs.
sdk/​dotnet/​Microsoft.Mxc.Sdk.ConsoleDriver/​Program.cs Imports V1 APIs.
scripts/​check-dotnet-api-parity.js Tracks relocated types and platform discovery.
README.md Updates Node quick-start imports.
docs/​wsl/​wslc-state-aware.md Clarifies the V1 contract target.
docs/​wsl/​wsl-container-getting-started.md Updates Node and Rust imports.
docs/​versioning.md Defines per-major SDK namespaces.
docs/​state-aware-lifecycle/​mxc-state-aware-sandbox-api.md Updates lifecycle exports and guidance.
docs/​state-aware-lifecycle/​mxc-state-aware-sandbox-api-overview.md Updates lifecycle namespace references.
docs/​seatbelt/​seatbelt-backend.md Updates the Node example import.
docs/​nanvix-microvm/​nanvix-integration-plan.md Uses raw experimental configuration in the example.
docs/​lxc-support/​lxc-backend.md Separates raw execution and V1 policy imports.
docs/​isolation-session/​state-aware-typescript.md Updates V1 imports and contract guidance.
docs/​isolation-session/​state-aware-rust.md Updates Rust execution API references.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/sdk-v1-namespaces branch from ab229c2 to a886b1b Compare October 2, 2026 04:28
Copilot AI balanced review requested due to automatic review settings October 2, 2026 04:28

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.

Copilot review overview

🔵 Needs a closer look

Public API compatibility across three SDKs needs human review, with a confirmed CI selector regression still unresolved.

Review effort: Balanced
Findings: None

This PR places contract-mapped authoring and typed execution APIs in
Microsoft.Mxc.Sdk.V1, mxc_sdk::v1, and @microsoft/mxc-sdk/v1. These surfaces
evolve additively across published 1.x contracts while a future V2 can live
alongside them. Version-independent APIs stay at each package root.

Details

* Move .NET policy, request, lifecycle, and adapter APIs and their tests
  into V1 folders. Keep discovery on root MxcPlatform and fix XML references.
* Group Rust typed lifecycle APIs under v1::container and request-aware
  probing under v1::probe; keep facts, handles, output, and raw JSON at root.
* Export Node policy and lifecycle APIs from /v1, with root raw-config and
  runtime APIs, CommonJS-compatible exports, and node10 type resolution.
* Add cross-language namespace guards, update consumers and examples, and
  fix platform-specific SDK test imports and macOS lint.

Tests

* cargo fmt --all -- --check passed. Workspace check and lint passed:
  cargo check --workspace --all-targets --all-features
  cargo clippy --workspace --all-targets --all-features -- -D warnings
* cargo test -p mxc-sdk -p mxc_engine -p mxc_ffi: 283 passed, 8 ignored.
  Rustdoc, Linux all-target checks, and macOS clippy passed with warnings
  denied. Native Linux/macOS and elevated host suites were not run.
* npm run build, npm run typecheck, and npm test passed (389 passed,
  20 skipped); installed ESM/CommonJS and node10/NodeNext consumers passed.
* Full .NET tests passed (299 passed, 27 live-host skips). XML documentation,
  C# API parity, generated bindings, and git diff --check passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 30c4f940-9c8e-4d3e-89ff-b1776045bb1c
Generated-with: gpt-6.1-sol
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/sdk-v1-namespaces branch from a886b1b to 0df868a Compare October 2, 2026 04:51
Copilot AI balanced review requested due to automatic review settings October 2, 2026 04:51

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.

Copilot review overview

🔵 Needs a closer look

Stale CI class selectors exclude both relocated IsolationSession C# suites, causing backend validation to run no tests and fail.

Review effort: Balanced
Findings: None

@MGudgin
Gudge (MGudgin) merged commit 31767df into main Oct 2, 2026
31 checks passed
@MGudgin
Gudge (MGudgin) deleted the user/gudge/sdk-v1-namespaces branch October 2, 2026 05:14
Branden Bonaby (bbonaby) pushed a commit that referenced this pull request Oct 2, 2026
…pace (#1371)

Select the isolation-session C# test classes in any namespace

The scheduled isolation-session jobs selected the C# end-to-end classes by
fully qualified name. #1355 moved both into Microsoft.Mxc.Sdk.Tests.V1, so the
filters matched nothing and the C# suite executed no tests. The filters now
match the class names in any namespace, and the suite fails when either class
executes no tests.

Co-authored-by: adpa-ms <>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 74255d4c-9d4f-4f2f-a9cc-e6d3ecd37780
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.

3 participants