Skip to content

Add exact contract publication tooling - #1150

Closed
Gudge (MGudgin) wants to merge 2 commits into
user/gudge/version_specific_config_parsers_phase10bfrom
user/gudge/version_specific_config_parsers_phase11a
Closed

Gudge (MGudgin) wants to merge 2 commits into
user/gudge/version_specific_config_parsers_phase10bfrom
user/gudge/version_specific_config_parsers_phase11a

Conversation

@MGudgin

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

Copy link
Copy Markdown
Member

📖 Description

Adds Phase 11a publication and freeze tooling for exact configuration
contracts without changing the current v0.9 lifecycle state.

The Rust ContractVersion and CONTRACTS registry remains authoritative.
The schema generator emits machine-readable registry metadata from Rust and
projects a Rust-authored publication profile. A profile can include the stable
one-shot root and graduated state-aware provision backends; selecting a
state-aware backend also includes the shared start, exec, stop, and deprovision
roots.

The checked-in v0.9 profile remains conservative until the pre-publication
migration removes the experimental block and the backend graduation decision
is complete. Windows Sandbox can already be projected without an experimental
member. IsolationSession and WSLC selections fail explicitly until their
provision fields move to permanent locations, preventing silent field loss.

A merge-base-aware gate freezes published schema identities, profile metadata,
digests, and fixtures while permitting behavior-preserving Rust refactors.

🔗 References

Stacked on #1145.

The normative plan revision is commit 7bb0dbba on
user/gudge/version_specific_config_parsers_plan.

🔍 Validation

  • cargo fmt --all -- --check
  • cargo test -p mxc_config_contract -p mxc_schema_gen
  • cargo test -p wxc_common -p mxc_engine
  • cargo clippy -p mxc_config_contract -p mxc_schema_gen --all-targets -- -D warnings
  • npm test from scripts/versioning
  • Contract codegen, freeze, schema-version, and config-validation gates

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

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 with
the GitHub Actions build; it runs on merge to main, and Microsoft reviewers
with write access can trigger it on a PR with /azp run. See
docs/pull-requests.md.

If the dependency-feed-check check fails on a new dependency, the crate must
be added to the feed before the PR can pass. See
docs/pull-requests.md
for the steps.

This PR adds Phase 11a publication and freeze tooling for exact configuration
contracts without changing the current v0.9 lifecycle state.

Details

* Keep the Rust ContractVersion and CONTRACTS registry authoritative, with a
  generated machine-readable JSON artifact for CI history comparisons.
* Add a stable-candidate publication schema plus registry and publish commands
  to mxc_schema_gen.
* Add schema digest, fixture, identity, and generated-artifact freeze checks to
  the versioning CI job.
* Document the publication workflow and Rust source-of-truth boundary.

Tests

* cargo fmt --all -- --check
* cargo test -p mxc_config_contract -p mxc_schema_gen
* cargo test -p wxc_common -p mxc_engine
* cargo clippy -p mxc_config_contract -p mxc_schema_gen --all-targets -- -D warnings
* npm test in scripts/versioning
* Contract codegen, freeze, schema-version, and config-validation gates

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4bc9ddda-3260-4e9f-8fc4-a16074d837dc
Generated-with: gpt-5.6-sol
@MGudgin
Gudge (MGudgin) requested a review from a team as a code owner September 14, 2026 02:41
@azure-pipelines

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

This PR updates Phase 11a so publication can select graduated state-aware
roots without admitting experimental fields into a published contract.

Details

* Add a Rust-authored publication profile with an explicit one-shot selection
  and graduated state-aware backend list.
* Project Windows Sandbox provision plus the shared lifecycle roots without an
  experimental member, while failing explicitly for IsolationSession and WSLC
  until their provision fields move to permanent locations.
* Emit the selected publication profile in generated registry metadata and
  freeze it with published contract identities.
* Keep the checked-in v0.9 profile conservative until backend graduation is
  decided in the pre-publication migration phase.

Tests

* cargo fmt --all -- --check
* cargo test -p mxc_config_contract -p mxc_schema_gen
* cargo test -p wxc_common -p mxc_engine
* cargo clippy -p mxc_config_contract -p mxc_schema_gen --all-targets -- -D warnings
* npm test in scripts/versioning
* Contract codegen, freeze, schema-version, and config-validation gates

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4bc9ddda-3260-4e9f-8fc4-a16074d837dc
Generated-with: gpt-5.6-sol
@MGudgin
Gudge (MGudgin) requested review from a team and a balanced review from Copilot September 14, 2026 03:20

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 freeze gate mishandles object-valued profiles and does not yet protect the required adapter and builder behavior.

Get a fresh assessment by requesting another Copilot review.

Review tier: Balanced
Findings: 2 High severity · 2 Medium severity

Open findings (4)
What changed in this PR

Adds tooling to project, publish, and freeze exact configuration contracts without changing v0.9 lifecycle status.

Changes:

  • Adds Rust-authored publication profiles and stable schema projections.
  • Adds registry generation and publication CLI commands.
  • Adds CI freeze validation, tests, generated metadata, and documentation.
File Description
src/​tools/​mxc_schema_gen/​tests/​cli.rs Tests registry generation and publication.
src/​tools/​mxc_schema_gen/​src/​main.rs Implements registry and publish commands.
src/​tools/​mxc_schema_gen/​Cargo.toml Adds SHA-256 support.
src/​core/​mxc_config_contract/​src/​version.rs Makes contract versions hashable.
src/​core/​mxc_config_contract/​src/​registry.rs Adds lifecycle and freeze metadata.
src/​core/​mxc_config_contract/​src/​dev/​schema.rs Generates publication-profile schemas.
src/​core/​mxc_config_contract/​src/​dev/​publication.rs Defines stable-candidate request projections.
src/​core/​mxc_config_contract/​src/​dev/​one_shot.rs Classifies containment variants.
src/​core/​mxc_config_contract/​src/​dev/​mod.rs Exports publication APIs.
src/​Cargo.lock Records the SHA-256 dependency.
scripts/​versioning/​tests/​check-contract-freeze.test.js Tests freeze validation helpers.
scripts/​versioning/​package.json Exposes the freeze-check command.
scripts/​versioning/​check-contract-freeze.js Implements merge-base freeze checks.
schemas/​contract-registry.generated.json Records generated contract metadata.
docs/​versioning.md Documents the publication workflow.
docs/​schema-codegen.md Documents registry and freeze tooling.
.github/​workflows/​Versioning.Checks.Job.yml Runs freeze validation in CI.
.github/​copilot-instructions.md Records publication conventions.

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

errors.push(`published contract ${version} changed status to ${after.status}`);
}
for (const field of immutableIdentityFields) {
if (after[field] !== before[field]) {
Comment on lines +325 to +326
fn version_order(version: &str) -> Result<(u64, u64, u64), String> {
let core = version.split_once('-').map_or(version, |(core, _)| core);
const repoRoot = join(__dirname, "..", "..");
const registryPath = join("schemas", "contract-registry.generated.json");
const immutableIdentityFields = [
"rustVariant",
Comment on lines +154 to +160
for (const field of [
"schemaPath",
"contractModulePath",
"adapterPath",
"builderPath",
"fixturePath",
]) {
@MGudgin

Copy link
Copy Markdown
Member Author

Abandoning. Going to take a different approach.

An error occurred while trying to automatically change base from user/gudge/version_specific_config_parsers_phase10b to main September 15, 2026 13:57
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