Skip to content

Scope verbose diagnostics to Learning Mode events - #1396

Open
Jacob Dereje (jacobdereje-msft) wants to merge 12 commits into
microsoft:mainfrom
jacobdereje-msft:jacob/unrecognized-events
Open

Jacob Dereje (jacobdereje-msft) wants to merge 12 commits into
microsoft:mainfrom
jacobdereje-msft:jacob/unrecognized-events

Conversation

@jacobdereje-msft

@jacobdereje-msft Jacob Dereje (jacobdereje-msft) commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Retains sanitized verbose diagnostics for all resource types within known Learning Mode events. Filters by provider and event ID, records decoding failures, and caches unavailable manifest schemas within the existing limit.

Tests

Ran 224 Windows decoder tests and Clippy locally; all passed. Replayed 48 native and controlled traces, verifying unchanged actionable JSON and preservation of selected event properties and counts.

Microsoft Reviewers: Open in CodeFlow

Copilot-Session: 7758b99e-b7a0-4060-baf9-268db306b58b
Copilot AI balanced review requested due to automatic review settings October 5, 2026 21:04
Comment thread docs/learning-mode/capabilities.md Outdated

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

This PR updates Learning Mode verbose logging so unfamiliar ETW providers/event IDs are retained as bounded, sanitized diagnostics (with explicit failure reasons), and adjusts guarded relogging + telemetry projection accordingly.

Changes:

  • Preserve unknown providers/events in verbose logs (including schema event names when available) and record closed diagnostic reasons on decode failures instead of aborting analysis.
  • Update guarded relogging + analysis to handle relogger transport headers and keep all in-scope provider events.
  • Bump verbose logging document schema to v3 and update tests/docs to match.
File Description
src/​testing/​wxc_e2e_tests/​tests/​e2e_telemetry_etw.rs Updates E2E fixture to build plm, uses a local denied file, and bumps expected verbose doc version to v3.
src/​host/​plm/​src/​stop.rs Adjusts truncation/adjusted-config test fixture to include a denial entry.
src/​host/​plm/​src/​elevated.rs Switches guarded analysis to the “relogged trace” analyzer entry point.
src/​core/​mxc_engine/​src/​verbose_telemetry.rs Re-aggregates signatures for telemetry after dropping provider GUIDs/properties and removing schema event names.
src/​core/​learning_mode_platforms/​windows/​src/​tdh_decode.rs Adds schema event name to decoded parts and test support for schema injection.
src/​core/​learning_mode_platforms/​windows/​src/​extractors.rs Extends redaction heuristics (embedded paths, path-like property names) and adds sanitize_event_name.
src/​core/​learning_mode_platforms/​windows/​src/​etl_filter.rs Relogs all in-scope events (not just known providers) and adds an ETW-based regression test for unknown-event preservation.
src/​core/​learning_mode_platforms/​windows/​src/​etl_decode.rs Records diagnostics for unknown/malformed events, adds relogged-trace analysis path, and treats schema failures as non-fatal (with incompleteness marking).
src/​core/​learning_mode_platforms/​windows/​src/​capability_dacl.rs Updates test fixtures for the new event_name field in decoded parts.
src/​core/​learning_mode_platforms/​windows/​Cargo.toml Adds Windows-only dev-deps for new ETW relogging test (tempfile, tracelogging).
src/​core/​learning_mode_core/​src/​verbose_logging.rs Adds other provider, schemaUnavailable outcome, schema eventName, and bumps document version to v3.
src/​core/​learning_mode_core/​src/​analyze.rs Updates test fixtures for the new event_name field.
src/​backends/​process_container/​common/​src/​capture_output.rs Updates test fixture signatures for the new event_name field.
docs/​learning-mode/​capabilities.md Documents v3 schema, new diagnostics behavior, redaction rules, and relogging semantics.

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

Comment thread src/core/learning_mode_platforms/windows/src/extractors.rs Outdated
Comment thread src/core/learning_mode_platforms/windows/src/extractors.rs Outdated
Comment thread src/core/learning_mode_core/src/verbose_logging.rs Outdated
Comment thread src/core/learning_mode_platforms/windows/src/tdh_decode.rs Outdated
Copilot-Session: 7758b99e-b7a0-4060-baf9-268db306b58b
Copilot AI balanced review requested due to automatic review settings October 5, 2026 23:10

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.

Copilot review overview

🔵 Needs a closer look

Schema-name sanitization can retain account identifiers that payload sanitization removes.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Sanitize schema names using payload identity context

src/​core/​learning_mode_platforms/​windows/​src/​extractors.rs:625

Sanitizing the schema name in isolation loses the payload's identity-redaction context. For a TraceLogging event named jsmith with UserName=jsmith, the payload username is redacted but signature.eventName retains it; username components in named-object schema names have the same problem. Sanitize successful schema names using the raw payload's identity candidates before bounding or hashing, while keeping schema metadata separate from any payload field named EventName. Add regression tests for both forms.

Copilot-Session: 7758b99e-b7a0-4060-baf9-268db306b58b
Copilot AI balanced review requested due to automatic review settings October 6, 2026 20:20

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.

Copilot review overview

🟡 Changes recommended

The promised unfamiliar-event retention conflicts with the implementation’s explicit exclusion behavior and needs resolution.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)

Comment thread src/core/learning_mode_platforms/windows/src/etl_decode.rs Outdated
Copilot-Session: 7758b99e-b7a0-4060-baf9-268db306b58b
@jacobdereje-msft Jacob Dereje (jacobdereje-msft) changed the title Retain unrecognized Learning Mode events Scope verbose diagnostics to Learning Mode events Oct 6, 2026
Copilot-Session: 7758b99e-b7a0-4060-baf9-268db306b58b
Copilot AI balanced review requested due to automatic review settings October 6, 2026 21: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.

Copilot review overview

🟡 Changes recommended

Replay filtering can retain unrelated payloads, and diagnostic-only schema failures incorrectly mark actionable results incomplete.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity

Open (3)
Resolved since last review (2)

Comment thread src/core/learning_mode_platforms/windows/src/etl_filter.rs Outdated
Comment thread src/core/learning_mode_platforms/windows/src/etl_decode.rs Outdated
…ents

Copilot-Session: ca558f28-d3df-4b85-9e44-b9fddef77c62
Require an allowlisted, process-scoped Learning Mode event at each
selected relog ordinal, and keep a missing NetworkDecisionV1 schema from
marking actionable results incomplete.

Copilot-Session: ca558f28-d3df-4b85-9e44-b9fddef77c62
Copilot AI balanced review requested due to automatic review settings October 7, 2026 04:45

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.

Copilot review overview

🟡 Changes recommended

The consumer reference still describes incompatible artifact and failure semantics, which can mislead callers about incomplete results.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (3)

Comment thread src/mxc-sdk/src/core/learning_mode_core/verbose_logging.rs
Copilot-Session: ca558f28-d3df-4b85-9e44-b9fddef77c62
Copilot AI balanced review requested due to automatic review settings October 7, 2026 16:12
Copilot-Session: ca558f28-d3df-4b85-9e44-b9fddef77c62

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

Canonical Learning Mode documentation still describes the previous artifact format and failure semantics.

1 open finding

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 7, 2026 16:16

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 relogging callback ordering, transport-header handling, and diagnostic privacy boundaries warrant final human validation.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

…ents

Copilot-Session: ca558f28-d3df-4b85-9e44-b9fddef77c62
Copilot AI balanced review requested due to automatic review settings October 7, 2026 16:25

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

Security-sensitive Windows relogging needs human validation, and the sanitizer’s quadratic processing remains unresolved.

1 open finding

🧠 Review effort: Balanced

Comment thread src/mxc-sdk/src/core/learning_mode_windows/extractors.rs
@jacobdereje-msft

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

Copilot-Session: ca558f28-d3df-4b85-9e44-b9fddef77c62
Copilot AI balanced review requested due to automatic review settings October 7, 2026 16:49

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@MGudgin Gudge (MGudgin) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Reviewed PR #1396 at ca4e222 against 43c5da4 (13 files, +1399/-329). I request changes primarily because the changed guarded relog ordinal invariant has no committed nonempty-selection regression test, and because the new negative schema cache retains TDH failures that need not mean a manifest is unavailable. The other comments identify conditional performance, documentation, and test-design issues; Low items are non-blocking. No ordinal mismatch or transient TDH failure was reproduced.

Verified clean, with receipts: is_learning_mode_event accepts only the explicit provider/event-ID pairs (extractors.rs:218-235); verbose telemetry clears eventName and properties before emission (verbose_telemetry.rs:148-156); relogging rejects count and selected-PID mismatches (etl_filter.rs:93-112,323-333). The new private-session round trip emits only an unrelated provider, so its selected set is empty (etl_filter.rs:371-527); the guarded telemetry e2e is #[ignore] (wxc_e2e_tests_e2e_telemetry_etw.rs:441-443). Existing isolated selection tests do not replace a nonempty round trip.

Findings outside the diff

Low — telemetry projection documentation: docs/development/architecture/telemetry.md:204-206 is byte-identical between base and head. The new eventName removal and group merge in the changed verbose_telemetry.rs:148-163 newly expose the incomplete description. This is anchored on the added projection line and is not a pre-existing defect being charged to the PR.

Verified pre-existing — not attributed to this PR

No unchanged, unrelated defect is filed. The 4,096-entry cache limit and one-million-event global processing bound already existed; comments concern only the PR's newly stored negative entries. A provisional finding that an unscoped capability schema error can set truncated before identifying a PID was withdrawn: unknown PID deliberately fails closed. Another provisional suggestion to exempt NetworkDecision events from the global processing bound was withdrawn because that bound is intentional and no safe exception was established.

Comment thread src/mxc-sdk/src/core/learning_mode_windows/etl_filter.rs Outdated
Comment thread src/mxc-sdk/src/core/learning_mode_windows/tdh_decode.rs
Comment thread src/mxc-sdk/src/core/learning_mode_windows/etl_filter.rs Outdated
Comment thread src/mxc-sdk/src/core/learning_mode_windows/tdh_decode.rs
Comment thread src/mxc-sdk/src/core/learning_mode_windows/etl_decode.rs Outdated
Comment thread docs/logging-access-denied.md Outdated
Comment thread docs/logging-access-denied.md
Comment thread src/mxc-sdk/src/core/learning_mode_windows/tdh_decode.rs
Comment thread src/mxc-sdk/src/core/learning_mode_core/verbose_logging.rs
Comment thread src/mxc-sdk/src/core/mxc_engine/verbose_telemetry.rs
@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs-Author-Feedback Waiting for additional information or action from the issue or pull-request author. label Oct 7, 2026
Copilot-Session: ca558f28-d3df-4b85-9e44-b9fddef77c62
Copilot AI balanced review requested due to automatic review settings October 7, 2026 20:03

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

Privacy-sensitive Windows trace scoping, relogging, and schema-failure recovery warrant final human validation.

0 open findings

🧠 Review effort: Balanced

@microsoft-github-policy-service microsoft-github-policy-service Bot added Needs-Attention Requires attention or a decision from the MXC maintainers. and removed Needs-Author-Feedback Waiting for additional information or action from the issue or pull-request author. labels Oct 7, 2026

@MGudgin Gudge (MGudgin) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to approve #1395

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs-Author-Feedback Waiting for additional information or action from the issue or pull-request author. label Oct 7, 2026

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

Needs-Attention Requires attention or a decision from the MXC maintainers. Needs-Author-Feedback Waiting for additional information or action from the issue or pull-request author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants