Skip to content

Harden exact contract infrastructure - #1186

Closed
Gudge (MGudgin) wants to merge 1 commit into
user/gudge/version_specific_config_parsers_phase13from
user/gudge/version_specific_config_parsers_phase13_followups
Closed

Gudge (MGudgin) wants to merge 1 commit into
user/gudge/version_specific_config_parsers_phase13from
user/gudge/version_specific_config_parsers_phase13_followups

Conversation

@MGudgin

@MGudgin Gudge (MGudgin) commented Sep 16, 2026

Copy link
Copy Markdown
Member

📖 Description

Hardens exact-contract infrastructure with focused cleanup that reduces
duplicated conformance tests and makes registry-driven code-generation and
backend-name checks fail closed.

Details

  • Internalize normalization DTOs as non-deserializable implementation types.
  • Share v0.9 and v0.10 exact conformance suites.
  • Centralize artifact and request-root metadata in the Rust registry.
  • Drive fixture diagnostics from registered roots and reject inconsistent
    renderability metadata without panicking.
  • Document the registry-owned request-root contributor workflow.
  • Correct architecture guidance to keep exact contracts authoritative for
    deserialization, aliases, schemas, and generated contract types.
  • Fail closed on missing registry roots and unknown backend names.

Tests

  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --exclude wxc_e2e_tests
  • MicroVM x64 build and targeted test_microvm_ E2E tests
  • Node npm run build, npm test, and npm run typecheck:integration
  • .NET: 322 passed, 27 host-dependent tests skipped
  • 82 versioning tests and all exact codegen, parity, and config gates
Microsoft Reviewers: Open in CodeFlow

@MGudgin
Gudge (MGudgin) requested a review from a team as a code owner September 16, 2026 22:02
@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) added this pull request to stack #1190 September 16, 2026 22:04
@MGudgin
Gudge (MGudgin) requested a review from a team September 18, 2026 17:15
Copilot AI balanced review requested due to automatic review settings September 18, 2026 17:24
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from fc5d451 to d4408e0 Compare September 18, 2026 17:24

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

Registry metadata and code-generation validation still contain correctness gaps that can misreport roots or mask failures.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
What changed in this PR

Hardens exact-contract infrastructure by centralizing registry metadata, internalizing normalization types, and consolidating conformance tests.

Changes:

  • Makes normalization DTOs crate-private and non-deserializable.
  • Shares v0.9/v0.10 exact-contract tests.
  • Moves artifact and request-root validation to registry metadata.
File Description
src/​tools/​mxc_schema_gen/​src/​main.rs Emits and validates registry metadata.
src/​core/​wxc_common/​src/​wire.rs Internalizes normalization wire types.
src/​core/​wxc_common/​src/​splice.rs Parses containment names explicitly.
src/​core/​wxc_common/​src/​lib.rs Makes the wire module crate-private.
src/​core/​wxc_common/​src/​config_contract_adapters/​v0_9/​state_aware_tests/​common.rs Constructs test DTOs directly.
src/​core/​wxc_common/​src/​config_contract_adapters/​dev/​state_aware_tests/​common.rs Constructs development test DTOs directly.
src/​core/​mxc_engine/​src/​probe.rs Revises backend-name validation tests.
src/​core/​mxc_engine/​src/​policy.rs Validates emitted JSON against exact contracts.
src/​core/​mxc_engine/​src/​platform.rs Uses canonical backend-name tests.
src/​core/​mxc_config_contract/​tests/​v0_9_0_alpha/​state_aware/​common.rs Exports v0.9 request types to shared tests.
src/​core/​mxc_config_contract/​tests/​v0_9_0_alpha/​state_aware.rs Uses shared lifecycle tests.
src/​core/​mxc_config_contract/​tests/​v0_9_0_alpha/​common.rs Exports the v0.9 one-shot type.
src/​core/​mxc_config_contract/​tests/​v0_9_0_alpha.rs Configures shared v0.9 suites.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha/​state_aware/​stop.rs Removes duplicated stop tests.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha/​state_aware/​start.rs Removes duplicated start tests.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha/​state_aware/​exec.rs Removes duplicated exec tests.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha/​state_aware/​deprovision.rs Removes duplicated deprovision tests.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha/​state_aware/​common.rs Exports development request types.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha/​state_aware.rs Uses shared lifecycle tests.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha/​one_shot.rs Removes duplicated one-shot tests.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha/​common.rs Exports the development one-shot type.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha/​annotations.rs Removes duplicated annotation tests.
src/​core/​mxc_config_contract/​tests/​v0_10_0_alpha.rs Configures shared development suites.
src/​core/​mxc_config_contract/​tests/​support/​state_aware/​stop.rs Makes stop tests version-independent.
src/​core/​mxc_config_contract/​tests/​support/​state_aware/​start.rs Makes start tests version-independent.
src/​core/​mxc_config_contract/​tests/​support/​state_aware/​exec.rs Makes exec tests version-independent.
src/​core/​mxc_config_contract/​tests/​support/​state_aware/​deprovision.rs Makes deprovision tests version-independent.
src/​core/​mxc_config_contract/​tests/​support/​one_shot.rs Adds version-aware shared assertions.
src/​core/​mxc_config_contract/​tests/​support/​exact.rs Adds contract-version substitution helpers.
src/​core/​mxc_config_contract/​tests/​support/​annotations.rs Shares version-aware annotation tests.
src/​core/​mxc_config_contract/​src/​registry.rs Adds artifact and request-root metadata.
src/​core/​mxc_config_contract/​src/​lib.rs Exports request-root metadata.
src/​backends/​isolation_session/​common/​src/​state_aware.rs Removes obsolete wire parity testing.
scripts/​versioning/​tests/​check-contract-codegen.test.js Tests registry-driven validation.
scripts/​versioning/​check-schema-versions.js Uses registry request roots and artifact flags.
scripts/​versioning/​check-contract-codegen.js Drives code generation from registry metadata.
docs/​schema-codegen.md Documents registry-driven code generation.
docs/​backend-support-probe-api-plan.md Updates the canonical backend-name reference.

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

Comment thread scripts/versioning/check-contract-codegen.js Outdated
Comment thread src/core/mxc_config_contract/src/registry.rs Outdated
Comment thread src/core/mxc_engine/src/probe.rs Outdated
Copilot AI review requested due to automatic review settings September 18, 2026 18:22
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from d4408e0 to 4c8cfbc Compare September 18, 2026 18:22

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

Registry validation and legacy request-root metadata still contain correctness issues.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)

Copilot AI review requested due to automatic review settings September 18, 2026 18:27
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from 4c8cfbc to 13a2f84 Compare September 18, 2026 18:27
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from 13a2f84 to df2a9ff Compare September 18, 2026 18: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

🔵 Needs a closer look

The cross-cutting parsing, registry, code-generation, and conformance-test refactor warrants final human validation.

Review effort: Balanced
Findings: None

Resolved since last review (3)

Copilot AI review requested due to automatic review settings September 18, 2026 18:32

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

Generator error handling and fixture validation still contain paths that bypass controlled registry-driven behavior.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)

Comment thread scripts/versioning/check-contract-codegen.js
Comment thread src/tools/mxc_schema_gen/src/main.rs Outdated
Copilot AI review requested due to automatic review settings September 18, 2026 18:39
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from df2a9ff to 2f4f261 Compare September 18, 2026 18:39
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from f3dbbd4 to 6c4aef8 Compare September 18, 2026 20:29

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

Cross-cutting parser, registry, generator, and conformance-suite changes require final human validation.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

Comment thread src/core/wxc_common/src/wire.rs
Copilot AI review requested due to automatic review settings September 18, 2026 20: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

🔵 Needs a closer look

It spans parsing boundaries, schema generation, registry validation, and broad test restructuring that warrant final human review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Copilot AI review requested due to automatic review settings September 18, 2026 20:53
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from 6c4aef8 to 74c9dfd Compare September 18, 2026 20: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.

Copilot review overview

🟢 Approval recommended

The prior issues are addressed and no unresolved correctness concerns remain.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI review requested due to automatic review settings September 18, 2026 21:45
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from 74c9dfd to ac4e901 Compare September 18, 2026 21:45

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

Cross-cutting trust-boundary and code-generation changes warrant final human verification despite strong regression coverage.

Review effort: Balanced
Findings: None

Copilot AI review requested due to automatic review settings September 18, 2026 21:58
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from ac4e901 to 74fe582 Compare September 18, 2026 21: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

Cross-cutting parsing, registry, code-generation, and compatibility-test changes warrant final human validation.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Comment thread src/core/wxc_common/src/wire.rs
This PR hardens exact-contract infrastructure with focused cleanup that
reduces duplicated conformance tests and makes registry-driven code-generation
and backend-name checks fail closed.

Details

* Internalize normalization DTOs as non-deserializable implementation types.
* Share v0.9 and v0.10 exact conformance suites.
* Centralize artifact and request-root metadata in the Rust registry.
* Drive fixture diagnostics from registered roots and reject inconsistent
  renderability metadata without panicking.
* Document the registry-owned request-root contributor workflow.
* Correct architecture guidance to keep exact contracts authoritative for
  deserialization, aliases, schemas, and generated contract types.
* Fail closed on missing registry roots and unknown backend names.

Tests

* `cargo fmt --all -- --check`, `cargo check --workspace --all-targets`,
  and all-feature workspace Clippy passed.
* Workspace unit tests and the MicroVM-enabled x64 E2E tests passed.
* Node build, 434 unit tests, and integration type-check passed.
* .NET tests passed: 322 succeeded and 27 host-dependent tests skipped.
* All 82 versioning tests and exact codegen/parity/config gates passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 075defa1-7450-47ec-a6d8-953c69d509ee
Generated-with: gpt-5.6-sol
Copilot AI review requested due to automatic review settings September 18, 2026 22:05
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/version_specific_config_parsers_phase13_followups branch from 74fe582 to be6e680 Compare September 18, 2026 22:05

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

It changes cross-version parsing, artifact generation, and conformance infrastructure across multiple trust boundaries.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Gudge (MGudgin) pushed a commit that referenced this pull request Sep 19, 2026
This PR documents where schema-aware working-directory validation should run
on the exact-contract stack through #1186.

Details

* Compare the current #1147 checks with the #1184-#1186 normalization flow.
* Recommend typed compatibility validation before `ExecutionRequest` creation.
* Preserve SDK mutation defenses, error classification, and WSLC translation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bc45e3c7-c6f1-4ed8-9d08-fb1e18622401
Generated-with: gpt-5.6-sol
fixture_directory: "deprovision",
schema_definition: "DeprovisionRequest",
},
];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should just nuke the union of request roots. support just the normal request

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For the corresponding #1187-stack follow-up in #1189, OneShotRequest is only one supported root, not an umbrella for the full contract. Published v0.9 also has IsolationSessionProvisionRequest, WslcProvisionRequest, StartRequest, ExecRequest, StopRequest, and DeprovisionRequest; development v0.10 additionally has WindowsSandboxProvisionRequest. The registry metadata drives per-root schema dispatch checks and fixture validation. Reducing it to OneShotRequest would drop exact-contract coverage for the published state-aware surfaces, so I am retaining the complete root list.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

@MGudgin

Copy link
Copy Markdown
Member Author

Closing in favour of #1189

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