Skip to content

feat(sccm): bind DP sources to sealed server intake - #458

Merged
adamgell merged 15 commits into
codex/parser-family-skeletonfrom
codex/sccm329-dp-authority-restack-r115
Aug 3, 2026
Merged

feat(sccm): bind DP sources to sealed server intake#458
adamgell merged 15 commits into
codex/parser-family-skeletonfrom
codex/sccm329-dp-authority-restack-r115

Conversation

@adamgell

@adamgell adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Scope

Implements the first production slice of the Distribution Point workflow: a pure-Rust, wasm-compatible adapter that projects only canonical server-dp-distribution logical CCM evidence from the reviewed server-intake boundary.

This deliberately does not complete the Distribution Point diagnostic workflow. It emits cited source observations, explicit coverage gaps, and bounded source requests only. It does not yet reduce package/content/version transactions, emit terminal DP findings, perform native collection, or perform client/server correlation. The tracking issue remains open.

Authority and safety contract

  • Requires both canonical adapter and topology seals before exporting any observation.
  • Preserves producer host, workflow-subject DP, source version, rotation lineage, line ranges, and normalized timestamp provenance.
  • Rejects duplicate artifact identities, missing/duplicate/holey evidence, coverage mismatch, topology mismatch, unsupported profiles, incomplete fragments, and noncanonical rotation.
  • Missing or unusable source coverage remains a coverage state and artifact request, never a role diagnosis.
  • Requests both site-side distmgr.log and DP-side SMSDPProv.log when the missing side is not yet known.
  • cross_side_correlation_performed is always false.

Test-first history

The branch preserves separate RED and GREEN commits for canonical intake behavior, canonical evidence and coverage continuity, sealed adapter/topology authority, dual-source requests for unscoped gaps, stable serialized coverage reason labels, and the distinction between sealed lower-predicate tests and post-intake authority quarantine.

Verification at current integration

Head: 0e63f6a09e61074f0e32c3745e2acb3921975815

Base: a185a68fe6c1290aece9d55805e4173262a61193

Merge tree: 77ee09a69542e959715c52fed1c895af95558bed

GitHub updated the branch without force. The new merge commit has parents 2150f85d and a185a68f; its tree is byte-identical to the independently validated current-base synthetic merge.

  • DP adapter: 16/16
  • server intake: 62/62
  • DP fixture contract: 48/48
  • Management Point: 3/3
  • Site Core: 42/42
  • SUP fixture contract: 18/18
  • advanced-role catalog: 7/7
  • full parser: 444 unit tests plus all integration/doc tests
  • strict parser Clippy: pass
  • parser wasm32 check: pass
  • npx tsc --noEmit: pass
  • scoped rustfmt --check on all three changed files: pass
  • git diff --check: pass
  • independent current-base review: GO, no P0-P3 findings

Repository-wide cargo fmt --check --all reports inherited drift only in five non-#329 ESP files; no changed file overlaps those hunks.

Fresh hosted CodeRabbit, Copilot, and CI are required on this exact head before merge. Prior hosted reviews are not treated as current-head acceptance.

Remaining dependency/state

The full package/content/version/DP state reducer remains required and will consume the already-merged ten-scenario synthetic corpus after this source boundary lands. Content-to-DP correlation remains blocked until both upstream semantic fact contracts are stable. Native Windows/SCCM validation remains future work; this PR makes no live-acceptance claim.

Closes no issue.

Summary by CodeRabbit

  • New Features
    • Added analysis for SCCM Distribution Point server intake.
    • Validates source authority, artifact identity, metadata, topology, coverage, rotation, versions, and evidence continuity.
    • Produces consistent source observations, coverage status, and role-specific collection requests.
    • Supports versioned analysis profiles and schema metadata.
  • Bug Fixes
    • Invalid or incomplete intake data now fails safely with actionable collection requests.
    • Untrusted, malformed, or forged artifacts are excluded from analysis.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a canonical SCCM Distribution Point analyzer. It validates intake authority, artifact identity, metadata, topology, coverage, rotation, versions, and evidence. It emits deterministic observations, coverage gaps, and role-specific collection requests. Tests cover valid, invalid, incomplete, and reordered intake data.

Changes

Distribution Point analysis

Layer / File(s) Summary
Analysis contract and module wiring
crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs, crates/cmtraceopen-parser/src/sccm/server/windows/mod.rs, crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs
Defines public analysis records and metadata, exports the module, and provides fixture-loading test helpers.
Canonical intake validation
crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs, crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs
Validates authority, artifact eligibility, metadata, topology, coverage membership, rotation, roles, identifiers, timestamps, and contiguous evidence. Tests verify fail-closed behavior for invalid mutations and malformed evidence.
Coverage projection and artifact requests
crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs, crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs
Produces deterministic observations and coverage gaps, and generates deduplicated role-specific requests for distmgr.log and SMSDPProv.log. Tests verify complete, missing, undeclared, and reordered coverage. The analyzer performs no cross-side correlation.

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

Sequence Diagram(s)

sequenceDiagram
  participant SccmServerIntakeAssessment
  participant analyze_distribution_point
  participant SccmDistributionPointAnalysis
  SccmServerIntakeAssessment->>analyze_distribution_point: provide intake assessment
  analyze_distribution_point->>SccmServerIntakeAssessment: validate authority and canonical artifacts
  analyze_distribution_point->>SccmDistributionPointAnalysis: emit observations, gaps, and requests
Loading

Possibly related PRs

  • adamgell/cmtraceopen#374: Provides the synthetic Distribution Point fixture corpus and contract tests consumed by this implementation.
  • adamgell/cmtraceopen#430: Defines provenance-scoped intake identities and deterministic artifact ordering used by this analyzer.
  • adamgell/cmtraceopen#434: Adds the intake assessment and artifact/topology validation contracts used by the analyzer.

Suggested labels: test

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.90% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly summarizes the main change: binding Distribution Point sources to the sealed server-intake boundary.
✨ Finishing Touches 💡 1
📝 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 enhancement New feature or request feature New feature parser Log parser related sccm SCCM/ConfigMgr related labels Aug 3, 2026
@adamgell adamgell self-assigned this Aug 3, 2026
@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review — exact-head review requested for 63897dd. Please assess this only as the bounded sealed-intake DP source adapter described in the PR; it is not the full semantic DP reducer.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

@adamgell I will perform a full review of PR #458 at 63897dd0b16185e3d660e90f04210422a4580c28.

I will assess the bounded sealed-intake DP source adapter only. I will not treat the absent semantic DP reducer as a defect in this PR.

✅ 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

Adds the first SCCM server Distribution Point (DP) workflow slice by introducing a canonical-intake–bound adapter that projects only vetted DP distribution CCM evidence into a structured analysis output (observations, coverage gaps, and bounded artifact requests), without attempting any higher-level DP transaction/state reduction.

Changes:

  • Introduces analyze_distribution_point() adapter that enforces intake/topology seal authority and admits only canonical DP distribution sources/evidence.
  • Exposes the new adapter via cmtraceopen_parser::sccm::server::windows module exports.
  • Adds a dedicated integration test suite covering deterministic output, sealed-authority failure-closed behavior, coverage gap semantics, and bounded source requests.

Reviewed changes

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

File Description
crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs New integration tests validating the DP adapter’s canonical projection, determinism, and failure-closed/coverage-gap behavior.
crates/cmtraceopen-parser/src/sccm/server/windows/mod.rs Wires the new distribution_point module into the Windows server surface and re-exports its API.
crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs Implements the canonical-intake DP adapter, coverage-gap reasoning, and bounded artifact-request emission.

@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 (8)
crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs (6)

540-573: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Consider cached or borrowed sort keys.

Both key functions allocate on every comparison. source_observation_sort_key clones two String values, and coverage_gap_sort_key allocates four String values plus a Vec<String> clone. sort_by and sort_by_key call these O(n log n) times.

The collections are small, so this is not a current problem. If you want to remove the allocations, either return borrowed &str tuples or use sort_by_cached_key, which computes each key once per element.

🤖 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/sccm/server/windows/distribution_point.rs`
around lines 540 - 573, Update the sorting logic using
source_observation_sort_key and coverage_gap_sort_key to avoid rebuilding
allocated keys on every comparison. Prefer sort_by_cached_key so each element’s
existing key function is evaluated once, preserving the current sort-key
ordering and behavior.

221-241: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider one shared eligibility predicate and the short SccmEvidence path.

Lines 225-228 and lines 238-241 repeat the same four eligibility checks. Extract them into one helper, for example artifact_is_eligible(artifact), and call it from both places.

Line 223 also spells out crate::sccm::SccmEvidence although line 15 already imports SccmEvidence, and canonical_evidence_set at line 375 uses the short path.

♻️ Proposed refactor
+fn artifact_is_eligible(artifact: &SccmServerArtifactAssessment) -> bool {
+    artifact.state == SccmCoverageState::Captured
+        && artifact.profile_eligible
+        && artifact.parser_eligible
+        && artifact.fragment_complete != Some(false)
+}
+
 fn admitted_for_source_observation(
     artifact: &SccmServerArtifactAssessment,
-    evidence: &crate::sccm::SccmEvidence,
+    evidence: &SccmEvidence,
 ) -> bool {
-    artifact.state == SccmCoverageState::Captured
-        && artifact.profile_eligible
-        && artifact.parser_eligible
-        && artifact.fragment_complete != Some(false)
+    artifact_is_eligible(artifact)
         && evidence.role == artifact.producer_role
         && evidence.timestamp.ordering_state == SccmTimeOrderingState::NormalizedUtc
 }
🤖 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/sccm/server/windows/distribution_point.rs`
around lines 221 - 241, Extract the four shared artifact eligibility checks from
admitted_for_source_observation and artifact_metadata_is_congruent into an
artifact_is_eligible helper, then reuse it in both predicates while preserving
their additional conditions. Update admitted_for_source_observation to use the
already imported SccmEvidence type instead of the fully qualified crate path.

355-370: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Consider precomputing an artifact index to remove repeated scans.

For every membership id, this closure scans intake.artifacts linearly and then calls classify_artifact_name twice through is_dp_distribution_artifact and rotation_is_canonical_for_artifact. coverage_is_congruent runs once per candidate artifact, so classification repeats many times for the same artifact.

Intake bounds the artifact count and the coverage membership count, so the current cost stays bounded. If you want the adapter to stay cheap as those bounds grow, build one BTreeMap<&str, &SccmServerArtifactAssessment> plus a cached DP-eligibility set in analyze_distribution_point and pass it down.

🤖 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/sccm/server/windows/distribution_point.rs`
around lines 355 - 370, Optimize coverage matching by precomputing an artifact
index in analyze_distribution_point: build a BTreeMap keyed by artifact ID plus
a cached set of artifacts eligible for DP distribution, then pass both into
coverage_is_congruent. Replace the repeated intake.artifacts scans and duplicate
classification calls in the artifact_ids closure with indexed lookups while
preserving all existing matching predicates and uniqueness checks.

184-196: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider extracting the shared analysis envelope.

Lines 158-170 and lines 184-196 repeat the same schema_version, workflow, profile, and cross_side_correlation_performed values. A single constructor keeps the two exit paths aligned when the profile or schema version changes.

♻️ Proposed refactor
+fn analysis_envelope(
+    source_observations: Vec<SccmDistributionPointSourceObservation>,
+    coverage_gaps: Vec<SccmDistributionPointCoverageGap>,
+    artifact_requests: Vec<SccmArtifactRequest>,
+) -> SccmDistributionPointAnalysis {
+    SccmDistributionPointAnalysis {
+        schema_version: SCCM_DISTRIBUTION_POINT_ANALYSIS_SCHEMA_VERSION,
+        workflow: SccmDistributionPointWorkflow::DistributionPointContent,
+        profile: SccmDistributionPointProfile {
+            id: SCCM_DISTRIBUTION_POINT_INTAKE_PROFILE_ID.to_owned(),
+            version: SCCM_DISTRIBUTION_POINT_INTAKE_PROFILE_VERSION,
+            stability: "experimental".to_owned(),
+        },
+        source_observations,
+        coverage_gaps,
+        artifact_requests,
+        cross_side_correlation_performed: false,
+    }
+}
🤖 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/sccm/server/windows/distribution_point.rs`
around lines 184 - 196, Extract the repeated analysis envelope from the two
construction paths in the relevant distribution-point analysis function into a
shared constructor or helper. Centralize the common schema_version, workflow,
profile, and cross_side_correlation_performed values, then have both paths reuse
it while supplying their distinct source_observations, coverage_gaps, and
artifact_requests fields.

255-277: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Share the profile-version predicate with intake.

distribution_point.rs repeats the numeric 5.00.BBBB.RRRR grammar from intake.rs. Extract the shared numeric predicate while preserving synthetic-only acceptance of "5.00.TEST". Opaque version handles are already excluded because they are not profile_eligible.

🤖 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/sccm/server/windows/distribution_point.rs`
around lines 255 - 277, Extract the shared numeric 5.00.BBBB.RRRR version
predicate from supported_source_version into the existing intake-related shared
symbol, then reuse it from distribution_point.rs. Keep "5.00.TEST" accepted only
by the distribution-point predicate, while preserving rejection of opaque and
malformed versions.

492-519: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Define canonical request identifiers in the catalog.

The catalog declares two logical names per producer role, but this function hardcodes only distmgr and smsDpProv. Add an explicit canonical request entry or shared helper so catalog changes cannot leave admission and follow-up requests inconsistent.

🤖 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/sccm/server/windows/distribution_point.rs`
around lines 492 - 519, Update artifact_requests to obtain the distmgr and
smsDpProv request identifiers from the catalog’s canonical request entries or
shared helper instead of hardcoding string literals. Ensure every generated
SccmArtifactRequest uses those canonical identifiers while preserving the
existing producer-role routing and reasons.
crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs (2)

92-104: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Post-intake mutation makes the admission predicates untested.

Every one of these tests mutates the assessment after assess_server_intake seals it. Any such mutation breaks adapter_authority_is_intake_bound, so analyze_distribution_point returns at line 89 of crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs before is_dp_distribution_artifact, artifact_metadata_is_congruent, admitted_for_source_observation, or canonical_evidence_set runs. assert_dp_coverage_only accepts that outcome because it only checks non-emptiness, so the tests pass while the predicates they name stay uncovered. To cover a predicate, encode the defect in the fixture manifest so intake seals it, then assert the coverage-only projection.

  • crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs#L92-L104: assert the expected gap count, source_id, state, reason, and requested logical_id instead of non-emptiness, so an authority-invalid result cannot satisfy a predicate-driven expectation.
  • crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs#L421-L452: move the four defects ("profile-ineligible", "parser-ineligible", "incomplete-fragment", "invalid-evidence") into sealed fixture manifests so admitted_for_source_observation and canonical_evidence_set execute, or rename the test to state that it only proves authority-gate determinism.
  • crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs#L469-L477: add a fixture whose DP coverage omits the artifact at intake time, so coverage_is_congruent rejects the artifact instead of the authority gate.
  • crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs#L479-L502: add sealed fixtures for the wrong subject role, the missing topology role, the ineligible profile, and the wrong rotation, so subject_handle_is_congruent, topology_is_congruent, and rotation_is_canonical_for_artifact execute.

Do you want me to open an issue to track the fixture-level admission coverage?

🤖 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_server_distribution_point.rs` around
lines 92 - 104, Distribution-point tests mutate assessments after intake, so
authority gating prevents the intended admission and congruence predicates from
executing. In
crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs:92-104, assert
exact gap count, source_id, state, reason, and logical_id values rather than
non-emptiness. At 421-452, encode the four defects in sealed fixture manifests
so admitted_for_source_observation and canonical_evidence_set run, or rename the
test to cover only authority-gate determinism. At 469-477, add a fixture
omitting the artifact from DP coverage at intake so coverage_is_congruent
rejects it; at 479-502, add sealed fixtures covering wrong subject role, missing
topology role, ineligible profile, and wrong rotation for
subject_handle_is_congruent, topology_is_congruent, and
rotation_is_canonical_for_artifact.

13-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Import SccmServerIntakeAssessment to shorten the signatures.

The fully qualified path cmtraceopen_parser::sccm::server::windows::SccmServerIntakeAssessment appears six times, at lines 15, 41, 51, 61, 89, and 109. Line 3 already imports from the same module.

♻️ Proposed refactor
 use cmtraceopen_parser::sccm::server::windows::{
-    analyze_distribution_point, assess_server_intake, SccmServerArtifactPayload,
+    analyze_distribution_point, assess_server_intake, SccmServerArtifactPayload,
+    SccmServerIntakeAssessment,
 };
-fn load_assessment(
-    scenario: &str,
-) -> cmtraceopen_parser::sccm::server::windows::SccmServerIntakeAssessment {
+fn load_assessment(scenario: &str) -> SccmServerIntakeAssessment {
🤖 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_server_distribution_point.rs` around
lines 13 - 15, Import SccmServerIntakeAssessment from
cmtraceopen_parser::sccm::server::windows alongside the existing module import,
then replace all six fully qualified type references in load_assessment and the
related test signatures with the imported name.
🤖 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/src/sccm/server/windows/distribution_point.rs`:
- Around line 540-573: Update the sorting logic using
source_observation_sort_key and coverage_gap_sort_key to avoid rebuilding
allocated keys on every comparison. Prefer sort_by_cached_key so each element’s
existing key function is evaluated once, preserving the current sort-key
ordering and behavior.
- Around line 221-241: Extract the four shared artifact eligibility checks from
admitted_for_source_observation and artifact_metadata_is_congruent into an
artifact_is_eligible helper, then reuse it in both predicates while preserving
their additional conditions. Update admitted_for_source_observation to use the
already imported SccmEvidence type instead of the fully qualified crate path.
- Around line 355-370: Optimize coverage matching by precomputing an artifact
index in analyze_distribution_point: build a BTreeMap keyed by artifact ID plus
a cached set of artifacts eligible for DP distribution, then pass both into
coverage_is_congruent. Replace the repeated intake.artifacts scans and duplicate
classification calls in the artifact_ids closure with indexed lookups while
preserving all existing matching predicates and uniqueness checks.
- Around line 184-196: Extract the repeated analysis envelope from the two
construction paths in the relevant distribution-point analysis function into a
shared constructor or helper. Centralize the common schema_version, workflow,
profile, and cross_side_correlation_performed values, then have both paths reuse
it while supplying their distinct source_observations, coverage_gaps, and
artifact_requests fields.
- Around line 255-277: Extract the shared numeric 5.00.BBBB.RRRR version
predicate from supported_source_version into the existing intake-related shared
symbol, then reuse it from distribution_point.rs. Keep "5.00.TEST" accepted only
by the distribution-point predicate, while preserving rejection of opaque and
malformed versions.
- Around line 492-519: Update artifact_requests to obtain the distmgr and
smsDpProv request identifiers from the catalog’s canonical request entries or
shared helper instead of hardcoding string literals. Ensure every generated
SccmArtifactRequest uses those canonical identifiers while preserving the
existing producer-role routing and reasons.

In `@crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs`:
- Around line 92-104: Distribution-point tests mutate assessments after intake,
so authority gating prevents the intended admission and congruence predicates
from executing. In
crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs:92-104, assert
exact gap count, source_id, state, reason, and logical_id values rather than
non-emptiness. At 421-452, encode the four defects in sealed fixture manifests
so admitted_for_source_observation and canonical_evidence_set run, or rename the
test to cover only authority-gate determinism. At 469-477, add a fixture
omitting the artifact from DP coverage at intake so coverage_is_congruent
rejects it; at 479-502, add sealed fixtures covering wrong subject role, missing
topology role, ineligible profile, and wrong rotation for
subject_handle_is_congruent, topology_is_congruent, and
rotation_is_canonical_for_artifact.
- Around line 13-15: Import SccmServerIntakeAssessment from
cmtraceopen_parser::sccm::server::windows alongside the existing module import,
then replace all six fully qualified type references in load_assessment and the
related test signatures with the imported name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cc49bf41-2a5c-45df-a666-28ed1f4585e7

📥 Commits

Reviewing files that changed from the base of the PR and between 09aafd4 and 63897dd.

📒 Files selected for processing (3)
  • crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/mod.rs
  • crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Published test-only correction 2150f85 after independently validating CodeRabbit review feedback. Production is unchanged. The 16 DP tests now separate three reachable valid-seal adapter guards (profile eligibility, missing subject handle, unobserved DP role), intake-level role/rotation rejection, and explicit post-intake authority quarantine for mutations that cannot exist in canonical sealed intake. Focused 16/16, full parser, strict Clippy, wasm32, TypeScript build, scoped Rustfmt/diff, and local CodeRabbit zero findings pass. Fresh exact-head hosted CodeRabbit, Copilot, and CI remain merge gates.

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@adamgell
adamgell requested a review from Copilot August 3, 2026 18:52
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ 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 17 minutes.

@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 (3)
crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs (3)

221-253: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the shared eligibility predicate.

admitted_for_source_observation and artifact_metadata_is_congruent repeat the same four artifact checks: state == Captured, profile_eligible, parser_eligible, and fragment_complete != Some(false). A future change to one list can silently diverge from the other.

♻️ Proposed extraction
+fn artifact_is_usable(artifact: &SccmServerArtifactAssessment) -> bool {
+    artifact.state == SccmCoverageState::Captured
+        && artifact.profile_eligible
+        && artifact.parser_eligible
+        && artifact.fragment_complete != Some(false)
+}
+
 fn admitted_for_source_observation(
     artifact: &SccmServerArtifactAssessment,
     evidence: &crate::sccm::SccmEvidence,
 ) -> bool {
-    artifact.state == SccmCoverageState::Captured
-        && artifact.profile_eligible
-        && artifact.parser_eligible
-        && artifact.fragment_complete != Some(false)
+    artifact_is_usable(artifact)
         && evidence.role == artifact.producer_role
         && evidence.timestamp.ordering_state == SccmTimeOrderingState::NormalizedUtc
 }
🤖 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/sccm/server/windows/distribution_point.rs`
around lines 221 - 253, Extract the repeated artifact eligibility checks from
admitted_for_source_observation and artifact_metadata_is_congruent into a shared
predicate, then call it from both functions. Preserve the existing four
conditions exactly and leave each function’s additional evidence,
source-version, topology, and coverage checks unchanged.

355-370: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Reduce repeated classification work in the coverage check.

coverage_is_congruent runs for each candidate artifact. For every coverage membership it scans all intake.artifacts and calls is_dp_distribution_artifact and rotation_is_canonical_for_artifact, which each call classify_artifact_name and scan declared_server_source_catalog(). The total work grows quadratically with artifact count. Manifest limits bound the input, so this is not a runtime risk today. Precompute a map from artifact_id to the DP-eligibility and rotation results once in analyze_distribution_point, then look values up here.

🤖 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/sccm/server/windows/distribution_point.rs`
around lines 355 - 370, In analyze_distribution_point, precompute and retain a
map keyed by artifact_id containing each artifact’s DP-eligibility and
canonical-rotation results, so classification and declared_server_source_catalog
scans occur only once per artifact. Update coverage_is_congruent’s artifact
membership check to use this map alongside the existing identity and uniqueness
checks, removing the repeated intake.artifacts scan and calls to
is_dp_distribution_artifact and rotation_is_canonical_for_artifact.

255-277: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse the intake version predicate instead of duplicating it.

supported_source_version re-implements source_version_is_profile_eligible from intake.rs (lines 2365-2384). Two differences exist. This copy accepts "5.00.TEST" unconditionally, while intake accepts it only for synthetic fixtures. Sealed intake currently blocks that value for non-synthetic manifests, so the adapter stays closed today, but the two predicates can drift apart later. Export a shared helper in the module and call it from both sites.

🤖 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/sccm/server/windows/distribution_point.rs`
around lines 255 - 277, Replace the duplicated validation in
supported_source_version with a shared exported helper from intake.rs, based on
source_version_is_profile_eligible. Update both the intake call site and
supported_source_version to use that helper, preserving the synthetic-fixture
handling for "5.00.TEST" so both paths enforce identical eligibility rules.
🤖 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/src/sccm/server/windows/distribution_point.rs`:
- Around line 221-253: Extract the repeated artifact eligibility checks from
admitted_for_source_observation and artifact_metadata_is_congruent into a shared
predicate, then call it from both functions. Preserve the existing four
conditions exactly and leave each function’s additional evidence,
source-version, topology, and coverage checks unchanged.
- Around line 355-370: In analyze_distribution_point, precompute and retain a
map keyed by artifact_id containing each artifact’s DP-eligibility and
canonical-rotation results, so classification and declared_server_source_catalog
scans occur only once per artifact. Update coverage_is_congruent’s artifact
membership check to use this map alongside the existing identity and uniqueness
checks, removing the repeated intake.artifacts scan and calls to
is_dp_distribution_artifact and rotation_is_canonical_for_artifact.
- Around line 255-277: Replace the duplicated validation in
supported_source_version with a shared exported helper from intake.rs, based on
source_version_is_profile_eligible. Update both the intake call site and
supported_source_version to use that helper, preserving the synthetic-fixture
handling for "5.00.TEST" so both paths enforce identical eligibility rules.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ecdb59e-0528-46e4-bdc2-c0b8b854b61c

📥 Commits

Reviewing files that changed from the base of the PR and between 09aafd4 and 2150f85.

📒 Files selected for processing (3)
  • crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/mod.rs
  • crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs

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 (2)

crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs:555

  • coverage_gap_sort_key clones multiple Strings and the Vec<String> just to sort coverage gaps. This adds avoidable allocations and copies; returning borrowed strings/slices keeps the sort deterministic without extra heap work.
fn coverage_gap_sort_key(
    gap: &SccmDistributionPointCoverageGap,
) -> (String, String, String, String, Vec<String>) {
    (
        gap.source_id.clone(),

crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs:549

  • source_observation_sort_key clones artifact_id and entry_id just to build a sort key. This allocates during sorting and can become noticeable when a DP artifact has many evidence records. Prefer returning borrowed &str fields for the key to keep sorting allocation-free.

This issue also appears on line 551 of the same file.

fn source_observation_sort_key(
    observation: &SccmDistributionPointSourceObservation,
) -> (String, u32, u32, String) {
    (
        observation.artifact_id.clone(),

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Independent disposition of the exact-head review nits: (1) the duplicated four-condition eligibility predicates are currently identical and covered by the 16-test matrix; extracting them is a maintenance follow-up, not a semantic defect. (2) repeated DP classification is bounded by the 512-artifact intake ceiling and CodeRabbit itself identifies no current runtime risk; precomputation belongs with the full semantic reducer. (3) the local version-shape recheck cannot admit non-synthetic 5.00.TEST because both adapter/topology seals and intake profile eligibility are required; sharing the intake helper would need synthetic provenance that the public assessment intentionally does not expose and would overlap the active shared SUP intake seam. (4) Copilot sort-key allocation observations are valid performance cleanup before expanding to high-volume semantic facts, but do not change deterministic output or authority. No review suggestion is being silently accepted or dismissed; these are recorded gates for the next #329 reducer slice, while this PR remains the bounded unwired source adapter.

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@adamgell
adamgell requested a review from Copilot August 3, 2026 19:47
@coderabbitai

coderabbitai Bot commented Aug 3, 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.

Suppressed comments (1)

crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs:496

  • artifact_requests only ever emits distmgr and/or smsDpProv requests, even though the declared DP distribution source catalog also includes pkgXferMgr (site-side) and pullDp (DP-side). If intake coverage gaps occur for those other declared DP distribution artifacts, the adapter will request the wrong logical artifact (or fail to request a compatible one), making recollection guidance inaccurate.

Consider generating requests from the declared source spec(s) for server-dp-distribution by producer role (or from the specific artifact IDs present in the gap), so the requested logical IDs match the eligible DP-distribution sources actually in play (e.g., include pkgXferMgr/pullDp where applicable).

fn artifact_requests(gaps: &[SccmDistributionPointCoverageGap]) -> Vec<SccmArtifactRequest> {
    let mut requests = Vec::with_capacity(gaps.len());
    for gap in gaps {
        if gap.producer_role.is_none() {
            requests.push(SccmArtifactRequest {

@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 (3)
crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs (2)

221-224: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use the imported SccmEvidence path.

SccmEvidence is imported at line 15. canonical_evidence_set at line 375 uses the short path. Use the same form here for consistency.

♻️ Proposed change
 fn admitted_for_source_observation(
     artifact: &SccmServerArtifactAssessment,
-    evidence: &crate::sccm::SccmEvidence,
+    evidence: &SccmEvidence,
 ) -> bool {
🤖 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/sccm/server/windows/distribution_point.rs`
around lines 221 - 224, Update the admitted_for_source_observation function
signature to use the imported SccmEvidence type directly instead of the fully
qualified crate::sccm::SccmEvidence path, matching canonical_evidence_set and
the existing import.

255-277: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Reuse the canonical source-version predicate.

Move supported_source_version into shared intake logic and use it from the Distribution Point adapter. This prevents future drift between synthetic_fixture handling and profile eligibility.

🤖 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/sccm/server/windows/distribution_point.rs`
around lines 255 - 277, Move the supported_source_version predicate into the
shared intake logic, then update the Distribution Point adapter to import and
call that canonical helper instead of defining its own local version. Ensure
both synthetic_fixture handling and profile eligibility reuse the same
predicate.
crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs (1)

111-195: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add assertions for schema_version and profile.

No test in this file asserts analysis.schema_version, analysis.profile.id, analysis.profile.version, or analysis.profile.stability. Those four fields are part of the public analysis contract that distribution_point.rs declares at lines 23-25 and 158-165. A change to any of them would pass all 12 tests in this file.

Pin them in one place, for example inside both shared helpers or in the canonical happy-path test.

💚 Proposed addition
 fn assert_dp_intake_authority_invalid(
     assessment: &SccmServerIntakeAssessment,
     context: &str,
 ) -> Value {
     let analysis = analyze_distribution_point(assessment);
+    assert_eq!(analysis.schema_version, 1, "{context}");
+    assert_eq!(analysis.profile.id, "sccm-dp-intake-envelope", "{context}");
+    assert_eq!(analysis.profile.version, 1, "{context}");
+    assert_eq!(analysis.profile.stability, "experimental", "{context}");
     assert!(
🤖 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_server_distribution_point.rs` around
lines 111 - 195, Add assertions covering analysis.schema_version and
analysis.profile.id, analysis.profile.version, and analysis.profile.stability in
the shared distribution-point test helpers, preferably
assert_dp_sealed_guard_rejection and assert_dp_intake_authority_invalid so all
related cases are pinned to the public contract. Use the canonical expected
values declared by distribution_point.rs and keep the existing validation
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.

Nitpick comments:
In `@crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs`:
- Around line 221-224: Update the admitted_for_source_observation function
signature to use the imported SccmEvidence type directly instead of the fully
qualified crate::sccm::SccmEvidence path, matching canonical_evidence_set and
the existing import.
- Around line 255-277: Move the supported_source_version predicate into the
shared intake logic, then update the Distribution Point adapter to import and
call that canonical helper instead of defining its own local version. Ensure
both synthetic_fixture handling and profile eligibility reuse the same
predicate.

In `@crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs`:
- Around line 111-195: Add assertions covering analysis.schema_version and
analysis.profile.id, analysis.profile.version, and analysis.profile.stability in
the shared distribution-point test helpers, preferably
assert_dp_sealed_guard_rejection and assert_dp_intake_authority_invalid so all
related cases are pinned to the public contract. Use the canonical expected
values declared by distribution_point.rs and keep the existing validation
unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 519dbff3-ba9a-4f36-9661-34c828244e43

📥 Commits

Reviewing files that changed from the base of the PR and between a185a68 and 0e63f6a.

📒 Files selected for processing (3)
  • crates/cmtraceopen-parser/src/sccm/server/windows/distribution_point.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/mod.rs
  • crates/cmtraceopen-parser/tests/sccm_server_distribution_point.rs

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Fresh exact-head review disposition:

  • CodeRabbit's short-path cleanup, shared canonical source-version predicate, and public schema/profile assertions are valid maintainability/test-hardening requests. They do not expose a current admission bypass because the adapter first requires the sealed intake profile-eligibility result. They are accepted as the first mandatory pre-reducer commit on the still-open workflow branch, before package/content/version semantic expansion.
  • Copilot's suppressed suggestion to request every catalog candidate is not adopted in this bounded adapter. A role-level gap does not identify which optional logical member is missing; the execution contract intentionally requests the canonical minimal site-side distmgr and DP-side SMSDPProv representatives. Broadening that to PkgXferMgr/PullDP would request evidence not justified by the current gap. A later exact source-specific gap may add a matching request.
  • Prior bounded-input allocation/index suggestions remain recorded as pre-high-volume reducer hardening, not a correctness blocker for the current evidence/coverage-only slice.

No review finding authorizes a client causal claim, a role diagnosis, native collection, or a broad parser. The issue remains open and the semantic reducer branch may not expand until those accepted hardening contracts pass independent review.

@adamgell
adamgell marked this pull request as ready for review August 3, 2026 20:02
@adamgell
adamgell merged commit bc5d4f8 into codex/parser-family-skeleton Aug 3, 2026
11 checks passed
adamgell added a commit that referenced this pull request Aug 4, 2026
Reviewed bounded adapter slice only. The full package/content/version reducer, correlation, native collection, and live Windows validation remain open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature New feature 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