Repository navigation
Emit errors and warnings as structured ScriptResponse JSON #1482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Elliot (theelliotm)
merged 35 commits into
main
from
user/emichlin/cross-backend-error-contract
Oct 29, 2026
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
4a9c362
Give wxc-exec a typed error and warning contract
theelliotm 4f6c81d
Classify every backend failure by which side can act on it
theelliotm 1067ca9
Skip capture assertions where the host reports backend_unavailable
theelliotm f9d03b9
Report a tier the host could not build as backend_unavailable
theelliotm ad5b809
Keep an unrepresentable policy field a rejection, not an unavailable β¦
theelliotm 0a3b502
Merge remote-tracking branch 'origin/main' into user/emichlin/cross-bβ¦
theelliotm 1e1923d
Route audit cleanup diagnostics through the warning contract
theelliotm a39b1d0
Apply one classification to the paths that still disagreed
theelliotm 9b7a541
Merge remote-tracking branch 'origin/main' into user/emichlin/cross-bβ¦
theelliotm fcb5c5a
Remove Seatbelt sandbox-exec availability check
theelliotm 04d2170
Changes in response to Gudge's feedback
theelliotm 387df58
Centralize phase-aware ScriptResponse construction
theelliotm 5267817
Fix engine warning tests failing on Windows and macOS
theelliotm bc01847
Address Copilot review: timeout phase, warning line start, lifecycle β¦
theelliotm a132298
Merge remote-tracking branch 'origin/main' into user/emichlin/cross-bβ¦
theelliotm c1c3b29
fixes: teardown outcome shadowing execoutcome, ScriptResponse defaultβ¦
theelliotm ab78432
Classify Seatbelt profile host errors and emit dry-run error envelopes
theelliotm 2ed5f6f
Keep IsolationSession timeouts typed and envelopes on fresh lines
theelliotm cce533e
Merge origin/main
theelliotm 3afba24
Report relayed lifecycle exec timeouts as backend errors
theelliotm c33d632
Merge origin/main
theelliotm 7d25f28
Classify unexaminable filesystem policy paths as launch failures
theelliotm 5aa9ce7
Merge origin/main into user/emichlin/cross-backend-error-contract
theelliotm c6759be
Box the WSLc session-create failure response
theelliotm 42d5259
Merge origin/main into cross-backend-error-contract
theelliotm 9023780
Use a refused runtime proxy in the LXC refusal-phase test
theelliotm 7001ad6
Report host faults during policy path checks as backend errors
theelliotm 7264314
Condense error-classification text in versioning.md into a table
theelliotm 4fb15f6
Scope fmt::Write import to the wslc arm so non-wslc builds compile
theelliotm c4f5192
Merge origin/main into user/emichlin/cross-backend-error-contract
theelliotm 84776f9
Report host I/O faults while resolving deniedPaths as backend errors
theelliotm da7afec
Merge origin/main into user/emichlin/cross-backend-error-contract
theelliotm 909d0cb
Keep SDK v1 error codes where v2 codes would break callers
theelliotm 995d669
Merge origin/main into user/emichlin/cross-backend-error-contract
theelliotm c7bfbe5
Require a typed timeout error from the IsolationSession host test
theelliotm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <!-- | ||
| Copyright (c) Microsoft Corporation. | ||
| Licensed under the MIT License. | ||
| --> | ||
|
|
||
| # SDK v2 Error Codes | ||
|
|
||
| > **Audience:** MXC developers | ||
|
|
||
| > **Status:** WIP, tracked by [#1595](https://github.com/microsoft/mxc/issues/1595) | ||
|
|
||
| Failures are meant to be classified by the side that can fix them: the request | ||
| (`policy_validation`, exit `1`), the host (`backend_unavailable`, exit `-1`), or | ||
| the runtime (`backend_error`, exit `-1`). See the | ||
| [error contract](../architecture/versioning.md#error-contract). | ||
|
|
||
| The sites below still report their SDK v1 code, because changing it would break | ||
| published SDK callers. Each one has a `// SDK v2:` comment that names its | ||
| intended code. Move them together in the next major SDK version. | ||
|
|
||
| | Site | SDK v1 | SDK v2 | | ||
| |---|---|---| | ||
| | Shared validator: empty script, `enumeratePaths` off ProcessContainer | `backend_error` | `policy_validation` | | ||
| | Policy path checks (`FilesystemPolicyError::into_response`) | `backend_error` | `policy_validation`, or `backend_error` with phase `LaunchFailed` for host faults | | ||
| | Backend not compiled in (`mxc_engine` `run` and `dispatch`) | `unsupported_containment` | `backend_unavailable` | | ||
| | ProcessContainer: unenforceable field (`deniedPaths`, `enumeratePaths`, LPAC) | `backend_unavailable` | `policy_validation` | | ||
| | ProcessContainer: PSEC baseline unsupported | `policy_validation` | `backend_unavailable` | | ||
| | Bubblewrap: request refusals | `backend_error` | `policy_validation` | | ||
| | Bubblewrap: missing or too-old `bwrap`, no network support; proxy lookup failure | `backend_error` | `backend_unavailable`; phase `LaunchFailed` | | ||
| | LXC: request refusals | `backend_error` | `policy_validation` | | ||
| | LXC: tooling missing, streaming off Linux | `backend_error` | `backend_unavailable` | | ||
| | Seatbelt: refusals (`rejected_response`) | `backend_error` | `policy_validation` | | ||
| | WSLC: policy-path host faults | `policy_validation` | `backend_error` | | ||
| | IsolationSession one-shot: lifecycle refusals, `IsolationSessionError` conversion | `backend_error` | `policy_validation` / `backend_unavailable` | | ||
| | IsolationSession one-shot: `validate` and launch failures always use phases `Rejected` and `LaunchFailed` | as forced | the phase from the underlying error | | ||
| | IsolationSession relayed exec timeout | exit code `-1` | `backend_error` "script timed out" | | ||
|
|
||
| ## Remaining work | ||
|
|
||
| - Switch each site to its SDK v2 code behind the v2 SDK surface, keeping v1 callers on the v1 codes. | ||
| - Update the Rust, .NET and Node references under `docs/api-reference/`, the backend guides and the host test scripts under `tests/scripts/`. |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.