Repository navigation
feat(sccm): establish shared diagnostic contract boundary (#318 Phase A) - #336
Conversation
|
@coderabbitai review Please review this draft against the #318 architecture boundary, with particular attention to producer-role provenance, future-value serialization, canonical rotation handling, public |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a public SCCM diagnostics module with serialized artifact models, canonical rotation handling, deterministic source classification, and contract tests backed by an artifact manifest fixture. ChangesSCCM diagnostics
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
|
@coderabbitai review The Phase A interface PR is now ready for review. Please run the full review against |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Pull request overview
Establishes the initial, public SCCM diagnostics contract boundary within the pure cmtraceopen-parser crate, including versioned schema types and a deterministic source catalog intended to support future SCCM intake/diagnostics phases without changing existing parser primitives.
Changes:
- Adds public SCCM schema models (coverage, roles, findings, rotations, artifacts) with JSON serialization behavior and schema versioning.
- Introduces a role-aware SCCM source catalog + filename rotation grammar and exposes classification/catalog APIs.
- Adds a synthetic SCCM manifest fixture plus contract tests covering serialization and catalog semantics.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/cmtraceopen-parser/tests/sccm_spine_contract.rs | New contract tests for SCCM schema/versioning, serde behavior, catalog semantics, and rotation grammar. |
| crates/cmtraceopen-parser/tests/fixtures/sccm/spine/artifact-manifest.json | New fixture manifest used for SCCM artifact/coverage round-trip validation. |
| crates/cmtraceopen-parser/src/sccm/models.rs | New SCCM contract models (schema version, coverage, roles, finding class, rotation, artifact) with custom serde behaviors. |
| crates/cmtraceopen-parser/src/sccm/mod.rs | New SCCM module root exporting catalog + models. |
| crates/cmtraceopen-parser/src/sccm/catalog.rs | New SCCM source catalog table and artifact-name classifier (including canonical rotation suffix parsing). |
| crates/cmtraceopen-parser/src/lib.rs | Exposes the new sccm module publicly from the parser crate. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Branches and diff summary =='
git branch --all --no-color | sed -n '1,120p'
git diff --stat codex/parser-family-skeleton...HEAD
git diff --name-status codex/parser-family-skeleton...HEAD
echo '== SCCM plans =='
fd -t f . docs/superpowers/plans 2>/dev/null | sort
echo '== Likely SCCM implementation/test files =='
fd -t f . | rg -i 'sccm|spine|contract|cmtrace' | sort | sed -n '1,240p'
echo '== Public parser API map =='
fd -t f -e rs . | xargs -r rg -n -C2 \
'pub (struct|enum|trait|mod|use)|\b(LogEntry|ParserKind)\b' \
| sed -n '1,360p'Length of output: 1240 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== PR metadata =='
gh pr view 336 --repo adamgell/cmtraceopen \
--json number,url,baseRefName,baseRefOid,headRefName,headRefOid,title \
--jq '{number,url,baseRefName,baseRefOid,headRefName,headRefOid,title}'
base_sha=$(gh pr view 336 --repo adamgell/cmtraceopen --json baseRefOid --jq .baseRefOid)
echo "== Base SHA: ${base_sha} =="
echo '== Changed files =='
git diff --name-status "${base_sha}...HEAD"
echo '== Diff stat =='
git diff --stat "${base_sha}...HEAD"
echo '== SCCM execution plans =='
fd -t f . docs/superpowers/plans 2>/dev/null | sort | while IFS= read -r file; do
printf '\n--- %s ---\n' "$file"
rg -n -i -C2 'sccm|phase a|contract|rotation|producer|wasm|LogEntry|ParserKind' "$file" || true
done
echo '== Changed Rust item outlines =='
git diff --name-only "${base_sha}...HEAD" -- '*.rs' | while IFS= read -r file; do
printf '\n--- %s ---\n' "$file"
ast-grep outline "$file" --items all --view expanded || true
doneLength of output: 217558 🏁 Script executed: #!/bin/bash
set -euo pipefail
base_sha='f2caccfb8602638807bff5c19d722c037676ca43'
echo '== Spine plan: public models, catalog, and Phase A boundaries =='
sed -n '1,410p' docs/superpowers/plans/2026-07-30-sccm-diagnostic-spine.md
echo '== Public SCCM models =='
cat -n crates/cmtraceopen-parser/src/sccm/models.rs
echo '== SCCM artifact catalog =='
cat -n crates/cmtraceopen-parser/src/sccm/catalog.rs
echo '== SCCM contract tests (all) =='
cat -n crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
echo '== Synthetic manifest fixture =='
cat -n crates/cmtraceopen-parser/tests/fixtures/sccm/spine/artifact-manifest.json
echo '== Exact PR patch for changed Rust/fixture files =='
git diff --find-renames --find-copies --no-ext-diff \
"${base_sha}...HEAD" -- \
crates/cmtraceopen-parser/src/lib.rs \
crates/cmtraceopen-parser/src/sccm \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs \
crates/cmtraceopen-parser/tests/fixtures/sccm/spine/artifact-manifest.jsonLength of output: 137701 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Parser crate manifest and declared dependencies =='
parser_manifest=$(fd -t f '^Cargo\.toml$' crates/cmtraceopen-parser | head -n 1)
printf '%s\n' "$parser_manifest"
cat -n "$parser_manifest"
echo '== SCCM module imports and calls with potential I/O/platform coupling =='
ast-grep run --lang rust \
--pattern 'use $PATH;' \
crates/cmtraceopen-parser/src/sccm
ast-grep run --lang rust \
--pattern '$OBJ.$METHOD($$$)' \
crates/cmtraceopen-parser/src/sccm \
| rg -n -i -C2 'std::fs|File|Path|read_|write_|Command|process|registry|winapi|windows|tokio|reqwest|http|socket|network|env'
echo '== Broad SCCM source search for platform/I-O APIs =='
rg -n -i -C2 \
'std::(fs|net|process|path|env)|\b(File|Path|Command|ReadDir|Tcp|Udp|Windows|Win32|Registry|WMI|Tauri|tokio|reqwest|hyper)\b' \
crates/cmtraceopen-parser/src/sccm || true
echo '== Existing public LogEntry and ParserKind definitions =='
log_entry_file=$(fd -t f '^log_entry\.rs$' | head -n 1)
printf '%s\n' "$log_entry_file"
ast-grep outline "$log_entry_file" --items all --match 'LogEntry|ParserKind' --view expanded
rg -n -C3 'pub (struct LogEntry|enum ParserKind)\b' "$log_entry_file"
echo '== Cross-check new SCCM module references into legacy public models =='
rg -n -C2 '\b(LogEntry|ParserKind)\b' crates/cmtraceopen-parser/src/sccm crates/cmtraceopen-parser/src/lib.rs || trueLength of output: 7554
The remaining requested boundaries look sound from source inspection: the change is additive, does not modify public ✅ Action performedReview finished.
|
|
Independent Phase A API re-review is PASS at |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/cmtraceopen-parser/src/sccm/models.rs (1)
19-74: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated string-backed-enum-with-future-fallback pattern across
SccmRoleandSccmArtifactFamily. Both types independently hand-roll the same shape: aserialized_namelookup table, aSerializeimpl callingserialize_str, and aDeserializeimpl chaining string-equality guards ending in anUnknown(String)catch-all. This duplication risks the two impls drifting as more roles/families are added in later phases.
crates/cmtraceopen-parser/src/sccm/models.rs#L19-L74: extract the shared pattern (e.g. a declarative macro or a small generic helper keyed on a static&[(&str, Variant)]table) and implementSccmRolein terms of it.crates/cmtraceopen-parser/src/sccm/catalog.rs#L29-L89: implementSccmArtifactFamilyusing the same shared helper/macro introduced forSccmRole.♻️ Example macro-based consolidation sketch
macro_rules! string_backed_enum { ($name:ident { $($variant:ident => $str:literal),+ $(,)? }) => { impl $name { fn serialized_name(&self) -> &str { match self { $(Self::$variant => $str,)+ Self::Unknown(value) => value, } } } impl Serialize for $name { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer { serializer.serialize_str(self.serialized_name()) } } impl<'de> Deserialize<'de> for $name { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de> { Ok(match String::deserialize(deserializer)? { $($str => Self::$variant,)+ value => Self::Unknown(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/models.rs` around lines 19 - 74, Extract the duplicated string-backed enum serialization and deserialization logic into one shared macro or helper, then use it for SccmRole in crates/cmtraceopen-parser/src/sccm/models.rs lines 19-74 and SccmArtifactFamily in crates/cmtraceopen-parser/src/sccm/catalog.rs lines 29-89. Preserve each type’s existing string mappings and Unknown(String) fallback while removing their separate serialized_name, Serialize, and Deserialize implementations.
🤖 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/models.rs`:
- Around line 19-74: Extract the duplicated string-backed enum serialization and
deserialization logic into one shared macro or helper, then use it for SccmRole
in crates/cmtraceopen-parser/src/sccm/models.rs lines 19-74 and
SccmArtifactFamily in crates/cmtraceopen-parser/src/sccm/catalog.rs lines 29-89.
Preserve each type’s existing string mappings and Unknown(String) fallback while
removing their separate serialized_name, Serialize, and Deserialize
implementations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 47032be9-3fab-45e6-89ec-29ecfecec67c
📒 Files selected for processing (6)
crates/cmtraceopen-parser/src/lib.rscrates/cmtraceopen-parser/src/sccm/catalog.rscrates/cmtraceopen-parser/src/sccm/mod.rscrates/cmtraceopen-parser/src/sccm/models.rscrates/cmtraceopen-parser/tests/fixtures/sccm/spine/artifact-manifest.jsoncrates/cmtraceopen-parser/tests/sccm_spine_contract.rs
|
@coderabbitai full review Commit |
|
✅ Action performedFull 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 33 minutes. |
|
Review disposition: CodeRabbit’s enum-macro suggestion is deferred as nonblocking YAGNI. There are only two small wire enums in separate modules; introducing a shared macro in this compatibility boundary would increase indirection without changing safety. Exact mappings and future fallbacks remain exhaustively tested. All three inline Copilot threads have been replied to and resolved; two were fixed in |
|
@coderabbitai full review Please perform a substantive full review of exact current head |
|
Your plan includes PR reviews subject to rate limits. Reviews are available now. |
|
@coderabbitai review Review exact current head |
|
✅ Action performedReview finished.
|
CodeRabbit exact-head gate — changes requiredLocal CodeRabbit CLI v0.7.1 completed a committed review of exact head The #318 owner is adding a red regression and correcting canonical-basename/rotation semantics. Reviewer pseudocode will not be applied blindly because simply stripping Reference: https://learn.microsoft.com/en-us/intune/configmgr/core/plan-design/hierarchy/about-log-files |
|
The focused regression first failed because Verification at committed head:
Repository-wide |
|
@coderabbitai review Please review exact head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
head_sha='3f7ce001c7d599647d32175d6632eac7bb1daadd'
parent_sha="${head_sha}^"
echo '== Verify requested commit is available =='
git show -s --format='commit=%H%nparent=%P%nsubject=%s' "$head_sha"
echo '== Exact commit patch =='
git diff --find-renames --find-copies --no-ext-diff "${parent_sha}" "$head_sha" -- \
crates/cmtraceopen-parser/src/sccm/catalog.rs \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
echo '== Relevant item outline =='
ast-grep outline crates/cmtraceopen-parser/src/sccm/catalog.rs --items all --view expanded
ast-grep outline crates/cmtraceopen-parser/tests/sccm_spine_contract.rs --items all --match 'catalog|rotation|lo' --view expanded || true
echo '== Catalog parser, lookup, and source declarations =='
rg -n -C5 \
'ParsedArtifactName|from_name|classify_artifact_name|SOURCE_CATALOG|declared_source_catalog|LoUnderscore|lo_' \
crates/cmtraceopen-parser/src/sccm/catalog.rs
echo '== Focused regression and nearby catalog contract tests =='
rg -n -C8 \
'catalog_recognizes_standard_lo_rollback_name_by_canonical_log_basename|CcmExec\.lo_|CcmExec\.log\.lo_|wrong.role|undeclared|LoUnderscore' \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
echo '== Precise changed-line context at exact head =='
git diff -U40 "${parent_sha}" "$head_sha" -- \
crates/cmtraceopen-parser/src/sccm/catalog.rs \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rsLength of output: 24574 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Catalog declaration(s) for CcmExec and adjacent naming convention =='
rg -n -C4 'basename: "(CcmExec|AppEnforce|PolicyAgent)' \
crates/cmtraceopen-parser/src/sccm/catalog.rs
echo '== Full classification and parsed-name implementation =='
sed -n '396,530p' crates/cmtraceopen-parser/src/sccm/catalog.rs
echo '== Role, unknown-source, and rotation contract test bodies =='
sed -n '270,455p' crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
echo '== All explicit .lo_ classifier call sites and assertions =='
rg -n -C5 'classify_artifact_name\([^)]*\.lo_|\.lo_.*(Unknown|unsupported|role|SccmRole)' \
crates/cmtraceopen-parser/tests crates/cmtraceopen-parser/src --glob '*.rs' || true
echo '== SCCM public model fields and their provenance meanings =='
sed -n '85,110p' crates/cmtraceopen-parser/src/sccm/catalog.rsLength of output: 15002
The
This was source-and-contract-test inspection only; I did not infer native Windows acceptance. ✅ Action performedReview finished.
|
adamgell
left a comment
There was a problem hiding this comment.
Independent exact-head review found one remaining canonical-grammar blocker. Microsoft documents that Configuration Manager copies AppEnforce.log to the same filename with the extension replaced by .lo_ (AppEnforce.lo_), not an appended AppEnforce.log.lo_: https://learn.microsoft.com/en-us/intune/configmgr/core/plan-design/hierarchy/about-log-files#how-it-works
Head 3f7ce001 correctly adds support for the standard form, but the test named catalog_rotation_grammar_accepts_only_canonical_suffixes still classifies the appended form as canonical/supported. That creates an evidence-first false-positive path for a nonstandard filename. Required before merge: retain AppEnforce.lo_ (case-insensitive) as LoUnderscore; treat AppEnforce.log.lo_ as an explicit unsupported/unknown filename suffix; add focused red/green proof; and obtain a new exact-head CodeRabbit review. No native Windows acceptance is inferred.
|
Follow-up canonical-grammar blocker fixed in new commit TDD proof:
Verification at exact committed head:
No merge performed. Exact-head review is requested below. |
|
@coderabbitai review Review exact head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
head_sha='b143ffcd94c80cf03748ea282afda82971b66d55'
parent_sha="${head_sha}^"
echo '== Requested commit =='
git show -s --format='commit=%H%nparent=%P%nsubject=%s' "$head_sha"
echo '== Exact patch =='
git diff --find-renames --find-copies --no-ext-diff -U45 "$parent_sha" "$head_sha" -- \
crates/cmtraceopen-parser/src/sccm/catalog.rs \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
echo '== Changed-file outlines =='
for file in $(git diff --name-only "$parent_sha" "$head_sha" -- '*.rs'); do
printf '\n--- %s ---\n' "$file"
ast-grep outline "$file" --items all --view expanded
done
echo '== Classification and canonical catalog lookup =='
rg -n -C8 \
'struct ParsedArtifactName|impl ParsedArtifactName|fn from_name|fn classify_artifact_name|SOURCE_CATALOG|LoUnderscore|unknown_filename_suffix' \
crates/cmtraceopen-parser/src/sccm/catalog.rs
echo '== Exact .lo_ contract coverage and grammar matrix =='
rg -n -C10 \
'lo_|LoUnderscore|catalog_rotation_grammar_accepts_only_canonical_suffixes|catalog_recognizes_standard_lo_rollback_name_by_canonical_log_basename|filenameSuffix|AppEnforce' \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
echo '== Changed SCCM source checks for platform/I-O coupling =='
git diff --name-only "$parent_sha" "$head_sha" -- crates/cmtraceopen-parser/src/sccm | while IFS= read -r file; do
rg -n -i -C2 \
'std::(fs|net|process|path|env)|\b(File|Path|Command|ReadDir|Tcp|Udp|Windows|Win32|Registry|WMI|Tauri|tokio|reqwest|hyper)\b' \
"$file" || true
doneLength of output: 24115
The commit substantively enforces the requested distinction:
This conclusion is based on exact-commit source and contract-test inspection only; no native Windows acceptance is inferred. You are interacting with an AI system. |
adamgell
left a comment
There was a problem hiding this comment.
Independent final review PASS at exact head b143ffcd94c80cf03748ea282afda82971b66d55.
Verified the canonical replacement-extension grammar, explicit unsupported preservation for appended .log.lo_, exact producer-role gating, stable public tags, and parser-only/wasm boundary. Fresh local proof: focused canonical-rotation test passed; full parser suite passed 592/592 (349 unit + 222 ESP integration + 21 SCCM); strict Clippy passed; wasm32 check passed; npx tsc --noEmit passed; owned-file Rust 1.88 formatting passed; git diff --check passed; worktree is clean and synchronized. Repository-wide cargo fmt --check --all still reports only the documented unrelated baseline drift and no owned #318 file.
CodeRabbit separately reviewed this exact SHA with no findings. No native Windows acceptance is claimed. Approved for the #336 shared-spine Phase A merge gate; #342 remains separately blocked on its public-message privacy correction.
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.
…t-1.6.0 fixes (#633) * docs(changelog): cite the shipped issue numbers and record main's post-1.6.0 fixes Three things were wrong with the changelog as it stood after the 1.6.0 cut. **The 1.6.0 section under-cited its own SCCM work.** A check across every commit in the tag (`v1.5.2..9bbaf67`) found twelve issue numbers that shipped without appearing anywhere in the section: #335, #336, #342, #344, #346, #348, #350, #394, #404, #418, #444, #458. They are the foundation and hardening under the one SCCM bullet — diagnostic spine, evidence framing, canonical intake and health contracts, signal tokens, correlation keys, coverage assessment, bounded ids, overlapping evidence ranges, client discovery, DP-to-intake binding. The bullet now names them. Two more were folded into bullets that described their work without citing them: the CodeRabbit retarget and review charter (#537, #538 under the agent-tooling bullet) and the framework's own extraction (#543, #548 under Reducer Framework v1). **Main carries two fixes the 1.6.0 tag does not.** `[Unreleased]` was empty while `9bbaf67e..main` held the updater-manifest publisher fix and the `rustls` advisory bump, so both are recorded now. Verified: a script that walks every `feat`/`fix`/`perf`/`refactor`/`build`/`ci` commit in the tag, extracts its issue references and checks them against both the 1.6.0 and 1.5.2 sections now reports zero undocumented references. The one that looked missing before, #521, is documented under 1.5.2 where it shipped. * docs(changelog): name the redaction boundary decision in the 1.6.0 section The section cited the work but never named ADR-004 revision 1 or the ruling that makes it load-bearing. The changelog is the durable record, so the decision now appears there with the audit finding that motivated it, what changed (projected form is the only constructible public form, preserving variants are explicitly named local-only entry points), and a pointer to the document that carries the eight rulings. * docs(changelog): say the redaction decision in plain English Same decision, no jargon: 'covered almost none of the places data actually leaves the app' rather than 'binds at almost no real export surface', 'the version holding the real values' rather than 'the preserving variant', and the check described as following through nested data rather than as structural enforcement being recursive. The eight rulings and the ADR link are unchanged.
Scope
Issue-scoped Phase A of #318 from the SCCM diagnostics execution contract:
LogEntryorParserKinddistmgr/PkgXferMgrandWCM/wsyncmgrremain site-server producers; DP-local/SUP-local sources stay distinct; Admin Service remains a family on the Provider producer)No Windows I/O, Tauri, registry, WMI, network, database, live collection, workflow reducer, or cross-side correlation is added.
Dependency state
This is the shared API review point. #319 and #335 production intake remain blocked until this Phase A contract is reviewed. Tasks 4–7 of #318 (logical-record evidence, signals, versioned keys, conservative findings) remain follow-up commits on this issue branch after the interface gate.
Verification
cargo test --locked -p cmtraceopen-parser --test sccm_spine_contract— 17 passedcargo test --locked -p cmtraceopen-parser— 588 passed in the owner runcargo clippy --locked -p cmtraceopen-parser --all-targets -- -D warnings— passedcargo check --locked -p cmtraceopen-parser --target wasm32-unknown-unknown— passednpx tsc --noEmit— passedgit diff --check f2caccf..HEAD— passedRepo-wide
cargo fmt --check --allhas unrelated pre-existing ESP/Tauri drift identical to the base commit; this PR does not modify those files.Review gates
e42df2bRefs #318
Refs #317
Summary by CodeRabbit