Skip to content

[WSLC] (4/4) Expose explicit session lifecycle - #1512

Open
Soham Das (SohamDas2021) wants to merge 4 commits into
sohamdas2021-pr3-session-phase-vocabularyfrom
sohamdas2021-pr4-session-contract-and-cli
Open

Soham Das (SohamDas2021) wants to merge 4 commits into
sohamdas2021-pr3-session-phase-vocabularyfrom
sohamdas2021-pr4-session-contract-and-cli

Conversation

@SohamDas2021

@SohamDas2021 Soham Das (SohamDas2021) commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Explicit WSLc sessions are now reachable through development 1.1.0-alpha MXC request JSON, the in-process engine, and CLI. Callers can create a VM with CPU/memory/GPU sizing, share it across sandboxes, and release it when empty. Omitting sessionId preserves implicit-session behavior.

Dry runs validate without allocating resources, session operations avoid the sandbox correlation store, and isolated provisions identify the selected cold image store instead of reporting a misleading missing-image error. Published contracts and SDK V1 remain unchanged. Sandbox policy hashes record named-session placement but do not include the joined VM's sizing; this limitation is documented.

🔗 References

Part of #1460. Fourth of four PRs; stacked on #1503.

PR Title
1 [WSLC] (1/4) Move the lifecycle daemon off the create-and-run image store
2 [WSLC] (2/4) Hold multiple sessions in the lifecycle daemon
3 [WSLC] (3/4) Add the session lifecycle phases and dispatch routing
4 [WSLC] (4/4) Expose explicit session lifecycle — this PR

🔍 Validation

All results are from the rebased stack on Windows with a live WSL2 host.

From src\:

Command Result
cargo fmt --all -- --check passed
cargo test --quiet --workspace passed
cargo test --quiet --workspace --features wxc/wslc passed; SDK library 3252, daemon 139, executor 72 tests passed
cargo clippy --quiet --workspace --all-targets -- -D warnings passed
cargo clippy --quiet --workspace --all-targets --features wxc/wslc -- -D warnings passed
cargo build --quiet -p wxc --features wslc passed
cargo build --quiet -p mxc-sdk --features wslc --bin wxc-wslc-daemon passed

From the repository root:

Command Result
node .\scripts\versioning\check-schema-versions.js passed
node .\scripts\versioning\validate-configs.js passed; 412 configs validated, 14 intentionally-invalid exemptions
node .\scripts\versioning\check-contract-codegen.js passed; all 3 generated artifact sets match; published schemas unchanged

Live E2E: 122/122 passed, including shared sandboxes, independently releasable identically sized sessions, and the private one-warmed-slot refusal case.

$wxc = Join-Path (Get-Location) 'src\target\debug\wxc-exec.exe'
& .\tests\scripts\run_wslc_state_aware_tests.ps1 -WxcExecPath $wxc -Debug

Host-gated/ignored Rust cases were not enabled by the workspace commands; the live WSLc coverage above ran separately.

✅ 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 pull request builds.

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 pull request builds
for the steps.

Microsoft Reviewers: Open in CodeFlow

@SohamDas2021
Soham Das (SohamDas2021) requested a review from a team as a code owner October 15, 2026 23:37
@azure-pipelines

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

@SohamDas2021
Soham Das (SohamDas2021) added this pull request to stack #1502 October 15, 2026 23:39
Comment thread src/mxc-sdk/src/backends/wslc/common/state_aware.rs Fixed
Comment thread src/mxc-sdk/src/backends/wslc/common/state_aware.rs Fixed
Comment thread src/mxc-sdk/src/core/mxc_engine/state_aware.rs Fixed
@SohamDas2021
Soham Das (SohamDas2021) requested review from a team and a balanced review from Copilot October 16, 2026 02:34
@SohamDas2021
Soham Das (SohamDas2021) force-pushed the sohamdas2021-pr4-session-contract-and-cli branch from ece05e7 to 9df17ae Compare October 16, 2026 02:50

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

Windows VM ownership, shared-session capabilities, and store isolation warrant human review of the reported integration results.

0 open findings

What changed in this PR

Completes the WSLc session lifecycle stack for #1460, exposing explicit VM creation, sharing, and release through development request JSON, the engine, and CLI. Published contracts and SDK V1 remain unchanged.

Changes:

  • Adds session operations, sizing, placement, and CLI identity routing.
  • Separates session telemetry correlation and improves cold-store diagnostics.
  • Adds contract and lifecycle tests, generated artifacts, and documentation.
File Description
tests/​scripts/​run_wslc_state_aware_tests.ps1 Tests shared sessions, independent lifetimes, and cold-store refusal.
tests/​scripts/​run_wslc_all_tests.ps1 Warms three daemon stores.
tests/​scripts/​README.md Documents expanded test prerequisites.
tests/​configs/​wslc_state_aware_provision_session.json Adds session creation fixture.
tests/​configs/​wslc_state_aware_provision_in_session.json Adds named-session placement fixture.
tests/​configs/​wslc_state_aware_deprovision_session.json Adds session release fixture.
src/​tools/​wxc/​src/​main.rs Exposes session operations and identity flags.
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​fixtures/​wslc_provision/​valid/​named_session.json Covers valid session placement.
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​fixtures/​wslc_provision_session/​valid/​sized.json Covers explicit VM sizing.
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​fixtures/​wslc_provision_session/​valid/​minimal.json Covers default session creation.
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​fixtures/​wslc_provision_session/​invalid/​foreign_session_id.json Rejects identity on session creation.
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​fixtures/​wslc_provision_session/​invalid/​foreign_sandbox_provision.json Rejects sandbox configuration on session creation.
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​fixtures/​wslc_deprovision_session/​valid/​minimal.json Covers valid session release.
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​fixtures/​wslc_deprovision_session/​invalid/​missing_session_id.json Requires release identity.
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​fixtures/​wslc_deprovision_session/​invalid/​foreign_sandbox_id.json Rejects sandbox identity for session release.
src/​mxc-sdk/​tests/​mxc_contract/​v1_1_0_alpha/​fixtures.rs Registers and tests session fixtures.
src/​mxc-sdk/​src/​state_aware_sdk.rs Preserves implicit placement for SDK V1.
src/​mxc-sdk/​src/​core/​mxc_engine/​state_aware.rs Updates correlation and session validation tests.
src/​mxc-sdk/​src/​core/​mxc_contract/​registry.rs Registers development session request roots.
src/​mxc-sdk/​src/​core/​mxc_contract/​dev/​state_aware/​provision/​wslc.rs Adds optional session placement.
src/​mxc-sdk/​src/​core/​mxc_contract/​dev/​state_aware/​provision_session.rs Defines session creation requests.
src/​mxc-sdk/​src/​core/​mxc_contract/​dev/​state_aware/​phase.rs Recognizes session phase names.
src/​mxc-sdk/​src/​core/​mxc_contract/​dev/​state_aware/​mod.rs Exports session contract types.
src/​mxc-sdk/​src/​core/​mxc_contract/​dev/​state_aware/​deprovision_session.rs Defines session release requests.
src/​mxc-sdk/​src/​core/​mxc_contract/​dev/​schema.rs Generates session schema branches.
src/​mxc-sdk/​src/​core/​mxc_contract/​dev/​request.rs Parses WSLc session requests.
src/​mxc-sdk/​src/​core/​mxc_contract/​dev/​mod.rs Exports development session types.
src/​mxc-sdk/​src/​core/​mxc_common/​telemetry/​correlation_state.rs Keeps session operations outside sandbox correlation storage.
src/​mxc-sdk/​src/​core/​mxc_common/​state_aware_dispatch.rs Uses valid session IDs in tests.
src/​mxc-sdk/​src/​core/​mxc_common/​state_aware_binding_tests.rs Updates session binding test identities.
src/​mxc-sdk/​src/​core/​mxc_common/​splice.rs Updates session routing test identity.
src/​mxc-sdk/​src/​core/​mxc_common/​sdk_input.rs Restricts named sessions to the development contract.
src/​mxc-sdk/​src/​core/​mxc_common/​policy_identity.rs Records named placement without session values.
src/​mxc-sdk/​src/​core/​mxc_common/​models.rs Carries optional placement identity.
src/​mxc-sdk/​src/​core/​mxc_common/​config_parser.rs Parses session roots and validates CLI target flags.
src/​mxc-sdk/​src/​core/​mxc_common/​config_contract_adapters/​v1_0/​state_aware.rs Preserves published-contract implicit placement.
src/​mxc-sdk/​src/​core/​mxc_common/​config_contract_adapters/​v0_9/​state_aware.rs Preserves older-contract implicit placement.
src/​mxc-sdk/​src/​core/​mxc_common/​config_contract_adapters/​dev/​state_aware.rs Adapts session sizing and identities.
src/​mxc-sdk/​src/​core/​mxc_common/​config_contract_adapters/​dev/​state_aware_tests/​session.rs Tests session adaptation and field presence.
src/​mxc-sdk/​src/​core/​mxc_common/​config_contract_adapters/​dev/​state_aware_tests/​mod.rs Includes session adapter tests.
src/​mxc-sdk/​src/​core/​mxc_common/​config_contract_adapters/​dev/​mod.rs Routes session request adaptation.
src/​mxc-sdk/​src/​backends/​wslc/​common/​state_aware.rs Implements session operations and validation.
src/​mxc-sdk/​src/​backends/​wslc/​common/​image.rs Explains selected cold-store failures and recovery.
src/​mxc-sdk/​src/​backends/​wslc/​common/​daemon_client.rs Adds session lifecycle client calls.
sdk/​node/​src/​generated/​v1_1_0_alpha/​wire.ts Regenerates development session types.
scripts/​versioning/​check-schema-versions.js Checks required session request roots.
schemas/​schema-version.json Updates the WSLc compatibility selector.
schemas/​dev/​mxc-config.schema.1.1.0-alpha.json Adds generated session schemas.
docs/​telemetry.md Links lifecycle correlation documentation.
docs/​schema.md Documents session requests and identity routing.
docs/​development/​build-and-test/​schema-codegen.md Updates request-root generation documentation.
docs/​development/​architecture/​versioning.md Explains development-only session availability.
docs/​development/​architecture/​telemetry.md Documents internal correlation and session separation.
docs/​development/​architecture/​container-lifecycle.md Documents session CLI transport.
docs/​backends/​wslc/​wslc-state-aware.md Explains session behavior, testing, and limitations.
docs/​backends/​wslc/​wsl-container-getting-started.md Adds session sizing and placement examples.

🧠 Review effort: Balanced


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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a56b1c8c-bb73-41f2-83c1-f27ef0f37c66
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a56b1c8c-bb73-41f2-83c1-f27ef0f37c66
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a56b1c8c-bb73-41f2-83c1-f27ef0f37c66
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a56b1c8c-bb73-41f2-83c1-f27ef0f37c66
Copilot AI balanced review requested due to automatic review settings October 16, 2026 03:29
@SohamDas2021
Soham Das (SohamDas2021) force-pushed the sohamdas2021-pr4-session-contract-and-cli branch from 9df17ae to 354d88c Compare October 16, 2026 03: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.

🔵 Needs a closer look

Cross-process VM sharing, GPU configuration, and resource teardown warrant final human review of the reported Windows/WSL2 validation.

0 open findings

🧠 Review effort: Balanced

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.

3 participants