Repository navigation
Conversation
Implements the reviewed Phase A SCCM spine contracts for issue #318, including pure-Rust artifact/coverage/provenance models, exact role-aware catalog classification, conservative rotation grammar, and canonical ConfigMgr .lo_ handling. Validation: 592 parser tests, strict Clippy, wasm32, TypeScript, scoped Rust 1.88 formatting, and diff checks. CodeRabbit and independent exact-head review passed. Native Windows acceptance remains pending and is not claimed. Part of #318.
Canonicalize the synthetic server-intake site and rollover contract, preserve parser fixture bytes across Windows-style checkouts, and add the focused cross-platform corpus guard. Refs #335.
Part of #318. Preserve public LogEntry compatibility while adding internal logical CCM evidence framing, timestamp provenance, deterministic evidence references, and conservative public redaction.
Part of #321. Add the synthetic policy scenario matrix, exact fixture contracts, counterpart-ready facts, and conservative preparation documentation. No production reducer or native acceptance.
Part of #327. Canonicalize sitecomp.lo_ and enforce fail-closed site-core artifact storage, coverage, capped-fragment, and capture-state contracts. No production reducer or native acceptance.
Part of #320. Pin exact LAB site evidence and the canonical unique ccmsetup.lo_ rollover contract with fail-closed adversarial fixture tests. No production reducer or native acceptance.
Refs #319. Pins exact client-intake synthetic identity, rotation provenance, and capped payload contracts after independent and CodeRabbit review.
Refs #318. Adds the reviewed Task 5 structured signal contract with parsed-base-safe enrichment, deterministic UTF-16 spans, and serde round-trip coverage.
Refs #322. Adds the reviewed 12-scenario synthetic deployment/content corpus and fail-closed fixture contracts; production reduction and native validation remain open.
Add fail-closed, versioned SCCM correlation-key extraction with conservative Low-confidence profiles and whole-token boundary validation. Refs #318.
…dings feat(sccm): enforce evidence-backed findings
📝 WalkthroughWalkthroughAdded the SCCM parser module with diagnostic models, CCM logical-record scanning, evidence redaction, source catalogs, key and signal extraction, findings validation, Provider/Admin Service analysis, extensive fixture corpora, contract tests, and preparation specifications. ChangesSCCM diagnostic foundation
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 3📝 Generate docstrings 💡
⚔️ Resolve merge conflicts 💡
🛠️ Fix failing CI checks 💡
Comment |
There was a problem hiding this comment.
Actionable comments posted: 17
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
🟡 Minor comments (6)
crates/cmtraceopen-parser/tests/fixtures/sccm/client/deployment/success/manifest.json-13-13 (1)
13-13: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winRemove
rotation.fragmentCompletefrom the absent artifact.
deployment-success-policy-absenthascaptureState: "absent". Fixture validation requires absent artifacts to omitrotation.fragmentComplete. Based on learnings, non-captured artifacts must omitrotation.fragmentComplete.🤖 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/fixtures/sccm/client/deployment/success/manifest.json` at line 13, Update the deployment-success-policy-absent fixture object to remove rotation.fragmentComplete while preserving its captureState of absent and all other fields.Source: Learnings
crates/cmtraceopen-parser/tests/fixtures/sccm/server/provider_and_admin_service/README.md-51-52 (1)
51-52: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winInclude producer-host and version context in the exact-key rule.
The documented rule omits producer-host and source-version context. This can permit an incorrect cross-host or cross-version interpretation of exact transaction identity.
Proposed fix
- Exact request identity requires a profile-validated request ID, safe - operation handle, endpoint ID, layer, and compatible topology. + Exact request identity requires a profile-validated request ID, safe + operation handle, endpoint ID, producer host, layer, compatible topology, + and source-version context.The PR objective requires matching request, operation, endpoint, producer-host, topology, and version context.
🤖 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/fixtures/sccm/server/provider_and_admin_service/README.md` around lines 51 - 52, Update the exact request identity rule in the README to include producer-host and source-version context alongside the existing request ID, operation handle, endpoint ID, layer, and compatible topology requirements. Ensure the documented rule reflects matching request, operation, endpoint, producer-host, topology, and version context.docs/sccm/preparation/issue-327-server-site-core-corpus.md-144-146 (1)
144-146: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winKeep the issue reference inside the paragraph.
Line 145 starts with
#335and triggers MarkdownlintMD018. WriteIssue#335owns...instead.🤖 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 `@docs/sccm/preparation/issue-327-server-site-core-corpus.md` around lines 144 - 146, Update the paragraph in the preparation corpus so the issue reference remains inline but does not begin the line: replace the sentence starting with “#335 owns” with one starting “Issue `#335` owns,” preserving the surrounding wording and meaning.Source: Linters/SAST tools
docs/superpowers/plans/2026-07-30-sccm-client-extended.md-553-553 (1)
553-553: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winCorrect the spelling of
monotonicly.Use
monotonicallyin this reducer requirement.🤖 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 `@docs/superpowers/plans/2026-07-30-sccm-client-extended.md` at line 553, In the reducer requirement in the SCCM client extended plan, replace the misspelled term “monotonicly” with “monotonically,” leaving the rest of the requirement unchanged.Source: Linters/SAST tools
crates/cmtraceopen-parser/src/sccm/server/windows/provider_and_admin_service.rs-408-423 (1)
408-423: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAllow repeated phases for valid retries.
The
provider-retryfixture expects success with two consecutiveexecuteProviderOperationobservations. Theindex > previouscheck marks this transaction incomplete. Allow non-decreasing phase indices or handle valid retries explicitly.🤖 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/provider_and_admin_service.rs` around lines 408 - 423, Update the phase-order validation around has_valid_order to accept repeated consecutive phases by using non-decreasing indices, while still rejecting phases that move backward. Preserve the existing unknown-phase handling and terminal/complete determination.crates/cmtraceopen-parser/src/sccm/models.rs-281-328 (1)
281-328: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winUnvalidated
Unknownpayloads in two extensible enums.SccmRole,SccmPhase, andSccmTerminalEvidenceKindall rejectUnknownvalues that are empty, padded, or equal to a declared name.SccmRotationandSccmArtifactFamilyapply no such check, so anUnknownvalue can shadow a declared tag and break or silently change the JSON round trip. The shared root cause is the missing canonical-form guard on these two types.
crates/cmtraceopen-parser/src/sccm/models.rs#L281-L328: add a match arm inSerializethat rejects anSccmUnknownRotation::kindthat is empty, is not trimmed, or equalscurrent,loUnderscore,numbered, ortimestamped.crates/cmtraceopen-parser/src/sccm/catalog.rs#L54-L89: add ahas_canonical_serialized_formcheck toSccmArtifactFamily, and reject the non-canonicalUnknownvalue in bothSerializeandDeserialize, matching theSccmRolepattern.🤖 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/models.rs` around lines 281 - 328, Add canonical-form validation for Unknown values in SccmRotation’s Serialize implementation in crates/cmtraceopen-parser/src/sccm/models.rs:281-328, rejecting empty, untrimmed, or declared-kind strings current, loUnderscore, numbered, and timestamped. In crates/cmtraceopen-parser/src/sccm/catalog.rs:54-89, add SccmArtifactFamily’s has_canonical_serialized_form check and reject non-canonical Unknown values in both Serialize and Deserialize, matching the SccmRole pattern.
🧹 Nitpick comments (12)
crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs (1)
11-12: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueThe SHA-256 constant is never computed.
EXPECTED_CAPPED_SHA256appears only inside the assertion message at Line 31. The test compares raw bytes and never derives a digest, so the message claims a pin that the test does not enforce. Remove the constant and simplify the message, or compute the digest and assert it.♻️ Proposed change
-const EXPECTED_CAPPED_SHA256: &str = - "3253f6c4bc7d74bd2dbdadbe2f6543ff61a57161f85f650869b1292556270114";assert_eq!( CAPPED_CONTENT, EXPECTED_CAPPED_CONTENT, - "fixture bytes must retain SHA-256 {EXPECTED_CAPPED_SHA256}" + "capped fixture bytes changed" );🤖 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_client_intake_fixture_contract.rs` around lines 11 - 12, Update the test around EXPECTED_CAPPED_SHA256 so it enforces the intended SHA-256 pin: compute the digest from the capped bytes and assert it equals the expected value, rather than only mentioning the constant in the assertion message.crates/cmtraceopen-parser/tests/sccm_server_provider_and_admin_service.rs (1)
25-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winBuild the evidence path from
endpoint_idinstead of hardcoded segments.
captured_fixtureacceptsendpoint_idbut ignores it when it builds the path. It hardcodesprovider-localandadmin-service-lab. The fixture contract insccm_server_provider_and_admin_service_fixture_contract.rsderives the relative path asevidence/{source_id}/{endpoint_id}/current/{basename}. A future scenario with a different endpoint id would silently read the wrong file or fail with an unclear I/O panic.♻️ Proposed change
- let content = fs::read_to_string(fixture_root().join(scenario).join("evidence").join( - if source_id == "server-provider" { - "server-provider/provider-local/current/Smsprov.log" - } else { - "server-admin-service/admin-service-lab/current/AdminService.log" - }, - )) - .expect("fixture log is readable"); + let content = fs::read_to_string( + fixture_root() + .join(scenario) + .join("evidence") + .join(source_id) + .join(endpoint_id) + .join("current") + .join(basename), + ) + .expect("fixture log is readable");🤖 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_provider_and_admin_service.rs` around lines 25 - 32, Update captured_fixture to construct the evidence path using its endpoint_id parameter, following the contract evidence/{source_id}/{endpoint_id}/current/{basename}; retain the source-specific log basename selection and remove the hardcoded provider-local and admin-service-lab segments.crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs (1)
32-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
rotation.fragmentCompleteis unspecified for captured site_core artifacts. The site_core validator never requires the flag on captured artifacts, so the corpus drifted:rotation-boundary/manifest.jsondeclares it andstatus-processing-failure/manifest.jsonomits it. The client deployment and provider contracts both treat the flag as required for captured artifacts, so a future shared analyzer would reject the site_core manifests that omit it.
crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs#L32-L46: extendcoverage_contract_failuresto also report a failure whencaptureStateiscapturedorcappedandrotation.fragmentCompleteis not a boolean.crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/status-processing-failure/manifest.json#L22-L24: add"fragmentComplete": trueto therotationobject of both captured artifacts (Lines 22-24 and Lines 41-43), then apply the same to every other site_core manifest that omits it.🤖 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_site_core_fixture_contract.rs` around lines 32 - 46, Update coverage_contract_failures in crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs: for captured and capped artifacts, require rotation.fragmentComplete to be a boolean while preserving the existing invalid-complete-fragment check. Add fragmentComplete: true to both captured artifacts in crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/status-processing-failure/manifest.json at lines 22-24 and 41-43, and apply the same manifest update to every other site_core manifest that omits the field.Source: Learnings
crates/cmtraceopen-parser/tests/sccm_server_provider_and_admin_service_fixture_contract.rs (1)
725-1729: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffSplit
schema_failuresinto per-section validators.
schema_failuresspans about 1000 lines and validates manifest identity, topology, artifacts, profiles, coverage, transactions, observations, evidence references, source-local observations, and artifact requests in one function. It also carries a large mutable state set (endpoint_layers,artifact_sources,artifact_physical_state,physical_line_counts,artifact_rotation_provenance) across all sections. Extracting one function per section, each returningVec<String>plus the derived maps it owns, would make each rule reviewable in isolation and make a failing rule easier to locate.This is a suggestion for a follow-up change. The current logic is consistent and the mutation tests cover it well.
🤖 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_provider_and_admin_service_fixture_contract.rs` around lines 725 - 1729, Split schema_failures into focused per-section validator functions for manifest identity, topology, artifacts, profiles, coverage, transactions, observations/evidence, source-local observations, and artifact requests. Move each section’s validation and owned derived state—such as endpoint_layers, artifact_sources, artifact_physical_state, physical_line_counts, and artifact_rotation_provenance—into the relevant helper, returning its Vec<String> failures and required maps. Keep schema_failures as the coordinator that invokes the helpers and aggregates failures without changing validation behavior.docs/superpowers/specs/2026-07-29-parser-family-architecture-design.md (1)
260-264: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse a fenced code block for the dependency direction.
The four-space block triggers markdownlint MD046. Use a fenced
textblock so the diagram renders consistently.🤖 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 `@docs/superpowers/specs/2026-07-29-parser-family-architecture-design.md` around lines 260 - 264, In the dependency direction section, replace the four-space-indented diagram with a fenced text code block. Preserve the existing dependency arrows and wording exactly inside the fence.Source: Linters/SAST tools
docs/sccm/preparation/issue-320-client-health-corpus.md (1)
8-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winNormalize paragraph-start issue references.
These paragraphs start with
#<issue>, which triggers markdownlint MD018. Rewrite each reference as normal text, such asIssue#319``, or escape the hash.
docs/sccm/preparation/issue-320-client-health-corpus.md#L8-L9: Rewrite the paragraph beginning with#319.docs/sccm/preparation/issue-321-client-policy-corpus.md#L12-L12: Rewrite the paragraph beginning with#321.docs/sccm/preparation/issue-321-client-policy-corpus.md#L183-L183: Rewrite the paragraph beginning with#321.docs/sccm/preparation/issue-321-client-policy-corpus.md#L192-L192: Rewrite the paragraph beginning with#333.docs/sccm/preparation/issue-321-client-policy-corpus.md#L209-L209: Rewrite the paragraph beginning with#318.docs/sccm/preparation/issue-322-client-deployment-corpus.md#L140-L140: Rewrite the paragraph beginning with#333.docs/superpowers/plans/2026-07-30-sccm-server-extended.md#L34-L34: Rewrite the paragraph beginning with#331.docs/superpowers/plans/2026-07-30-sccm-server-extended.md#L434-L434: Rewrite the paragraph beginning with#331.🤖 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 `@docs/sccm/preparation/issue-320-client-health-corpus.md` around lines 8 - 9, Normalize all paragraph-start issue references to avoid markdownlint MD018: in docs/sccm/preparation/issue-320-client-health-corpus.md lines 8-9 rewrite `#319`; in docs/sccm/preparation/issue-321-client-policy-corpus.md lines 12, 183, 192, and 209 rewrite `#321`, `#321`, `#333`, and `#318` respectively; in docs/sccm/preparation/issue-322-client-deployment-corpus.md line 140 rewrite `#333`; and in docs/superpowers/plans/2026-07-30-sccm-server-extended.md lines 34 and 434 rewrite `#331` references. Use normal text such as “Issue `#N`” or escape each hash while preserving the paragraph content.Source: Linters/SAST tools
crates/cmtraceopen-parser/src/sccm/server/windows/provider_and_admin_service.rs (2)
357-367: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winDuplicate field names silently take the last value.
collect()into aBTreeMapkeeps the last occurrence of each key. A record such asrequestid=<a>;...;requestid=<b>resolves to<b>with no error. The resolved fields form the transaction identity, so a malformed or crafted record can select which key wins. Consider rejecting a record that repeats an admitted field name.🛡️ Proposed change
-fn parse_fields(message: &str) -> BTreeMap<String, String> { - message +fn parse_fields(message: &str) -> Option<BTreeMap<String, String>> { + let mut fields = BTreeMap::new(); + for (key, value) in message .split(';') .filter_map(|part| { let (key, value) = part.split_once('=')?; let key = key.trim().to_ascii_lowercase(); let value = value.trim().trim_matches(['"', '\'']); (!key.is_empty() && !value.is_empty()).then(|| (key, value.to_owned())) }) - .collect() -} + { + if fields.insert(key, value).is_some() { + return None; + } + } + Some(fields) +}
parse_candidatethen returnsErr("evidence contains duplicate fields")whenparse_fieldsreturnsNone.🤖 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/provider_and_admin_service.rs` around lines 357 - 367, Update parse_fields to detect duplicate normalized field names and reject the entire record instead of silently overwriting earlier values; change its return type or result signaling so parse_candidate can return Err("evidence contains duplicate fields") when duplication is detected, while preserving existing filtering and parsing behavior for unique fields.
224-226: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRecord a gap when an admitted artifact yields no candidates.
If
artifact.evidenceis empty, the loop adds no gap and no transaction. The artifact passed every admission check, so the report gives no explicit signal that the source contained no usable records. The PR objective states that missing source information is reported explicitly.♻️ Proposed change
if artifact_candidates.is_empty() { + if artifact.evidence.is_empty() { + gaps.push(ProviderAdminServiceGap { + artifact_id: artifact.artifact_id.clone(), + reason: "source contains no evidence records".to_owned(), + }); + } continue; }🤖 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/provider_and_admin_service.rs` around lines 224 - 226, Update the artifact-processing loop around the artifact_candidates empty check so an admitted artifact with no candidates records an explicit gap before continuing. Preserve the existing candidate-processing behavior and ensure the gap identifies the missing source information using the loop’s existing gap/reporting mechanism.crates/cmtraceopen-parser/src/sccm/evidence.rs (1)
183-201: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winThe public-tail whitelist duplicates the analyzer field contract.
The label list here must stay aligned with the field names that
parse_candidatereads incrates/cmtraceopen-parser/src/sccm/server/windows/provider_and_admin_service.rs(Lines 302-341). If a field name is added to the analyzer and not added here, a record that follows a private label is redacted to end of line and the analyzer reports a gap instead of a transaction. The link between the two lists is implicit today.Define the admitted label set once in a shared crate-private constant and reference it from both modules.
🤖 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/evidence.rs` around lines 183 - 201, Define the admitted SCCM label set once as a shared crate-private constant, then update the public-tail whitelist in the evidence parser and the field-name checks in parse_candidate within provider_and_admin_service.rs to reference it. Remove the duplicated label lists while preserving the existing value validation and analyzer behavior.crates/cmtraceopen-parser/src/sccm/findings.rs (2)
720-755: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winAvoid rebuilding the source catalog on every validation.
declared_source_catalog()allocates aVecof 47 entries, and each entry allocates severalStringvalues.validate_artifact_requestscalls it unconditionally, including whenrequestsis empty.SccmFinding::validateruns on every build, every deserialization, and twice per serialization (lines 227-234), so this cost repeats for each finding. Build the catalog only when requests exist, or cache it in aOnceLock.♻️ Proposed change
fn validate_artifact_requests( requests: &[SccmArtifactRequest], ) -> Result<(), SccmFindingValidationError> { if requests.len() > MAX_SCCM_NEXT_ARTIFACT_REQUESTS { return Err(SccmFindingValidationError::TooManyArtifactRequests); } + if requests.is_empty() { + return Ok(()); + } let catalog = declared_source_catalog();🤖 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/findings.rs` around lines 720 - 755, Update validate_artifact_requests to avoid calling declared_source_catalog when requests is empty, returning success immediately in that case; for non-empty requests, retain the existing validation behavior while building the catalog only once per validation call.
222-252: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value
Serializeclones and validates the finding twice.The implementation validates
self, clones it, normalizes the clone, then validates again. The firstvalidate()call is redundant, becausenormalize_findingonly trims and sorts, and the second call covers the same rules on the normalized value. Removing the first call halves the validation cost per serialization.Confirm that no contract test depends on the pre-normalization error being reported.
🤖 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/findings.rs` around lines 222 - 252, The Serialize implementation for SccmFinding redundantly validates before and after normalization. In SccmFinding::serialize, remove the initial self.validate() call and its error mapping, while retaining clone, normalize_finding, and the subsequent normalized.validate() check; verify contract tests do not require pre-normalization validation errors.crates/cmtraceopen-parser/src/sccm/keys.rs (1)
290-301: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winKeep fail-closed token handling and add delimiter tests. Existing tests cover only the declared boundaries and several malformed delimiters. Add direct cases for
),",], and>; the fixture matches place these characters in the log wrapper, not directly after a value.🤖 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/keys.rs` around lines 290 - 301, Add direct delimiter test cases for ), ", ], and > in the key-token parsing tests, placing each character in the surrounding log wrapper as the fixture requires rather than immediately after the parsed value. Preserve the existing fail-closed behavior and boundary handling in candidate_token_end and is_key_token_boundary.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@crates/cmtraceopen-parser/src/sccm/server/windows/provider_and_admin_service.rs`:
- Around line 419-423: Update the terminal evidence flag in the report-building
logic to derive from the same validity condition as complete state, requiring
both has_valid_order and terminal.is_some(). Keep terminal_disposition based on
the detected terminal observation, but ensure terminal_evidence is false
whenever the phase order is invalid.
- Around line 454-458: Make transaction_id construction in
ProviderAdminServiceTransaction injective across endpoint_id and host_handle
components. Prefer validating endpoint_id with a charset constraint that
excludes “:” wherever it is accepted, while preserving existing validation;
alternatively, encode or escape components before the format call so distinct
grouping keys cannot produce the same identifier.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/client/deployment/location-missing/manifest.json`:
- Line 9: Remove the rotation.fragmentComplete field from the artifact with
artifactId deployment-location-missing-content-absent in the manifest, while
preserving captureState "absent" and all other fields. Ensure absent or skipped
artifacts omit rotation.fragmentComplete.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/contradictory/manifest.json`:
- Around line 9-11: Remove rotation.fragmentComplete from every artifact with
captureState set to "absent" or "skipped" in the manifest entries at
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/contradictory/manifest.json
lines 9-11,
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/identity-failure/manifest.json
line 11, and
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/incomplete/manifest.json
line 11; leave all other artifact fields unchanged.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/malformed/manifest.json`:
- Around line 10-11: Update the two absent artifact entries identified by
artifactId in the manifest to remove rotation.fragmentComplete while preserving
their other rotation fields and metadata. Ensure non-captured artifacts with
captureState "absent" omit this property.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/rotation-boundary/manifest.json`:
- Around line 10-12: Remove the rotation.fragmentComplete property from all
three absent artifacts in
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/rotation-boundary/manifest.json
lines 10-12 and
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/setup-failure/manifest.json
lines 9-11; leave captured-artifact metadata unchanged.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/missing-root/manifest.json`:
- Around line 7-17: Remove the rotation.fragmentComplete property from every
absent artifact in the manifest, including the entries identified by artifactId
values such as fixture-missing-app-enforce-current and
fixture-missing-update-supplemental-current. Preserve each artifact’s other
rotation fields and captureState: "absent" values unchanged.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/client/policy/incomplete/manifest.json`:
- Line 9: Remove the rotation.fragmentComplete field from the
policy-incomplete-state-absent artifact in the manifest fixture, while
preserving its captureState of "absent" and all other artifact properties.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/client/policy/request-auth-failure/manifest.json`:
- Line 7: Update the absent artifact entry identified by artifactId
policy-auth-location-absent by removing only rotation.fragmentComplete from its
rotation object. Preserve rotation.kind and all other manifest fields unchanged
so non-captured artifacts omit fragmentComplete.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/server/provider_and_admin_service/provider-success/expected.json`:
- Around line 9-12: Update the provider/admin-service fixture contract in
expected.json and schema_failures to include producerHostHandle and incorporate
the host into transaction identity. Extend the fixtures with identical request,
operation, endpoint, and host records using distinct admitted source versions,
and assert that analyze_provider_admin_service produces separate transactions
for each version.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/server/provider_and_admin_service/rotation-boundary/manifest.json`:
- Line 10: Update the rotation-02-lo artifact metadata so originalBasename is
Smsprov.lo_ and rotation.kind uses the canonical lo value, matching the other
.lo_ fixture while preserving all other fields.
In `@docs/sccm/preparation/issue-327-server-site-core-corpus.md`:
- Around line 50-53: Update the SC_INBOX_BACKLOG preparation guidance to make
its precondition explicit: either derive the serialized componentWork
last-success value from preceding admitted phase evidence, or require an
admitted SC_COMPONENT_WORK_OK record before accepting the backlog record. Do not
state ComponentWork as an unconditional success when that evidence is absent.
In `@docs/sccm/preparation/issue-335-server-intake.md`:
- Around line 92-96: Clarify the capture-limit contract in the artifact
collection documentation by defining byteLimit as the number of raw bytes
copied, using the prefix covering byte offsets 0 through byteLimit-1. Align the
stated bytesCopied and truncation behavior with that definition, and add
boundary fixtures/tests for limits of zero, one, and N bytes.
In `@docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md`:
- Around line 123-128: Remove product/exit codes from the Deployment minimum
stable keys in
docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md:123-128 and the
versioned key list at
docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md:591-591; retain
them only as outcome evidence or signals. Apply the same key-versus-signal
separation to the Deployment table in
docs/superpowers/plans/2026-07-30-sccm-client-extended.md:123-128, without using
product or exit codes for transaction identity.
In `@docs/superpowers/plans/2026-07-30-sccm-diagnostic-spine.md`:
- Around line 117-130: Update the SccmFinding contract to expose terminal
evidence metadata, aligning it with the terminal_evidence field in SccmFinding
validation. Define or reuse an evidence representation that records terminality
and key binding so high-confidence ConfirmedFailure findings can be validated,
and specify tests covering the required terminal or corroborating evidence
behavior.
- Around line 84-115: The public models SccmArtifact, SccmEvidenceRef, and
SccmEvidence must not directly serialize raw-sensitive fields. Replace their
direct Serialize exposure with private raw models and redacted DTOs, or custom
redacting serializers that remove or sanitize paths, hosts, messages, and
execution context before JSON output; retain the required public serialization
API and add direct serialization tests using sentinel sensitive values to verify
they never appear.
In `@docs/superpowers/plans/2026-07-30-sccm-server-extended.md`:
- Around line 231-255: Update the exact request-key admission and private fact
contract described in “Step 3: Implement layered source/fact extraction” to
require producer-host context and source/version context alongside the request
ID, operation/query handle, and role/endpoint context. Prevent exact-key
emission when either context is missing or incompatible, so requests from
different hosts, topologies, or ConfigMgr versions cannot merge; expose only
redacted or opaque handles in exports.
---
Minor comments:
In `@crates/cmtraceopen-parser/src/sccm/models.rs`:
- Around line 281-328: Add canonical-form validation for Unknown values in
SccmRotation’s Serialize implementation in
crates/cmtraceopen-parser/src/sccm/models.rs:281-328, rejecting empty,
untrimmed, or declared-kind strings current, loUnderscore, numbered, and
timestamped. In crates/cmtraceopen-parser/src/sccm/catalog.rs:54-89, add
SccmArtifactFamily’s has_canonical_serialized_form check and reject
non-canonical Unknown values in both Serialize and Deserialize, matching the
SccmRole pattern.
In
`@crates/cmtraceopen-parser/src/sccm/server/windows/provider_and_admin_service.rs`:
- Around line 408-423: Update the phase-order validation around has_valid_order
to accept repeated consecutive phases by using non-decreasing indices, while
still rejecting phases that move backward. Preserve the existing unknown-phase
handling and terminal/complete determination.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/client/deployment/success/manifest.json`:
- Line 13: Update the deployment-success-policy-absent fixture object to remove
rotation.fragmentComplete while preserving its captureState of absent and all
other fields.
In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/server/provider_and_admin_service/README.md`:
- Around line 51-52: Update the exact request identity rule in the README to
include producer-host and source-version context alongside the existing request
ID, operation handle, endpoint ID, layer, and compatible topology requirements.
Ensure the documented rule reflects matching request, operation, endpoint,
producer-host, topology, and version context.
In `@docs/sccm/preparation/issue-327-server-site-core-corpus.md`:
- Around line 144-146: Update the paragraph in the preparation corpus so the
issue reference remains inline but does not begin the line: replace the sentence
starting with “#335 owns” with one starting “Issue `#335` owns,” preserving the
surrounding wording and meaning.
In `@docs/superpowers/plans/2026-07-30-sccm-client-extended.md`:
- Line 553: In the reducer requirement in the SCCM client extended plan, replace
the misspelled term “monotonicly” with “monotonically,” leaving the rest of the
requirement unchanged.
---
Nitpick comments:
In `@crates/cmtraceopen-parser/src/sccm/evidence.rs`:
- Around line 183-201: Define the admitted SCCM label set once as a shared
crate-private constant, then update the public-tail whitelist in the evidence
parser and the field-name checks in parse_candidate within
provider_and_admin_service.rs to reference it. Remove the duplicated label lists
while preserving the existing value validation and analyzer behavior.
In `@crates/cmtraceopen-parser/src/sccm/findings.rs`:
- Around line 720-755: Update validate_artifact_requests to avoid calling
declared_source_catalog when requests is empty, returning success immediately in
that case; for non-empty requests, retain the existing validation behavior while
building the catalog only once per validation call.
- Around line 222-252: The Serialize implementation for SccmFinding redundantly
validates before and after normalization. In SccmFinding::serialize, remove the
initial self.validate() call and its error mapping, while retaining clone,
normalize_finding, and the subsequent normalized.validate() check; verify
contract tests do not require pre-normalization validation errors.
In `@crates/cmtraceopen-parser/src/sccm/keys.rs`:
- Around line 290-301: Add direct delimiter test cases for ), ", ], and > in the
key-token parsing tests, placing each character in the surrounding log wrapper
as the fixture requires rather than immediately after the parsed value. Preserve
the existing fail-closed behavior and boundary handling in candidate_token_end
and is_key_token_boundary.
In
`@crates/cmtraceopen-parser/src/sccm/server/windows/provider_and_admin_service.rs`:
- Around line 357-367: Update parse_fields to detect duplicate normalized field
names and reject the entire record instead of silently overwriting earlier
values; change its return type or result signaling so parse_candidate can return
Err("evidence contains duplicate fields") when duplication is detected, while
preserving existing filtering and parsing behavior for unique fields.
- Around line 224-226: Update the artifact-processing loop around the
artifact_candidates empty check so an admitted artifact with no candidates
records an explicit gap before continuing. Preserve the existing
candidate-processing behavior and ensure the gap identifies the missing source
information using the loop’s existing gap/reporting mechanism.
In `@crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs`:
- Around line 11-12: Update the test around EXPECTED_CAPPED_SHA256 so it
enforces the intended SHA-256 pin: compute the digest from the capped bytes and
assert it equals the expected value, rather than only mentioning the constant in
the assertion message.
In
`@crates/cmtraceopen-parser/tests/sccm_server_provider_and_admin_service_fixture_contract.rs`:
- Around line 725-1729: Split schema_failures into focused per-section validator
functions for manifest identity, topology, artifacts, profiles, coverage,
transactions, observations/evidence, source-local observations, and artifact
requests. Move each section’s validation and owned derived state—such as
endpoint_layers, artifact_sources, artifact_physical_state,
physical_line_counts, and artifact_rotation_provenance—into the relevant helper,
returning its Vec<String> failures and required maps. Keep schema_failures as
the coordinator that invokes the helpers and aggregates failures without
changing validation behavior.
In `@crates/cmtraceopen-parser/tests/sccm_server_provider_and_admin_service.rs`:
- Around line 25-32: Update captured_fixture to construct the evidence path
using its endpoint_id parameter, following the contract
evidence/{source_id}/{endpoint_id}/current/{basename}; retain the
source-specific log basename selection and remove the hardcoded provider-local
and admin-service-lab segments.
In `@crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs`:
- Around line 32-46: Update coverage_contract_failures in
crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs: for captured
and capped artifacts, require rotation.fragmentComplete to be a boolean while
preserving the existing invalid-complete-fragment check. Add fragmentComplete:
true to both captured artifacts in
crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/status-processing-failure/manifest.json
at lines 22-24 and 41-43, and apply the same manifest update to every other
site_core manifest that omits the field.
In `@docs/sccm/preparation/issue-320-client-health-corpus.md`:
- Around line 8-9: Normalize all paragraph-start issue references to avoid
markdownlint MD018: in docs/sccm/preparation/issue-320-client-health-corpus.md
lines 8-9 rewrite `#319`; in
docs/sccm/preparation/issue-321-client-policy-corpus.md lines 12, 183, 192, and
209 rewrite `#321`, `#321`, `#333`, and `#318` respectively; in
docs/sccm/preparation/issue-322-client-deployment-corpus.md line 140 rewrite
`#333`; and in docs/superpowers/plans/2026-07-30-sccm-server-extended.md lines 34
and 434 rewrite `#331` references. Use normal text such as “Issue `#N`” or escape
each hash while preserving the paragraph content.
In `@docs/superpowers/specs/2026-07-29-parser-family-architecture-design.md`:
- Around line 260-264: In the dependency direction section, replace the
four-space-indented diagram with a fenced text code block. Preserve the existing
dependency arrows and wording exactly inside the fence.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| let terminal = observations | ||
| .iter() | ||
| .find(|observation| observation.phase == "recordOutcome" && observation.terminal); | ||
| let terminal_disposition = terminal.map(|observation| observation.disposition.as_str()); | ||
| let complete = has_valid_order && terminal.is_some(); |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
terminal_evidence can be true while state is incomplete.
terminal is computed independently of has_valid_order. If a transaction contains a terminal recordOutcome record but the phase order is invalid, the report emits state: "incomplete", classification: "insufficientEvidence", and terminal_evidence: true. That combination contradicts the public summary text, which states that evidence stops before a valid explicit terminal outcome.
Derive the flag from the same condition used for the state.
🐛 Proposed change
- terminal_evidence: terminal.is_some(),
+ terminal_evidence: complete,Also applies to: 471-471
🤖 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/provider_and_admin_service.rs`
around lines 419 - 423, Update the terminal evidence flag in the report-building
logic to derive from the same validity condition as complete state, requiring
both has_valid_order and terminal.is_some(). Keep terminal_disposition based on
the detected terminal observation, but ensure terminal_evidence is false
whenever the phase order is invalid.
| ProviderAdminServiceTransaction { | ||
| transaction_id: format!( | ||
| "{}:{request_id}:{operation_handle}:{endpoint_id}:{host_handle}", | ||
| layer.serialized_name(), | ||
| ), |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
transaction_id is not injective across key components.
endpoint_id is only checked for non-emptiness at Line 179, and is_safe_host_handle permits :. Two different grouping keys can therefore produce the same transaction_id. Example: endpoint_id = "a:safe:b" with host_handle = "safe:c", and endpoint_id = "a" with host_handle = "safe:b:safe:c", both render provider:<uuid>:<op>:a:safe:b:safe:c. Downstream consumers that key by transaction_id would merge distinct transactions.
Constrain endpoint_id with a charset check that excludes :, or build the identifier from length-prefixed or escaped components.
🤖 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/provider_and_admin_service.rs`
around lines 454 - 458, Make transaction_id construction in
ProviderAdminServiceTransaction injective across endpoint_id and host_handle
components. Prefer validating endpoint_id with a charset constraint that
excludes “:” wherever it is accepted, while preserving existing validation;
alternatively, encode or escape components before the format call so distinct
grouping keys cannot produce the same identifier.
| "bundle":{"role":"client","workflow":"deployment","captureHost":"LAB-CLIENT-01","siteCode":"LAB","artifactOrder":"designOnlyCatalog.entryId,pathFingerprint,rotationRank,originalBasename,artifactId","rotationOrder":"current,lo,numeric-ascending,timestamp-ascending"}, | ||
| "artifacts":[ | ||
| {"artifactId":"deployment-location-missing-intent-current","designOnlyCatalog":{"entryId":"client-app-intent","groupMemberships":["client-app-intent"]},"role":"client","kind":"ccmLog","captureState":"captured","encoding":"utf-8","collectionLimit":{"byteLimit":4096,"limitApplied":false},"originalBasename":"AppIntentEval.log","sanitizedSourcePath":"SYNTHETIC://root-a/CCM/Logs/AppIntentEval.log","pathFingerprint":"synthetic:deployment-location-missing-intent","rotation":{"kind":"current","fragmentComplete":true},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T03:40:10Z","bytesCopied":532,"relativePath":"evidence/client-app-intent/current/AppIntentEval.log"}, | ||
| {"artifactId":"deployment-location-missing-content-absent","designOnlyCatalog":{"entryId":"client-content","groupMemberships":["client-content"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"CAS.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic:deployment-location-missing-content-absent","rotation":{"kind":"current","fragmentComplete":false},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T03:40:10Z","bytesCopied":0,"relativePath":null} |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Remove rotation.fragmentComplete from the absent artifact.
Line 9 sets captureState to "absent". Remove rotation.fragmentComplete from this artifact. Fixture validation expects that field to be omitted for absent artifacts.
Proposed fix
- "rotation":{"kind":"current","fragmentComplete":false}
+ "rotation":{"kind":"current"}Based on learnings: if an artifact has captureState "absent" or "skipped", the manifest must omit rotation.fragmentComplete.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {"artifactId":"deployment-location-missing-content-absent","designOnlyCatalog":{"entryId":"client-content","groupMemberships":["client-content"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"CAS.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic:deployment-location-missing-content-absent","rotation":{"kind":"current","fragmentComplete":false},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T03:40:10Z","bytesCopied":0,"relativePath":null} | |
| {"artifactId":"deployment-location-missing-content-absent","designOnlyCatalog":{"entryId":"client-content","groupMemberships":["client-content"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"CAS.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic:deployment-location-missing-content-absent","rotation":{"kind":"current"},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T03:40:10Z","bytesCopied":0,"relativePath":null} |
🤖 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/fixtures/sccm/client/deployment/location-missing/manifest.json`
at line 9, Remove the rotation.fragmentComplete field from the artifact with
artifactId deployment-location-missing-content-absent in the manifest, while
preserving captureState "absent" and all other fields. Ensure absent or skipped
artifacts omit rotation.fragmentComplete.
Source: Learnings
| {"artifactId":"health-contradictory-evaluation-absent","designOnlyCatalog":{"entryId":"client-evaluation","groupMemberships":["client-evaluation"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"CcmEval.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic-candidate-health-contradictory-evaluation-absent","rotation":{"kind":"current","fragmentComplete":true},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T01:50:01Z","bytesCopied":0,"relativePath":null}, | ||
| {"artifactId":"health-contradictory-identity-absent","designOnlyCatalog":{"entryId":"client-identity","groupMemberships":["client-identity"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"ClientIDManagerStartup.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic-candidate-health-contradictory-identity-absent","rotation":{"kind":"current","fragmentComplete":true},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T01:50:02Z","bytesCopied":0,"relativePath":null}, | ||
| {"artifactId":"health-contradictory-location-services-absent","designOnlyCatalog":{"entryId":"client-location-services-shared","groupMemberships":["client-content","client-location"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"LocationServices.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic-candidate-health-contradictory-location-services-absent","rotation":{"kind":"current","fragmentComplete":true},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T01:50:03Z","bytesCopied":0,"relativePath":null} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Remove rotation.fragmentComplete from all absent artifacts.
The fixture validator expects the merged non-captured representation without rotation.fragmentComplete.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/contradictory/manifest.json#L9-L11: Removerotation.fragmentCompletefrom each absent artifact.crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/identity-failure/manifest.json#L11-L11: Removerotation.fragmentCompletefrom the absent artifact.crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/incomplete/manifest.json#L11-L11: Removerotation.fragmentCompletefrom the absent artifact.
Based on learnings, a fixture manifest must omit rotation.fragmentComplete if captureState is "absent" or "skipped".
📍 Affects 3 files
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/contradictory/manifest.json#L9-L11(this comment)crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/identity-failure/manifest.json#L11-L11crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/incomplete/manifest.json#L11-L11
🤖 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/fixtures/sccm/client/health/contradictory/manifest.json`
around lines 9 - 11, Remove rotation.fragmentComplete from every artifact with
captureState set to "absent" or "skipped" in the manifest entries at
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/contradictory/manifest.json
lines 9-11,
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/identity-failure/manifest.json
line 11, and
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/incomplete/manifest.json
line 11; leave all other artifact fields unchanged.
Source: Learnings
| {"artifactId":"health-malformed-identity-absent","designOnlyCatalog":{"entryId":"client-identity","groupMemberships":["client-identity"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"ClientIDManagerStartup.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic-candidate-health-malformed-identity-absent","rotation":{"kind":"current","fragmentComplete":true},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T02:10:02Z","bytesCopied":0,"relativePath":null}, | ||
| {"artifactId":"health-malformed-location-services-absent","designOnlyCatalog":{"entryId":"client-location-services-shared","groupMemberships":["client-content","client-location"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"LocationServices.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic-candidate-health-malformed-location-services-absent","rotation":{"kind":"current","fragmentComplete":true},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T02:10:03Z","bytesCopied":0,"relativePath":null} |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Remove rotation.fragmentComplete from absent artifacts.
Both artifacts use captureState: "absent". The manifest must omit rotation.fragmentComplete for non-captured artifacts. Fixture validation expects that representation.
Proposed fix
- "rotation":{"kind":"current","fragmentComplete":true}
+ "rotation":{"kind":"current"}Based on learnings, non-captured artifacts must omit rotation.fragmentComplete; fixture validation expects the merged representation.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {"artifactId":"health-malformed-identity-absent","designOnlyCatalog":{"entryId":"client-identity","groupMemberships":["client-identity"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"ClientIDManagerStartup.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic-candidate-health-malformed-identity-absent","rotation":{"kind":"current","fragmentComplete":true},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T02:10:02Z","bytesCopied":0,"relativePath":null}, | |
| {"artifactId":"health-malformed-location-services-absent","designOnlyCatalog":{"entryId":"client-location-services-shared","groupMemberships":["client-content","client-location"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"LocationServices.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic-candidate-health-malformed-location-services-absent","rotation":{"kind":"current","fragmentComplete":true},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T02:10:03Z","bytesCopied":0,"relativePath":null} | |
| {"artifactId":"health-malformed-identity-absent","designOnlyCatalog":{"entryId":"client-identity","groupMemberships":["client-identity"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"ClientIDManagerStartup.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic-candidate-health-malformed-identity-absent","rotation":{"kind":"current"},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T02:10:02Z","bytesCopied":0,"relativePath":null}, | |
| {"artifactId":"health-malformed-location-services-absent","designOnlyCatalog":{"entryId":"client-location-services-shared","groupMemberships":["client-content","client-location"]},"role":"client","kind":"ccmLog","captureState":"absent","encoding":null,"collectionLimit":null,"originalBasename":"LocationServices.log","sanitizedSourcePath":null,"pathFingerprint":"synthetic-candidate-health-malformed-location-services-absent","rotation":{"kind":"current"},"sourceVersion":"5.00.TEST.0000","capturedUtc":"2026-07-30T02:10:03Z","bytesCopied":0,"relativePath":null} |
🤖 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/fixtures/sccm/client/health/malformed/manifest.json`
around lines 10 - 11, Update the two absent artifact entries identified by
artifactId in the manifest to remove rotation.fragmentComplete while preserving
their other rotation fields and metadata. Ensure non-captured artifacts with
captureState "absent" omit this property.
Source: Learnings
| - Capture limits apply inclusively to raw file bytes before decoding. A capped | ||
| artifact is the exact prefix of the source through byte `byteLimit`; the | ||
| collector neither decodes first nor splits, repairs, or replaces bytes to | ||
| form text. It records `bytesCopied == file size == byteLimit`, | ||
| `truncated: true`, and `fragmentComplete: false`. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Define byteLimit as a byte count.
Lines 92-96 call the cap inclusive, but also require bytesCopied == byteLimit. A zero-based prefix through byte byteLimit contains byteLimit + 1 bytes. Capture and fixture implementations can therefore disagree at every cap boundary.
Use one precise contract, such as “the prefix of length byteLimit, covering bytes 0..byteLimit-1,” and add boundary tests for zero, one, and N bytes.
🤖 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 `@docs/sccm/preparation/issue-335-server-intake.md` around lines 92 - 96,
Clarify the capture-limit contract in the artifact collection documentation by
defining byteLimit as the number of raw bytes copied, using the prefix covering
byte offsets 0 through byteLimit-1. Align the stated bytesCopied and truncation
behavior with that definition, and add boundary fixtures/tests for limits of
zero, one, and N bytes.
| | Workflow | Transaction phases | Minimum stable keys | | ||
| | --- | --- | --- | | ||
| | Health/location | Setup, Service, Identity, SiteAssignment, ManagementPoint, Transport | client GUID, site code, management-point host | | ||
| | Policy | Request, Download, Persist, Schedule, Evaluate, Report | policy/assignment ID, client GUID, site code, policy request ID | | ||
| | Deployment | Intent, Requirements, LocateContent, Transfer, Cache, Enforce, Detect, Report | assignment ID, CI ID, package/content ID, DP host, BITS job ID, product/exit code | | ||
| | Updates | Scan, Evaluate, LocateSup, Download, MaintenanceWindow, Install, Reboot, Report | update/KB, CI ID, content ID, SUP host, update job/result ID | |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Do not use product or exit codes as transaction identity.
Product and exit codes are outcome signals. They can repeat across unrelated transactions. Including them in the key contract can merge unrelated deployments.
docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md#L123-L128: remove product/exit codes from the minimum stable keys and retain them as evidence or signals.docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md#L591-L591: removeproduct/exitfrom the versioned key list.docs/superpowers/plans/2026-07-30-sccm-client-extended.md#L123-L128: apply the same key-versus-signal separation to the deployment table.
📍 Affects 2 files
docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md#L123-L128(this comment)docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md#L591-L591docs/superpowers/plans/2026-07-30-sccm-client-extended.md#L123-L128
🤖 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 `@docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md` around
lines 123 - 128, Remove product/exit codes from the Deployment minimum stable
keys in docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md:123-128
and the versioned key list at
docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md:591-591; retain
them only as outcome evidence or signals. Apply the same key-versus-signal
separation to the Deployment table in
docs/superpowers/plans/2026-07-30-sccm-client-extended.md:123-128, without using
product or exit codes for transaction identity.
| pub struct SccmArtifact { | ||
| pub artifact_id: String, | ||
| pub display_name: String, | ||
| pub original_path: Option<String>, | ||
| pub host: Option<String>, | ||
| pub role: SccmRole, | ||
| pub configmgr_version: Option<String>, | ||
| pub collected_at_utc: Option<String>, | ||
| pub rotation: SccmRotation, | ||
| pub coverage: SccmCoverageState, | ||
| pub encoding: Option<String>, | ||
| } | ||
|
|
||
| pub struct SccmEvidenceRef { | ||
| pub artifact_id: String, | ||
| pub entry_id: String, | ||
| pub line_start: Option<u32>, | ||
| pub line_end: Option<u32>, | ||
| } | ||
|
|
||
| pub struct SccmEvidence { | ||
| pub evidence_id: String, | ||
| pub reference: SccmEvidenceRef, | ||
| pub role: SccmRole, | ||
| pub component: Option<String>, | ||
| pub ccm_source_file: Option<String>, | ||
| pub message: String, | ||
| pub timestamp: SccmTimestamp, | ||
| pub signals: Vec<SccmSignal>, | ||
| pub keys: Vec<SccmCorrelationKey>, | ||
| pub execution_context: Option<SccmSensitiveHandle>, | ||
| } |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
Do not make raw-bearing fields directly serializable.
Lines 84-115 expose paths, hosts, messages, and context-bearing data in public models. Line 195 then requires Serialize for public types. Unless these fields use custom redacting serializers, direct JSON serialization can publish caller, query, authentication, path, or host data. Use private raw models plus redacted DTOs, or define custom serializers. Add direct serialization tests with sentinel sensitive values.
Also applies to: 195-196
🤖 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 `@docs/superpowers/plans/2026-07-30-sccm-diagnostic-spine.md` around lines 84 -
115, The public models SccmArtifact, SccmEvidenceRef, and SccmEvidence must not
directly serialize raw-sensitive fields. Replace their direct Serialize exposure
with private raw models and redacted DTOs, or custom redacting serializers that
remove or sanitize paths, hosts, messages, and execution context before JSON
output; retain the required public serialization API and add direct
serialization tests using sentinel sensitive values to verify they never appear.
| pub struct SccmFinding { | ||
| pub finding_id: String, | ||
| pub class: SccmFindingClass, | ||
| pub phase: SccmPhase, | ||
| pub role: SccmRole, | ||
| pub severity: Severity, | ||
| pub confidence: SccmConfidence, | ||
| pub title: String, | ||
| pub summary: String, | ||
| pub evidence: Vec<SccmEvidenceRef>, | ||
| pub coverage_gap_artifact_ids: Vec<String>, | ||
| pub correlation_keys: Vec<SccmCorrelationKey>, | ||
| pub next_artifacts: Vec<SccmArtifactRequest>, | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Declare terminal evidence in the finding contract.
Lines 751-756 require terminal or corroborating evidence for a high-confidence ConfirmedFailure, but SccmFinding exposes only Vec<SccmEvidenceRef>. SccmEvidenceRef has no terminality or key-binding metadata, so the validator cannot prove this requirement. Align this plan with crates/cmtraceopen-parser/src/sccm/findings.rs:188-202, which exposes terminal_evidence, or define equivalent metadata and tests.
Also applies to: 751-757
🤖 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 `@docs/superpowers/plans/2026-07-30-sccm-diagnostic-spine.md` around lines 117
- 130, Update the SccmFinding contract to expose terminal evidence metadata,
aligning it with the terminal_evidence field in SccmFinding validation. Define
or reuse an evidence representation that records terminality and key binding so
high-confidence ConfirmedFailure findings can be validated, and specify tests
covering the required terminal or corroborating evidence behavior.
| ### Request key and privacy rule | ||
|
|
||
| A request transaction needs a profile-validated request/correlation ID, operation/query handle, and compatible role/endpoint context. Caller identity, query text, URL parameters, authorization header/token, tenant/domain host, and certificate details are never public key values. If correlation requires an identity-like field, use the #318 deterministic redacted handle and test that raw form is absent from exports. | ||
|
|
||
| - [ ] **Step 1: Write failing source/privacy tests** | ||
|
|
||
| Assert: | ||
|
|
||
| - Provider and Admin Service source records produce different role/workflow candidates; | ||
| - a request cannot be keyed only by endpoint path or same-minute timestamp; | ||
| - authz/authorization evidence redacts raw caller/token-like content; | ||
| - unrecognized IIS source remains supplemental/unsupported, not an Admin Service transaction; | ||
| - missing provider source and missing Admin Service source request the exact distinct artifact group; | ||
| - same request-like identifier from incompatible topology/role cannot merge; | ||
| - rotation fragment/unknown version cannot emit an exact request key. | ||
|
|
||
| - [ ] **Step 2: Run red** | ||
|
|
||
| ~~~bash | ||
| cargo test --locked -p cmtraceopen-parser --test sccm_server_provider_and_admin_service source_privacy_and_keys | ||
| ~~~ | ||
|
|
||
| - [ ] **Step 3: Implement layered source/fact extraction** | ||
|
|
||
| Keep separate private fact kinds for Provider service, Admin Service, and supplementary IIS. Each contains sanitized request key candidate, operation category, phase candidate, terminality, signals, evidence ref, and redaction class. Use source/version profile admission before emitting exact keys. Do not log/query SQL/provider/database/API data or make network calls. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Require producer-host and version context in exact request keys.
The request-key rule requires a request ID, operation/query handle, and role/endpoint context. It does not explicitly require the producer-host or source/version context required by the PR contract.
Without these fields, equivalent requests from different provider hosts, topologies, or ConfigMgr versions can merge into one transaction. Add these fields to exact-key admission and to the private fact contract. Export only redacted or opaque handles.
Proposed contract update
- A request transaction needs a profile-validated request/correlation ID, operation/query handle, and compatible role/endpoint context.
+ A request transaction needs a profile-validated request/correlation ID, operation/query handle, producer-host handle, endpoint, compatible topology, and source/version context.
- Each contains sanitized request key candidate, operation category, phase candidate, terminality, signals, evidence ref, and redaction class.
+ Each contains a sanitized request key candidate containing producer-host, endpoint, topology, and source/version context, plus operation category, phase candidate, terminality, signals, evidence ref, and redaction class.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ### Request key and privacy rule | |
| A request transaction needs a profile-validated request/correlation ID, operation/query handle, and compatible role/endpoint context. Caller identity, query text, URL parameters, authorization header/token, tenant/domain host, and certificate details are never public key values. If correlation requires an identity-like field, use the #318 deterministic redacted handle and test that raw form is absent from exports. | |
| - [ ] **Step 1: Write failing source/privacy tests** | |
| Assert: | |
| - Provider and Admin Service source records produce different role/workflow candidates; | |
| - a request cannot be keyed only by endpoint path or same-minute timestamp; | |
| - authz/authorization evidence redacts raw caller/token-like content; | |
| - unrecognized IIS source remains supplemental/unsupported, not an Admin Service transaction; | |
| - missing provider source and missing Admin Service source request the exact distinct artifact group; | |
| - same request-like identifier from incompatible topology/role cannot merge; | |
| - rotation fragment/unknown version cannot emit an exact request key. | |
| - [ ] **Step 2: Run red** | |
| ~~~bash | |
| cargo test --locked -p cmtraceopen-parser --test sccm_server_provider_and_admin_service source_privacy_and_keys | |
| ~~~ | |
| - [ ] **Step 3: Implement layered source/fact extraction** | |
| Keep separate private fact kinds for Provider service, Admin Service, and supplementary IIS. Each contains sanitized request key candidate, operation category, phase candidate, terminality, signals, evidence ref, and redaction class. Use source/version profile admission before emitting exact keys. Do not log/query SQL/provider/database/API data or make network calls. | |
| ### Request key and privacy rule | |
| A request transaction needs a profile-validated request/correlation ID, operation/query handle, producer-host handle, endpoint, compatible topology, and source/version context. Caller identity, query text, URL parameters, authorization header/token, tenant/domain host, and certificate details are never public key values. If correlation requires an identity-like field, use the `#318` deterministic redacted handle and test that raw form is absent from exports. | |
| - [ ] **Step 1: Write failing source/privacy tests** | |
| Assert: | |
| - Provider and Admin Service source records produce different role/workflow candidates; | |
| - a request cannot be keyed only by endpoint path or same-minute timestamp; | |
| - authz/authorization evidence redacts raw caller/token-like content; | |
| - unrecognized IIS source remains supplemental/unsupported, not an Admin Service transaction; | |
| - missing provider source and missing Admin Service source request the exact distinct artifact group; | |
| - same request-like identifier from incompatible topology/role cannot merge; | |
| - rotation fragment/unknown version cannot emit an exact request key. | |
| - [ ] **Step 2: Run red** | |
| ~~~bash | |
| cargo test --locked -p cmtraceopen-parser --test sccm_server_provider_and_admin_service source_privacy_and_keys | |
| ~~~ | |
| - [ ] **Step 3: Implement layered source/fact extraction** | |
| Keep separate private fact kinds for Provider service, Admin Service, and supplementary IIS. Each contains a sanitized request key candidate containing producer-host, endpoint, topology, and source/version context, plus operation category, phase candidate, terminality, signals, evidence ref, and redaction class. Use source/version profile admission before emitting exact keys. Do not log/query SQL/provider/database/API data or make network calls. |
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)
[warning] 247-247: Inconsistent indentation for list items at the same level
Expected: 2; Actual: 0
(MD005, list-indent)
🤖 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 `@docs/superpowers/plans/2026-07-30-sccm-server-extended.md` around lines 231 -
255, Update the exact request-key admission and private fact contract described
in “Step 3: Implement layered source/fact extraction” to require producer-host
context and source/version context alongside the request ID, operation/query
handle, and role/endpoint context. Prevent exact-key emission when either
context is missing or incompatible, so requests from different hosts,
topologies, or ConfigMgr versions cannot merge; expose only redacted or opaque
handles in exports.
|
Superseded on main. Current Provider/Admin Service analysis uses canonical server intake, typed phases/states, a distinct Admin Service role, scoped topology/host coverage, privacy checks, and exact production oracles with 13 direct tests versus 5 here; hardened by 7c95922. The 408-file diff is retired integration-stack bulk. Closing unmerged. |
Summary
Validation
cargo test --locked -p cmtraceopen-parser --test sccm_server_provider_and_admin_service --test sccm_server_provider_and_admin_service_fixture_contractcargo check --locked -p cmtraceopen-parser --target wasm32-unknown-unknowncargo clippy --locked -p cmtraceopen-parser --all-targets -- -D warningsgit diff --checkOut of scope: native Windows capture, Tauri commands, live SCCM acceptance, broad IIS parsing, UI, cross-side/client causality, and merge.
Summary by CodeRabbit