Skip to content

feat(sccm): seal client evidence admission authority - #457

Merged
adamgell merged 27 commits into
codex/parser-family-skeletonfrom
codex/sccm319-client-authority-final-r116
Aug 3, 2026
Merged

feat(sccm): seal client evidence admission authority#457
adamgell merged 27 commits into
codex/parser-family-skeletonfrom
codex/sccm319-client-authority-final-r116

Conversation

@adamgell

@adamgell adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Part of #319.

Summary

  • Add optional intake-owned declaredByteLength and lowercase contentSha256 bindings to complete captured client artifacts, with paired/fail-closed validation.
  • Add a bytes-only public admission input and an opaque non-Serde client evidence capability that reassesses canonical intake, verifies exact payload length/digest, scans the existing raw CCM grammar, and seals deterministic bounded evidence.
  • Enforce per-payload, aggregate-byte, logical-record, retained-evidence, and streamed integrity-seal work ceilings; malformed tails, invalid offsets/encodings, collisions, missing/extra/swapped payloads, and incomplete coverage fail closed.
  • Keep raw CCM readiness source-local: catalogued non-CCM siblings cannot block or enter raw admission, while raw CCM gaps/rotations/caps still block the affected group. A captured fragment with no declared supported encoding is now excluded from payload eligibility and remains an explicit source-local coverage gap instead of aborting unrelated evidence.
  • Bind crate-private key extraction to one sealed artifact, its catalogued family, its admitted evidence, and an internally selected versioned profile.
  • Keep current native and legacy manifest projections assessment-only by explicitly leaving both content-binding fields None; even exact native-manifest-validated bytes remain MissingContentBinding.

Architecture boundaries

  • cmtraceopen-parser remains pure Rust and wasm32-compatible.
  • Raw CCM remains the shared transport grammar; no ParserKind::Sccm and no duplicate parser.
  • Public LogEntry, generic collection-manifest, and ArtifactStatus contracts are unchanged.
  • This slice adds no native source hashing, capture/enumeration caller, Tauri command, network/database/registry/WMI dependency, workflow reducer, or cross-side correlation.
  • All tests are synthetic. There is no live Windows or SCCM-lab acceptance claim.
  • The future native binding must derive length/digest and retained bytes from the same opened source handle; this PR deliberately does not grant that authority.

Review evidence

  • Original reviewed integration base: 09aafd4a70fb70f7db90a4ebb09c10bb1ee12020; current live integration after the disjoint private-destination merge: 03ea96c9f17e000baeab19fa205d7184a68ac2ec.
  • Exact head: 05f5d5ed2138042871f0bebc3b9f081ffb660e99
  • Twenty-seven issue-scoped commits; twelve changed files.
  • The first nineteen commits are 19/19 patch-equivalent to the independently reviewed donor range; final test-only hardening pins the independent serialized-seal work cap.
  • Independent full-range adversarial review: GO, no P0-P3 finding.
  • Independent final-delta review: GO.
  • Independent six-commit authority/work-budget correction review: GO, no finding; forged family profiles and per-payload aggregate scanning are pinned fail-closed.
  • Independent missing-encoding correction review (f6c458ad..05f5d5ed): GO, no P0-P3 finding; the parent bug was reproduced from control flow and the corrected source-local gap, sealed readiness set, public grammar, full parser, Clippy, and wasm boundaries were verified.
  • Local CodeRabbit full-range plus prior deltas returned zero findings. Exact correction review produced one non-actionable suggestion to supply a deliberately ineligible payload; doing so must remain ExtraPayload and would invalidate the local-gap success test.

Verification

  • cargo test --locked -p cmtraceopen-parser sccm::client::admission_tests — 15 passed
  • cargo test --locked -p cmtraceopen-parser sccm::client::authority_contract_tests — 17 passed
  • cargo test --locked -p cmtraceopen-parser --test sccm_client_admission_authority — 1 passed
  • cargo test --locked -p cmtraceopen-parser --test sccm_client_intake — 65 passed
  • cargo test --locked -p cmtrace-open --test sccm_client_manifest --no-default-features --features sccm-diagnostics — 21 passed
  • cargo test --locked -p cmtraceopen-parser — passed
  • cargo check --locked -p cmtrace-open --no-default-features --features sccm-diagnostics — passed
  • strict app and parser Clippy with -D warnings — passed
  • parser wasm32-unknown-unknown check — passed
  • npx --offline tsc --noEmit — passed
  • scoped Rustfmt, range git diff --check, and clean worktree — passed

Repository-wide formatting still reports inherited drift in unrelated files byte-identical between base and head; this range adds none.

This draft remains blocked on exact-head hosted CI, CodeRabbit, Copilot, zero unresolved threads, and a repeated live base/head/tree guard. It does not complete #319; same-handle native capture binding and live Windows validation remain open.

Summary by CodeRabbit

  • New Features

    • Added SCCM client evidence admission with validation for payload integrity, content bindings, encodings, CCM framing, record limits, timestamps, and extraction profiles.
    • Added SHA-256 and byte-length metadata for captured intake artifacts and fragments.
    • Added bounded logical-record scanning with completion and limit-status reporting.
    • Added artifact-family-aware extraction profile support.
  • Bug Fixes

    • Prevented unsupported or legacy projections from inventing content-binding metadata.
    • Improved handling of ambiguous and incomplete CCM records.
  • Documentation

    • Documented native-capture requirements for retained bytes, lengths, and digests.

@adamgell adamgell added sccm SCCM/ConfigMgr related parser Log parser related feature New feature labels Aug 3, 2026
@adamgell adamgell self-assigned this Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds bounded CCM scanning and SCCM client evidence admission. Intake artifacts now support byte-length and SHA-256 bindings. Admission validates payloads, encoding, provenance, limits, extraction profiles, ordering, and integrity seals.

Changes

SCCM evidence authority

Layer / File(s) Summary
Bounded CCM scanning
crates/cmtraceopen-parser/src/parser/ccm.rs
The scanner shares accounting for records, fallback entries, IDs, errors, completion, and record limits.
Intake bindings and profile contracts
crates/cmtraceopen-parser/src/sccm/client/intake.rs, crates/cmtraceopen-parser/src/sccm/keys.rs, crates/cmtraceopen-parser/src/sccm/client/mod.rs
Intake data preserves optional length and SHA-256 bindings. Profiles can bind to artifact families.
Evidence admission and integrity sealing
crates/cmtraceopen-parser/src/sccm/client/admission.rs, crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs
Admission validates payloads, decoding, framing, limits, provenance, profiles, ordering, and deterministic integrity seals.
Authority validation and projections
crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs, crates/cmtraceopen-parser/tests/*, src-tauri/src/sccm/manifest.rs, src-tauri/tests/sccm_client_manifest.rs, docs/sccm/preparation/issue-319-client-intake.md
Tests cover source authority, profile boundaries, serialization, and mutation rejection. Manifest projections leave bindings absent, and documentation defines native capture requirements.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant IntakeBundle
  participant admit_client_evidence
  participant scan_logical_records_bounded
  participant SccmExtractionProfile
  participant IntegritySeal
  IntakeBundle->>admit_client_evidence: canonical assessment and captured payloads
  admit_client_evidence->>scan_logical_records_bounded: decoded CCM content and record limit
  scan_logical_records_bounded-->>admit_client_evidence: bounded records and scan status
  admit_client_evidence->>SccmExtractionProfile: artifact family
  SccmExtractionProfile-->>admit_client_evidence: family-bound profile
  admit_client_evidence->>IntegritySeal: ordered evidence projection
  IntegritySeal-->>admit_client_evidence: deterministic SHA-256 seal
Loading

Possibly related issues

Possibly related PRs

Suggested labels: test

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: sealed SCCM client evidence admission authority.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

@github-actions github-actions Bot added the enhancement New feature or request label Aug 3, 2026
@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

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

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot added the test Testing related label Aug 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the SCCM client intake pipeline by introducing an evidence “admission authority” that can fail-closed on mismatched payload length/digest, malformed CCM framing, and bounded-work ceilings, producing an opaque sealed evidence capability for downstream reducers.

Changes:

  • Adds optional intake-owned declaredByteLength and contentSha256 bindings (paired + validated) to enable exact payload-length/digest verification during admission.
  • Introduces a bytes-only admission API (SccmClientCapturedPayload + admit_client_evidence) that reassesses canonical intake, validates payload integrity, frames bounded CCM logical records, and seals deterministic evidence with an integrity hash.
  • Adds bounded CCM logical-record scanning support and expands synthetic tests/docs to cover admission failure modes and legacy/native projection expectations.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src-tauri/tests/sccm_client_manifest.rs Updates manifest projection tests to assert completeness is preserved while content binding remains unset for native/legacy projections.
src-tauri/src/sccm/manifest.rs Ensures legacy/native manifest-to-bundle projections explicitly leave new binding fields as None.
docs/sccm/preparation/issue-319-client-intake.md Documents the required single-handle native binding workflow and clarifies legacy fixtures’ assessment-only status.
crates/cmtraceopen-parser/tests/sccm_client_intake.rs Updates synthetic intake fixtures to include the new optional binding fields (defaulting to None).
crates/cmtraceopen-parser/tests/sccm_client_admission_authority.rs Adds a public contract test asserting bytes-only admission succeeds only with intake-bound length/digest authority.
crates/cmtraceopen-parser/src/sccm/keys.rs Adds family-bound profile selection for admitted evidence and adjusts built-in experimental profile recognition.
crates/cmtraceopen-parser/src/sccm/client/mod.rs Wires in the new admission module and exposes the admission API types/functions.
crates/cmtraceopen-parser/src/sccm/client/intake.rs Adds/validates declared_byte_length + content_sha256 in intake artifacts/fragments and exposes helpers for admission.
crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs Adds extensive contract tests for admission fail-closed behavior, readiness locality, and profile binding.
crates/cmtraceopen-parser/src/sccm/client/admission.rs Implements the admission authority: integrity checks, bounded decoding/framing/retention, and deterministic sealing.
crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs Adds focused unit tests for admission limits, encoding/BOM rules, determinism, and seal tamper detection.
crates/cmtraceopen-parser/src/parser/ccm.rs Adds a bounded logical-record scan projection to support admission’s fail-closed framing and record-limit enforcement.

Comment thread crates/cmtraceopen-parser/src/sccm/keys.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (9)
crates/cmtraceopen-parser/src/sccm/client/admission.rs (3)

117-174: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff

Each accessor call re-serializes and re-hashes the complete sealed bundle.

evidence, source_coverage, extract_keys_for_artifact, and require_captured_source all call verify_integrity. verify_integrity calls compute_integrity_seal, which serializes every retained record and hashes up to MAX_SCCM_CLIENT_ADMISSION_SEAL_BYTES. A reducer that queries coverage per source group therefore pays a full multi-megabyte serialization and SHA-256 pass per query. require_captured_source pays it once through source_coverage, and extract_keys_for_artifact pays it again before extraction.

The fail-closed intent is clear, so do not remove the check. Consider giving reducers one explicit verified view, for example a crate-private verified(&self) -> Result<VerifiedView<'_>, _> that verifies once and then exposes the accessors without re-verification. Keep the current verifying methods for single-shot callers.

🤖 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/client/admission.rs` around lines 117 -
174, Introduce a crate-private verified view for SccmClientAdmittedEvidence that
calls verify_integrity once and exposes evidence, source coverage, and artifact
key extraction accessors without repeating verification. Update reducer paths,
including require_captured_source, to acquire and reuse this verified view
across related queries, while preserving the existing verifying methods for
single-shot callers and retaining fail-closed integrity checks.

710-722: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Two hex helpers and two SHA-256 validators now exist in the crate.

digest_hex here and BoundedIntegrityWriter::finish at lines 632-638 both format a digest as lowercase hex with the same per-byte format! loop. is_lowercase_sha256 also duplicates the digest-shape check that intake.rs performs through is_sha256_digest. Two independent shape checks can drift, and drift here changes which bindings intake accepts versus which bindings admission trusts.

Extract one fn hex_digest(bytes: impl AsRef<[u8]>) -> String and share a single digest-shape predicate between intake.rs and admission.rs.

🤖 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/client/admission.rs` around lines 710 -
722, Consolidate the duplicate lowercase digest formatting and validation
helpers by introducing one shared hex_digest(bytes: impl AsRef<[u8]>) function
and one shared SHA-256 digest-shape predicate. Update
BoundedIntegrityWriter::finish, the local digest_hex/is_lowercase_sha256 usage
in admission.rs, and intake.rs’s is_sha256_digest path to reuse these shared
symbols so intake acceptance and admission trust apply identical validation.

366-382: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Pass remaining_logical_records to scan_logical_records_bounded.

This prevents a late payload from retaining up to 4,096 records before admission rejects the bundle. A zero limit sets record_limit_exceeded when the scanner encounters a record. The scanner still processes the input after reaching the limit, so this change limits retained records but does not fully bound scan work.

🤖 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/client/admission.rs` around lines 366 -
382, Update the call to scan_logical_records_bounded in the admission flow to
pass remaining_logical_records as its record-limit argument instead of the fixed
MAX_SCCM_CLIENT_ADMISSION_LOGICAL_RECORDS value. Preserve the existing limit,
framing, malformed-input, and checked subtraction handling.
crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs (2)

592-622: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the redundant is_err assertion.

admission_error already fails the test when the result is Ok. Lines 610-613 duplicate that check and consume readability.

♻️ Proposed simplification
-    let result = admit_client_evidence(&bundle, &assessment, &payloads);
-    assert!(
-        result.is_err(),
-        "two individually bounded rotations totaling 4,098 records were admitted"
-    );
     let error = admission_error(
-        result,
+        admit_client_evidence(&bundle, &assessment, &payloads),
         "the logical-record cap must apply across the complete bundle",
     );
🤖 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/client/admission_tests.rs` around lines
592 - 622, In admission_enforces_logical_record_cap_across_all_payloads, remove
the separate result.is_err assertion and pass result directly to
admission_error, which already validates that admission fails. Preserve the
existing error-message assertion.

571-590: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the retained-evidence budget stays below its cap in this test.

This test asserts IntegritySealLimitExceeded. The fixture uses one record with 700,000 NUL characters. The retained-evidence check runs before the seal computation in admit_client_evidence. The test therefore depends on 700,000 retained bytes remaining under MAX_SCCM_CLIENT_ADMISSION_RETAINED_EVIDENCE_BYTES while the JSON-escaped form (six bytes per NUL) exceeds the seal cap. Add a comment or a derived assertion that ties the fixture size to both constants. A future change of either cap would otherwise flip this test to a different error without an obvious cause.

🤖 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/client/admission_tests.rs` around lines
571 - 590, Update
admission_applies_the_integrity_seal_cap_independently_of_retained_memory to
explicitly verify the fixture remains within
MAX_SCCM_CLIENT_ADMISSION_RETAINED_EVIDENCE_BYTES while its escaped
representation exceeds the integrity seal cap. Use derived assertions or a
focused comment tied to the existing constants, preserving the expected
IntegritySealLimitExceeded result.
src-tauri/tests/sccm_client_manifest.rs (1)

298-301: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Compare the error value so a failure reports the observed variant.

assert!(matches!(...)) prints only the pattern on failure. SccmClientEvidenceAdmissionError is compared with assert_eq! in the parser tests, so it implements PartialEq and Debug. Use assert_eq! here to show which error occurred.

♻️ Proposed change
-    assert!(matches!(
-        admit_client_evidence(&bundle, &assessment, &[payload]),
-        Err(SccmClientEvidenceAdmissionError::MissingContentBinding)
-    ));
+    assert_eq!(
+        admit_client_evidence(&bundle, &assessment, &[payload]).err(),
+        Some(SccmClientEvidenceAdmissionError::MissingContentBinding)
+    );

This change requires SccmClientAdmittedEvidence to implement Debug for Result::err() reporting; if it does not, keep matches! and add the error text to the message 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 `@src-tauri/tests/sccm_client_manifest.rs` around lines 298 - 301, Replace the
matches! assertion around admit_client_evidence with an assert_eq! comparison
against the expected MissingContentBinding error, ensuring
SccmClientAdmittedEvidence implements Debug as required for Result error
reporting. If that result type cannot implement Debug, retain matches! and add
an assertion failure message containing the observed error text.
src-tauri/src/sccm/manifest.rs (1)

123-125: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Record why the content binding stays absent here.

The native projection leaves declared_byte_length and content_sha256 unset, so admission fails closed with MissingContentBinding. The manifest already carries a copied byte count. A future author could populate these fields from a separate stat or hash step. docs/sccm/preparation/issue-319-client-intake.md Lines 139-146 forbids that, because a file replacement between the steps would bind the manifest to bytes that were never supplied. Add a one-line comment at this site that points to the single-handle 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 `@src-tauri/src/sccm/manifest.rs` around lines 123 - 125, Add a one-line
comment immediately above the unset declared_byte_length and content_sha256
fields in the native projection, documenting that they must remain absent
because binding requires the single file handle used for intake and must not
rely on separate stat or hash steps.
crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs (2)

61-69: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Simplify the relative_path construction.

The chained then/or_else expresses one three-way choice. A single if reads clearer and removes the duplicated physical test.

♻️ Proposed simplification
-    let relative_path = (physical && group != "unknown")
-        .then(|| format!("evidence/{group}/current/{basename}"))
-        .or_else(|| {
-            (physical && group == "unknown").then(|| format!("evidence/{group}/{basename}"))
-        });
+    let relative_path = physical.then(|| {
+        if group == "unknown" {
+            format!("evidence/{group}/{basename}")
+        } else {
+            format!("evidence/{group}/current/{basename}")
+        }
+    });
🤖 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/client/authority_contract_tests.rs` around
lines 61 - 69, Update the relative_path construction to use one conditional
expression: return the “current” path when physical is true and group is not
"unknown", the fallback group path when physical is true with an unknown group,
and None otherwise. Replace the chained then/or_else logic without changing the
resulting paths.

17-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Share the fixture helpers instead of copying them.

digest and the CCM record builder exist in three places: here, in admission_tests.rs (Lines 10-15 and 83-93), and in crates/cmtraceopen-parser/tests/sccm_client_admission_authority.rs (Lines 8-23). The record template must stay identical for the binding assertions to keep their meaning. Extract one shared test-support module and use it in all three files.

🤖 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/client/authority_contract_tests.rs` around
lines 17 - 34, Extract the duplicated digest and CCM record-builder helpers into
one shared test-support module, then update authority_contract_tests.rs,
admission_tests.rs, and sccm_client_admission_authority.rs to import and reuse
those helpers. Preserve the existing helper behavior and identical record
template, including formatting and fixture values, so all binding assertions
retain their meaning.
🤖 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/parser/ccm.rs`:
- Around line 374-394: The caller of scan_logical_records_bounded, specifically
admit_client_evidence, must pass the current remaining_logical_records budget
for each payload instead of the fixed MAX_SCCM_CLIENT_ADMISSION_LOGICAL_RECORDS
value. Update the budget before each scan as records are admitted so scanning
stops at the bundle-wide remaining limit and does not materialize records beyond
it.

---

Nitpick comments:
In `@crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs`:
- Around line 592-622: In
admission_enforces_logical_record_cap_across_all_payloads, remove the separate
result.is_err assertion and pass result directly to admission_error, which
already validates that admission fails. Preserve the existing error-message
assertion.
- Around line 571-590: Update
admission_applies_the_integrity_seal_cap_independently_of_retained_memory to
explicitly verify the fixture remains within
MAX_SCCM_CLIENT_ADMISSION_RETAINED_EVIDENCE_BYTES while its escaped
representation exceeds the integrity seal cap. Use derived assertions or a
focused comment tied to the existing constants, preserving the expected
IntegritySealLimitExceeded result.

In `@crates/cmtraceopen-parser/src/sccm/client/admission.rs`:
- Around line 117-174: Introduce a crate-private verified view for
SccmClientAdmittedEvidence that calls verify_integrity once and exposes
evidence, source coverage, and artifact key extraction accessors without
repeating verification. Update reducer paths, including require_captured_source,
to acquire and reuse this verified view across related queries, while preserving
the existing verifying methods for single-shot callers and retaining fail-closed
integrity checks.
- Around line 710-722: Consolidate the duplicate lowercase digest formatting and
validation helpers by introducing one shared hex_digest(bytes: impl AsRef<[u8]>)
function and one shared SHA-256 digest-shape predicate. Update
BoundedIntegrityWriter::finish, the local digest_hex/is_lowercase_sha256 usage
in admission.rs, and intake.rs’s is_sha256_digest path to reuse these shared
symbols so intake acceptance and admission trust apply identical validation.
- Around line 366-382: Update the call to scan_logical_records_bounded in the
admission flow to pass remaining_logical_records as its record-limit argument
instead of the fixed MAX_SCCM_CLIENT_ADMISSION_LOGICAL_RECORDS value. Preserve
the existing limit, framing, malformed-input, and checked subtraction handling.

In `@crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs`:
- Around line 61-69: Update the relative_path construction to use one
conditional expression: return the “current” path when physical is true and
group is not "unknown", the fallback group path when physical is true with an
unknown group, and None otherwise. Replace the chained then/or_else logic
without changing the resulting paths.
- Around line 17-34: Extract the duplicated digest and CCM record-builder
helpers into one shared test-support module, then update
authority_contract_tests.rs, admission_tests.rs, and
sccm_client_admission_authority.rs to import and reuse those helpers. Preserve
the existing helper behavior and identical record template, including formatting
and fixture values, so all binding assertions retain their meaning.

In `@src-tauri/src/sccm/manifest.rs`:
- Around line 123-125: Add a one-line comment immediately above the unset
declared_byte_length and content_sha256 fields in the native projection,
documenting that they must remain absent because binding requires the single
file handle used for intake and must not rely on separate stat or hash steps.

In `@src-tauri/tests/sccm_client_manifest.rs`:
- Around line 298-301: Replace the matches! assertion around
admit_client_evidence with an assert_eq! comparison against the expected
MissingContentBinding error, ensuring SccmClientAdmittedEvidence implements
Debug as required for Result error reporting. If that result type cannot
implement Debug, retain matches! and add an assertion failure message containing
the observed error text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3db723dc-f337-4e6a-8d45-a8bf995421e7

📥 Commits

Reviewing files that changed from the base of the PR and between 09aafd4 and 7da7d8d.

📒 Files selected for processing (12)
  • crates/cmtraceopen-parser/src/parser/ccm.rs
  • crates/cmtraceopen-parser/src/sccm/client/admission.rs
  • crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs
  • crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs
  • crates/cmtraceopen-parser/src/sccm/client/intake.rs
  • crates/cmtraceopen-parser/src/sccm/client/mod.rs
  • crates/cmtraceopen-parser/src/sccm/keys.rs
  • crates/cmtraceopen-parser/tests/sccm_client_admission_authority.rs
  • crates/cmtraceopen-parser/tests/sccm_client_intake.rs
  • docs/sccm/preparation/issue-319-client-intake.md
  • src-tauri/src/sccm/manifest.rs
  • src-tauri/tests/sccm_client_manifest.rs

Comment thread crates/cmtraceopen-parser/src/parser/ccm.rs
@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Published exact reviewed correction f6c458a. Two hosted blockers are now fixed: public family-bearing profile forgery returns no keys plus UnvalidatedProfile, and bounded CCM scanning consumes the true remaining bundle budget (4096 then 1 in the regression) without materializing more than 4096 records. Panic-safe observer cleanup is also pinned. Independent exact-range review: GO/no findings. Focused authority/aggregate/cleanup tests, full parser (443 units plus integrations), strict parser Clippy, wasm32, TypeScript, scoped Rustfmt/diff, and local CodeRabbit zero findings pass. Both handled review threads are resolved; fresh exact-head hosted CodeRabbit, Copilot, and CI remain merge gates.

@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

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

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 17 minutes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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

Suppressed comments (1)

crates/cmtraceopen-parser/src/sccm/client/admission.rs:44

  • The doc comment for MAX_SCCM_CLIENT_ADMISSION_LOGICAL_RECORDS says it limits “logical CCM records”, but the underlying bounded CCM scan enforces the limit against all logical records materialized during scanning (including unmatched plain-text/error records), not just LogFormat::Ccm records. This mismatch can mislead future maintainers and consumers of the error (LogicalRecordLimitExceeded).
/// Maximum logical CCM records retained from one admitted client bundle.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (6)
crates/cmtraceopen-parser/src/parser/ccm.rs (1)

402-421: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Restore the outer observation state if observe_bounded_scans is nested.

observations.replace(Some(Vec::new())) overwrites the installed state before the assertion fails. The outer call then loses its collected observations, and the outer expect can report a misleading state. Check first, then install.

♻️ Proposed change
     BOUNDED_SCAN_OBSERVATIONS.with(|observations| {
         assert!(
-            observations.replace(Some(Vec::new())).is_none(),
+            observations.borrow().is_none(),
             "bounded scan observation cannot be nested"
         );
+        observations.replace(Some(Vec::new()));
     });
🤖 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/parser/ccm.rs` around lines 402 - 421, Update
observe_bounded_scans to inspect the existing BOUNDED_SCAN_OBSERVATIONS state
before installing a new Vec, so a nested call fails without overwriting the
outer observation buffer. Preserve the outer state for cleanup and collection
after the assertion.
src-tauri/src/sccm/manifest.rs (1)

124-125: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Record why the native projection drops the manifest content binding.

The native manifest already carries contentSha256 and bytesCopied, as the fixture in src-tauri/tests/sccm_client_manifest.rs shows. This projection deliberately discards both, so no native bundle can produce admissible evidence yet. Without an inline rationale, a later change may copy the manifest values here and defeat the single-handle authority rule documented in docs/sccm/preparation/issue-319-client-intake.md. Add a short comment that points to the pending native handle work. The legacy projection at Lines 872-873 has no manifest values to copy, so it needs no comment.

♻️ Proposed comment
             fragment_complete: Some(source.fragment_complete),
+            // The manifest digest and byte count are not single-handle
+            // capture authority, so they must not become an admission
+            // binding. The pending native capture work populates these
+            // fields from one open source handle instead.
             declared_byte_length: None,
             content_sha256: None,
🤖 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 `@src-tauri/src/sccm/manifest.rs` around lines 124 - 125, Add a short inline
comment beside declared_byte_length and content_sha256 in the native manifest
projection explaining that these fields are intentionally omitted pending native
handle work, and reference the single-handle authority rule or its documented
issue. Do not modify the legacy projection.
crates/cmtraceopen-parser/src/sccm/client/admission.rs (1)

275-437: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Consider splitting admit_client_evidence into named phases.

The function performs eight distinct steps: bound checks, canonical reassessment, eligibility selection, group readiness, payload count reconciliation, per-payload decode and scan, evidence normalization, and sealing. Extracting select_eligible_fragments, compute_admitted_source_groups, and normalize_scanned_records would keep each fail-closed rule independently testable without changing behavior.

🤖 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/client/admission.rs` around lines 275 -
437, Refactor admit_client_evidence into named phases without changing behavior:
extract eligibility selection into select_eligible_fragments, source-group
readiness into compute_admitted_source_groups, and per-record normalization and
identity/retained-size validation into normalize_scanned_records. Keep the
existing bound checks, canonical assessment, payload reconciliation,
decoding/scanning, and integrity sealing flow, preserving all fail-closed errors
and validation limits.
crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs (1)

418-469: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the exact rejection reason in the admission tests that assert only is_err(). Admission distinguishes 24 error variants, and each one encodes a separate fail-closed rule. These three tests assert only that admission failed, so a change that swaps one rejection reason for another still passes. The neighbouring tests already compare against SccmClientEvidenceAdmissionError variants through the admission_error helper.

  • crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs#L418-L469: assert the variant for the capped, incomplete, unknown-profile, malformed-CCM, and invalid-offset cases.
  • crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs#L219-L253: assert MissingPayload, ExtraPayload, DuplicatePayload, and PayloadIntegrityMismatch for the four cases in order.
  • crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs#L439-L465: assert the variant that proves a non-CCM source never becomes eligible.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs` around lines
418 - 469, Strengthen the admission assertions by replacing bare is_err() checks
with admission_error comparisons against the precise
SccmClientEvidenceAdmissionError variant: in
crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs:418-469 cover
capped, incomplete, unknown-profile, malformed-CCM, and invalid-offset cases; in
crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs:219-253 assert
MissingPayload, ExtraPayload, DuplicatePayload, and PayloadIntegrityMismatch in
order; and in
crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs:439-465
assert the variant proving non-CCM sources are ineligible. Reuse the neighboring
admission_error helper and existing error variants.
crates/cmtraceopen-parser/src/sccm/client/intake.rs (1)

1530-1552: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low value

Share the SHA-256 validator

is_sha256_digest rejects uppercase hexadecimal values. Share this validator with admission to keep both paths aligned with the lowercase contract.

🤖 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/client/intake.rs` around lines 1530 -
1552, The SHA-256 validation in validate_content_binding must use the shared
admission validator so uppercase handling and the lowercase contract remain
consistent. Replace the local is_sha256_digest dependency with the existing
shared validator used by admission, preserving the current
invalid-content-binding error behavior.
crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs (1)

680-686: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Bind the fixture to EXPERIMENTAL_VERSION_PREFIX.

Make the private constant crate-visible, use it for configmgr_version_prefixes, and derive selected_configmgr_version from the same prefix. This keeps the test focused on the validated_artifact_families rule.

🤖 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/client/authority_contract_tests.rs` around
lines 680 - 686, Make the existing experimental version-prefix constant
crate-visible, then update the SccmExtractionProfile fixture in the
caller-constructed test to use EXPERIMENTAL_VERSION_PREFIX for
configmgr_version_prefixes and derive selected_configmgr_version from that same
prefix. Leave validated_artifact_families unchanged so the test remains focused
on that rule.
🤖 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/client/admission.rs`:
- Around line 530-540: Update assess_client_intake’s fragment filtering so
fragments with encoding: None or an unsupported encoding are excluded from both
eligible and admitted_source_groups before payload decoding. Preserve admission
of supported encodings and the existing local-gap behavior, and add a contract
test covering a missing-encoding fragment without aborting unrelated source
admission.

---

Nitpick comments:
In `@crates/cmtraceopen-parser/src/parser/ccm.rs`:
- Around line 402-421: Update observe_bounded_scans to inspect the existing
BOUNDED_SCAN_OBSERVATIONS state before installing a new Vec, so a nested call
fails without overwriting the outer observation buffer. Preserve the outer state
for cleanup and collection after the assertion.

In `@crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs`:
- Around line 418-469: Strengthen the admission assertions by replacing bare
is_err() checks with admission_error comparisons against the precise
SccmClientEvidenceAdmissionError variant: in
crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs:418-469 cover
capped, incomplete, unknown-profile, malformed-CCM, and invalid-offset cases; in
crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs:219-253 assert
MissingPayload, ExtraPayload, DuplicatePayload, and PayloadIntegrityMismatch in
order; and in
crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs:439-465
assert the variant proving non-CCM sources are ineligible. Reuse the neighboring
admission_error helper and existing error variants.

In `@crates/cmtraceopen-parser/src/sccm/client/admission.rs`:
- Around line 275-437: Refactor admit_client_evidence into named phases without
changing behavior: extract eligibility selection into select_eligible_fragments,
source-group readiness into compute_admitted_source_groups, and per-record
normalization and identity/retained-size validation into
normalize_scanned_records. Keep the existing bound checks, canonical assessment,
payload reconciliation, decoding/scanning, and integrity sealing flow,
preserving all fail-closed errors and validation limits.

In `@crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs`:
- Around line 680-686: Make the existing experimental version-prefix constant
crate-visible, then update the SccmExtractionProfile fixture in the
caller-constructed test to use EXPERIMENTAL_VERSION_PREFIX for
configmgr_version_prefixes and derive selected_configmgr_version from that same
prefix. Leave validated_artifact_families unchanged so the test remains focused
on that rule.

In `@crates/cmtraceopen-parser/src/sccm/client/intake.rs`:
- Around line 1530-1552: The SHA-256 validation in validate_content_binding must
use the shared admission validator so uppercase handling and the lowercase
contract remain consistent. Replace the local is_sha256_digest dependency with
the existing shared validator used by admission, preserving the current
invalid-content-binding error behavior.

In `@src-tauri/src/sccm/manifest.rs`:
- Around line 124-125: Add a short inline comment beside declared_byte_length
and content_sha256 in the native manifest projection explaining that these
fields are intentionally omitted pending native handle work, and reference the
single-handle authority rule or its documented issue. Do not modify the legacy
projection.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a8e9ac59-a76d-4294-a00c-9e17f313da22

📥 Commits

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

📒 Files selected for processing (12)
  • crates/cmtraceopen-parser/src/parser/ccm.rs
  • crates/cmtraceopen-parser/src/sccm/client/admission.rs
  • crates/cmtraceopen-parser/src/sccm/client/admission_tests.rs
  • crates/cmtraceopen-parser/src/sccm/client/authority_contract_tests.rs
  • crates/cmtraceopen-parser/src/sccm/client/intake.rs
  • crates/cmtraceopen-parser/src/sccm/client/mod.rs
  • crates/cmtraceopen-parser/src/sccm/keys.rs
  • crates/cmtraceopen-parser/tests/sccm_client_admission_authority.rs
  • crates/cmtraceopen-parser/tests/sccm_client_intake.rs
  • docs/sccm/preparation/issue-319-client-intake.md
  • src-tauri/src/sccm/manifest.rs
  • src-tauri/tests/sccm_client_manifest.rs

Comment thread crates/cmtraceopen-parser/src/sccm/client/admission.rs
@adamgell

adamgell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

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

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 9 minutes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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

@adamgell
adamgell marked this pull request as ready for review August 3, 2026 19:32
@adamgell
adamgell merged commit a185a68 into codex/parser-family-skeleton Aug 3, 2026
11 checks passed
adamgell added a commit that referenced this pull request Aug 4, 2026
Add the reviewed pure-Rust client evidence admission boundary with intake-owned content binding, bounded shared CCM framing, opaque sealed authority, family-bound extraction profiles, and source-local coverage gaps. Native same-handle capture binding and live Windows validation remain future gated work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature New feature parser Log parser related sccm SCCM/ConfigMgr related test Testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants