Skip to content

fix(sccm): reject overlapping evidence ranges in the spine - #420

Merged
adamgell merged 4 commits into
codex/parser-family-skeletonfrom
fix/spine-overlap-validation
Aug 2, 2026
Merged

fix(sccm): reject overlapping evidence ranges in the spine#420
adamgell merged 4 commits into
codex/parser-family-skeletonfrom
fix/spine-overlap-validation

Conversation

@adamgell

@adamgell adamgell commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Closes #418.

findings.rs::validate_all_evidence_references keyed on (artifact_id, entry_id) and rejected only the same identity carrying a different range. Two references with overlapping line ranges under different entry_ids inside one finding passed validation, so one physical record could be cited twice and compare_evidence_refs would rank the two on span width alone.

Semantics chosen, and why

The predicate now lives in the spine as evidence_references_overlap:

  • Scoped to one artifact. Line numbers only mean something relative to a source.
  • Inclusive bounds. line_start/line_end are inclusive line numbers, so 4-6 and 6-9 share line 6 and overlap, while 1-2 and 3-4 abut and do not. Equal spans are the degenerate overlap and are rejected.
  • A reference carrying no bounds asserts no extent and therefore cannot be shown to claim another reference's lines. (None, None) on either side is not an overlap. This is what keeps existing citations that omit line numbers valid.
  • Inverted ranges are handled by ordering, not by the predicate. An inverted range reads as empty under an inclusive test and would be silently judged disjoint from everything, which is the failure mode this repo has hit before. The spine closes it by running the validity gate first: every reference clears validate_evidence_reference (both bounds present or both absent, start > 0, end >= start) inside the same function before any pair reaches the overlap sweep, so InvalidEvidenceReference still wins and an inverted range can never be mistaken for an empty span.

The deliberate choice not to make the predicate itself fail closed on inverted input is load bearing for the duplication collapse. management_point.rs calls it from evidence_identity_is_unique, which compares a candidate against every bundle entry, including entries that never passed the reducer's own safe_evidence_reference gate. A fail-closed predicate would let one malformed bundle entry suppress good evidence there. Validity is a separate question from extent, and each caller already answers it.

Precedence inside validate_all_evidence_references is now: InvalidEvidenceReference (per reference) -> ConflictingEvidenceReference (one identity, two ranges) -> OverlappingEvidenceReference (two identities, one physical line). The first two are unchanged.

The sweep is O(n log n), not pairwise: references are keyed by identity so each entry id contributes exactly one span, spans are sorted per artifact by start line, and a span that clears the widest span seen so far clears every earlier one. SccmFinding deserialization has no cap on evidence count, so a quadratic validator on the wire path was not acceptable.

Did the two reducer copies agree?

Yes, byte-identical. Verified by extracting both and diffing:

Both produced the same text for artifact scoping, inclusive-bounds comparison, and missing-bound handling. No edge case disagreed, so there was no semantics dispute to resolve, and the spine predicate is that text with the reasoning written down.

Duplication collapse

The management-point copy is deleted; the reducer imports the spine predicate. The removed body is byte-identical to the spine one, so admission there is unchanged, and sccm_server_management_point passes unmodified (26/26).

policy.rs does not exist on codex/parser-family-skeleton yet, so its copy cannot be collapsed here. #391 should drop evidence_references_overlap from policy.rs when it rebases and import crate::sccm::findings::evidence_references_overlap instead. quarantine_overlapping_evidence stays where it is: it is a reducer policy (quarantine every participant rather than reject the bundle), not the predicate.

Shipped-fixture audit

Every expected.json in the tree was scanned for two references with distinct entryId and overlapping ranges inside one artifact, across all three citation surfaces (evidence, terminalEvidence[].reference, correlationKeys[].evidence). The same scan was run against every in-flight SCCM lane branch, since this rejection lands under work already in review.

Branch findings references violations
codex/parser-family-skeleton (065b8cb) 57 79 0
codex/sccm-321-policy-analysis (#391) 24 28 0
codex/sccm-320-health-analysis (#392) 24 28 0
codex/sccm-319-pure-intake (#394) 24 28 0
codex/sccm-spine-findings-hardening (#404) 24 28 0
codex/sccm-327-site-core-reducer (#405) 24 28 0
codex/sccm-322-deployment-reducer (#407) 24 28 0

No shipped fixture carries the shape. Reducer output is covered by the fixture contract suites: they run each reducer over its corpus and diff against expected.json, and management point in particular does builder.build().ok()?, so a newly rejected finding would silently vanish and fail the comparison. All of them stay green, so no reducer emits an overlapping citation today either.

One test fixture did carry the shape, and it is reported rather than papered over. finding_rejects_key_or_terminal_refs_that_are_not_cited built its uncited reference with finding_evidence_ref("client-policy-agent", "policy:2-2"), and that helper pins every span to line 1 regardless of the entry id. So policy:2-2 claimed line 1 alongside policy:1-1, which is exactly the defect: two entry ids over one physical line, with entry ids that advertise ranges contradicting their own bounds. The fix spells the span out as 2-2 to match the entry id it advertises. The test's subject, that an uncited reference is rejected, is unchanged and still asserts CorrelationKeyEvidenceNotCited / TerminalEvidenceNotCited. This was a latent inconsistency in the fixture, not a semantics disagreement.

RED / GREEN

  • RED 19addcdb added the contract plus the inert OverlappingEvidenceReference variant so it compiles, and failed with the spine accepting the shape: called Result::unwrap_err() on an Ok value: SccmFinding { ... evidence: [SccmEvidenceRef { artifact_id: "artifact-a", entry_id: "entry-a", line_start: Some(4), line_end: Some(6) }, SccmEvidenceRef { artifact_id: "artifact-a", entry_id: "entry-b", line_start: Some(4), line_end: Some(6) }] }. 139 passed, 2 failed.
  • GREEN 8b487a35 wired the predicate into the validator and collapsed the management-point copy. 141 passed, 0 failed.

New coverage goes through the real SccmFinding::validate path, not a unit helper: builder, direct validate(), serde deserialization, and the validating serializer. Six overlap shapes (identical, shared start line, shared end line, contained, containing, straddling) are each exercised on all three citation surfaces, and the shapes that must keep validating are pinned too: adjacent spans, equal spans in different artifacts, one bounded plus one unbounded, and both unbounded.

Verification

All from the worktree, all clean.

  • cargo test --locked -p cmtraceopen-parser --test sccm_spine_contract: 141 passed, 0 failed (138 before).
  • cargo test --locked -p cmtraceopen-parser: 1039 passed, 0 failed across 21 binaries. Baseline on 065b8cb was 1036; the delta is exactly the 3 new spine tests, every other binary count is identical.
  • cargo test --locked --workspace: 1793 passed, 0 failed across 36 binaries.
  • cargo clippy --locked -p cmtraceopen-parser --all-targets -- -D warnings: clean.
  • cargo check --locked -p cmtraceopen-parser --target wasm32-unknown-unknown: clean.
  • npx tsc --noEmit: clean.
  • git diff --check 065b8cb7 HEAD: clean.
  • rustfmt --check on all three changed files: clean.

Every SCCM contract suite in the tree, run individually, all green:

Suite Tests
sccm_client_deployment_fixture_contract 8
sccm_client_health_fixture_contract 3
sccm_client_intake_fixture_contract 3
sccm_client_inventory_compliance_metering_fixture_contract 47
sccm_client_management_fixture_contract 29
sccm_client_task_sequence_fixture_contract 30
sccm_client_updates_fixture_contract 17
sccm_correlation_contract 12
sccm_server_advanced_roles_catalog 6
sccm_server_distribution_point_fixture_contract 48
sccm_server_hierarchy_and_replication_fixture_contract 28
sccm_server_intake 11
sccm_server_intake_fixture_contract 1
sccm_server_management_point 26
sccm_server_provider_and_admin_service_fixture_contract 30
sccm_server_software_update_point_fixture_contract 18
sccm_site_core_fixture_contract 5
sccm_spine_contract 141
Total 463

Reviewer attention

SccmFindingValidationError gains a variant. It is #[derive(Debug, Clone, Copy, PartialEq, Eq)] with no #[non_exhaustive], and nothing in the tree matches on it exhaustively, but any lane holding a match should be checked on rebase.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Evidence validation now detects and rejects overlapping bounded references for the same artifact and entry.
    • References from primary, terminal, and correlation-key evidence are validated consistently.
    • Valid disjoint, adjacent, cross-artifact, and unbounded references continue to be accepted.
    • Clear validation errors are reported when evidence references conflict.
  • Tests

    • Expanded coverage for validation, serialization, deserialization, citation ranges, and evidence reference handling.

adamgell and others added 2 commits August 1, 2026 12:32
`validate_all_evidence_references` keys on (artifact_id, entry_id) and
only rejects one identity carrying two ranges. Two references over the
same physical lines under different entry ids pass, so one record can be
cited twice and `compare_evidence_refs` picks between them arbitrarily.

Adds the failing contract across all three citation surfaces plus the
serde boundaries, and pins the shapes that must keep validating:
adjacent spans, equal spans in different artifacts, and references that
assert no extent at all.

The `OverlappingEvidenceReference` variant lands inert here so the
contract compiles; nothing reads it yet.

Refs #418

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two references over the same physical lines under different entry ids
double-count one record and leave `compare_evidence_refs` ranking them on
span width alone. Identity equality never saw it, so each reducer had to
grow its own guard.

The overlap predicate now lives beside the validator every finding
already passes through, and `validate_all_evidence_references` sorts each
artifact's spans and sweeps them, so the rule holds no matter which
reducer, or none, assembled the finding.

Semantics are the ones both existing copies already agreed on: inclusive
bounds, so equal spans overlap and abutting spans do not; scoped to one
artifact; and a reference carrying no bounds asserts no extent and can
overlap nothing. An inverted range reads as empty under an inclusive
test, so validity is checked first: every reference clears
`validate_evidence_reference` before any pair reaches the predicate, and
`InvalidEvidenceReference` still wins over the new rejection.

The management-point copy is deleted in favour of the spine predicate.
The bodies were byte-identical, so admission there is unchanged; its
inverted-range handling in particular is preserved, because the reducer
compares candidates that have not passed its own safety gate.

`finding_rejects_key_or_terminal_refs_that_are_not_cited` built its
uncited reference from a helper that pins every span to line 1, so
`policy:2-2` claimed line 1 and contradicted its own entry id. The span
is now spelled out.

Closes #418

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@adamgell
adamgell requested a review from Copilot August 1, 2026 16:41
@adamgell

adamgell commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 424eb380-1036-48bd-ab70-a44f8ee3aef3

📥 Commits

Reviewing files that changed from the base of the PR and between 681a070 and c7ed2d0.

📒 Files selected for processing (3)
  • crates/cmtraceopen-parser/src/sccm/findings.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs
  • crates/cmtraceopen-parser/tests/sccm_spine_contract.rs

📝 Walkthrough

Walkthrough

The SCCM finding validator now detects overlapping bounded evidence ranges across primary, terminal, and correlation-key references. Management Point validation uses the shared overlap helper. Contract tests cover invalid overlaps, valid ranges, and serialization round trips.

Changes

SCCM evidence validation

Layer / File(s) Summary
Shared overlap validation
crates/cmtraceopen-parser/src/sccm/findings.rs, crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs
Adds OverlappingEvidenceReference, validates cited evidence across all supported surfaces, rejects overlapping bounded ranges within an artifact, and removes the duplicate Management Point helper.
Overlap validation contract tests
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
Tests overlapping ranges, disjoint and adjacent ranges, cross-artifact ranges, unbounded references, and serde round trips. Updates an uncited evidence fixture to match its declared line range.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: test

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes rejecting overlapping SCCM evidence ranges, which is the primary change.
Linked Issues check ✅ Passed The changes satisfy issue #418 by enforcing artifact-scoped overlap validation across evidence surfaces and consolidating the shared predicate.
Out of Scope Changes check ✅ Passed The implementation, predicate consolidation, and contract tests are directly related to the linked issue objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@github-actions github-actions Bot added bug Something isn't working enhancement New feature or request parser Log parser related sccm SCCM/ConfigMgr related labels Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

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

Extends the SCCM “spine” finding validator to reject overlapping evidence line ranges within the same artifact across distinct (artifact_id, entry_id) identities, preventing double-citation of the same physical records and stabilizing evidence ordering/comparison.

Changes:

  • Adds OverlappingEvidenceReference to SccmFindingValidationError and enforces an O(n log n) overlap sweep across all three citation surfaces (top-level evidence, terminal evidence, correlation-key evidence).
  • Centralizes the overlap predicate as sccm::findings::evidence_references_overlap and reuses it from the management-point reducer (removing a duplicate implementation).
  • Updates/expands sccm_spine_contract tests to cover overlap rejection, serde round-trips, and valid disjoint/unbounded cases.

Reviewed changes

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

File Description
crates/cmtraceopen-parser/src/sccm/findings.rs Adds overlap error variant, shared overlap predicate, and spine-level disjoint-span validation across citation surfaces.
crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs Removes local overlap helper and imports the shared spine predicate to keep semantics unified.
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs Fixes a latent fixture inconsistency and adds comprehensive tests for overlapping/disjoint evidence range behavior.

@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.

🧹 Nitpick comments (1)
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs (1)

1319-1342: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider a three-span case to exercise the widest tracking branch.

All six cases use exactly two spans. With two spans, the sweep compares the first against the second and the widest update on line 757 of findings.rs never affects the outcome. A three-span case reaches that branch: spans 1-9, 2-3, 5-6 on one artifact sort to [1-9, 2-3, 5-6], and only the retained 1-9 span catches 5-6. If the sweep tracked the previous span instead of the widest span, that case would pass validation incorrectly and the current suite would not detect the regression.

🤖 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/tests/sccm_spine_contract.rs` around lines 1319 -
1342, Extend the overlap test cases in evidence_surface_findings to include a
three-span artifact scenario with spans 1-9, 2-3, and 5-6, asserting
OverlappingEvidenceReference. Ensure the test exercises widest-span retention
during the sweep rather than only comparing two spans.
🤖 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.

Nitpick comments:
In `@crates/cmtraceopen-parser/tests/sccm_spine_contract.rs`:
- Around line 1319-1342: Extend the overlap test cases in
evidence_surface_findings to include a three-span artifact scenario with spans
1-9, 2-3, and 5-6, asserting OverlappingEvidenceReference. Ensure the test
exercises widest-span retention during the sweep rather than only comparing two
spans.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c2217dd4-ced4-434b-81bd-7ec34d97faba

📥 Commits

Reviewing files that changed from the base of the PR and between 065b8cb and 8b487a3.

📒 Files selected for processing (3)
  • crates/cmtraceopen-parser/src/sccm/findings.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs
  • crates/cmtraceopen-parser/tests/sccm_spine_contract.rs

adamgell added a commit that referenced this pull request Aug 1, 2026
)

The CI workflow triggers only on `main`, but the entire SCCM program stacks
on `codex/parser-family-skeleton`. Seven open pull requests (#391, #392,
#394, #404, #405, #407, #420) therefore run none of the six jobs -- no
cargo check/test, no clippy, no MSRV check, no tsc, no Playwright E2E, and
no platform builds -- while still reporting as mergeable.

GitHub gives no signal for this: a pull request whose base branch is absent
from the trigger list is not "pending" or "skipped", it simply has no
checks, which is easy to misread as a passing PR with light gating.

Add the integration branch to both triggers so lane PRs are gated before
they land on it, and so the branch itself is checked after each merge.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@adamgell

adamgell commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Review follow-up and CI-base sync — exact head 3615a87

I independently checked the CodeRabbit three-span nitpick before changing the test. The proposed 1-9, 2-3, 5-6 case cannot exercise retained-widest behavior: after sorting, 1-9 and 2-3 overlap, so this validator returns immediately and never inspects 5-6. More generally, because the function exits on the first overlap, the widest update occurs only after a disjoint interval; with start-sorted intervals that current interval is then also the adjacent interval with the furthest end. Adding the proposed case would pass but would not prove the stated branch property, so I did not add a misleading test.

I non-force merged the updated integration base solely to activate PR #429 hosted CI. The feature delta remains the same three files. Fresh local gates on the synchronized head: spine 141/141, wasm32 check green, strict parser Clippy green, scoped rustfmt green, and diff check green.

@coderabbitai review

Please review exact head 3615a87 and re-evaluate the three-span rationale above. A no-finding approval must be attached to this head before merge.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== checked-out revision =='
git rev-parse HEAD
git status --short
echo

echo '== PR diff summary against merge base =='
base="$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null || true)"
if [ -n "$base" ]; then
  git diff --stat "$base"..HEAD -- \
    crates/cmtraceopen-parser/src/sccm/findings.rs \
    crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs \
    crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
  git diff --find-renames --unified=80 "$base"..HEAD -- \
    crates/cmtraceopen-parser/src/sccm/findings.rs \
    crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs \
    crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
else
  echo 'Could not determine merge base with main.'
fi
echo

echo '== source outlines =='
ast-grep outline crates/cmtraceopen-parser/src/sccm/findings.rs --items all --view expanded
ast-grep outline crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs --items all --view expanded
ast-grep outline crates/cmtraceopen-parser/tests/sccm_spine_contract.rs --items all --view expanded
echo

echo '== overlap definitions and call sites =='
rg -n -C 8 '\bevidence_references_overlap\b|OverlappingEvidenceReference|ConflictingEvidenceReference|InvalidEvidenceReference' \
  crates/cmtraceopen-parser/src/sccm/findings.rs \
  crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs \
  crates/cmtraceopen-parser/tests/sccm_spine_contract.rs

Length of output: 121439


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== revision and remotes =='
git rev-parse HEAD
git remote -v
echo

echo '== changed paths relative to merge base =='
base="$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null)"
git diff --name-status "$base"..HEAD
echo

echo '== findings validation and overlap implementation =='
sed -n '404,780p' crates/cmtraceopen-parser/src/sccm/findings.rs
echo

echo '== management-point usage =='
sed -n '1096,1148p' crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs
echo

echo '== overlap test helpers and cases =='
sed -n '476,590p' crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
sed -n '1110,1415p' crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
echo

echo '== all helper call sites in Rust source =='
rg -n -C 4 '\bevidence_references_overlap\s*\(' crates/cmtraceopen-parser/src --glob '*.rs'
echo

echo '== focused source diff =='
git diff --unified=25 "$base"..HEAD -- crates/cmtraceopen-parser/src/sccm/findings.rs
echo '== focused management-point diff =='
git diff --unified=25 "$base"..HEAD -- crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs

Length of output: 91054


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== checked-out SHA =='
git rev-parse HEAD
echo

echo '== PR `#420` metadata =='
gh pr view 420 --repo adamgell/cmtraceopen \
  --json number,headRefOid,baseRefName,headRefName,changedFiles,files \
  --jq '{number, headRefOid, baseRefName, headRefName, changedFiles, files: [.files[].path]}'
echo

echo '== commit metadata =='
git show --no-patch --format='commit=%H%nparents=%P%nsubject=%s' HEAD
echo

echo '== SccmFinding::validate and evidence validation =='
sed -n '404,765p' crates/cmtraceopen-parser/src/sccm/findings.rs
echo

echo '== overlap contract tests =='
sed -n '1262,1418p' crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
echo

echo '== shared helper call sites =='
rg -n -C 3 '\bevidence_references_overlap\s*\(' crates/cmtraceopen-parser/src --glob '*.rs'
echo

echo '== PR file patches, limited to the requested three paths =='
gh api 'repos/adamgell/cmtraceopen/pulls/420/files?per_page=100' \
  --jq '.[] | select(.filename == "crates/cmtraceopen-parser/src/sccm/findings.rs" or .filename == "crates/cmtraceopen-parser/src/sccm/server/windows/management_point.rs" or .filename == "crates/cmtraceopen-parser/tests/sccm_spine_contract.rs") | {filename, status, additions, deletions, patch}' \
  | head -c 120000
printf '\n'

Length of output: 39855


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== precedence-related contract tests =='
rg -n -C 18 'prioritizes|precedence|ConflictingEvidenceReference|InvalidEvidenceReference' \
  crates/cmtraceopen-parser/tests/sccm_spine_contract.rs \
  | head -n 320
echo

echo '== current conflict-validation block =='
sed -n '649,765p' crates/cmtraceopen-parser/src/sccm/findings.rs
echo

echo '== first-parent conflict-validation block =='
git show HEAD^1:crates/cmtraceopen-parser/src/sccm/findings.rs \
  | sed -n '635,710p'
echo

echo '== changed test names and assertions around evidence validation =='
git diff --unified=12 HEAD^1..HEAD -- crates/cmtraceopen-parser/tests/sccm_spine_contract.rs \
  | rg -n -C 12 'InvalidEvidenceReference|ConflictingEvidenceReference|OverlappingEvidenceReference|prioritizes|fn finding_' \
  | head -n 400

Length of output: 21029


@adamgell Full review completed for 3615a87de51fd1ce1eb8cca10c44aa9bce30647a.

I found no review findings.

Your three-span rationale is correct. After sorting, 1-9 overlaps 2-3. The validator returns before it processes 5-6. A retained-widest update occurs only after a disjoint span. With start-sorted inclusive spans, that span must also end after the current widest span. The proposed case cannot test a separate retained-widest path.

I verified the exact PR head and the three-file delta. The implementation preserves artifact scoping, inclusive bounds, unbounded-reference behavior, invalid-reference validation before the overlap sweep, and the Management Point shared-predicate consolidation. The contract coverage includes all three citation surfaces, serialization boundaries, valid disjoint cases, and the overlap shapes.

To attach a platform approval, post the explicit top-level command @coderabbitai approve.


✏️ Learnings added
Learnt from: adamgell
URL: https://github.com/adamgell/cmtraceopen/pull/420

Timestamp: 2026-08-01T22:38:57.270Z
Learning: For the SCCM evidence-reference overlap sweep in `crates/cmtraceopen-parser/src/sccm/findings.rs`, a three-span case such as `1-9`, `2-3`, and `5-6` cannot exercise a retained-widest update because the validator returns immediately when `1-9` overlaps `2-3`. After start-order sorting, any span that clears the current widest span must also extend beyond its end and therefore becomes the new widest span.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 6 minutes.

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.

Suppressed comments (1)

crates/cmtraceopen-parser/src/sccm/findings.rs:460

  • SccmFindingValidationError is a public, non-#[non_exhaustive] enum. Adding the new OverlappingEvidenceReference variant is a breaking change for downstream crates that match this error exhaustively; please ensure this is acceptable for the crate’s semver policy (e.g., major bump), or consider making the enum #[non_exhaustive] going forward to avoid repeated breaking changes when new validation errors are added.
    MissingRequiredField,
    InvalidRole,
    InvalidEvidenceReference,
    ConflictingEvidenceReference,
    OverlappingEvidenceReference,

@adamgell

adamgell commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Reviewed Copilots suppressed semver note at exact 3615a87. It is not a blocker for this integration-branch repair: origin/main has no sccm/findings.rs and therefore no released SccmFindingValidationError contract; the new variant is being added within the still-unintegrated SCCM API review sequence, not to an already-published mainline enum. Public LogEntry is unchanged. If the SCCM error type later needs extension after mainline release, non-exhaustive handling can be evaluated as an intentional public-API change rather than silently widening this overlap-fix slice.

@adamgell

adamgell commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Exact integration resync checkpoint — c7ed2d04d4e5bffa2d942fa18b2c0625c42193c7

Merged current origin/codex/parser-family-skeleton non-force after PR #431 landed. The net feature delta remains exactly the intended three files.

Fresh local verification on this exact head:

  • SCCM spine contract: 141/141
  • Management Point contract: 26/26
  • full parser tests: green
  • wasm32-unknown-unknown check: green
  • strict parser Clippy: green
  • scoped rustfmt and git diff --check: green
  • local CodeRabbit committed review: 0 findings across all 3 changed files
  • hosted CodeRabbit approval is attached to this exact commit
  • unresolved review threads: 0

Hosted CI run 30724221323 is still in progress. This PR will not merge until the exact-head Copilot review and every required hosted job, including package builds, are green.

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.

Suppressed comments (1)

crates/cmtraceopen-parser/src/sccm/findings.rs:461

  • SccmFindingValidationError is a public enum in the published cmtraceopen-parser crate. Adding OverlappingEvidenceReference is a breaking change for downstream users who exhaustively match on this enum. Consider marking it #[non_exhaustive] to make future additions non-breaking (and ensure the next published version bump reflects the API change).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SccmFindingValidationError {
    MissingRequiredField,
    InvalidRole,
    InvalidEvidenceReference,
    ConflictingEvidenceReference,
    OverlappingEvidenceReference,
    MissingEvidenceOrCoverageGap,

@adamgell
adamgell marked this pull request as ready for review August 1, 2026 23:59
@adamgell

adamgell commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@adamgell
adamgell requested a review from Copilot August 1, 2026 23:59
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

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.

@adamgell
adamgell merged commit d5beb5b into codex/parser-family-skeleton Aug 2, 2026
12 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 parser Log parser related sccm SCCM/ConfigMgr related test Testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants