Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3f0df3c
Finalize telemetry documentation
RamonArjona4 Aug 18, 2026
c35147a
Harden telemetry consent foundation
RamonArjona4 Aug 18, 2026
dc13cc7
Reject stale consent presenter decisions
RamonArjona4 Aug 19, 2026
f375e70
Tag WINEXT telemetry with MXC Part A
RamonArjona4 Aug 20, 2026
257c306
Make WINEXT contract test format-independent
RamonArjona4 Aug 20, 2026
b58d4f8
Request delete access for consent lock
RamonArjona4 Aug 20, 2026
e711eeb
Integrate telemetry into MXC runtime
RamonArjona4 Aug 18, 2026
435b71e
Stabilize blocking-task panic regression
RamonArjona4 Aug 19, 2026
153cb7a
Report confirmed SDK kills as cancellation
RamonArjona4 Aug 20, 2026
bd60b66
Verify WINEXT Part A fields in ETW
RamonArjona4 Aug 20, 2026
253228a
Align telemetry with the 0.8 config adapter
RamonArjona4 Aug 20, 2026
ed3a7c3
Merge main into telemetry runtime branch
RamonArjona4 Aug 31, 2026
cbc42ea
Fix dependency and API parity CI gates
RamonArjona4 Aug 31, 2026
944c698
Preserve telemetry sandbox attribution
RamonArjona4 Aug 31, 2026
bfb0ecb
Complete telemetry contract and lifecycle handling
RamonArjona4 Sep 1, 2026
0ad1b03
Fix telemetry lifecycle edge cases
RamonArjona4 Sep 1, 2026
ad189bb
Merge main into telemetry runtime
RamonArjona4 Sep 1, 2026
4169b06
Consolidate telemetry runtime consent pivot
RamonArjona4 Sep 2, 2026
34a9059
Remove consent transport versioning
RamonArjona4 Sep 2, 2026
2dc3c0b
Simplify consent command dispatch
RamonArjona4 Sep 2, 2026
8a077c2
Fix state-aware telemetry diagnostics
RamonArjona4 Sep 2, 2026
291d015
Fix piped consent smoke assertion
RamonArjona4 Sep 2, 2026
8879a7d
Remove non-Windows executor detail
Copilot Sep 2, 2026
c4aa355
Apply requested telemetry removals
RamonArjona4 Sep 2, 2026
55a45d1
Close telemetry ownership gaps
RamonArjona4 Sep 2, 2026
416f691
Scope smoke-test consent overrides
RamonArjona4 Sep 2, 2026
e24bf5f
Fix consent test module ordering
RamonArjona4 Sep 2, 2026
1f5ace1
Merge main into telemetry runtime
RamonArjona4 Sep 2, 2026
42c0c12
Merge main into telemetry runtime
RamonArjona4 Sep 4, 2026
5df9226
Merge current main into telemetry runtime
RamonArjona4 Sep 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/Build.Windows.Job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,32 @@ jobs:
--no-default-features
--features "${{ matrix.features }}"

- name: Test telemetry consent and policy in release mode
run: |
cargo test --locked --release --target ${{ matrix.target }} -p wxc_common telemetry::consent
cargo test --locked --release --target ${{ matrix.target }} -p wxc_common telemetry::policy

- name: Test
run: cargo test --locked --release --target ${{ matrix.target }}
--no-default-features
--features "${{ matrix.features }}"

- name: Build debug executor for isolated telemetry smoke tests
if: matrix.arch == 'x64'
run: cargo build --locked -p wxc --features test-support

- name: Run isolated telemetry consent smoke test
if: matrix.arch == 'x64'
working-directory: ${{ github.workspace }}
shell: pwsh
run: tests\scripts\run_telemetry_consent_smoke_test.ps1 -BinDir src\target\debug

- name: Run isolated telemetry ETW smoke test
if: matrix.arch == 'x64'
working-directory: ${{ github.workspace }}
shell: pwsh
run: tests\scripts\run_telemetry_etw_smoke_test.ps1 -BinDir src\target\debug

- name: Upload binaries
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand Down
8 changes: 5 additions & 3 deletions docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ cannot mix both formats in one request.
"extraMachLookups": [] // Additional Mach service global-names the inner process may resolve
},

"telemetry": { // Telemetry (Windows only)
"enabled": true // Request emission for this run; MXC-owned user consent
// and a permitting administrative policy are also required
},

"experimental": { // Experimental features (requires --experimental)
"wslc": { // WSL Container settings
"image": "alpine:latest", // Container image name
Expand All @@ -210,9 +215,6 @@ cannot mix both formats in one request.
"portMappings": [ // Host<->container port forwarding. TCP only -- the WSLC SDK runtime returns E_NOTIMPL for UDP, so the parser hard-rejects "udp" entries with a clear message.
{ "windowsPort": 8080, "containerPort": 80, "protocol": "tcp" }
Comment thread
RamonArjona4 marked this conversation as resolved.
]
},
"telemetry": { // Telemetry (Windows only)
"enabled": true // Emit TraceLogging ETW events via pure Rust tracelogging crate
}
}
}
Expand Down
17 changes: 7 additions & 10 deletions docs/telemetry/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ C++ shim, WIL, or FFI is required.
└──────────────────────────────────────────────────────┘
```

## Why the Rust `tracelogging` Crate (Not WIL C++ Shim)
## TraceLogging implementation

An earlier design used a WIL C++ shim compiled via the `cc` crate. PR review
feedback correctly noted that the WIL dependency added C++ compilation, NuGet
download, FFI unsafety, and blocked non-Windows contributors from building the
crate. The Rust `tracelogging` crate provides the core ETW primitives needed,
and the small set of WIL features MXC actually uses can be replicated with
Rust constants and `write_event!` struct fields.
The Rust `tracelogging` crate provides MXC's required ETW primitives without a
C++ build, NuGet dependency, or FFI boundary. MXC supplies the remaining
provider metadata through Rust constants and `write_event!` struct fields.

### Feature comparison

Expand Down Expand Up @@ -183,9 +180,9 @@ Emitted on execution errors.
| `__TlgCV__` | string | Microsoft Correlation Vector (MS-CV) — the lifecycle correlation key (see [Correlating a lifecycle](#correlating-a-lifecycle)); empty for one-shot executions |

> **No free-form error text is emitted.** Error messages can contain paths,
> usernames, or credentials, so `MXC.Error` deliberately carries only the
> bounded `error_type` category and the numeric `exit_code` — never the
> message string itself.
> usernames, or credentials, so `MXC.Error` deliberately carries only bounded
> attribution fields, the `error_type` category, and the numeric `exit_code` —
> never the message string itself.
Comment on lines +183 to +185

### Correlating a lifecycle

Expand Down
92 changes: 33 additions & 59 deletions schemas/dev/mxc-config.schema.0.9.0-alpha.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@
"DeprovisionExperimental": {
"additionalProperties": false,
"description": "Experimental settings accepted by the `deprovision` phase.",
"properties": {
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry override."
}
},
"type": "object"
},
"DeprovisionPhase": {
Expand All @@ -219,10 +213,6 @@
"_comment": {
"description": "Optional human-readable annotation ignored by the runtime."
},
"correlationVector": {
"description": "Optional correlation vector relayed from provision.",
"type": "string"
},
"experimental": {
"$ref": "#/definitions/DeprovisionExperimental",
"description": "Optional closed post-provision experimental settings."
Expand All @@ -235,6 +225,10 @@
"description": "Identifier of the sandbox to deprovision.",
"type": "string"
},
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry configuration."
},
"version": {
"$ref": "#/definitions/Version",
"description": "Exact development contract version."
Expand All @@ -250,12 +244,6 @@
"ExecExperimental": {
"additionalProperties": false,
"description": "Experimental settings accepted by the `exec` phase.",
"properties": {
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry override."
}
},
"type": "object"
},
"ExecPhase": {
Expand All @@ -275,10 +263,6 @@
"_comment": {
"description": "Optional human-readable annotation ignored by the runtime."
},
"correlationVector": {
"description": "Optional correlation vector relayed from provision.",
"type": "string"
},
"experimental": {
"$ref": "#/definitions/ExecExperimental",
"description": "Optional closed exec experimental settings."
Expand All @@ -299,6 +283,10 @@
"description": "Identifier of the sandbox to execute in.",
"type": "string"
},
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry configuration."
},
"version": {
"$ref": "#/definitions/Version",
"description": "Exact development contract version."
Expand Down Expand Up @@ -400,10 +388,6 @@
"isolation_session": {
"$ref": "#/definitions/StateAwareIsolationSession",
"description": "Optional IsolationSession backend settings."
},
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry override."
}
},
"type": "object"
Expand Down Expand Up @@ -435,6 +419,10 @@
"$ref": "#/definitions/ProvisionPhase",
"description": "Exact `provision` phase marker."
},
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry configuration."
},
"version": {
"$ref": "#/definitions/Version",
"description": "Exact development contract version."
Expand Down Expand Up @@ -876,10 +864,6 @@
"additionalProperties": false,
"description": "Experimental settings.",
"properties": {
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry override."
},
"test": {
"$ref": "#/definitions/TestFeature",
"description": "Optional placeholder test feature."
Expand Down Expand Up @@ -980,6 +964,10 @@
"$ref": "#/definitions/Seatbelt",
"description": "Optional macOS Seatbelt configuration."
},
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry configuration."
},
"ui": {
"$ref": "#/definitions/Ui",
"description": "Optional cross-platform user-interface policy."
Expand Down Expand Up @@ -1280,12 +1268,6 @@
"StartExperimental": {
"additionalProperties": false,
"description": "Experimental settings accepted by the `start` phase.",
"properties": {
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry override."
}
},
"type": "object"
},
"StartPhase": {
Expand All @@ -1305,10 +1287,6 @@
"_comment": {
"description": "Optional human-readable annotation ignored by the runtime."
},
"correlationVector": {
"description": "Optional correlation vector relayed from provision.",
"type": "string"
},
"experimental": {
"$ref": "#/definitions/StartExperimental",
"description": "Optional closed post-provision experimental settings."
Expand All @@ -1321,6 +1299,10 @@
"description": "Identifier returned by the provision phase.",
"type": "string"
},
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry configuration."
},
"version": {
"$ref": "#/definitions/Version",
"description": "Exact development contract version."
Expand Down Expand Up @@ -1358,12 +1340,6 @@
"StopExperimental": {
"additionalProperties": false,
"description": "Experimental settings accepted by the `stop` phase.",
"properties": {
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry override."
}
},
"type": "object"
},
"StopPhase": {
Expand All @@ -1383,10 +1359,6 @@
"_comment": {
"description": "Optional human-readable annotation ignored by the runtime."
},
"correlationVector": {
"description": "Optional correlation vector relayed from provision.",
"type": "string"
},
"experimental": {
"$ref": "#/definitions/StopExperimental",
"description": "Optional closed post-provision experimental settings."
Expand All @@ -1399,6 +1371,10 @@
"description": "Identifier returned by the provision phase.",
"type": "string"
},
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry configuration."
},
"version": {
"$ref": "#/definitions/Version",
"description": "Exact development contract version."
Expand All @@ -1413,7 +1389,7 @@
},
"Telemetry": {
"additionalProperties": false,
"description": "One-shot telemetry override.",
"description": "Telemetry settings.",
"properties": {
"enabled": {
"description": "Whether telemetry is enabled.",
Expand Down Expand Up @@ -1521,12 +1497,6 @@
"WindowsSandboxExperimental": {
"additionalProperties": false,
"description": "Experimental settings accepted by a Windows Sandbox provision request.",
"properties": {
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry override."
}
},
"type": "object"
},
"WindowsSandboxProvisionRequest": {
Expand Down Expand Up @@ -1556,6 +1526,10 @@
"$ref": "#/definitions/ProvisionPhase",
"description": "Exact `provision` phase marker."
},
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry configuration."
},
"version": {
"$ref": "#/definitions/Version",
"description": "Exact development contract version."
Expand Down Expand Up @@ -1593,10 +1567,6 @@
"additionalProperties": false,
"description": "Experimental settings accepted by a WSLC provision request.",
"properties": {
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry override."
},
"wslc": {
"$ref": "#/definitions/StateAwareWslc",
"description": "Optional WSLC backend settings."
Expand Down Expand Up @@ -1635,6 +1605,10 @@
"$ref": "#/definitions/ProvisionPhase",
"description": "Exact `provision` phase marker."
},
"telemetry": {
"$ref": "#/definitions/Telemetry",
"description": "Optional telemetry configuration."
},
"version": {
"$ref": "#/definitions/Version",
"description": "Exact development contract version."
Expand Down
34 changes: 14 additions & 20 deletions schemas/dev/mxc-config.schema.0.9.0-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,6 @@
],
"description": "Seatbelt backend config (pre-promotion alias)."
},
"telemetry": {
"anyOf": [
{
"$ref": "#/definitions/Telemetry"
},
{
"type": "null"
}
],
"description": "Telemetry configuration."
},
"test": {
"anyOf": [
{
Expand Down Expand Up @@ -961,10 +950,11 @@
"type": "object"
},
"Telemetry": {
"description": "Telemetry configuration (`experimental.telemetry`).",
"additionalProperties": false,
"description": "Telemetry configuration (`telemetry`).",
"properties": {
"enabled": {
"description": "Explicit telemetry override. `true` = force on, `false` = force off, omitted = disabled (default off).",
"description": "Explicit telemetry opt-in for this invocation. `true` = opt in (still subject to the user's consent and to administrative policy — it can never turn telemetry on for someone who has not consented), `false` = force off, omitted = off.",
"type": [
"boolean",
"null"
Expand Down Expand Up @@ -1196,13 +1186,6 @@
],
"description": "Containment backend to use for execution. Accepts abstract intents (`process`, `vm`) and concrete backends; the binary resolves intents to a concrete backend per host at run time."
},
"correlationVector": {
"description": "Microsoft Correlation Vector (MS-CV) seeded at `provision` and returned in the provision result. The client relays it verbatim into every later state-aware phase so all phases of one lifecycle share a telemetry base prefix (emitted under `__TlgCV__`). The executor is the trust boundary: on each non-provision phase it validates the relayed value and *spins* a fresh child element off a mutable base (so multiple invocations of one phase stay distinct), passes an already-frozen vector through unchanged, and reseeds a brand-new base if the relayed value is absent or malformed — so a missing or hostile relay never reaches telemetry unvalidated. Ignored unless experimental telemetry is enabled; not valid on one-shot requests.",
"type": [
"string",
"null"
]
},
"experimental": {
"anyOf": [
{
Expand Down Expand Up @@ -1331,6 +1314,17 @@
],
"description": "macOS Seatbelt backend configuration. Used when containment is `seatbelt`."
},
"telemetry": {
Comment thread
RamonArjona4 marked this conversation as resolved.
"anyOf": [
{
"$ref": "#/definitions/Telemetry"
},
{
"type": "null"
}
],
"description": "Telemetry configuration."
},
"ui": {
"anyOf": [
{
Expand Down
2 changes: 1 addition & 1 deletion sdk/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ await deprovisionSandbox(sandboxId, undefined, opts);

`windows_sandbox` follows the same shape (substitute the containment string and provide `filesystem.readwritePaths` / `readonlyPaths` at provision if needed). See [`docs/windows-sandbox/windows-sandbox.md`](https://github.com/microsoft/mxc/blob/main/docs/windows-sandbox/windows-sandbox.md) for the per-phase config matrix.

`wslc` follows the same shape and needs no provision config at all (it defaults to an `alpine:latest` container with no network). Provide `filesystem.readwritePaths` / `readonlyPaths` (mounted for the sandbox's lifetime), `network.defaultPolicy: 'allow'` (a bridged container; the default `'block'` gives no network), and/or a backend-specific `image` / `imageTarPath` at provision; inject a cooperative `network.proxy: { url }` per-exec. WSLc state-aware requests default to schema `0.8.0-alpha`. See [`docs/wsl/wslc-state-aware.md`](https://github.com/microsoft/mxc/blob/main/docs/wsl/wslc-state-aware.md) for the per-phase config matrix.
`wslc` follows the same shape and needs no provision config at all (it defaults to an `alpine:latest` container with no network). Provide `filesystem.readwritePaths` / `readonlyPaths` (mounted for the sandbox's lifetime), `network.defaultPolicy: 'allow'` (a bridged container; the default `'block'` gives no network), and/or a backend-specific `image` / `imageTarPath` at provision; inject a cooperative `network.proxy: { url }` per-exec. WSLc state-aware requests normally default to schema `0.8.0-alpha`; requests that include `telemetry` default to `0.9.0-alpha`. See [`docs/wsl/wslc-state-aware.md`](https://github.com/microsoft/mxc/blob/main/docs/wsl/wslc-state-aware.md) for the per-phase config matrix.

**Handling failures.** Every lifecycle call rejects with a typed `MxcError`. Branch on `code` first:

Expand Down
Loading
Loading