[IsolationSession] Refactor runner into per-responsibility module files#352
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the Windows IsolationSessionRunner backend in wxc_common by splitting the former monolithic isolation_session_runner.rs into a focused module tree under src/wxc_common/src/isolation_session/, while updating call sites to the new module path.
Changes:
- Replaced the single-file IsolationSession runner implementation with a multi-module layout (
error,policy,manager,one_shot,state_aware, etc.) underwxc_common::isolation_session. - Updated executor/dispatcher imports to reference
wxc_common::isolation_session::IsolationSessionRunner. - Preserved and regrouped unit tests alongside the new modules; added pinning tests for state-aware wire-format constants.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/wxc/src/main.rs | Updates the IsolationSession runner import to the new module path. |
| src/wxc_common/src/state_aware_dispatch.rs | Updates state-aware backend construction to use the new module path. |
| src/wxc_common/src/lib.rs | Switches exported module from isolation_session_runner to isolation_session. |
| src/wxc_common/src/isolation_session/mod.rs | Introduces the new IsolationSession module root and defines IsolationSessionRunner. |
| src/wxc_common/src/isolation_session/error.rs | Moves typed error model + conversions into a dedicated module. |
| src/wxc_common/src/isolation_session/policy.rs | Moves phase-specific policy validation and user-bundle validation. |
| src/wxc_common/src/isolation_session/process_options.rs | Moves process option construction and WinRT translation helpers. |
| src/wxc_common/src/isolation_session/folder_sharing.rs | Moves ShareFolderBatch request building and per-path outcome aggregation. |
| src/wxc_common/src/isolation_session/protected_paths_filter.rs | Moves the MXC #330 protected-path filter/normalization and tests. |
| src/wxc_common/src/isolation_session/manager.rs | Moves the IsoSessionOps lifecycle wrapper and process execution/relay logic. |
| src/wxc_common/src/isolation_session/one_shot.rs | Moves the one-shot ScriptRunner implementation. |
| src/wxc_common/src/isolation_session/state_aware.rs | Moves the StatefulSandboxBackend implementation and adds wire-format pinning tests. |
| src/wxc_common/src/isolation_session_runner.rs | Deletes the old monolithic implementation file. |
MGudgin
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits the 2,860-line
src/wxc_common/src/isolation_session_runner.rsinto 9 per-responsibility module files under
src/wxc_common/src/isolation_session/:mod.rsIsolationSessionRunner(the only externally-reachable type)error.rsIsolationSessionErrorenum +ScriptResponse/MxcErrorconversionspolicy.rsIsolationSessionUsershape checkprocess_options.rsProcessOptions+ WinRTIsoSessionProcessOptionstranslatorfolder_sharing.rsShareFolderBatchAsyncrequest build + per-path outcome aggregationprotected_paths_filter.rsmanager.rsIsolationSessionManagerlifecycle wrapper (1:1 withIsoSessionOps)one_shot.rsScriptRunnerimpl (full lifecycle in a single process)state_aware.rsStatefulSandboxBackendimpl (per-phase lifecycle methods)No external API change:
wxc_common::isolation_session::IsolationSessionRunnerremains the only externally-reachable item; every internal symbol is now
pub(super)/ module-private.Notable mechanical changes
IsolationSessionManager::create_processnow returnsi32rather thanProcessResult { exit_code, stdout, stderr }. The string fields werealways empty (output is streamed via relay threads), so this is a pure
cosmetic simplification —
ProcessResultis dropped entirely.STILL_ACTIVEshutdown ladder is extracted into a documentedwait_with_graceful_shutdownhelper. The original error-handlingcontract is preserved: first
ExitCode()query is?-propagated;per-tier subsequent queries fall back to
STILL_ACTIVE.Tests
All 81 existing unit tests are preserved, grouped with the code they
cover. Two new pinning tests added in
state_aware.rs:backend_key_matches_wire_formatandid_prefix_matches_wire_format.Microsoft Reviewers: Open in CodeFlow