Harden exact contract infrastructure - #1186
Gudge (MGudgin) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
fc5d451 to
d4408e0
Compare
There was a problem hiding this comment.
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
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.
d4408e0 to
4c8cfbc
Compare
4c8cfbc to
13a2f84
Compare
13a2f84 to
df2a9ff
Compare
There was a problem hiding this comment.
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
df2a9ff to
2f4f261
Compare
f3dbbd4 to
6c4aef8
Compare
6c4aef8 to
74c9dfd
Compare
74c9dfd to
ac4e901
Compare
ac4e901 to
74fe582
Compare
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
74fe582 to
be6e680
Compare
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", | ||
| }, | ||
| ]; |
There was a problem hiding this comment.
I think we should just nuke the union of request roots. support just the normal request
There was a problem hiding this comment.
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.
|
Closing in favour of #1189 |


📖 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
renderability metadata without panicking.
deserialization, aliases, schemas, and generated contract types.
Tests
cargo fmt --all -- --checkcargo check --workspace --all-targetscargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --exclude wxc_e2e_teststest_microvm_E2E testsnpm run build,npm test, andnpm run typecheck:integrationMicrosoft Reviewers: Open in CodeFlow