Skip to content

Move the SDK authoring types into mxc-sdk - #1353

Open
Gudge (MGudgin) wants to merge 1 commit into
user/gudge/remove-binding-json-ffifrom
user/gudge/move-sdk-policy-types
Open

Gudge (MGudgin) wants to merge 1 commit into
user/gudge/remove-binding-json-ffifrom
user/gudge/move-sdk-policy-types

Conversation

@MGudgin

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

Copy link
Copy Markdown
Member

This PR moves the Rust SDK's v1 policy, containment, request,
and typed lifecycle authoring types into mxc-sdk. The engine now accepts a
normalized ExecutionRequest from either the SDK builder or the exact JSON
parser and keeps backend dispatch, host probing, telemetry, and execution in
one place.

Details

  • Move policy, exact v1 builder, SDK v1 goldens, backend config types, and
    typed lifecycle SDK models into mxc-sdk under the public mxc_sdk::v1 paths.
  • Replace mxc_engine::spawn(SandboxRequest) with
    mxc_engine::spawn_execution_request(&ExecutionRequest).
  • Keep root mxc_sdk raw JSON, discovery, telemetry, Sandbox, Output, and
    WaitOutcome APIs stable while v1::spawn_sandbox forwards request.inner to
    the engine.
  • Add direct mxc_config_contract and serde dependencies to mxc-sdk and remove
    non-test contract dependency from mxc_engine.
  • Rewrite engine tests to use ExecutionRequest or SdkStateAwareInput directly
    and move SDK-builder validation tests with the moved SDK code.

Tests

  • Baseline Rust test inventory: mxc_engine 139, mxc-sdk 60, mxc_ffi 84;
    total 283. After move: mxc_engine 90, mxc-sdk 109, mxc_ffi 84; total 283.
  • cargo fmt --all -- --check; cargo check --workspace --all-targets
    --all-features; cargo clippy --workspace --all-targets --all-features --
    -D warnings; cargo test -p mxc_engine --all-features; cargo test -p
    mxc-sdk --all-features; cargo test -p mxc_ffi --all-features; cargo test
    -p wxc --all-features; RUSTDOCFLAGS=-D warnings cargo doc -p mxc-sdk -p
    mxc_ffi --no-deps --all-features.
  • sdk/node: npm run build; npm test; npm run typecheck.
  • sdk/dotnet: dotnet test --solution Microsoft.Mxc.Sdk.slnx.
  • node scripts/check-dotnet-api-parity.js; node
    scripts/check-dotnet-bindings-codegen.js; node
    scripts/versioning/check-contract-codegen.js; node
    scripts/versioning/validate-configs.js; node
    scripts/versioning/check-tests-present.js.
  • git diff --check.
Microsoft Reviewers: Open in CodeFlow

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/move-sdk-policy-types branch from 91b389c to efc776c Compare September 30, 2026 17:18
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/move-sdk-policy-types branch from efc776c to e44c918 Compare September 30, 2026 17:27
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/move-sdk-policy-types branch from e44c918 to c0f2a80 Compare September 30, 2026 17:32
Gudge (MGudgin) pushed a commit that referenced this pull request Sep 30, 2026
This PR adds a handoff for the v1 SDK and JSON-only FFI ingress stack and
updates the ingress plan to match what was built. It records the pull
requests, branches, worktrees, and backups, the design decisions and their
reasons, review status, open items, and working notes for a new session.

Details

* Add docs/version-aware-stack-session-handoff-2026-09-30.md covering
  #1271, #1348, and #1349-#1353, the backend-based experimental opt-in,
  JSON-only ingress, V1 namespaces and MxcPlatform, the pinned SDK target,
  Node export conditions, shared goldens, and E0.
* Mark the plan adopted, replace the planned branch table with the opened
  pull requests, record the unified experimental check, the serde removal,
  the V1 writer location, and E0, and add the namespace, goldens, and E0
  decisions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 33217f7b-dc7d-4da0-af5f-018fef64013c
Generated-with: claude-opus-5.5
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/move-sdk-policy-types branch from c0f2a80 to ec05b94 Compare September 30, 2026 20:29
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/move-sdk-policy-types branch from ec05b94 to fae3cba Compare September 30, 2026 20:31
@MGudgin
Gudge (MGudgin) added this pull request to stack #1356 September 30, 2026 21:26
@MGudgin
Gudge (MGudgin) marked this pull request as ready for review September 30, 2026 21:27
@MGudgin
Gudge (MGudgin) requested a review from a team as a code owner September 30, 2026 21:27
Copilot AI balanced review requested due to automatic review settings September 30, 2026 21:27
@MGudgin
Gudge (MGudgin) requested a review from a team September 30, 2026 21:30
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/move-sdk-policy-types branch from fae3cba to 3ac7782 Compare September 30, 2026 21:30

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

🟡 Changes recommended

The new engine metadata type is compiled out while still referenced unconditionally on Linux and macOS.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Moves Rust v1 authoring and lifecycle types from mxc_engine into the public mxc-sdk facade while retaining execution and backend dispatch in the engine.

Changes:

  • Relocates policy, backend configuration, lifecycle models, and golden tests into mxc-sdk.
  • Changes engine APIs to consume normalized execution inputs.
  • Updates dependencies and documentation for the new ownership boundary.
File Description
tests/​policy/​README.md Updates golden-test paths and commands.
src/​mxc_telemetry/​src/​lib.rs Updates engine API references.
src/​core/​wxc_common/​src/​telemetry/​mod.rs Updates streaming API documentation.
src/​core/​wxc_common/​src/​sdk_input.rs Documents SDK ownership.
src/​core/​mxc-sdk/​src/​state_aware_sdk.rs Owns lifecycle models and engine result conversion.
src/​core/​mxc-sdk/​src/​sandbox.rs Converts typed lifecycle requests before engine dispatch.
src/​core/​mxc-sdk/​src/​policy/​sdk_v1_goldens.rs Moves SDK golden validation.
src/​core/​mxc-sdk/​src/​policy/​network.rs Adds public network authoring types.
src/​core/​mxc-sdk/​src/​policy/​exact/​v1_0.rs Builds exact v1 contracts.
src/​core/​mxc-sdk/​src/​policy/​exact/​mod.rs Normalizes SDK policy requests.
src/​core/​mxc-sdk/​src/​policy.rs Updates public request documentation.
src/​core/​mxc-sdk/​src/​lib.rs Exposes the relocated v1 API.
src/​core/​mxc-sdk/​src/​configs/​seatbelt.rs Adds Seatbelt authoring configuration.
src/​core/​mxc-sdk/​src/​configs/​process_container.rs Adds ProcessContainer configuration and tests.
src/​core/​mxc-sdk/​src/​configs/​lxc.rs Adds LXC authoring configuration.
src/​core/​mxc-sdk/​src/​configs.rs Re-exports backend configurations.
src/​core/​mxc-sdk/​Cargo.toml Adds contract and test dependencies.
src/​core/​mxc_engine/​src/​state_aware.rs Replaces SDK models with normalized engine DTOs.
src/​core/​mxc_engine/​src/​run.rs Uses normalized requests in attribution tests.
src/​core/​mxc_engine/​src/​lib.rs Exposes normalized execution entry points.
src/​core/​mxc_engine/​src/​error.rs Updates API documentation.
src/​core/​mxc_engine/​src/​dispatch.rs Rewrites tests around normalized requests.
src/​core/​mxc_engine/​Cargo.toml Removes the runtime contract dependency.
src/​Cargo.lock Records dependency relocation.
src/​backends/​bubblewrap/​common/​src/​bwrap_runner.rs Updates engine API references.
src/​backends/​bubblewrap/​common/​src/​bwrap_command.rs Updates SDK builder references.
docs/​authoring-a-new-feature.md Points feature authors to the SDK builder.

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

Comment thread src/core/mxc_engine/src/state_aware.rs Outdated
Copilot AI balanced review requested due to automatic review settings September 30, 2026 21:31

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

🟡 Changes recommended

The new engine metadata type is Windows-gated despite unconditional cross-platform references, breaking Linux and macOS builds.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)

Comment on lines +883 to +887
let config = if image.is_none() && image_tar_path.is_none() {
None
} else {
Some(wxc_common::models::WslcProvisionConfig {
image,
/// this gate the runner silently discards an explicitly-set, security-relevant
/// field. Every *public* entry point reaches the runner through the parser
/// today -- `mxc_engine::build_request*` maps a policy to wire JSON and runs
/// today -- `mxc_sdk::build_request*` maps a policy to wire JSON and runs
This PR moves the Rust SDK's v1 policy, containment, request,
and typed lifecycle authoring types into mxc-sdk. The engine now accepts a
normalized ExecutionRequest from either the SDK builder or the exact JSON
parser and keeps backend dispatch, host probing, telemetry, and execution in
one place.

Details

* Move policy, exact v1 builder, SDK v1 goldens, backend config types, and
  typed lifecycle SDK models into mxc-sdk under the public mxc_sdk::v1 paths.
* Replace mxc_engine::spawn(SandboxRequest) with
  mxc_engine::spawn_execution_request(&ExecutionRequest).
* Keep root mxc_sdk raw JSON, discovery, telemetry, Sandbox, Output, and
  WaitOutcome APIs stable while v1::spawn_sandbox forwards request.inner to
  the engine.
* Add direct mxc_config_contract and serde dependencies to mxc-sdk and remove
  non-test contract dependency from mxc_engine.
* Rewrite engine tests to use ExecutionRequest or SdkStateAwareInput directly
  and move SDK-builder validation tests with the moved SDK code.

Tests

* Baseline Rust test inventory: mxc_engine 139, mxc-sdk 60, mxc_ffi 84;
  total 283. After move: mxc_engine 90, mxc-sdk 109, mxc_ffi 84; total 283.
* cargo fmt --all -- --check; cargo check --workspace --all-targets
  --all-features; cargo clippy --workspace --all-targets --all-features --
  -D warnings; cargo test -p mxc_engine --all-features; cargo test -p
  mxc-sdk --all-features; cargo test -p mxc_ffi --all-features; cargo test
  -p wxc --all-features; RUSTDOCFLAGS=-D warnings cargo doc -p mxc-sdk -p
  mxc_ffi --no-deps --all-features.
* sdk/node: npm run build; npm test; npm run typecheck.
* sdk/dotnet: dotnet test --solution Microsoft.Mxc.Sdk.slnx.
* node scripts/check-dotnet-api-parity.js; node
  scripts/check-dotnet-bindings-codegen.js; node
  scripts/versioning/check-contract-codegen.js; node
  scripts/versioning/validate-configs.js; node
  scripts/versioning/check-tests-present.js.
* git diff --check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 33217f7b-dc7d-4da0-af5f-018fef64013c
Generated-with: gpt-5.5
Copilot AI balanced review requested due to automatic review settings September 30, 2026 21:40
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/move-sdk-policy-types branch from 3ac7782 to e246be7 Compare September 30, 2026 21:40

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

🟡 Changes recommended

Contributor and package documentation currently reference a nonexistent builder path and contradict the new ownership model.

Review effort: Balanced
Findings: 1 Medium severity · 3 Low severity

Open (4)
Resolved since last review (1)

| `src/core/wxc_common/src/config_contract_adapters/dev/` | Adapt the exact field into private `CommonRequestIR` |
| `src/core/wxc_common/src/wire.rs` | Add only reusable nested normalization DTOs needed by the adapter; never add a whole-request root |
| `src/core/mxc_engine/src/policy/exact/v1_1.rs` | If the Rust SDK exposes the field, update the production development builder |
| `src/core/mxc-sdk/src/policy/exact/v1_1.rs` | If the Rust SDK exposes the field, update the production development builder |
Comment on lines +147 to +149
//! host probing, and execution live in the internal `mxc_engine` crate;
//! `mxc-sdk` owns the public policy/config authoring layer and wraps the
//! engine's streaming handle in [`Sandbox`].

This branch has not been deployed

No deployments
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.

2 participants