Skip to content

Implement W365 Agents Phase 2 checkout and release lifecycle - #1723

Open
tbyfield wants to merge 5 commits into
mainfrom
users/tbyfield/w365a-phase2-lifecycle
Open

tbyfield wants to merge 5 commits into
mainfrom
users/tbyfield/w365a-phase2-lifecycle

Conversation

@tbyfield

@tbyfield tbyfield commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Implement the experimental W365 Agents Phase 2 vertical slice on the merged Phase 1 contracts: checkout through provision and terminal release through stop or deprovision.

  • Add an internal environment-configured API 2.0 service client, session-based opaque IDs, checked binding and normal engine dispatch. W365 is included in normal builds and requires runtime experimental authorization.
  • Preserve known cleanup identities, request IDs and uncertain outcomes in native structured errors. Never automatically replay checkout or perform hidden cleanup. Release acceptance does not claim completed guest reset or sanitization.
  • Use the existing Windows executor lifecycle interface. Linux/macOS executors are unchanged; their general lifecycle CLI support is deferred. Engine-level trusted-TLS fixtures run on all three platforms, with fresh-process executor recovery coverage on Windows.
  • Keep readiness/start, exec, PTY, create-and-run execution and placement sessions explicitly unavailable. Typed W365 SDK APIs are not added; Dev SDK JSON access remains gated pending cross-SDK error metadata and SDK validation.
  • Preserve Phase 1 request types and generated artifacts. Service settings remain environment-only, with no per-call endpoint/token overrides or caller-selected API version.

The branch contains one implementation commit, d9985fc7, above the merged Phase 1 commit 37a3e931.

🔗 References

Refs #1615 (open, maintainer-applied feature-accepted).

Approved and merged design/API proposal: #1619. Phase 1 contracts: #1697.

Implementation scope and validation limits: docs/backends/w365agents/w365agents-backend.md.

🔍 Validation

Local Windows validation of the final tree, from src/ unless stated otherwise:

  • cargo check -p mxc-sdk --quiet — passed after removing the unused ureq/json feature and refreshing the lockfile.
  • cargo build --locked -p wxc --features test-support --quiet — passed.
  • With MXC_W365_TEST_EXECUTOR pointing to the built target/debug/wxc-exec.exe, cargo test --locked -p mxc-sdk --lib w365 -- --include-ignored — passed, 6 tests, including trusted-TLS engine and fresh-process Windows executor fixtures. Only loopback services and synthetic credentials were used.
  • cargo test --locked -p mxc-sdk --lib --quiet -- config_parser state_aware backend_registry policy_identity — passed, 497 tests.
  • cargo test --locked -p mxc-sdk --test mxc_contract_v1_1_0_alpha --test state_aware --quiet — passed, 388 contract tests and 16 lifecycle tests.
  • cargo test --locked -p mxc_ffi --lib state_aware --quiet — passed, 21 tests.
  • cargo fmt --all -- --check — passed.
  • cargo clippy --locked -p mxc-sdk -p mxc_ffi -p wxc --all-targets -- -D warnings — passed; build script reported the existing Python Store alias prerequisite warning.
  • Repository root: node scripts/versioning/check-contract-codegen.js — passed; three artifact sets match and published schemas match origin/main.
  • Repository root: git diff --check origin/main..HEAD — passed.

Native Linux/macOS runs and dependency-feed validation have not been run locally; PR CI remains required. Existing CI matrices are preserved. Windows CI requires both fixtures; Linux/macOS CI requires the engine fixture.

Separately supplied live evidence at earlier commit 32ac2531 established exactly one authorized API 2.0 Local checkout and fresh-process deprovision with renewed credentials and the same retained ID. This proves release acceptance only, not completed reset, HumanUser, readiness/exec or SDK behavior. An earlier HumanUser attempt returned HTTP 500/provision_timeout with uncertainty and no session ID and remains unresolved. No additional live calls were made for this review or publication. The backend guide's original statement that live validation has not run predates that supplied evidence.

✅ Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • For features or changes requiring a spec: linked the issue with maintainer-applied feature-accepted
  • For implementation: linked the required approved and merged design/API spec, or explained why no spec is required
  • Feature issue remains open unless this PR completes all agreed implementation, validation, and documentation
  • Updated documentation (if applicable)
  • Updated Copilot instructions (if build, architecture, or conventions changed)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes (see pull request builds)

No new repository-wide architecture or contributor convention requires an instruction update. CLA status and dependency-feed CI are left unconfirmed.

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

Add environment-configured checkout and terminal release through the normal engine, preserving session cleanup identities and uncertain outcomes. Expose lifecycle operations through the existing Windows executor only; leave Linux and macOS CLI lifecycle support unchanged. Keep readiness, execution and public SDK access explicitly deferred. Validate parser and engine behavior with cross-platform trusted-TLS fixtures and fresh-process recovery through the Windows executor.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 18:43
@azure-pipelines

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

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.

🟡 Changes recommended

Checkout error responses discard valid session IDs needed for cleanup, and required Azure builds omit lifecycle and recovery fixtures, allowing artifacts to be published without those checks.

2 open issues
What changed in this PR

Implements the experimental W365 Agents checkout and terminal-release lifecycle on the merged Phase 1 contracts, using MXC’s existing engine and Windows executor interfaces.

Changes:

  • Adds an environment-configured API 2.0 client, session-based IDs, checked dispatch and structured recovery errors.
  • Keeps readiness, execution and Dev SDK access unavailable pending later phases.
  • Adds trusted-TLS fixtures, GitHub Actions validation and documentation of configuration, cleanup and current limits.
File Description
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​w365_agents.rs Updates routing, authorization and SDK-gating assertions.
src/​mxc-sdk/​src/​core/​mxc_engine/​state_aware.rs Adds W365 dispatch and blocks SDK lifecycle access.
src/​mxc-sdk/​src/​core/​mxc_engine/​run.rs Rejects W365 create-and-run execution.
src/​mxc-sdk/​src/​core/​mxc_engine/​backend_registry.rs Registers W365 as experimental and not locally detectable.
src/​mxc-sdk/​src/​core/​mxc_common/​state_aware_request.rs Adds lifecycle phase parsing from strings.
src/​mxc-sdk/​src/​core/​mxc_common/​state_aware_operation.rs Adds passive W365 provision inputs.
src/​mxc-sdk/​src/​core/​mxc_common/​state_aware_dispatch.rs Routes the w365 ID prefix.
src/​mxc-sdk/​src/​core/​mxc_common/​state_aware_binding.rs Adds checked W365 request binding.
src/​mxc-sdk/​src/​core/​mxc_common/​policy_identity.rs Excludes W365 account coordinates from containment policy identity.
src/​mxc-sdk/​src/​core/​mxc_common/​models.rs Adds the W365 backend variant and names.
src/​mxc-sdk/​src/​core/​mxc_common/​config_parser.rs Normalizes W365 lifecycle requests and ID routing.
src/​mxc-sdk/​src/​core/​mxc_common/​config_contract_adapters/​dev/​w365_agents.rs Adapts contract settings into provision inputs.
src/​mxc-sdk/​src/​core/​mxc_common/​config_contract_adapters/​dev/​state_aware.rs Produces W365 lifecycle operations.
src/​mxc-sdk/​src/​core/​mxc_common/​cmdline.rs Selects Windows command syntax for W365.
src/​mxc-sdk/​src/​backends/​w365agents/​tests.rs Adds TLS lifecycle and fresh-executor recovery fixtures.
src/​mxc-sdk/​src/​backends/​w365agents/​service.rs Implements checkout, release, identity validation and service errors.
src/​mxc-sdk/​src/​backends/​w365agents/​mod.rs Implements backend validation and lifecycle methods.
src/​mxc-sdk/​src/​backends/​mod.rs Includes the internal W365 backend module.
src/​mxc-sdk/​Cargo.toml Adds HTTP/TLS dependencies and fixture support.
src/​ffi/​mxc_ffi/​src/​state_aware.rs Tests that W365 SDK access remains unavailable.
src/​Cargo.lock Records updated dependency resolution.
docs/​schema.md Explains W365 development-contract support and limits.
docs/​development/​build-and-test/​ci-validation-infrastructure.md Documents platform fixture coverage.
docs/​development/​architecture/​designs/​1615-w365a-backend/​README.md Updates implementation scope and environment-only configuration.
docs/​development/​architecture/​designs/​1615-w365a-backend/​api.md Clarifies the Phase 2 executor and SDK boundaries.
docs/​containment-policy/​dev/​policy.md Documents experimental checkout and release support.
docs/​backends/​w365agents/​w365agents-backend.md Adds configuration, cleanup and validation guidance.
.github/​workflows/​Build.Windows.Job.yml Requires engine and fresh-executor fixtures.
.github/​workflows/​Build.MacOS.Job.yml Requires the engine TLS fixture.
.github/​workflows/​Build.Linux.Job.yml Requires the engine TLS fixture.

Review effort: Balanced

Comment on lines +175 to +176
cargo test --locked -p mxc-sdk --lib --target '${{ matrix.target }}' w365 -- --include-ignored
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d2d77aa. Azure now explicitly discovers and runs the engine fixture on Linux x64 and both fixtures on Windows x64. Windows builds its test-support executor in a separate target directory outside shipping artifacts. macOS checks fixture discovery before the existing package suite runs it; cross-compiled Windows/Linux arm64 jobs remain build-only. Template structure and embedded PowerShell/Bash syntax checks passed locally; the updated Azure jobs have not run yet.

Retain valid session identities from bounded checkout error responses without changing HTTP failure classification or replaying allocation. Cover recovery and unreadable bodies in TLS and fresh-executor fixtures, and require fixture discovery and execution on native Azure build hosts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 20:08

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.

🟡 Changes recommended

The dependency changes introduce unconfigured native TLS/OpenSSL requirements into the ARM64 cross-build, while missing feed dependencies leave the dependency gate failing and block platform builds and W365 fixture verification.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Add locked dependencies to the required dependency feed

src/​mxc-sdk/​Cargo.toml:84

[P2] Add the new locked dependencies to the required dependency feed before merging. The current dependency-feed-check job fails with HTTP 401 and “No local versions of package 'rcgen'” (job 130096170380), which also skips the Windows, Linux and macOS build jobs and their new W365 fixtures. As documented in docs/development/build-and-test/pull-requests.md:228–240, a feed Contributor needs to run MXC-Update-Feed-Dependencies with prNumber=1723, then rerun the dependency gate and affected builds.

1 resolved since last review

Review effort: Balanced

Comment thread src/mxc-sdk/Cargo.toml Resolved
Preserve W365 rustls on all targets while restoring the architecture-specific optional native TLS and gzip features for Hyperlight. Add an Azure ARM64 dependency graph regression check.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 20:38

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.

🔵 Needs a closer look

The dependency feed cannot resolve rcgen, causing the dependency gate to fail and Windows, Linux, and macOS builds—including the new lifecycle fixtures—to be skipped.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

High severity Seed rcgen in MxcDependencies before merging

src/​mxc-sdk/​Cargo.toml:83

[P2] Seed the new dependencies in MxcDependencies before merging. The current dependency-feed-check job (130113697446) fails resolving rcgen with HTTP 401 and the feed explicitly reports “No local versions of package 'rcgen'.” Consequently, the Windows, Linux and macOS build jobs—including the new lifecycle fixtures—are skipped. Have a contributor run MXC-Update-Feed-Dependencies with prNumber=1723, as documented in docs/development/build-and-test/pull-requests.md:228–240, then rerun the gate and platform jobs; successful crates.io builds do not validate this dependency path.

1 resolved since last review

Review effort: Balanced

@tbyfield

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Use platform trust for production HTTPS and replace the rustls test server with native TLS. Generate test certificates at runtime, package Windows identities with OpenSSL, and explicitly clean up imported fixture keys. Add Linux OpenSSL build prerequisites including ARM64 target libraries and update CI dependency checks and documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 22:33

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.

🔵 Needs a closer look

Maintainer and service-owner review is needed to confirm outstanding cross-platform TLS/OpenSSL validation, accept the API 2.0 contract and live-validation limits, and reconcile the uncertain HumanUser checkout outcome.

1 open issue

Review effort: Balanced

Package generated EC fixture identities as PKCS12 for macOS import compatibility. Select the Windows OpenSSL executable directly instead of prepending Git Unix tools to PATH, preserving Windows tar for packaging validation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 23:18

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.

🔵 Needs a closer look

Unresolved API 2.0 HumanUser checkout behavior and allocation cleanup risks need service-owner confirmation, while Linux/macOS TLS fixtures and Azure ARM64 OpenSSL builds still lack execution results.

1 open issue

Review effort: Balanced

@tbyfield
tbyfield marked this pull request as ready for review November 11, 2026 00:10
@tbyfield
tbyfield requested a review from a team November 11, 2026 00:10
@tbyfield
tbyfield requested a review from a team as a code owner November 11, 2026 00:10

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