Skip to content

feat(sccm): define optional WSUS supplemental intake contract - #459

Merged
adamgell merged 6 commits into
codex/parser-family-skeletonfrom
codex/issue-335-sup-intake-contract-r122
Aug 3, 2026
Merged

feat(sccm): define optional WSUS supplemental intake contract#459
adamgell merged 6 commits into
codex/parser-family-skeletonfrom
codex/issue-335-sup-intake-contract-r122

Conversation

@adamgell

@adamgell adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Scope

Bounded pure-parser SCCM Server intake/catalog/fixture contract for the optional server-sup-wsus supplemental source. This adds no native collector, Windows I/O, diagnosis reducer, broad parser, or live acceptance claim.

Contract

  • Profiles the optional exact WsusHealth.json source with wsUs producer and softwareUpdatePoint workflow subject.
  • Validates synthetic 5.00.TEST fixture/version, configured-path fingerprint, role topology, host/subject handles, lineage, exact provider-defined rotation shape, and version/profile provenance.
  • Keeps the supplemental source coverage-only: a skipped source produces coverage state without a server finding or capture request.
  • A missing default path remains a coverage state, never evidence that the role is absent or broken.
  • Uses sanitized synthetic fixture material only.

Exact head and base

Head: a1de6d76d6ca23682a5d0d3583acd2e5d5663433

Base: bc5d4f854362e31ffbfae46d9a07950955690887

The branch was fast-forwarded without force from 51564000dbca5087df4396a5272bb86f872d2184. The new commit changes exactly server intake validation and its focused tests.

Review corrections

  • The WSUS expected coverage row no longer asserts requiredness, which is not serialized on SccmServerCoverage; a regression proves every expected WSUS coverage key exists in the serialized assessment.
  • The frozen synthetic WSUS tuple now requires rotation kind providerDefined with no value. Focused RED tests proved that a valid timestamped shape and a provider-defined value were previously accepted and then discarded as rotation: None; both now fail closed.
  • The rotation fix is restricted to server-sup-wsus && synthetic_fixture. Generic profile-defined parsing and non-synthetic production-style WSUS provenance are unchanged.
  • The exact server-sup-wsus guard remains intentional. Broadening it to all profileDefined sources would impose WSUS-only role, subject, version, host, path, and rotation constraints on future source cards.

Verification on exact head

  • focused rotation regressions — 2/2
  • production-style WSUS provenance regression — 1/1
  • cargo test -p cmtraceopen-parser --test sccm_server_intake — 68/68
  • server-intake fixture contract — 1/1
  • SUP fixture contract — 18/18
  • DP adapter — 16/16
  • full parser suite — pass
  • strict parser Clippy — pass
  • parser wasm32 check — pass
  • npx tsc --noEmit — pass
  • scoped rustfmt --check — pass
  • git diff --check — pass
  • independent exact-range review — GO
  • local exact-range CodeRabbit — zero findings

Fresh hosted CodeRabbit, Copilot, and CI are required on exact head a1de6d76 before merge. Earlier hosted results are not counted for this head.

Dependencies and non-goals

Native configured-path discovery/capture, native Windows/server-lab validation, semantic SUP/WSUS diagnosis, and client/server correlation remain separate follow-on work. A missing default path is not evidence a role is absent or broken.

Closes none; the server-intake issue remains open.

Summary by CodeRabbit

  • New Features

    • Added support for WSUS health supplemental sources and profile-defined server sources.
    • Added software update point classification for WSUS health data.
    • Added exact filename validation for applicable server-source artifacts.
  • Bug Fixes

    • Strengthened validation of WSUS artifact metadata, provenance, identity, and source details.
  • Tests

    • Added coverage for skipped WSUS health artifacts, metadata validation, mutation rejection, and production-style provenance.

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review\n\nPlease perform a fresh full review of exact head e57da51. This is a bounded pure-parser optional SUP/WSUS catalog/intake/fixture contract; do not infer native collection, semantic diagnosis, or live Windows acceptance.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The server source catalog now supports the profile-defined WSUS health source. Intake validates its metadata, topology, handles, version, and synthetic identifiers. Fixtures and tests cover skipped intake, invalid mutations, opaque provenance, and the expanded scenario set.

Changes

WSUS source intake

Layer / File(s) Summary
Source catalog and basename contracts
crates/cmtraceopen-parser/src/sccm/server/windows/catalog.rs
Adds ProfileDefined, optional exact-basename validation, and the server-sup-wsus source mapped to the software update point family.
WSUS tuple validation and synthetic identifiers
crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs
Validates the WSUS source tuple and permits its source, artifact, lineage, path, source-kind, and host identifiers.
Skipped WSUS fixture and contract tests
crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/supplemental-wsus-skipped/*, crates/cmtraceopen-parser/tests/sccm_server_intake.rs, crates/cmtraceopen-parser/tests/sccm_server_intake_fixture_contract.rs
Adds the skipped-source fixture and tests for valid metadata, rejected cross-field mutations, opaque provenance, and the twelfth scenario.

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

Sequence Diagram(s)

sequenceDiagram
  participant Intake as SCCM server intake
  participant Validator as validate_declared_source_tuple
  participant Catalog as declared_server_source_catalog
  Intake->>Validator: Validate declared WSUS source tuple
  Validator->>Catalog: Resolve server-sup-wsus specification
  Catalog-->>Validator: Return profile-defined source contract
  Validator-->>Intake: Accept or reject source metadata
Loading

Possibly related PRs

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 30.00% 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: defining an optional WSUS supplemental SCCM intake contract.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

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 extends the SCCM server intake (pure parser) contract to recognize an optional WSUS supplemental source (server-sup-wsus) and validates it via a bounded synthetic fixture, ensuring the source remains coverage-only and fail-closed under tuple mutations.

Changes:

  • Adds a new declared server source spec for server-sup-wsus with profileDefined kind and an exact WsusHealth.json basename contract.
  • Tightens parser-side validation for the WSUS supplemental “tuple” (roles observed, subject linkage, synthetic fixture immutability).
  • Introduces a new synthetic fixture scenario (supplemental-wsus-skipped) and expands the fixture matrix contract accordingly.

Reviewed changes

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

Show a summary per file
File Description
crates/cmtraceopen-parser/src/sccm/server/windows/catalog.rs Adds ProfileDefined source kind and declares the server-sup-wsus source spec with an explicit basename constraint.
crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs Enforces WSUS supplemental tuple validation and extends synthetic fixture-safe vocabularies for IDs/kinds/handles/fingerprints.
crates/cmtraceopen-parser/tests/sccm_server_intake.rs Adds targeted tests to ensure the optional WSUS supplemental contract is admitted and mutation attempts fail closed.
crates/cmtraceopen-parser/tests/sccm_server_intake_fixture_contract.rs Updates the expected fixture scenario count to include the new WSUS supplemental scenario.
crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/supplemental-wsus-skipped/* Adds new synthetic WSUS supplemental skipped fixture manifest and expected assessment output.

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

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

@coderabbitai coderabbitai Bot added the test Testing related label Aug 3, 2026
@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 20:07
@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 4 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 6 out of 6 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

🧹 Nitpick comments (1)
crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs (1)

2307-2347: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Trim dead conditions and avoid the hardcoded source-id gate in validate_declared_source_tuple.

Four conditions in this function are unreachable given the calling context in normalize_artifact:

  • spec.source_kind != SccmServerSourceKind::ProfileDefined: the catalog has exactly one source_id == "server-sup-wsus" entry, and its source_kind is fixed to ProfileDefined.
  • artifact.producer_role != SccmRole::WsUs: classify_declared_server_source's lookup already requires spec.producer_role == producer_role for this spec to be selected.
  • subject.role != SccmRole::SoftwareUpdatePoint: the same lookup already requires spec.workflow_subject_role == workflow_subject_role, which forces both workflow_subject to be Some and its role to match.
  • artifact.producer_host_handle.is_none(): this case already returns InvalidArtifact earlier in normalize_artifact (the producer_host_handle.is_none() branch around line 1043), before classification even runs.

The genuinely load-bearing checks are the roles_observed membership check, subject.instance_handle.is_none(), and source_version.is_none(), plus the synthetic literal-equality block. Keeping the dead conditions increases cognitive load for readers trying to determine which invariants are actually enforced here versus already guaranteed upstream.

Separately, gating this function on spec.source_id != "server-sup-wsus" couples it to a string literal that must be kept in sync by hand with the catalog entry in catalog.rs. If a future rename or typo desynchronizes them, this function silently stops enforcing the WSUS-specific requiredness rules (mandatory subject handle, mandatory source version, topology role membership) while still passing the generic catalog match. Consider gating on spec.source_kind == SccmServerSourceKind::ProfileDefined instead, and consider moving the synthetic-fixture literal constants (host handle, subject handle, version, path fingerprint, lineage id) onto SccmServerSourceSpec so future profile-defined sources don't require a new hardcoded branch in this function.

♻️ Proposed fix to remove the confirmed-dead conditions
     let subject = artifact
         .workflow_subject
         .as_ref()
         .ok_or(SccmServerIntakeError::InvalidArtifact)?;
-    if spec.source_kind != SccmServerSourceKind::ProfileDefined
-        || artifact.producer_role != SccmRole::WsUs
-        || subject.role != SccmRole::SoftwareUpdatePoint
-        || !roles_observed.contains(&SccmRole::WsUs)
+    if !roles_observed.contains(&SccmRole::WsUs)
         || !roles_observed.contains(&SccmRole::SoftwareUpdatePoint)
-        || artifact.producer_host_handle.is_none()
         || subject.instance_handle.is_none()
         || source_version.is_none()
     {
         return Err(SccmServerIntakeError::InvalidArtifact);
     }

If any of these are intentional defense-in-depth against future changes to classify_declared_server_source, keep them but add a comment stating that intent, so readers don't mistake them for load-bearing checks.

🤖 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/intake.rs` around lines
2307 - 2347, Update validate_declared_source_tuple to gate profile-specific
validation on spec.source_kind rather than the hardcoded "server-sup-wsus"
source ID, and remove the upstream-guaranteed checks for source kind, producer
role, subject role, and producer host presence. Retain the roles_observed,
subject.instance_handle, source_version, and synthetic-fixture validations; if
any removed checks are intentionally defensive, keep them only with a comment
documenting that purpose.
🤖 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/tests/fixtures/sccm/server/intake/supplemental-wsus-skipped/expected.json`:
- Line 3: Update the supplemental WSUS skipped fixture assertion for the
coverage entry so it validates a field present in the real SccmServerCoverage
output rather than the unsupported requiredness value; if no suitable output
field exists, remove requiredness from the expected fixture.

---

Nitpick comments:
In `@crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs`:
- Around line 2307-2347: Update validate_declared_source_tuple to gate
profile-specific validation on spec.source_kind rather than the hardcoded
"server-sup-wsus" source ID, and remove the upstream-guaranteed checks for
source kind, producer role, subject role, and producer host presence. Retain the
roles_observed, subject.instance_handle, source_version, and synthetic-fixture
validations; if any removed checks are intentionally defensive, keep them only
with a comment documenting that purpose.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: edf8dbda-26bb-4bf9-a7aa-ebd52ebaffab

📥 Commits

Reviewing files that changed from the base of the PR and between bc5d4f8 and a6d9575.

📒 Files selected for processing (6)
  • crates/cmtraceopen-parser/src/sccm/server/windows/catalog.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/supplemental-wsus-skipped/expected.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/supplemental-wsus-skipped/manifest.json
  • crates/cmtraceopen-parser/tests/sccm_server_intake.rs
  • crates/cmtraceopen-parser/tests/sccm_server_intake_fixture_contract.rs

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Review disposition for exact correction head 5156400:

  • Accepted the serialized-coverage oracle finding and fixed it test-first in 5156400. The inline thread has the exact verification evidence and is resolved.
  • Rejected the review-body suggestion to replace the exact server-sup-wsus gate with the shared profileDefined kind. Independent scoped review confirmed that doing so would make future profile-defined source cards inherit WSUS-only role, subject, version, host, configured-path, and rotation constraints. The exact source gate is the safer fail-closed contract. The retained upstream-overlapping predicates are intentional defense in depth; the load-bearing topology, handle, version, and synthetic provenance checks remain source-specific.

The branch was fast-forwarded without force. Fresh CodeRabbit, Copilot, and hosted CI must complete on 5156400 before this draft can be considered for merge.

@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 20:25
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@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/src/sccm/server/windows/intake.rs (1)

2307-2346: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

The role and kind checks repeat the catalog match. classify_declared_server_source already matched spec.producer_role, spec.workflow_subject_role, and spec.source_kind against the artifact before this function runs. Lines 2322-2324 therefore cannot fail for a spec that reached this point. The checks that add value are the roles_observed topology checks, the handle presence checks, and the source_version presence check. Consider keeping only those, and adding a short comment that marks the remaining checks as defense in depth if you want to retain them.

This is optional. The current code is correct and fails closed.

🤖 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/intake.rs` around lines
2307 - 2346, Simplify validate_declared_source_tuple by removing the redundant
spec.source_kind, artifact.producer_role, and subject.role comparisons already
guaranteed by classify_declared_server_source; retain the roles_observed,
handle-presence, and source_version checks. If those defense-in-depth checks
remain necessary, document that intent with a brief comment.
🤖 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/intake.rs`:
- Around line 2307-2346: Simplify validate_declared_source_tuple by removing the
redundant spec.source_kind, artifact.producer_role, and subject.role comparisons
already guaranteed by classify_declared_server_source; retain the
roles_observed, handle-presence, and source_version checks. If those
defense-in-depth checks remain necessary, document that intent with a brief
comment.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 780eb03e-95e4-4ff6-8b99-50826df40f34

📥 Commits

Reviewing files that changed from the base of the PR and between bc5d4f8 and 5156400.

📒 Files selected for processing (6)
  • crates/cmtraceopen-parser/src/sccm/server/windows/catalog.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/supplemental-wsus-skipped/expected.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/supplemental-wsus-skipped/manifest.json
  • crates/cmtraceopen-parser/tests/sccm_server_intake.rs
  • crates/cmtraceopen-parser/tests/sccm_server_intake_fixture_contract.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 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (1)

crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs:2340

  • For the server-sup-wsus synthetic fixture gate, validate_declared_source_tuple freezes lineage/path/handles/version but does not constrain artifact.rotation.kind / artifact.rotation.value. As a result, a synthetic WSUS manifest can mutate the rotation shape (e.g., kind: "timestamped" with a value) and still be accepted, undermining the intended fail-closed contract for this exact tuple.
    if synthetic_fixture
        && (artifact.producer_host_handle.as_deref() != Some("synthetic:host:wsus-01")
            || subject.instance_handle.as_deref() != Some("synthetic:subject:sup-01")
            || source_version != Some("5.00.TEST")
            || artifact.configured_path_provenance.path_fingerprint
                != "synthetic:path:sup-wsus-health"
            || artifact.rotation.lineage_id != "sup-wsus-health")

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Exact-head Copilot cycle completed on 5156400 with no new thread, but its suppressed rotation-shape observation is being treated as a real merge gate. Independent code tracing shows the profileDefined branch calls validate_declared_source_tuple, which freezes only the WSUS lineage identifier, then canonicalizes the source with no parsed rotation. A valid timestamped kind/value can therefore be accepted while the declared providerDefined shape is discarded. The draft remains NO-GO. A separate TDD correction will require the exact synthetic WSUS providerDefined kind with no value and preserve production opaque provenance behavior; fresh independent review and hosted cycles will follow.

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Exact head a1de6d76 adds the independently reviewed synthetic WSUS rotation-shape correction. RED proved timestamped and provider-defined-with-value mutations were accepted and silently discarded; GREEN freezes only the synthetic server-sup-wsus tuple to provider-defined/no-value. Production and generic profile-defined behavior remain unchanged. Local focused/aggregate tests, strict Clippy, wasm32, TypeScript, scoped formatting, diff check, and independent review are green. Please review this exact head; earlier approvals do not satisfy the gate.

@adamgell
adamgell requested a review from Copilot August 3, 2026 20:49
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

@adamgell: I will perform a fresh full review of the requested head a1de6d76. I will assess the synthetic WSUS rotation-shape contract and verify that production and generic profileDefined behavior remains unchanged.

✅ 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 6 out of 6 changed files in this pull request and generated no new comments.

@adamgell
adamgell marked this pull request as ready for review August 3, 2026 21:19
@adamgell
adamgell merged commit 8329522 into codex/parser-family-skeleton Aug 3, 2026
11 checks passed
adamgell added a commit that referenced this pull request Aug 4, 2026
* feat(sccm): catalogue optional WSUS supplemental intake

* test(sccm): expose WSUS supplemental tuple gaps

* fix(sccm): validate WSUS supplemental tuple

* test(sccm): align WSUS coverage oracle with serialized output

* fix(sccm): freeze synthetic WSUS rotation tuple
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