Add Apple Container config surface - #957
Conversation
Recognize typed experimental apple_container requests across the 0.8 contract, Rust and TypeScript builders, and generated artifacts. Keep execution fail-closed until the runtime backend is implemented. Co-authored-by: Copilot <[email protected]> Copilot-Session: b062729b-d6f3-47f6-9df0-6c1d5c8a1e5c
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Adds the experimental Apple Container configuration surface while keeping execution fail-closed until runtime support exists.
Changes:
- Adds Rust and TypeScript config models/builders.
- Validates Apple Container requests and rejects execution.
- Updates generated contracts, schemas, and tests.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/core/wxc_common/src/wire.rs |
Adds wire types and containment value. |
src/core/wxc_common/src/models.rs |
Adds domain configuration and mappings. |
src/core/wxc_common/src/config_parser.rs |
Validates and parses Apple Container configs. |
src/core/wxc_common/src/cmdline.rs |
Selects POSIX shell semantics. |
src/core/mxc-sdk/src/lib.rs |
Exports the Rust configuration section. |
src/core/mxc_engine/src/run.rs |
Rejects unimplemented execution without fallback. |
src/core/mxc_engine/src/policy.rs |
Adds the Rust request builder. |
src/core/mxc_engine/src/lib.rs |
Re-exports the builder type. |
src/core/mxc_engine/src/dispatch.rs |
Rejects streaming execution. |
src/core/mxc_config_contract/tests/v0_8_0_alpha/experimental/apple_container.rs |
Tests the 0.8 contract. |
src/core/mxc_config_contract/tests/v0_8_0_alpha/experimental.rs |
Registers contract tests. |
src/core/mxc_config_contract/tests/v0_8_0_alpha/enums.rs |
Covers the containment value. |
src/core/mxc_config_contract/src/dev/one_shot.rs |
Adds the dev containment variant. |
src/core/mxc_config_contract/src/dev/mod.rs |
Exports the contract type. |
src/core/mxc_config_contract/src/dev/experimental.rs |
Defines strict one-shot settings. |
sdk/node/tests/unit/wire-conformance.test.ts |
Checks public/wire type parity. |
sdk/node/tests/unit/sandbox.test.ts |
Tests builder and experimental gating. |
sdk/node/src/types.ts |
Adds public TypeScript types. |
sdk/node/src/sandbox.ts |
Implements the TypeScript builder. |
sdk/node/src/index.ts |
Exports the new API. |
sdk/node/src/generated/wire.ts |
Updates generated wire types. |
schemas/dev/mxc-config.schema.0.8.0-dev.json |
Updates the generated dev schema. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <[email protected]> Copilot-Session: b062729b-d6f3-47f6-9df0-6c1d5c8a1e5c
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated no new comments.
Suppressed comments (3)
src/core/wxc_common/src/wire.rs:564
- These annotations replace the inferred numeric bounds with only a minimum, so the generated schema accepts
cpuCountaboveu32::MAXandmemoryMbaboveu64::MAX, while the new 0.8 contract tests explicitly reject those values and native deserialization fails. Add the corresponding maximum constraints and regenerate the schema so editor/schema validation matches the typed contract.
#[cfg_attr(feature = "schema-gen", schemars(range(min = 1)))]
pub cpu_count: Option<u32>,
/// Requested memory limit in megabytes.
#[cfg_attr(feature = "schema-gen", schemars(range(min = 1)))]
pub memory_mb: Option<u64>,
sdk/node/README.md:66
- Adding
apple_containerto this statement makes it inaccurate: unlike the other listed experimental backends, the parser explicitly rejects Apple Container unlessversionis exactly0.8.0-alpha. Document that exception so users do not expect a 0.7 config plus experimental opt-in to work.
> **Stable schemas document only the non-experimental surface.** Experimental backends (`windows_sandbox`, `wslc`, `microvm`, `hyperlight`, `isolation_session`, `apple_container`), the `experimental.*` block, and state-aware lifecycle live in `0.8.0-dev`. The parser still accepts them when paired with `--experimental` regardless of which schema your config validates against — schema choice affects editor validation, not runtime behavior.
src/core/mxc-sdk/README.md:346
- This recommendation now includes Apple Container, but the standalone executor uses the changed engine path and also returns
UnsupportedContainment; it cannot be used as an alternative. Separate Apple Container from the backends that can be driven through standalone executors and state that its configuration is currently non-executable on every surface.
Any other backend (Windows Sandbox, IsolationSession, MicroVM, Hyperlight, LXC,
Apple Container)
returns an [`Error`] with [`ErrorCode::UnsupportedContainment`]; drive the
standalone executor binaries for those.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Resolve the 0.8 stable and 0.9 development schema promotion by moving the Apple Container experimental contract to 0.9 while preserving stable 0.8. Co-authored-by: Copilot <[email protected]> Copilot-Session: b062729b-d6f3-47f6-9df0-6c1d5c8a1e5c
Co-authored-by: Copilot <[email protected]> Copilot-Session: b062729b-d6f3-47f6-9df0-6c1d5c8a1e5c
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 30 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
src/core/mxc_config_contract/src/dev/experimental.rs:105
NonEmptyStringonly rejects""(primitives.rs:124-129), so an image containing only whitespace passes the exact 0.9 contract and generated schema. The rolling parser and TypeScript builder both trim before validating and reject that same value. Use Apple-image validation that rejects trim-empty input, add the whitespace case, and regenerate the contract artifacts so exact validation agrees with runtime.
pub struct OneShotAppleContainer {
/// OCI image reference. The image must provide `/bin/sh`.
pub image: NonEmptyString,
sdk/node/README.md:67
- Adding
apple_containerto this blanket statement makes it inaccurate: the new parser check requires the config's version to be exactly0.9.0-alpha, so an Apple Container config using a stable version is rejected even with experimental mode enabled. Call out this exception explicitly.
> **Stable schemas document only the non-experimental surface.** Experimental backends (`windows_sandbox`, `wslc`, `microvm`, `hyperlight`, `isolation_session`, `apple_container`), the `experimental.*` block, and state-aware lifecycle live in `0.9.0-dev`. The parser still accepts them when paired with `--experimental` regardless of which schema your config validates against — schema choice affects editor validation, not runtime behavior.
Co-authored-by: Copilot <[email protected]> Copilot-Session: b062729b-d6f3-47f6-9df0-6c1d5c8a1e5c
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 31 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/core/mxc_config_contract/src/dev/experimental.rs:105
NonEmptyStringonly rejects"", so this exact contract accepts an image containing only whitespace, while the authoritative parser rejects it viaac.image.trim().is_empty()inconfig_parser.rs:1369. Use an Apple-image type/deserializer that rejects blank strings (and emits the matching schema constraint), then add a whitespace case to the contract test so the exact contract converges with runtime validation.
pub image: NonEmptyString,
Co-authored-by: Copilot <[email protected]> Copilot-Session: b062729b-d6f3-47f6-9df0-6c1d5c8a1e5c
|
converting to draft while I fix the merge conflicts |
Co-authored-by: Copilot <[email protected]> Copilot-Session: b062729b-d6f3-47f6-9df0-6c1d5c8a1e5c
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 30 out of 32 changed files in this pull request and generated 2 comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/core/mxc_config_contract/src/dev/one_shot.rs:154
- This cross-field check only enforces one direction. A request with
containment: "process"(or omitted containment) plusexperimental.apple_containerstill passes the exact contract/schema, then fails later invalidate_single_backend_section; the same happens when Apple Container is supplied alongside another backend section. Rejectexperimental.apple_containerunless containment isapple_container, and add the equivalent reverse constraint to the generated exact schema so contract validation matches runtime behavior.
if matches!(
request.containment.as_ref(),
Some(Containment::AppleContainer)
) && request
.experimental
.as_ref()
.and_then(|experimental| experimental.apple_container.as_ref())
.is_none()
Co-authored-by: Copilot <[email protected]> Copilot-Session: b062729b-d6f3-47f6-9df0-6c1d5c8a1e5c
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 30 out of 32 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/core/wxc_common/src/wire.rs:845
- This only requires the key to exist; it does not require a non-null Apple Container object. The generated
Experimental.apple_containerschema isAppleContainer | null, so{"containment":"apple_container","experimental":{"apple_container":null}}passes the rolling schema whilepresent_backend_sections()treatsnullas absent and the parser rejects it. Add aproperties.apple_containerconstraint referencing#/definitions/AppleContaineralongsiderequired, then regenerate the rolling schema/types and cover the null case.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
📖 Description
Adds the experimental Apple Container configuration surface on the current
0.9.0-alphadevelopment contract:containment: "apple_container"with explicit experimentalopt-in;
unsupported_containmentuntil the runtimebackend lands.
Stable schema
0.8.0-alpharemains unchanged and does not include experimentalApple Container fields.
🔗 References
This is PR 1 of the stacked Apple Container implementation.
🔍 Validation
✅ Checklist
Cargo.lock, thedependency-feed-checkcheck passes (see docs/pull-requests.md)📋 Issue Type
GitHub Actions runs the PR validation build automatically. The ADO pipeline
(
MXC-PR-Build) is the Azure version of the PR pipeline, kept in parity withthe GitHub Actions build; it runs on merge to
main, and Microsoft reviewerswith write access can trigger it on a PR with
/azp run.Microsoft Reviewers: Open in CodeFlow