Skip to content

fix(intune): preserve scoped names across retries and events - #438

Merged
adamgell merged 21 commits into
mainfrom
codex/intune-name-event-retry-fix-r3-root
Aug 2, 2026
Merged

fix(intune): preserve scoped names across retries and events#438
adamgell merged 21 commits into
mainfrom
codex/intune-name-event-retry-fix-r3-root

Conversation

@adamgell

@adamgell adamgell commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • keep explicit-name suppression monotonic when a failed Intune download attempt is replaced by a retry
  • keep retry state isolated by content ID when downloads overlap
  • resolve an explicit app identity and its object-local name in one bounded scan
  • prevent AppWorkload, sidecar, and non-AppWorkload event paths from reattaching stale global registry names to ambiguous explicit evidence
  • preserve safe object-local enrichment and the established registry fallback when no explicit identity is present

This is a focused post-merge correction to the Intune batch-two work. It does not change public parser models.

Test-first evidence

  • RED 190a88e8: retry and event name-laundering regressions
  • GREEN b2b16aad: scoped identity/name context and inherited retry suppression

Verification

  • focused GUID registry, download, event, and Intune contract tests
  • cargo test --locked -p cmtraceopen-parser
  • cargo clippy --locked -p cmtraceopen-parser --all-targets --all-features -- -D warnings
  • cargo +1.88.0 check --locked -p cmtraceopen-parser --target wasm32-unknown-unknown
  • Rust 1.88 scoped rustfmt and git diff --check
  • independent full-range executable review — GO, no actionable findings

Review gates

  • Hosted CodeRabbit review at the final head
  • GitHub Copilot review at the final head
  • Required CI green

Summary by CodeRabbit

  • Bug Fixes
    • Improved app identity detection and name enrichment for download and event information.
    • Prevented ambiguous, conflicting, or out-of-scope names from being incorrectly associated with applications.
    • Preserved accurate local names while retaining safe fallback enrichment when no explicit identity is available.
    • Improved consistency across retries, partial downloads, failed downloads, and concurrent content processing.

Copilot AI review requested due to automatic review settings August 2, 2026 10:28
@github-actions github-actions Bot added bug Something isn't working enhancement New feature or request intune Microsoft Intune related parser Log parser related labels Aug 2, 2026
@adamgell

adamgell commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Please review the exact current head. Focus on retry-state inheritance and isolation, selected-object name scope, explicit identity boundaries, and safe fallback enrichment across all three event paths.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0e78a627-9254-404a-8cd3-91a60c73b46b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

Intune identity enrichment

Layer / File(s) Summary
Scoped identity context
crates/cmtraceopen-parser/src/intune/guid_registry.rs
Identity selection preserves JSON scope and classifies absent, valid, and invalid explicit identities. Duplicate-name validation, canonical suffix validation, and suffix enrichment use the shared context.
Download enrichment propagation
crates/cmtraceopen-parser/src/intune/download_stats.rs
Download analysis carries registry-enrichment suppression through creation, retries, partial downloads, finalization, and display-name resolution. Tests cover scope, conflicts, fallback, retries, and concurrent content IDs.
Event identity enrichment
crates/cmtraceopen-parser/src/intune/event_tracker.rs
Standard and AppWorkload events use scoped identity classification for GUID extraction and local, registry, or suppressed name enrichment. Tests cover identity boundaries and nested fields.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant IntuneMessage
  participant IdentityContext
  participant DownloadOrEventExtractor
  participant GUIDRegistry
  IntuneMessage->>IdentityContext: classify explicit identity and retain JSON scope
  IdentityContext-->>DownloadOrEventExtractor: GUID, local name, and suppression state
  DownloadOrEventExtractor->>GUIDRegistry: resolve name only when fallback is allowed
  GUIDRegistry-->>DownloadOrEventExtractor: resolved name
Loading

Possibly related issues

Possibly related PRs

  • adamgell/cmtraceopen#433: This PR extends explicit identity validation and fallback suppression across the same Intune parser components.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes scoped-name preservation across Intune retries and events.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/intune-name-event-retry-fix-r3-root

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Current HEAD and merge base =='
git status --short
git rev-parse HEAD
base="$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main)"
printf 'merge-base=%s\n' "$base"

printf '%s\n' '== Changed files =='
git diff --name-status "$base"...HEAD

printf '%s\n' '== Diff summary =='
git diff --stat "$base"...HEAD

printf '%s\n' '== Intune-related changed diff =='
git diff --unified=80 "$base"...HEAD -- \
  ':(glob)**/*.rs' \
  | rg -n -i -C 3 'intune|retry|download|appworkload|sidecar|guid|registry|explicit|identity|name' \
  || true

printf '%s\n' '== Rust files with relevant terms =='
rg -n -i -C 3 \
  'retry|content.?id|appworkload|sidecar|guid.?registry|explicit.?identity|selected.?object|intune' \
  -g '*.rs' \
  .

printf '%s\n' '== Structural outline for changed Rust files =='
git diff --name-only --diff-filter=ACMR "$base"...HEAD -- '*.rs' \
  | while IFS= read -r file; do
      printf '\n--- %s ---\n' "$file"
      ast-grep outline "$file" --items all || true
    done

Length of output: 201585


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main)"

printf '%s\n' '== Exact current HEAD =='
git rev-parse HEAD
git status --short

printf '%s\n' '== Changed hunks: download state =='
git diff --unified=25 "$base"...HEAD -- crates/cmtraceopen-parser/src/intune/download_stats.rs

printf '%s\n' '== Changed hunks: identity scope =='
git diff --unified=25 "$base"...HEAD -- crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '%s\n' '== Changed hunks: event enrichment =='
git diff --unified=25 "$base"...HEAD -- crates/cmtraceopen-parser/src/intune/event_tracker.rs

printf '%s\n' '== Download implementation =='
nl -ba crates/cmtraceopen-parser/src/intune/download_stats.rs | sed -n '100,570p'

printf '%s\n' '== GUID identity and local-name implementation =='
nl -ba crates/cmtraceopen-parser/src/intune/guid_registry.rs | sed -n '530,860p'

printf '%s\n' '== Event extraction and name enrichment implementation =='
nl -ba crates/cmtraceopen-parser/src/intune/event_tracker.rs | sed -n '450,750p'
nl -ba crates/cmtraceopen-parser/src/intune/event_tracker.rs | sed -n '1290,1495p'

printf '%s\n' '== New focused regression tests =='
rg -n -A90 -B8 \
  'retry_keeps_explicit_name_suppression_across_attempts|retry_suppression_is_isolated_between_concurrent_content_ids|downloads_do_not_take_names_outside_the_selected_identity_object|selected_ancestor_does_not_take_a_repeated_descendant_identity_name|conflicting_duplicate_names_in_the_selected_object_fail_closed|ingested_descendant_name_does_not_enrich_outer_selected_download|appworkload_events_do_not_enrich_names_outside_selected_identity_scope|non_appworkload_events_do_not_enrich_ambiguous_explicit_names|event_name_enrichment_remains_for_safe_identity_contexts' \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs

Length of output: 68216


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Identity selection and local-name scope at current HEAD =='
sed -n '540,790p' crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '%s\n' '== Download retry state and final enrichment at current HEAD =='
sed -n '114,465p' crates/cmtraceopen-parser/src/intune/download_stats.rs
sed -n '498,565p' crates/cmtraceopen-parser/src/intune/download_stats.rs

printf '%s\n' '== Event identity and enrichment paths at current HEAD =='
sed -n '471,730p' crates/cmtraceopen-parser/src/intune/event_tracker.rs
sed -n '1312,1488p' crates/cmtraceopen-parser/src/intune/event_tracker.rs

printf '%s\n' '== Targeted download regression tests =='
rg -n -A75 -B4 \
  'fn (retry_keeps_explicit_name_suppression_across_attempts|retry_suppression_is_isolated_between_concurrent_content_ids|explicit_name_ambiguity_suppresses_existing_registry_enrichment|non_explicit_download_keeps_registry_fallback)' \
  crates/cmtraceopen-parser/src/intune/download_stats.rs

printf '%s\n' '== Targeted event regression tests =='
rg -n -A80 -B4 \
  'fn (appworkload_events_do_not_enrich_names_outside_selected_identity_scope|non_appworkload_events_do_not_enrich_ambiguous_explicit_names|event_name_enrichment_remains_for_safe_identity_contexts|non_appworkload_events_respect_explicit_identity_boundaries)' \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs

printf '%s\n' '== Changed-file whitespace check =='
git diff --check "$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main)"...HEAD -- \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs

Length of output: 54690


@adamgell No actionable findings in b2b16aad21139713c506b7610c2ad04df3eebe63.

I verified the requested boundaries:

  • Retry suppression is inherited only from the replaced attempt for the same content ID.
  • Concurrent content IDs retain separate suppression state.
  • Explicit identity uses only the selected object-local name.
  • Valid explicit identity blocks registry-name fallback when the local name is absent or ambiguous.
  • AppWorkload, sidecar, and non-AppWorkload event paths use the same explicit-identity enrichment policy.
  • Registry fallback remains available when explicit identity is absent.

The focused regression tests cover these cases. git diff --check reports no whitespace errors.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

Pull request overview

This PR tightens Intune identity/name handling so explicit JSON identities act as hard boundaries, preventing stale global GUID registry names from being reattached during retries or when multiple downloads/events overlap. It introduces a scoped “identity + object-local name” context and threads it through event and download extraction to keep enrichment safe and deterministic.

Changes:

  • Added ExplicitAppIdentityContext to resolve an explicit identity and its object-local unambiguous name in one bounded scan, with explicit-identity boundaries suppressing unsafe fallback enrichment.
  • Updated event extraction to respect explicit identity boundaries and only enrich names from the selected object-local context (or registry fallback when no explicit identity exists).
  • Updated download extraction to keep explicit-name suppression monotonic across retries and isolate suppression per content ID; expanded tests to cover ambiguity and boundary cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/cmtraceopen-parser/src/intune/guid_registry.rs Adds explicit identity+local-name context selection, ambiguity handling for duplicate names, and shared name-enrichment helper.
crates/cmtraceopen-parser/src/intune/event_tracker.rs Uses explicit identity context to prevent unsafe name enrichment and stale registry fallback across event paths.
crates/cmtraceopen-parser/src/intune/download_stats.rs Carries “suppress registry enrichment” through retries/content IDs and derives download identity from explicit identity context with expanded tests.

Comment thread crates/cmtraceopen-parser/src/intune/guid_registry.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/cmtraceopen-parser/src/intune/event_tracker.rs (1)

608-617: 🚀 Performance & Scalability | 🔵 Trivial | 🏗️ Heavy lift

Same re-scan pattern for AppWorkload events.

explicit_app_identity_context(msg) scans at line 608, then guid_registry::extract_app_id(msg) (line 615) re-scans on the Absent path. Same root cause as lines 495-508 and guid_registry.rs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/intune/event_tracker.rs` around lines 608 -
617, Update the AppWorkload GUID resolution around explicit_app_identity_context
so the Absent branch reuses the already-scanned identity context instead of
calling guid_registry::extract_app_id(msg) again. Preserve extract_guid(msg) and
the existing Valid, Invalid, and Absent outcomes while eliminating the redundant
scan.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/cmtraceopen-parser/src/intune/download_stats.rs`:
- Around line 387-420: The Absent branch of extract_download_identity
redundantly rescans msg through extract_app_id and extract_app_name after
explicit_app_identity_context has already scanned it. Reuse the parsed context
or extend explicit_app_identity_context to provide the needed fallback identity
and display name, then remove the independent extract_app_id/extract_app_name
scans while preserving the existing heuristic behavior.

In `@crates/cmtraceopen-parser/src/intune/event_tracker.rs`:
- Around line 495-508: The Absent branch in the event-tracking GUID resolution
repeats a full message scan through guid_registry::extract_app_id. Reuse the
parsed data already produced by guid_registry::explicit_app_identity_context, or
expose the needed extracted app ID from that result, so the fallback avoids
rescanning line.message while preserving the existing GUID extraction precedence
and behavior.

In `@crates/cmtraceopen-parser/src/intune/guid_registry.rs`:
- Around line 619-648: Update explicit_app_identity_context and its callers so
the existing JsonFieldScan is reused when explicit identity is Absent, rather
than calling extract_app_id and scan_has_name_field to rescan the message.
Expose or pass the scan-backed fallback logic through the relevant
download_stats.rs and event_tracker.rs paths, preserving current identity and
local-name results while ensuring one bounded scan handles both resolutions.

---

Outside diff comments:
In `@crates/cmtraceopen-parser/src/intune/event_tracker.rs`:
- Around line 608-617: Update the AppWorkload GUID resolution around
explicit_app_identity_context so the Absent branch reuses the already-scanned
identity context instead of calling guid_registry::extract_app_id(msg) again.
Preserve extract_guid(msg) and the existing Valid, Invalid, and Absent outcomes
while eliminating the redundant scan.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 466f713f-8f60-4b18-8727-8fb7d2df70c2

📥 Commits

Reviewing files that changed from the base of the PR and between 2ae659c and b2b16aa.

📒 Files selected for processing (3)
  • crates/cmtraceopen-parser/src/intune/download_stats.rs
  • crates/cmtraceopen-parser/src/intune/event_tracker.rs
  • crates/cmtraceopen-parser/src/intune/guid_registry.rs

Comment thread crates/cmtraceopen-parser/src/intune/download_stats.rs
Comment thread crates/cmtraceopen-parser/src/intune/event_tracker.rs
Comment thread crates/cmtraceopen-parser/src/intune/guid_registry.rs
@adamgell

adamgell commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Exact-head correction pushed at 9feb4451e1467d2dc3eab0c5c5cfcb24be7227db. The shared bounded identity scan is reused only where named-GUID fallback is required; both ordinary and AppWorkload event paths retain one established GUID extraction pass and perform zero named-fallback extractions. The AppWorkload path called out outside the original diff is covered explicitly. Independent exact-range review returned GO; full parser, strict parser Clippy, Rust 1.88 workspace/wasm32 checks, changed-file rustfmt, and diff checks pass. Requesting fresh CodeRabbit and Copilot review of this exact head.

@adamgell

adamgell commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Please review exact head 9feb4451e1467d2dc3eab0c5c5cfcb24be7227db, including the full interaction with the original feature range.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

requested='9feb4451e1467d2dc3eab0c5c5cfcb24be7227db'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nREQUESTED=%s\n' "$actual" "$requested"
git status --short
git cat-file -e "${requested}^{commit}"

base="$(git merge-base "$requested" origin/main 2>/dev/null || git merge-base "$requested" main)"
printf 'BASE=%s\n' "$base"

printf '\n== Feature range ==\n'
git diff --name-status "$base" "$requested"
git diff --stat "$base" "$requested"

printf '\n== Changed-module outlines ==\n'
for file in \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs
do
  printf '\n--- %s ---\n' "$file"
  ast-grep outline "$file" --items all
done

printf '\n== Feature diff: relevant modules ==\n'
git diff --unified=35 "$base" "$requested" -- \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== Identity-context and enrichment definitions/call sites ==\n'
rg -n -C 8 \
  'explicit_app_identity_context|ExplicitAppIdentityContext|ExplicitAppIdentity|enrich_event_name_with_name|resolve.*name|named.*fallback|AppWorkload|Sidecar' \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== Retry-state definitions/transitions ==\n'
rg -n -C 10 \
  'retry|Retry|failed|Failed|content_id|content_id|suppres' \
  crates/cmtraceopen-parser/src/intune/download_stats.rs

printf '\n== Feature tests ==\n'
rg -n -C 4 \
  '#\[test\]|retry|concurrent|selected.*object|explicit.*identity|fallback|AppWorkload|sidecar|ambiguous|duplicate' \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== Diff whitespace check ==\n'
git diff --check "$base" "$requested"

Length of output: 202561


🏁 Script executed:

#!/bin/bash
set -euo pipefail

requested='9feb4451e1467d2dc3eab0c5c5cfcb24be7227db'
printf 'HEAD=%s\n' "$(git rev-parse HEAD)"
printf '\n== Exact-head correction ==\n'
git show --format=fuller --stat "$requested"
git diff --unified=70 "${requested}^" "$requested" -- \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== Download retry control flow ==\n'
nl -ba crates/cmtraceopen-parser/src/intune/download_stats.rs | sed -n '112,245p'
nl -ba crates/cmtraceopen-parser/src/intune/download_stats.rs | sed -n '380,570p'

printf '\n== Identity scan and selection control flow ==\n'
nl -ba crates/cmtraceopen-parser/src/intune/guid_registry.rs | sed -n '120,235p'
nl -ba crates/cmtraceopen-parser/src/intune/guid_registry.rs | sed -n '560,805p'

printf '\n== Ordinary-event extraction and enrichment ==\n'
nl -ba crates/cmtraceopen-parser/src/intune/event_tracker.rs | sed -n '471,575p'

printf '\n== AppWorkload and sidecar extraction and enrichment ==\n'
nl -ba crates/cmtraceopen-parser/src/intune/event_tracker.rs | sed -n '570,760p'

printf '\n== All registry enrichment call sites ==\n'
rg -n -C 12 \
  '\.enrich_event_name\(|enrich_event_name_with_name\(|\.resolve_fallback_name\(|registry\.resolve\(' \
  crates/cmtraceopen-parser/src/intune

printf '\n== Relevant exact test bodies ==\n'
nl -ba crates/cmtraceopen-parser/src/intune/download_stats.rs | sed -n '995,1315p'
nl -ba crates/cmtraceopen-parser/src/intune/event_tracker.rs | sed -n '2085,2440p'
nl -ba crates/cmtraceopen-parser/src/intune/guid_registry.rs | sed -n '1410,1878p'

printf '\n== All production callers of bounded context functions ==\n'
rg -n -C 4 \
  'explicit_app_identity_context(?:_with_named_guid_fallback)?\(' \
  crates/cmtraceopen-parser/src \
  -g '*.rs'

Length of output: 29202


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Download retry control flow ==\n'
sed -n '112,245p' crates/cmtraceopen-parser/src/intune/download_stats.rs
sed -n '380,570p' crates/cmtraceopen-parser/src/intune/download_stats.rs

printf '\n== Identity scan and selection control flow ==\n'
sed -n '120,235p' crates/cmtraceopen-parser/src/intune/guid_registry.rs
sed -n '560,805p' crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== Ordinary-event extraction and enrichment ==\n'
sed -n '471,575p' crates/cmtraceopen-parser/src/intune/event_tracker.rs

printf '\n== AppWorkload and sidecar extraction and enrichment ==\n'
sed -n '570,760p' crates/cmtraceopen-parser/src/intune/event_tracker.rs

printf '\n== All registry enrichment call sites ==\n'
rg -n -C 12 \
  '\.enrich_event_name\(|enrich_event_name_with_name\(|\.resolve_fallback_name\(|registry\.resolve\(' \
  crates/cmtraceopen-parser/src/intune

printf '\n== Focused download tests ==\n'
sed -n '995,1315p' crates/cmtraceopen-parser/src/intune/download_stats.rs

printf '\n== Focused event tests ==\n'
sed -n '2085,2440p' crates/cmtraceopen-parser/src/intune/event_tracker.rs

printf '\n== Focused identity tests ==\n'
sed -n '1410,1878p' crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== All production bounded-context callers ==\n'
rg -n -C 4 \
  'explicit_app_identity_context(?:_with_named_guid_fallback)?\(' \
  crates/cmtraceopen-parser/src \
  -g '*.rs'

printf '\n== Changed range whitespace check ==\n'
base="$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main)"
git diff --check "$base" HEAD

Length of output: 143258


@adamgell No actionable findings in exact head 9feb4451e1467d2dc3eab0c5c5cfcb24be7227db.

I verified the full feature range and the exact-head correction:

  • Retry replacement inherits suppression only from the removed entry with the same content ID.
  • Suppression remains monotonic through finalization and retry creation.
  • Concurrent content IDs retain separate retry state.
  • Valid explicit identity uses only its selected object-local name.
  • Unnamed or ambiguous explicit identity blocks registry enrichment.
  • Invalid explicit identity blocks both GUID attribution and registry enrichment.
  • Ordinary events, AppWorkload events, and sidecar events use the same enrichment boundary.
  • Named GUID fallback remains enabled only for download identity extraction and extract_app_id.
  • Ordinary and AppWorkload event extraction retain their established GUID extraction path without named-fallback extraction.
  • git diff --check reports no whitespace errors.
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/cmtraceopen-parser/src/intune/guid_registry.rs`:
- Around line 43-47: Document the fallback_app_id field in
ExplicitAppIdentityContext with its contract: it is populated only for
ExplicitAppIdentity::Absent when the caller enables the legacy named-GUID
fallback, and remains None for Valid and Invalid identities.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ce6d612f-6436-4f6c-a3cb-3b31a04f1a9c

📥 Commits

Reviewing files that changed from the base of the PR and between b2b16aa and 9feb445.

📒 Files selected for processing (3)
  • crates/cmtraceopen-parser/src/intune/download_stats.rs
  • crates/cmtraceopen-parser/src/intune/event_tracker.rs
  • crates/cmtraceopen-parser/src/intune/guid_registry.rs

Comment thread crates/cmtraceopen-parser/src/intune/guid_registry.rs
@adamgell

adamgell commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Please review exact head 6320011b, including the full interaction with the original feature and performance-correction range.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

requested='6320011b'
resolved="$(git rev-parse "${requested}^{commit}")"
head="$(git rev-parse HEAD)"
printf 'REQUESTED=%s\nRESOLVED=%s\nHEAD=%s\n' "$requested" "$resolved" "$head"
git status --short
git cat-file -e "${resolved}^{commit}"

base="$(git merge-base "$resolved" origin/main 2>/dev/null || git merge-base "$resolved" main)"
printf 'MERGE_BASE=%s\n' "$base"

printf '\n== Feature-range files ==\n'
git diff --name-status "$base" "$resolved"
git diff --stat "$base" "$resolved"

printf '\n== Changed Intune module outlines ==\n'
for file in \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs
do
  if git diff --quiet "$base" "$resolved" -- "$file"; then
    continue
  fi
  printf '\n--- %s ---\n' "$file"
  ast-grep outline "$file" --items all
done

printf '\n== Full feature diff for relevant modules ==\n'
git diff --unified=45 "$base" "$resolved" -- \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== Relevant definitions and call sites ==\n'
rg -n -C 8 \
  'explicit_app_identity_context|ExplicitAppIdentityContext|ExplicitAppIdentity|enrich_event_name_with_name|resolve_fallback_name|named.?fallback|AppWorkload|sidecar|retry|content_id|suppres' \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== Whitespace check ==\n'
git diff --check "$base" "$resolved"

Length of output: 202039


🏁 Script executed:

#!/bin/bash
set -euo pipefail

requested="$(git rev-parse '6320011b^{commit}')"
previous='9feb4451e1467d2dc3eab0c5c5cfcb24be7227db'
printf 'HEAD=%s\nREQUESTED=%s\nPREVIOUS=%s\n' "$(git rev-parse HEAD)" "$requested" "$previous"

printf '\n== Correction-range commits ==\n'
git log --format='%H%n%s%n%b%n' "${previous}..${requested}"

printf '\n== Correction-range diff ==\n'
git diff --unified=80 "$previous" "$requested" -- \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== Event extraction implementations ==\n'
sed -n '450,690p' crates/cmtraceopen-parser/src/intune/event_tracker.rs

printf '\n== Bounded-context callers outside tests ==\n'
rg -n -C 7 \
  'explicit_app_identity_context(?:_with_named_guid_fallback)?\(' \
  crates/cmtraceopen-parser/src \
  -g '*.rs' \
  -g '!**/tests/**'

printf '\n== Named-fallback counter tests ==\n'
rg -n -A55 -B10 \
  'named_guid_fallback_extraction_count|reset_named_guid_fallback_extraction_count' \
  crates/cmtraceopen-parser/src/intune/download_stats.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs

printf '\n== Correction-range whitespace check ==\n'
git diff --check "$previous" "$requested"

Length of output: 47399


@adamgell No actionable findings in exact head 6320011b612114c68ded7cee02e7f6a8a74c8ecd.

I reviewed the full feature range and the correction range.

  • The correction commit only documents the named-GUID fallback contract.
  • Download extraction and extract_app_id are the only production callers that enable named-GUID fallback.
  • Ordinary events use explicit_app_identity_context and retain one extract_guid pass only when explicit identity is absent.
  • AppWorkload and sidecar events use the same non-fallback context and retain one extract_guid pass only when explicit identity is absent.
  • Valid and invalid explicit identity still prevent named-GUID fallback.
  • The regression tests verify zero named-GUID fallback extractions for ordinary and AppWorkload event paths.
  • git diff --check passed for the full feature range and the correction range.
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/cmtraceopen-parser/src/intune/guid_registry.rs (1)

922-928: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Validate the full GUID shape before stripping the suffix.

The suffix check accepts any 36-character string containing only hexadecimal characters and dashes. This accepts malformed values such as 36 dashes or invalid dash positions. enrich_event_name_with_name can then remove non-GUID text and rewrite the event name. Reuse exact_guid(inner).is_some() or enforce the same 8-4-4-4-12 shape as guid_re(). (raw.githubusercontent.com)

Proposed fix
-    let is_full_guid =
-        inner.len() == 36 && inner.chars().all(|c| c.is_ascii_hexdigit() || c == '-');
+    let is_full_guid = exact_guid(inner).is_some();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/intune/guid_registry.rs` around lines 922 -
928, Update enrich_event_name_with_name and the underlying
strip_short_guid_suffix validation to require a complete GUID before stripping
the suffix, using exact_guid(inner).is_some() or the established guid_re()
8-4-4-4-12 shape. Preserve rewriting only for valid GUID suffixes and leave
malformed suffixes unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@crates/cmtraceopen-parser/src/intune/guid_registry.rs`:
- Around line 922-928: Update enrich_event_name_with_name and the underlying
strip_short_guid_suffix validation to require a complete GUID before stripping
the suffix, using exact_guid(inner).is_some() or the established guid_re()
8-4-4-4-12 shape. Preserve rewriting only for valid GUID suffixes and leave
malformed suffixes unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fa5a69a2-067f-40b1-8da0-01fbdbeaaca5

📥 Commits

Reviewing files that changed from the base of the PR and between 9feb445 and 6320011.

📒 Files selected for processing (1)
  • crates/cmtraceopen-parser/src/intune/guid_registry.rs

@adamgell

adamgell commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Verified the new exact-head CodeRabbit finding before changing code. It was valid: the previous suffix check accepted any 36-character hex/dash string, including malformed dash placement, and could rewrite a non-GUID event-name suffix.

Addressed test-first at 477caa2c:

  • RED 2fd26d6a proves malformed 36-character suffixes were rewritten.
  • GREEN 477caa2c reuses the canonical exact-GUID validator, preserving valid full GUID and legacy short-GUID behavior.

Verification on exact head 477caa2c:

  • focused malformed/full/short suffix tests: pass
  • full cmtraceopen-parser suite: pass
  • strict parser Clippy: pass
  • Rust 1.88 wasm32 parser check: pass
  • scoped rustfmt and git diff --check: pass

@coderabbitai review
@copilot review

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

requested="$(git rev-parse '477caa2c^{commit}')"
head="$(git rev-parse HEAD)"
printf 'REQUESTED=%s\nHEAD=%s\n' "$requested" "$head"
git status --short
git cat-file -e "${requested}^{commit}"

base="$(git merge-base "$requested" origin/main 2>/dev/null || git merge-base "$requested" main)"
printf 'MERGE_BASE=%s\n' "$base"

printf '\n== Exact-fix commit ==\n'
git show --format=fuller --stat "$requested"
git diff --unified=80 "${requested}^" "$requested" -- \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/download_stats.rs

printf '\n== Full feature range for affected modules ==\n'
git diff --unified=35 "$base" "$requested" -- \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/download_stats.rs

printf '\n== Affected module outlines ==\n'
ast-grep outline crates/cmtraceopen-parser/src/intune/guid_registry.rs --items all
ast-grep outline crates/cmtraceopen-parser/src/intune/event_tracker.rs --items all

printf '\n== Validator and enrichment definitions plus production call sites ==\n'
rg -n -C 10 \
  'enrich_event_name_with_name|is_exact_guid|exact.*guid|extract_guid|enrich_event_name\(' \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs \
  crates/cmtraceopen-parser/src/intune/download_stats.rs

printf '\n== Focused suffix-validation tests ==\n'
rg -n -A100 -B10 \
  'malformed.*suffix|full.*guid|short.*guid|enrich_event_name_with_name|event.*suffix' \
  crates/cmtraceopen-parser/src/intune/guid_registry.rs \
  crates/cmtraceopen-parser/src/intune/event_tracker.rs

printf '\n== All production uses of helper ==\n'
rg -n -C 8 'enrich_event_name_with_name\s*\(' crates/cmtraceopen-parser/src -g '*.rs'

printf '\n== Whitespace checks ==\n'
git diff --check "${requested}^" "$requested"
git diff --check "$base" "$requested"

Length of output: 183334


@adamgell No actionable findings in exact head 477caa2c.

strip_short_guid_suffix now uses exact_guid for full GUID suffixes. This rejects malformed 36-character hex/dash strings, including invalid dash placement. It still accepts canonical full GUIDs and legacy hexadecimal short-GUID suffixes ending in ....

The shared helper applies this validation to registry enrichment and explicit object-local enrichment. Therefore, ordinary, AppWorkload, and sidecar event paths use the corrected suffix check.

The regression tests cover malformed full-length suffixes, valid full GUID suffixes, and legacy short GUID suffixes. git diff --check passed for the fix and the complete feature range.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Verified the new exact-head CodeRabbit finding before changing code. It was valid: the previous suffix check accepted any 36-character hex/dash string, including malformed dash placement, and could re...

Reviewed the exact head 477caa2c. The malformed-GUID suffix fix is correct — strip_guid_suffix now delegates to parse_guid_str for canonical validation, so a 36-character hex/dash string that places dashes in non-standard positions will no longer be silently accepted and rewritten. All completed CI checks are green, including CodeQL and TypeScript. No issues found.

@adamgell

adamgell commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

@copilot-pull-request-reviewer review

@adamgell
adamgell merged commit aae3466 into main Aug 2, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request intune Microsoft Intune related parser Log parser related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants