Repository navigation
feat(sccm): add versioned correlation keys - #350
Conversation
|
@coderabbitai review Please review exact head |
|
Review-status handoff for exact head |
📝 WalkthroughWalkthroughAdds public SCCM correlation-key models and profile-aware extraction. Candidates are normalized, validated, deduplicated, ordered deterministically, and returned with confidence, evidence, offsets, or extraction gaps. ChangesSCCM key extraction
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ConfigMgrVersion
participant SccmExtractionProfile
participant SccmEvidence
participant extract_keys
participant SccmKeyExtractionResult
ConfigMgrVersion->>SccmExtractionProfile: for_version(version)
SccmExtractionProfile-->>extract_keys: selected profile and maturity
SccmEvidence->>extract_keys: evidence messages
extract_keys->>SccmKeyExtractionResult: normalized keys, gaps, evidence, UTF-16 offsets
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='c8119325f07b763e5d098bb8e5cebc41342b8ec4'
head='79ca233ddce7bdabfb27dc48bb1027aeed600b95'
git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"
printf '\n== Changed files ==\n'
git diff --name-status "$base" "$head"
printf '\n== Diff stat ==\n'
git diff --stat "$base" "$head"
printf '\n== Full patch ==\n'
git diff --find-renames --find-copies --no-ext-diff "$base" "$head"
printf '\n== Rust file outlines ==\n'
git diff --name-only --diff-filter=ACMR "$base" "$head" -- '*.rs' |
while IFS= read -r file; do
printf '\n--- %s ---\n' "$file"
ast-grep outline "$file" --items all || true
done
printf '\n== SCCM/profile/key references in changed files ==\n'
git diff --name-only --diff-filter=ACMR "$base" "$head" |
while IFS= read -r file; do
rg -n -i -C 3 \
'Sccm|ConfigMgr|CorrelationKey|ExtractionProfile|CoverageGap|Confidence|serde|serialize|deserialize|version|candidate' \
"$file" || true
doneLength of output: 124140 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '== Numbered candidate-pattern and extraction sections ==\n'
nl -ba crates/cmtraceopen-parser/src/sccm/keys.rs | sed -n '60,290p'
printf '\n== Numbered new public serde contracts ==\n'
nl -ba crates/cmtraceopen-parser/src/sccm/models.rs | sed -n '135,240p'
printf '\n== Boundary and malformed-candidate tests across repository ==\n'
rg -n -i -C 4 \
'boundary|truncat|malformed.?candidate|overlong|suffix|package id|assignment id|content id|server host|client guid' \
crates/cmtraceopen-parser/tests crates/cmtraceopen-parser/src
printf '\n== Public SCCM schema/compatibility references ==\n'
rg -n -i -C 3 \
'schema.?version|serde|serializ|deserializ|future.?tolerant|backward|compatib|SccmKeyConfidence|SccmExtractionProfile' \
README.md crates/cmtraceopen-parser 2>/dev/null || true
printf '\n== Dependency versions relevant to regex behavior ==\n'
rg -n -C 2 '^(regex|serde|serde_json)\s*=' Cargo.toml crates/**/Cargo.tomlLength of output: 1378 🏁 Script executed: #!/bin/bash
set -euo pipefail
numbered_range() {
local file="$1"
local first="$2"
local last="$3"
awk -v first="$first" -v last="$last" \
'NR >= first && NR <= last { printf "%6d\t%s\n", NR, $0 }' "$file"
}
printf '== Numbered candidate-pattern and extraction sections ==\n'
numbered_range crates/cmtraceopen-parser/src/sccm/keys.rs 60 290
printf '\n== Numbered new public serde contracts ==\n'
numbered_range crates/cmtraceopen-parser/src/sccm/models.rs 135 240
printf '\n== Boundary and malformed-candidate tests across repository ==\n'
rg -n -i -C 4 \
'boundary|truncat|malformed.?candidate|overlong|suffix|package id|assignment id|content id|server host|client guid' \
crates/cmtraceopen-parser/tests crates/cmtraceopen-parser/src || true
printf '\n== Public SCCM schema/compatibility references ==\n'
rg -n -i -C 3 \
'schema.?version|serde|serializ|deserializ|future.?tolerant|backward|compatib|SccmKeyConfidence|SccmExtractionProfile' \
README.md crates/cmtraceopen-parser 2>/dev/null || true
printf '\n== Dependency versions relevant to regex behavior ==\n'
rg -n -C 2 '^(regex|serde|serde_json)\s*=' Cargo.toml crates/**/Cargo.toml || trueLength of output: 201703
Finding
The fail-closed version/profile gates, per-candidate deterministic coverage gaps, camelCase serde contracts, and extracted-key ✅ Action performedReview finished.
|
adamgell
left a comment
There was a problem hiding this comment.
BLOCKER — independent exact-head review of 79ca233 against base c811932.
The fail-closed version/profile selection, all 14 normalization kinds, per-candidate missing/unvalidated gaps, experimental Low-only ceiling, forged Stable rejection, canonical version checks, UTF-16 span calculation, evidence references, deterministic ordering, public serde round trips, and pure-Rust/wasm scope are otherwise supported by the exact diff and fresh gates. No Task 7, ParserKind, CCM grammar, LogEntry, I/O, or dependency expansion is present.
Whole-token rejection is incomplete, as detailed inline. CodeRabbit independently reached the same blocker in substantive exact-head comment 5137095645 after the earlier EYES/rate-limit states; those earlier states were correctly treated as non-approval. There are currently no other review threads.
Fresh exact-SHA verification: focused key contract 12/12; full parser 643/643; strict Clippy pass; wasm32 check pass; npx tsc --noEmit pass; scoped Rust 1.88 rustfmt pass; exact-range git diff --check pass. Passing gates do not override the semantic boundary failure. The PR has no closing keyword and remains draft.
The live base advanced to a58eefd while this review ran. After the boundary correction, this branch must be restacked onto that live base, all gates rerun, and both substantive exact-head CodeRabbit and independent rereview repeated before merge. No files were edited and no merge was performed.
79ca233 to
c808848
Compare
|
@coderabbitai review Please perform a substantive review of corrected exact head This addresses the whole-token blocker in your prior substantive comment by enforcing the explicit boundary set (end, whitespace, comma, semicolon, ampersand), retaining any unrecognized continuation through the next boundary, rejecting it with no key, and citing the complete raw |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='a58eefdc2063f9e03899af882b0bcc35c9cc2bbd'
head='c808848c8b9da2451af25277e8ff65956530d4c2'
git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"
printf '%s\n' '== Exact commits =='
git show -s --format='%H%n%P%n%s' "$base"
git show -s --format='%H%n%P%n%s' "$head"
printf '%s\n' '== Changed files =='
git diff --name-status "$base" "$head"
printf '%s\n' '== Patch =='
git diff --find-renames --find-copies --no-ext-diff "$base" "$head"
printf '%s\n' '== Rust outlines for changed files =='
git diff --name-only --diff-filter=ACMR "$base" "$head" -- '*.rs' |
while IFS= read -r file; do
printf '\n--- %s ---\n' "$file"
ast-grep outline "$file" --items all || true
done
printf '%s\n' '== Boundary/extraction implementations and tests =='
rg -n -C 6 \
'find_candidates|MalformedCandidate|boundary|continuation|candidate|normalize|ExtractionProfile|SccmKeyConfidence|CoverageGap' \
crates/cmtraceopen-parser/src/sccm crates/cmtraceopen-parser/tests 2>/dev/null || trueLength of output: 201564 🏁 Script executed: #!/bin/bash
set -euo pipefail
base='a58eefdc2063f9e03899af882b0bcc35c9cc2bbd'
head='c808848c8b9da2451af25277e8ff65956530d4c2'
printf '%s\n' '== Changed file list =='
git diff --name-status "$base" "$head"
printf '%s\n' '== Diff summary by hunk =='
git diff --unified=12 --no-ext-diff "$base" "$head" -- \
'crates/cmtraceopen-parser/src/sccm/keys.rs' \
'crates/cmtraceopen-parser/src/sccm/models.rs' \
'crates/cmtraceopen-parser/src/sccm/mod.rs' \
'crates/cmtraceopen-parser/tests/sccm_spine_contract.rs' 2>/dev/null || true
printf '%s\n' '== Candidate and boundary source sections =='
nl -ba crates/cmtraceopen-parser/src/sccm/keys.rs | sed -n '1,380p'
printf '%s\n' '== SCCM public model sections =='
nl -ba crates/cmtraceopen-parser/src/sccm/models.rs | sed -n '1,300p'
printf '%s\n' '== SCCM spine test symbols =='
ast-grep outline crates/cmtraceopen-parser/tests/sccm_spine_contract.rs --items all 2>/dev/null || true
rg -n -C 10 \
'boundary|MalformedCandidate|version|profile|confidence|coverage|serde|candidate|key_' \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs 2>/dev/null || trueLength of output: 43375 🏁 Script executed: #!/bin/bash
set -euo pipefail
previous='79ca233ddce7bdabfb27dc48bb1027aeed600b95'
head='c808848c8b9da2451af25277e8ff65956530d4c2'
printf '%s\n' '== Correction-only diff =='
git diff --unified=20 --no-ext-diff "$previous" "$head" -- \
crates/cmtraceopen-parser/src/sccm/keys.rs \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
printf '%s\n' '== Direct extraction/profile API references =='
rg -n -C 5 \
'\bextract_keys\s*\(|\bnormalize_key\s*\(|SccmExtractionProfile::for_version\s*\(|SccmKeyExtractionResult\b' \
crates/cmtraceopen-parser/src crates/cmtraceopen-parser/tests \
-g '*.rs' || true
printf '%s\n' '== Boundary and candidate functions (numbered) =='
awk 'NR >= 200 && NR <= 330 { printf "%4d %s\n", NR, $0 }' \
crates/cmtraceopen-parser/src/sccm/keys.rs
printf '%s\n' '== Model serde contracts (numbered) =='
awk 'NR >= 145 && NR <= 255 { printf "%4d %s\n", NR, $0 }' \
crates/cmtraceopen-parser/src/sccm/models.rs
printf '%s\n' '== Relevant test methods (numbered) =='
rg -n \
'fn key_(extraction_requires_a_full_token_boundary_for_every_declared_kind|extraction_accepts_the_declared_full_token_boundaries|profile_forged_stable_profile_cannot_emit_strong_or_exact_keys|profile_version_selection_rejects_malformed_or_prefix_collision_versions|profile_and_extraction_result_have_deterministic_json_round_trips)' \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs || trueLength of output: 48128
No findings. The boundary correction resolves the prior blocker: I also confirmed statically that:
Static review only; I could not independently execute the test suite in this sandbox. You are interacting with an AI system. |
adamgell
left a comment
There was a problem hiding this comment.
Independent exact-range rereview of a58eefdc2063f9e03899af882b0bcc35c9cc2bbd..c808848c8b9da2451af25277e8ff65956530d4c2: BLOCKED. The original valid-prefix case is fixed, but an adversarial executable probe found a second cross-pattern adjacent-label path. CodeRabbit reviewed this exact head with no findings, but its static result does not cover the dynamic reproduction in the inline comment. The prior thread remains unresolved. Do not merge or mark ready until the forbidden-delimiter case emits no keys and a regression matrix covers adjacent labels.
|
@coderabbitai review Please perform a fresh substantive review of exact head Focus on the dynamic nested-label correction: every label start must be at start-of-message or follow only whitespace, comma, semicolon, or ampersand; forbidden |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='a58eefdc2063f9e03899af882b0bcc35c9cc2bbd'
head='e99cbab924da49d1b296459758307ba1ee8b110c'
git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"
printf '%s\n' '== Exact commit identities =='
git show -s --format='base: %H%nparents: %P%nsubject: %s' "$base"
git show -s --format='head: %H%nparents: %P%nsubject: %s' "$head"
printf '%s\n' '== Changed files =='
git diff --name-status "$base" "$head"
printf '%s\n' '== Diff stat =='
git diff --stat "$base" "$head"
printf '%s\n' '== AST outlines of changed Rust files =='
git diff --name-only --diff-filter=ACMR "$base" "$head" -- '*.rs' |
while IFS= read -r file; do
printf '\n--- %s ---\n' "$file"
ast-grep outline "$file" --items all || true
done
printf '%s\n' '== Full focused patch =='
git diff --unified=20 --no-ext-diff "$base" "$head" -- \
crates/cmtraceopen-parser/src/sccm/keys.rs \
crates/cmtraceopen-parser/src/sccm/models.rs \
crates/cmtraceopen-parser/src/sccm/mod.rs \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
printf '%s\n' '== Boundary/extraction implementation =='
nl -ba crates/cmtraceopen-parser/src/sccm/keys.rs | sed -n '1,420p'
printf '%s\n' '== Public SCCM models =='
nl -ba crates/cmtraceopen-parser/src/sccm/models.rs | sed -n '1,340p'
printf '%s\n' '== Direct extraction and profile API uses =='
rg -n -C 5 --type rust \
'\b(find_candidates|extract_keys|normalize_key|for_version)\s*\(|SccmKeyExtractionResult|SccmExtractionProfile|SccmCoverageGap|SccmCorrelationKey' \
crates/cmtraceopen-parser/src crates/cmtraceopen-parser/tests || true
printf '%s\n' '== Focused SCCM spine test functions and assertions =='
rg -n -C 12 --type rust \
'nested|boundary|MalformedCandidate|utf.?16|unvalidated|serde|confidence|coverage|forged|version' \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs || trueLength of output: 62854 🏁 Script executed: #!/bin/bash
set -euo pipefail
base='a58eefdc2063f9e03899af882b0bcc35c9cc2bbd'
previous='c808848c8b9da2451af25277e8ff65956530d4c2'
head='e99cbab924da49d1b296459758307ba1ee8b110c'
numbered() {
local file="$1"
local first="$2"
local last="$3"
awk -v first="$first" -v last="$last \
'NR >= first && NR <= last { printf "%6d %s\n", NR, $0 }' "$file"
}
printf '%s\n' '== Nested-label correction-only diff =='
git diff --unified=30 --no-ext-diff "$previous" "$head" -- \
crates/cmtraceopen-parser/src/sccm/keys.rs \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
printf '%s\n' '== Candidate discovery, boundaries, and normalization =='
numbered crates/cmtraceopen-parser/src/sccm/keys.rs 220 452
printf '%s\n' '== Public extraction model contracts =='
numbered crates/cmtraceopen-parser/src/sccm/models.rs 135 240
printf '%s\n' '== Nested-label and accepted-boundary tests =='
numbered crates/cmtraceopen-parser/tests/sccm_spine_contract.rs 560 760
printf '%s\n' '== Profile/gap/Serde contract tests =='
numbered crates/cmtraceopen-parser/tests/sccm_spine_contract.rs 365 450
numbered crates/cmtraceopen-parser/tests/sccm_spine_contract.rs 735 875
printf '%s\n' '== Direct production and test callers =='
rg -n -C 4 --type rust \
'\bextract_keys\s*\(|\bnormalize_key\s*\(|SccmExtractionProfile::for_version\s*\(' \
crates/cmtraceopen-parser/src crates/cmtraceopen-parser/tests || true
printf '%s\n' '== Public model serde attributes and artifact-family contract =='
rg -n -C 4 --type rust \
'#\[serde|pub (enum|struct) Sccm(ArtifactFamily|CorrelationKey|KeyConfidence|ExtractionProfile|ExtractionGap|KeyExtractionResult)' \
crates/cmtraceopen-parser/src/sccm/models.rs crates/cmtraceopen-parser/src/sccm/catalog.rs || true
printf '%s\n' '== Rust dependency features and wasm target configuration =='
rg -n -C 3 \
'^\[features\]|^\[dependencies\]|^regex\s*=|^serde\s*=|^serde_json\s*=|wasm32|crate-type' \
Cargo.toml crates/cmtraceopen-parser/Cargo.toml .cargo 2>/dev/null || trueLength of output: 2388 🏁 Script executed: #!/bin/bash
set -euo pipefail
base='a58eefdc2063f9e03899af882b0bcc35c9cc2bbd'
previous='c808848c8b9da2451af25277e8ff65956530d4c2'
head='e99cbab924da49d1b296459758307ba1ee8b110c'
numbered() {
local file="$1"
local first="$2"
local last="$3"
awk -v first="$first" -v last="$last" \
'NR >= first && NR <= last { printf "%6d %s\n", NR, $0 }' "$file"
}
printf '%s\n' '== Nested-label correction-only diff =='
git diff --unified=30 --no-ext-diff "$previous" "$head" -- \
crates/cmtraceopen-parser/src/sccm/keys.rs \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
printf '%s\n' '== Candidate discovery, boundaries, and normalization =='
numbered crates/cmtraceopen-parser/src/sccm/keys.rs 220 452
printf '%s\n' '== Public extraction model contracts =='
numbered crates/cmtraceopen-parser/src/sccm/models.rs 135 240
printf '%s\n' '== Nested-label and accepted-boundary tests =='
numbered crates/cmtraceopen-parser/tests/sccm_spine_contract.rs 560 760
printf '%s\n' '== Profile/gap/Serde contract tests =='
numbered crates/cmtraceopen-parser/tests/sccm_spine_contract.rs 365 450
numbered crates/cmtraceopen-parser/tests/sccm_spine_contract.rs 735 875
printf '%s\n' '== Direct production and test callers =='
rg -n -C 4 --type rust \
'\bextract_keys\s*\(|\bnormalize_key\s*\(|SccmExtractionProfile::for_version\s*\(' \
crates/cmtraceopen-parser/src crates/cmtraceopen-parser/tests || true
printf '%s\n' '== Public model serde attributes and artifact-family contract =='
rg -n -C 4 --type rust \
'#\[serde|pub (enum|struct) Sccm(ArtifactFamily|CorrelationKey|KeyConfidence|ExtractionProfile|ExtractionGap|KeyExtractionResult)' \
crates/cmtraceopen-parser/src/sccm/models.rs crates/cmtraceopen-parser/src/sccm/catalog.rs || true
printf '%s\n' '== Rust dependency features and wasm target configuration =='
rg -n -C 3 \
'^\[features\]|^\[dependencies\]|^regex\s*=|^serde\s*=|^serde_json\s*=|wasm32|crate-type' \
Cargo.toml crates/cmtraceopen-parser/Cargo.toml .cargo 2>/dev/null || trueLength of output: 85878
Finding
The nested-label correction itself looks sound under static review: I did not execute Rust tests, Clippy, or the wasm32 build in this sandbox. ✅ Action performedReview finished.
|
|
CodeRabbit finding disposition for exact head |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/cmtraceopen-parser/src/sccm/keys.rs (1)
243-264: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winUse a
RegexSetprefilter for key extraction
find_candidatesscans each message with all 14 key regexes. Use aRegexSetto identify matching pattern indices first, then run captures only for those patterns while preserving the existing ordering.🤖 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 243 - 264, Update find_candidates to use a RegexSet prefilter over the key patterns, first collecting matching pattern indices for the message and then running captures only against those patterns. Preserve the existing pattern ordering and all current candidate construction, label validation, token-boundary, and UTF-16 offset behavior.
🤖 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/keys.rs`:
- Around line 243-264: Update find_candidates to use a RegexSet prefilter over
the key patterns, first collecting matching pattern indices for the message and
then running captures only against those patterns. Preserve the existing pattern
ordering and all current candidate construction, label validation,
token-boundary, and UTF-16 offset behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b36ecedd-6b6b-4c1c-9752-d936b6fed9dc
📒 Files selected for processing (4)
crates/cmtraceopen-parser/src/sccm/keys.rscrates/cmtraceopen-parser/src/sccm/mod.rscrates/cmtraceopen-parser/src/sccm/models.rscrates/cmtraceopen-parser/tests/sccm_spine_contract.rs
adamgell
left a comment
There was a problem hiding this comment.
Exact-range independent rereview — PASS
Reviewed exact base a58eefdc2063f9e03899af882b0bcc35c9cc2bbd through exact head e99cbab924da49d1b296459758307ba1ee8b110c in a clean detached worktree. I found no blocking issue in this Task 6 slice.
Prior blockers
- Valid-prefix truncation is fixed. A fresh runtime cross-product rejected 63 malformed suffix cases across all 14 declared key kinds (
/,:,+, Unicode, plus an extra closing brace for every brace-bearing form). Each experimental-profile case emitted no key and one citedMalformedCandidate; each unvalidated-version case emitted no key and one citedUnvalidatedVersiongap preserving the full candidate raw text. - Nested-label escape is fixed. A fresh runtime cross-product rejected 70 cases: every one of the 14 second-label kinds after each of
/,:, and+, plus every second label after a doubled-brace assignment token and a Unicode-adjacent package token. No second key or second unvalidated candidate gap escaped the malformed first token.
I resolved the two prior review threads only after these matrices passed.
Independent contract proof
- 196 additional start/end/boundary/span cases passed across all 14 kinds. Start of message, end of message, and each declared whitespace/comma/semicolon/ampersand boundary were exercised independently.
- UTF-16 spans (including an astral prefix), raw values, evidence citations, deterministic repeated output, text-order sorting, and the extracted-key
Lowconfidence ceiling all matched. - The built-in profile remains experimental for the single observed
5.00.9128.*family; unknown/malformed versions do not emit keys; a forgedStableprofile is rejected. - Serde round trips passed for the profile/result models, and the full parser suite preserves CCM/
LogEntrycompatibility. - The exact diff changes only
keys.rs, the additive SCCM models/re-exports, and spine tests. It adds noParserKind::Sccm, I/O/native/Tauri/network/database dependency, dependency change, or Task 7 finding code.
Common wrapping punctuation ((...), [...], quoted forms) remains outside the explicitly declared token-boundary grammar: the probe emitted zero keys (and retained the general experimental-profile gap). That is a conservative false-negative/experimental-profile coverage limit, not a false key or causal claim; it should be expanded with sanitized observed corpus evidence before any profile promotion.
Verification
cargo test --locked -p cmtraceopen-parser --test sccm_spine_contract key_ -- --nocapture— 15 passedcargo test --locked -p cmtraceopen-parser --quiet— 654 passedcargo clippy --locked -p cmtraceopen-parser --all-targets -- -D warnings— passedcargo check --locked -p cmtraceopen-parser --target wasm32-unknown-unknown— passednpx tsc --noEmit— passed- Rust 1.88 rustfmt check of the four owned Rust files — passed
git diff --check a58eefdc2063f9e03899af882b0bcc35c9cc2bbd..e99cbab924da49d1b296459758307ba1ee8b110c— passed- CodeRabbit CLI exact committed-range review — 0 findings
CodeRabbit disposition
CodeRabbit's GitHub comment claiming SccmArtifactFamily lacks Serde is a false positive. catalog.rs imports the Serde traits at line 1, implements Serialize at line 54 and Deserialize at line 63, and maps future strings to Unknown(String) at line 86. I also runtime-round-tripped both ClientPolicy and Unknown("futureFamily"); the committed contract test covers the same behavior at sccm_spine_contract.rs:1420-1432. The 654-test build, strict Clippy, and wasm check independently compile the profile's Vec<SccmArtifactFamily> Serde bounds.
This is a SHA-anchored review of e99cbab924da49d1b296459758307ba1ee8b110c; it does not mark the draft ready, merge it, close #318, or authorize Task 7.
adamgell
left a comment
There was a problem hiding this comment.
Independent exact-range rereview PASS for a58eefd..e99cbab. A separate detached-worktree reviewer executed 63 malformed-suffix cases, 70 nested-label cases (all 14 second labels across slash, colon, plus, doubled-brace, and Unicode adjacency), and 196 independent accepted-boundary, UTF-16 span, and citation cases across all 14 kinds. No key or unvalidated candidate gap leaked; deterministic ordering, cited raw gaps, Low-confidence ceiling, version/profile fail-closed behavior, and known/future SccmArtifactFamily Serde round trips passed. Common wrapping punctuation is a conservative experimental-profile false negative, not a false positive, and remains an explicit profile limitation. Focused 15/15; full parser 654/654; strict Clippy, wasm32, TypeScript, scoped Rust 1.88 formatting, and exact-range diff checks passed. The CodeRabbit missing-Serde claim is disproved by the manual Serialize and Deserialize implementations and runtime round trips; its RegexSet suggestion is a non-blocking unmeasured optimization and is not warranted in this correctness slice. Both prior blockers are fixed at this SHA. No Task 7, native I/O, ParserKind, CCM, LogEntry, or dependency scope expansion found.
There was a problem hiding this comment.
Pull request overview
This PR adds a version-gated SCCM correlation-key extraction contract to the parser layer, introducing public models for extracted keys, extraction profiles, confidence, and deterministic “coverage gap” reporting without adding a new ParserKind.
Changes:
- Introduces new public SCCM key-related models (kinds, confidence, profiles, gaps, extraction result) and exports a new
keysmodule API. - Implements experimental (version-prefixed) key extraction with strict label/value boundary handling and conservative (Low) confidence emission.
- Expands the SCCM spine contract tests to cover normalization, version gating, malformed-token/nested-label rejection, ordering, and JSON round-trips.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/cmtraceopen-parser/tests/sccm_spine_contract.rs | Adds a comprehensive key normalization/extraction contract test matrix, including boundary and regression coverage. |
| crates/cmtraceopen-parser/src/sccm/models.rs | Adds public SCCM correlation-key, profile, confidence, gap, and result model contracts. |
| crates/cmtraceopen-parser/src/sccm/mod.rs | Wires the new keys module and re-exports its public API. |
| crates/cmtraceopen-parser/src/sccm/keys.rs | Implements versioned, boundary-aware SCCM key extraction and normalization. |
| pub extraction_profile_id: Option<String>, | ||
| pub evidence: Option<SccmEvidenceRef>, | ||
| pub start: Option<usize>, | ||
| pub end: Option<usize>, |
Add fail-closed, versioned SCCM correlation-key extraction with conservative Low-confidence profiles and whole-token boundary validation. Refs #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
Implements Task 6 of the SCCM diagnostic spine for #318:
No native collection, Windows I/O, findings/reducers, cross-side causal logic,
ParserKind::Sccm, CCM grammar,LogEntry, or dependency changes are included.Review corrections
Independent review first found that a regex capture could stop before an unrecognized contiguous value suffix. Values such as
{GUID}},LAB00001é, orhostécould therefore emit a truncated Low key. The first correction made end-of-message, whitespace, comma, semicolon, or ampersand the only accepted value boundaries.A fresh dynamic rereview then found the symmetric label-start flaw: per-label regex scans treated forbidden punctuation as a word boundary, so
package id=LAB00001/content id=ContentABCcould emit a nested ContentId even though the package token was malformed. Commite99cbab924da49d1b296459758307ba1ee8b110cnow applies the same explicit accepted-boundary contract to label starts. It does not special-case/,:, or+.The test-first nested-label matrix covers all 14 declared second-label kinds across forbidden
/,:, and+delimiters, plus Unicode and doubled-brace adjacency. It asserts zero leaked keys, one deterministic cited malformed PackageId gap, UTF-16 spans, and unvalidated-profile candidate behavior. The positive matrix pins accepted whitespace, newline, tab, comma, semicolon, and ampersand starts while retaining Low confidence.Restack evidence
Based on live
codex/parser-family-skeletonata58eefdc2063f9e03899af882b0bcc35c9cc2bbd.Verification on exact head
e99cbab924da49d1b296459758307ba1ee8b110ccargo test -p cmtraceopen-parser --test sccm_spine_contract key_extraction_rejects_every_label_inside_a_preceding_malformed_token -- --exact --nocapturereproduced leaked Low keys for all 14 second labels across/,:, and+, plus doubled-brace and unvalidated-profile leakagecargo test --locked -p cmtraceopen-parser --test sccm_spine_contract key_ -- --nocapture— 15 passedcargo test --locked -p cmtraceopen-parser— 654 passed, 0 failedcargo clippy --locked -p cmtraceopen-parser --all-targets -- -D warnings— passedcargo check --locked -p cmtraceopen-parser --target wasm32-unknown-unknown— passednpx tsc --noEmit— passedrustfmt --checkon all four owned files — passedgit diff --check a58eefdc2063f9e03899af882b0bcc35c9cc2bbd...HEAD— passedrustup run 1.88.0 cargo fmt --check --all— repository baseline remains red in the same 17 unrelated pre-existing files; none are in this PRReview gate
Substantive exact-head CodeRabbit review and a fresh independent dynamic rereview completed on
e99cbab924da49d1b296459758307ba1ee8b110c; both prior blocker threads are resolved. CodeRabbit’s missing-Serde warning was disproved by the existing manual implementations and runtime round trips, while its RegexSet note is a non-blocking unmeasured optimization. Common wrapping punctuation remains a conservative false-negative limitation of the experimental Low-confidence profile.Refs #318
Summary by CodeRabbit
New Features
Tests