Skip to content

feat(sccm): preserve client intake capture gaps - #436

Merged
adamgell merged 3 commits into
codex/parser-family-skeletonfrom
codex/sccm-319-client-cap-gap-contract-r1
Aug 2, 2026
Merged

feat(sccm): preserve client intake capture gaps#436
adamgell merged 3 commits into
codex/parser-family-skeletonfrom
codex/sccm-319-client-cap-gap-contract-r1

Conversation

@adamgell

@adamgell adamgell commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Scope

Advances #319 with the additive pure-Rust SCCM client capture-gap contract required before the native adapter can represent omitted rotations without relabeling retained evidence.

  • adds a coverage-only SccmClientIntakeCaptureGap projection for Capped and ParseFailed omissions;
  • keeps physical artifacts and public LogEntry behavior unchanged;
  • preserves empty-field wire compatibility;
  • validates standalone, bundle, and assessment serialization/deserialization;
  • enforces one order-independent 4,096 declaration quota across bundle artifacts and gaps before unbounded typed allocation;
  • preserves deterministic coverage, source identity, rotation lineage, and collision behavior.

No Windows I/O, registry, WMI, Tauri, network, database, workflow reducer, native capture, or live-Windows claim is included. Raw CCM remains the shared grammar; no parser kind was added.

Test-first review history

RED cases reproduced during review/correction:

  • standalone unsafe gap state serialized successfully;
  • malformed declaration 4,097 won over the shared quota error;
  • bundle deserialization accepted a raw Windows artifact ID through JSON Value and text;
  • assessment deserialization materialized 4,097 gaps before late projection rejection.

The final exact head fd52c4ceb6bde211f26d3647eda010e8fe81d8c0 passed a separate detached-worktree adversarial review across standalone/bundle/assessment serde, field order, malformed-over-quota precedence, collision matrices, deterministic projection, and compatibility behavior.

Verification

  • client intake: 65 passed;
  • SCCM spine: 161 passed;
  • full locked parser suite: passed;
  • strict parser Clippy with all targets/features: passed;
  • Rust 1.88 wasm32 check: passed;
  • changed-file Rust 1.88 rustfmt, git diff --check, and git show --check: passed;
  • independent exact-head verdict: GO;
  • local CodeRabbit runs: no completed actionable finding payload.

Advisory retained for follow-up: malformed unknown capture-gap field/enum names can appear in Serde error strings. The top-level bundle behavior is inherited and no current non-test deserializer/IPC exporter was found, so this is not represented as evidence output or a live privacy failure. Re-evaluate before any caller exposes raw parser errors through IPC/UI.

Dependency and next merge order

Target is codex/parser-family-skeleton at ce774fd60c2d6e209a4bf69ea968865bf0d205f7. Native client work remains local/NO-GO and must restack on the resulting merge commit, map native gaps explicitly, enforce the same global quota, sanitize legacy errors, and pass fresh review plus Windows acceptance. Keep #319 open.

Summary by CodeRabbit

  • New Features

    • Added capture-gap reporting for missing, capped, or failed-to-parse artifacts.
    • Capture gaps now appear in coverage assessments, summaries, grouping, sorting, and validation.
    • Added provenance details to help distinguish related capture gaps safely.
    • Added coverage reasons and ordering specifically for capture gaps.
  • Bug Fixes

    • Improved artifact and capture-gap limit handling.
    • Preserved compatibility with existing intake data and validated boundary cases.

Copilot AI review requested due to automatic review settings August 2, 2026 08:56
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

SCCM client intake now supports coverage-only capture gaps. Bundles and assessments serialize, validate, group, sort, and aggregate these declarations. Tests cover wire compatibility, shared limits, collision detection, provenance, and deterministic ordering.

Changes

Capture-gap intake support

Layer / File(s) Summary
Capture-gap contract and wire handling
crates/cmtraceopen-parser/src/sccm/client/intake.rs
Adds SccmClientIntakeCaptureGap and optional capture_gaps fields. Bundle and assessment wire formats support bounded, optional captureGaps values.
Capture-gap validation and identity checks
crates/cmtraceopen-parser/src/sccm/client/intake.rs
Validates capture-gap identifiers, sources, rotations, paths, lineages, coverage states, quotas, duplicate IDs, and cross-declaration collisions.
Assessment projection and coverage aggregation
crates/cmtraceopen-parser/src/sccm/client/intake.rs
Assigns capture gaps to groups, includes them in canonical projections and coverage aggregation, emits capture-specific reasons, and applies deterministic ordering.
Capture-gap behavior coverage
crates/cmtraceopen-parser/tests/sccm_client_intake.rs
Adds tests for serialization, legacy compatibility, validation, limits, collisions, provenance, ordering, projection, and boundary behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SccmClientIntakeBundle
  participant IntakeWireFormat
  participant SccmClientIntakeAssessment
  participant CoverageAggregation
  SccmClientIntakeBundle->>IntakeWireFormat: serialize captureGaps
  IntakeWireFormat->>SccmClientIntakeBundle: bounded deserialization and validation
  SccmClientIntakeBundle->>SccmClientIntakeAssessment: construct canonical assessment
  SccmClientIntakeAssessment->>CoverageAggregation: group and aggregate capture gaps
  CoverageAggregation-->>SccmClientIntakeAssessment: sorted coverage-gap entries
Loading

Possibly related PRs

Suggested labels: test

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving SCCM client intake capture gaps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 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 enhancement New feature or request feature New feature parser Log parser related sccm SCCM/ConfigMgr related labels Aug 2, 2026
@adamgell

adamgell commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Please review exact head fd52c4ceb6bde211f26d3647eda010e8fe81d8c0, including public serde validation, the combined order-independent 4,096 declaration quota, malformed-over-quota precedence, privacy-safe identities, deterministic coverage projection, and wasm/pure-Rust boundaries.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

@adamgell: I will review exact head fd52c4ceb6bde211f26d3647eda010e8fe81d8c0 against the requested contract and boundary conditions.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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 contract to represent coverage-only omissions (capture gaps) for recognized client source rotations (specifically Capped and ParseFailed) without changing physical artifacts or public LogEntry behavior. It adds a new projection type and ensures wire compatibility (empty additive field omitted) while enforcing a single shared declaration quota across artifacts and capture gaps.

Changes:

  • Introduces SccmClientIntakeCaptureGap plus bundle/assessment support for additive captureGaps with shape validation.
  • Enforces a shared, order-independent MAX_SCCM_CLIENT_INTAKE_ARTIFACTS quota across artifacts + captureGaps during bundle deserialization and bundle validation.
  • Expands the test suite to cover capture-gap semantics, deterministic projection/ordering, compatibility (empty field omission), and quota/malformed precedence.

Reviewed changes

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

File Description
crates/cmtraceopen-parser/src/sccm/client/intake.rs Adds capture-gap type + serde/validation, bundle/assessment wire support, shared quota enforcement, and coverage projection updates.
crates/cmtraceopen-parser/tests/sccm_client_intake.rs Adds/updates tests for capture-gap behavior, serde round-trips, compatibility guarantees, and shared-quota boundary cases.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

357-464: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider one generic bounded-sequence seed instead of two copies.

BoundedCaptureGapsSeed/BoundedCaptureGapVisitor and BoundedArtifactsSeed/BoundedArtifactVisitor are identical apart from the element type and the expecting wording. A single generic seed keeps the quota semantics in one place, so a future fix to the size_hint pre-check or the IgnoredAny probe cannot land in only one copy.

The current logic is correct, including the exact-boundary case and the limit == 0 case.

♻️ Sketch of a generic bounded seed
struct BoundedSeqSeed<T> {
    limit: usize,
    label: &'static str,
    element: PhantomData<T>,
}

impl<'de, T: Deserialize<'de>> DeserializeSeed<'de> for BoundedSeqSeed<T> {
    type Value = Vec<T>;

    fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
    where
        D: Deserializer<'de>,
    {
        deserializer.deserialize_seq(BoundedSeqVisitor {
            limit: self.limit,
            label: self.label,
            element: PhantomData,
        })
    }
}

Call sites then read BoundedSeqSeed::<SccmClientIntakeCaptureGap>::new(remaining, "SCCM client capture gaps").

🤖 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 357 - 464,
Replace the duplicated BoundedCaptureGapsSeed/BoundedCaptureGapVisitor and
BoundedArtifactsSeed/BoundedArtifactVisitor implementations with one generic
BoundedSeqSeed and visitor parameterized by the element type and description
label. Reuse the shared size_hint check, bounded collection, and IgnoredAny
overflow probe, while preserving the existing exact-boundary and limit == 0
behavior; update both call sites to pass the appropriate element type, remaining
limit, and expecting label.
🤖 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/client/intake.rs`:
- Around line 357-464: Replace the duplicated
BoundedCaptureGapsSeed/BoundedCaptureGapVisitor and
BoundedArtifactsSeed/BoundedArtifactVisitor implementations with one generic
BoundedSeqSeed and visitor parameterized by the element type and description
label. Reuse the shared size_hint check, bounded collection, and IgnoredAny
overflow probe, while preserving the existing exact-boundary and limit == 0
behavior; update both call sites to pass the appropriate element type, remaining
limit, and expecting label.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 562b304f-5a19-4ef4-89b0-f532178f5fa0

📥 Commits

Reviewing files that changed from the base of the PR and between ce774fd and fd52c4c.

📒 Files selected for processing (2)
  • crates/cmtraceopen-parser/src/sccm/client/intake.rs
  • crates/cmtraceopen-parser/tests/sccm_client_intake.rs

@adamgell
adamgell merged commit 26a9a5e into codex/parser-family-skeleton Aug 2, 2026
12 checks passed
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