Uh oh!
There was an error while loading. Please reload this page.
Complete stable telemetry runtime and lifecycle integration - #820
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This comment was marked as outdated.
This comment was marked as outdated.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d297b29 to
b1e1b8bCompare
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Keep state-aware envelopes isolated from diagnostic output and align timeout and non-zero exit classification with one-shot telemetry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e20d046-910e-4ee7-b8e8-acb0fe007208
There was a problem hiding this comment.
🔵 Needs a closer look
Two moderate telemetry correctness and coverage issues remain unresolved.
Review details
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
src/core/mxc_engine/src/state_aware.rs:363
- Telemetry is initialized only after
exec_attached_gate, so a valid telemetry-enabled exec request made from redirected/non-terminal stdio returnsmalformed_requestwithout the promised failureExecution/Errorevents (or telemetry-init warnings). Initialize telemetry/correlation before this gate and emit the gate failure through the state-aware telemetry path before returning.
src/core/wxc_common/src/config_parser.rs:804 Nonemeans two different things here: omitted containment on a one-shot request (which correctly defaults toprocess) and an unrecognized/malformedsandboxIdprefix on a non-provision state-aware request. In the latter case, telemetry-enabled dispatch failures are therefore recorded asmxc.sandbox_kind=processeven though the caller did not request process containment. Preserve the context or useunknownfor failed state-aware inference so error telemetry is not misattributed.
docs/telemetry/telemetry.md:206
- This replaces the caller-visible correlation-vector contract with an internal identifier, but it never names the ETW field that consumers actually receive. Both
MXC.ExecutionandMXC.Erroremit this value as the string field__TlgCV__; documenting that name here (or in both event tables) is necessary for the event contract to be usable and auditable.
- An MXC-internal lifecycle correlation identifier. SDK callers neither supply
nor receive it.
- Files reviewed: 89/92 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Validate the presentation request and terminal failure emitted when a piped consent request reaches stdin EOF. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e20d046-910e-4ee7-b8e8-acb0fe007208
There was a problem hiding this comment.
🟡 Changes recommended
Provider registration is not unwind-safe, and consent override ownership validation remains unresolved.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
src/core/mxc_engine/src/state_aware.rs:363
- This attached path also holds a successful provider registration only in a
bool. If warning surfacing, backend resolution, correlation setup, orrun_state_awarepanics and the library caller catches the unwind, the provider reference leaks because the explicit emitter is never reached. Use the same RAII registration owner as the streaming path, disarming it after the terminal emitter releases the reference.
src/core/mxc_engine/src/state_aware.rs:445 - A successful initialization is not unwind-safe here: any panic before
emit_sdk_state_aware_with_kindleaves the reference count incremented. Since these engine APIs can be embedded in a long-lived host that catches panics, this can keep ETW registered indefinitely and make subsequent library unloading unsafe. Own the registration with an RAII guard and disarm it only after the explicit terminal emission.
- Files reviewed: 89/92 changed files
- Comments generated: 3
- Review effort level: Balanced
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Jeff Whiteside (jsidewhite)
commented
Sep 2, 2026
revert please In reply to: 5515676524 Refers to: src/core/lxc/src/main.rs:1 in 4169b06. [](commit_id = 4169b06, deletion_comment = False) |
Jeff Whiteside (jsidewhite)
commented
Sep 2, 2026
rvert In reply to: 5515680362 Refers to: src/core/mxc_darwin/src/main.rs:1 in 4169b06. [](commit_id = 4169b06, deletion_comment = False) |
Co-authored-by: RamonArjona4 <25335379+RamonArjona4@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
🔵 Needs a closer look
A moderate terminal cleanup defect remains within broad cross-platform lifecycle changes.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
src/core/wxc_common/src/telemetry/mod.rs:319
- This terminal path skips
shutdown()when live consent/policy was withdrawn, and it also leaves the terminal slot unclaimed. The provider reference therefore remains registered, and a later panic can emit for an already-completed invocation if authorization is restored. Claim the terminal slot independently of authorization, emit only when authorized, and always release the provider reference.
This issue also appears in the following locations of the same file:
- line 426
- line 930
src/core/wxc_common/src/telemetry/mod.rs:430
- As in the completion path, authorization withdrawal returns before
shutdown()and before claiming the terminal slot. This leaks the registration reference and allows a later out-of-band event to represent an invocation that has already terminated. Always claim the slot and release the provider, while gating only the event writes on live authorization.
src/core/wxc_common/src/telemetry/mod.rs:934 - A live consent/policy change to deny collection makes this return without releasing the provider reference or consuming the process terminal slot. That breaks the balanced provider lifecycle and can permit a later panic/cancellation event after this phase already finished. Keep authorization around the writes only; terminal bookkeeping and
shutdown()must still run.
- Files reviewed: 89/92 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Remove the remaining consent command documentation and the non-Windows consent CLI and parsing refactors, while retaining the stable telemetry wiring required by the promoted runtime model. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e20d046-910e-4ee7-b8e8-acb0fe007208
Hold SDK telemetry registration with RAII until a streaming process wrapper takes ownership, and scope inherited consent-store overrides to direct child processes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e20d046-910e-4ee7-b8e8-acb0fe007208
Stamp and restore the consent-store override owner for direct executor children as well as ProcessStartInfo launches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e20d046-910e-4ee7-b8e8-acb0fe007208
RamonArjona4
commented
Sep 2, 2026
Addressed macOS file revert request: c4aa355 removes the consent CLI and parsing refactors; only the stable telemetry promotion wiring remains. |
RamonArjona4
commented
Sep 2, 2026
Confirmed the repeated LXC revert request is addressed by c4aa355. |
RamonArjona4
commented
Sep 2, 2026
Addressed schema-codegen removal request: PR #820 has no changes to |
RamonArjona4
commented
Sep 2, 2026
Addressed LXC file revert request: c4aa355 removes the consent CLI and parsing refactors; only the stable telemetry promotion wiring remains. |
RamonArjona4
commented
Sep 2, 2026
Confirmed the repeated macOS revert request is addressed by c4aa355. |
There was a problem hiding this comment.
🔵 Needs a closer look
The public Node version-default documentation is incorrect, and the Rust telemetry opt-in remains undocumented.
Review details
Suppressed comments (2)
sdk/node/src/state-aware-types.ts:170
- Adding telemetry changes the omitted-version default to
0.9.0-alpha, but the adjacent public JSDoc still promises0.8.0-alpha. This will mislead WSLc callers; document the conditional default here, as the implementation does inbuildStateAwareEnvelope.
telemetry?: TelemetryConfig;
src/core/mxc_engine/src/policy.rs:706
- This adds a public Rust SDK opt-in (
SandboxRequestis re-exported bymxc-sdk), but the crate README and top-level usage example still do not mention how telemetry is enabled or that consent and policy are additional gates. The repository requires Rust SDK API changes to update the crate docs/README, so please document this method insrc/core/mxc-sdk/README.md(and preferably show it in the crate-level usage docs).
- Files reviewed: 88/91 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e20d046-910e-4ee7-b8e8-acb0fe007208
There was a problem hiding this comment.
🔵 Needs a closer look
Moderate issues remain in Node versioning documentation and Windows dry-run telemetry behavior.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
src/core/wxc/src/main.rs:1341
--dry-runis documented as parsing and validating without execution, but this emits anExecutioncompletion event beforehandle_dry_run_exit. Linux and macOS place this emission after their terminating dry-run branch, so Windows uniquely reports validation-only commands as executions. Move the emission below the dry-run branch.
docs/telemetry/telemetry.md:206
- The new lifecycle identifier is emitted as
__TlgCV__on bothMXC.ExecutionandMXC.Error, but neither event field table documents it. Add the field name, state-aware-only scope, and empty one-shot behavior to both tables so the documented event contract matches the provider payload.
- An MXC-internal lifecycle correlation identifier. SDK callers neither supply
nor receive it.
sdk/node/src/state-aware-types.ts:170
- The public JSDoc immediately above still says an omitted WSLc version is always filled with
0.8.0-alpha, but addingtelemetrymakesbuildStateAwareEnvelopeselect0.9.0-alpha. Document this exception here so generated API docs do not contradict runtime behavior.
telemetry?: TelemetryConfig;
- Files reviewed: 88/91 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e20d046-910e-4ee7-b8e8-acb0fe007208
There was a problem hiding this comment.
🟡 Changes recommended
Four moderate issues remain in API documentation, sandbox-kind attribution, consent isolation, and lifecycle correlation persistence.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
sdk/node/src/state-aware-types.ts:170
- The preceding public JSDoc says an omitted WSLc version is always filled with
0.8.0-alpha, but adding this field changes the default to0.9.0-alphawhenever telemetry is present. Document that conditional default here as the README already does, so generated API documentation does not mislead callers.
telemetry?: TelemetryConfig;
- Files reviewed: 88/91 changed files
- Comments generated: 3
- Review effort level: Balanced
| let telemetry = cfg.telemetry.map(|raw| TelemetryConfig { | ||
| enabled: raw.enabled, | ||
| requested_sandbox_kind: Some(requested_sandbox_kind(cfg.containment.as_ref())), | ||
| }); |
| let owner = owner?.to_str()?.parse::<u32>().ok()?; | ||
| (Some(owner) == parent_process_id).then_some(path) |
| fn phase_vector(sandbox_id: &str) -> String { | ||
| match with_store(|store| store.load_and_prune(sandbox_id)) { | ||
| Some(root) if is_relayable(&root) => spin(&root), | ||
| _ => seed(), | ||
| } |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e20d046-910e-4ee7-b8e8-acb0fe007208
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved provider-registration leaks on panic violate telemetry unload-safety guarantees.
Review details
Suppressed comments (2)
src/core/mxc_engine/src/state_aware.rs:363
- The attached path also owns a bare provider reference after
telemetry::init. A backend panic can unwind to an SDK/FFI catch boundary without reachingemit_sdk_state_aware_with_kind, leaking the registration and violating the documented unload-safety invariant. Wrap this reference inTelemetryRegistrationand transfer it only when emitting the terminal event.
src/core/mxc_engine/src/state_aware.rs:445 telemetry::initincrements the process-wide ETW registration count, but this envelope path has no RAII owner. Ifrun_state_aware(or warning injection/emission) panics and the library caller catches the unwind,shutdownis never called; subsequent calls retain a leaked reference, and unloading the FFI library can leave ETW callbacks pointing into unmapped code. Hold aTelemetryRegistrationimmediately after initialization and transfer it only to the terminal emitter, as the streaming path does.
- Files reviewed: 88/91 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Resolve the telemetry and diagnostic overlap with PR #791 while preserving top-level telemetry consent, internal state-aware correlation, requested sandbox attribution, and the scoped ETW audit events. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e20d046-910e-4ee7-b8e8-acb0fe007208
There was a problem hiding this comment.
🟡 Changes recommended
The unresolved MS-CV boundary defect must be fixed before approval, and the stale telemetry documentation should be corrected.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 89/92 changed files
- Comments generated: 2
- Review effort level: Balanced
| /// Maximum wire length of a v2.1 vector before it must be terminated. | ||
| const MAX_LEN: usize = 128; |
| > 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. |
.github/copilot-instructions.md.Summary
Completes stable telemetry runtime and lifecycle integration across MXC:
0.9configuration contract.This is PR 3 of 5 and depends on the consent/policy foundation in PR 2.
Stack
Review only this PR's diff; prerequisite behavior is in the PR above.