Skip to content

feat(sccm): add bounded database export coverage contract - #499

Merged
adamgell merged 9 commits into
mainfrom
codex/sccm-sql-supplement-contract
Aug 5, 2026
Merged

adamgell merged 9 commits into
mainfrom
codex/sccm-sql-supplement-contract

Conversation

@adamgell

@adamgell adamgell commented Aug 5, 2026 •

Copy link
Copy Markdown
Owner

Closes #480.

Adds the explicit schema-v1 operator-supplied SCCM site-database export contract as coverage-only. The validator enforces recursive duplicate rejection, a 1 MiB and one-snapshot boundary, authorization and provenance consistency, privacy-safe opaque handles and aggregate counts, deterministic canonical SHA-256 integrity, strict missing-versus-null semantics, and non-sensitive public output.

The SQL card remains deferred and CAPTURE-MORE. This change adds no database access, SQL, credentials, discovery fallback, reducer, findings, semantic evidence, Windows collection, or compatibility alias. The obsolete generic database intake placeholder is removed.

Independent critic verdict: ACCEPT at 275b03e.

Local gates: focused contract, intake and catalog suites; full parser; strict Clippy; wasm32; scoped rustfmt; diff and public-boundary scans.

Summary by CodeRabbit

  • New Features

    • Added validation for SCCM site database export submissions.
    • Supports captured, partial, and access-denied coverage outcomes with coverage-only results.
    • Added schema and contract documentation for the export format.
  • Bug Fixes

    • Rejects malformed, oversized, duplicate-key, unknown-field, unauthorized, and integrity-mismatched submissions.
    • Synthetic database artifacts are no longer accepted during server intake.
  • Tests

    • Added comprehensive coverage for valid, invalid, duplicate, malformed, and unsupported export scenarios.

@github-actions github-actions Bot added enhancement New feature or request feature New feature parser Log parser related sccm SCCM/ConfigMgr related labels Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a bounded SCCM site-database export assessment API with strict JSON, schema, state, privacy, and integrity validation. Extracts duplicate-preserving JSON parsing for server intake. Adds fixtures, tests, documentation, and deferred source-card updates.

Changes

SCCM export contract

Layer / File(s) Summary
Shared duplicate-preserving JSON preflight
crates/cmtraceopen-parser/src/sccm/json_contract.rs, crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs
Adds preserved JSON parsing and recursive duplicate-key detection. Server intake uses the shared parser and removes synthetic database-export allowlists.
Site-database export assessment
crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs, crates/cmtraceopen-parser/src/sccm/server/windows/mod.rs, docs/sccm/contracts/*
Adds the public coverage-only assessment API. Validation covers bounded input, schema fields, authorization, provenance, snapshot state, timestamps, opaque handles, unknown fields, and SHA-256 integrity.
Fixtures and contract validation
crates/cmtraceopen-parser/tests/sccm_site_database_export_contract.rs, crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/*
Adds captured, denied, partial, malformed, duplicate, oversized, and unknown-version scenarios. Tests validate output serialization and rejection paths.
Source-card and intake alignment
crates/cmtraceopen-parser/tests/sccm_server_advanced_roles_catalog.rs, crates/cmtraceopen-parser/tests/sccm_server_intake.rs, docs/sccm/source-catalog/advanced-roles.md
Keeps the SQL database export card deferred and removes obsolete generic unsupported-database fixtures and assertions.
Implementation plan
docs/superpowers/plans/2026-08-04-sccm-480-sql-database-supplement-contract.md
Documents the contract rules, fixture matrix, validation tests, and verification scope.

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

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant assess_sccm_site_database_export
  participant parse_preserved_json
  participant IntegrityValidator
  Caller->>assess_sccm_site_database_export: Submit bounded JSON bytes
  assess_sccm_site_database_export->>parse_preserved_json: Parse and detect duplicate keys
  assess_sccm_site_database_export->>IntegrityValidator: Validate canonical SHA-256 digest
  IntegrityValidator-->>Caller: Return coverage-only assessment or contract error
Loading

Possibly related issues

  • Issue 481: It covers the same versioned, authorized site-database supplement contract and duplicate-key validation.

Possibly related PRs

Suggested labels: test

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately describes the SCCM database export coverage contract.
Linked Issues check ✅ Passed The PR implements the bounded, authorized, privacy-safe SCCM export contract and covers the linked issue requirements in [#480].
Out of Scope Changes check ✅ Passed The changes remain within the linked objective and preserve the stated non-goals, including no live database access or SQL execution.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/sccm-sql-supplement-contract

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

@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: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs`:
- Around line 16-103: Add rustdoc to every newly public item in the site
database export module: MAX_SCCM_SITE_DATABASE_EXPORT_BYTES,
SccmSiteDatabaseExportError and each variant, both public enums and their
variants, SccmSiteDatabaseExportCoverage, SccmSiteDatabaseExportAssessment, and
all accessor methods. Document the semver-relevant guarantees, including the
one-megabyte byte limit and that the evidence disposition is coverage-only,
while preserving existing signatures and behavior.
- Around line 269-277: Update opaque_handle to delegate digest validation to the
existing lowercase_hex_digest helper after stripping the prefix, while
preserving the required 64-character length check. Remove the duplicated
lowercase-hex byte predicates and keep opaque_handle’s boolean result unchanged
for valid and invalid handles.
- Around line 349-357: Document the purpose of WireSnapshotMember, stating that
the wrapper makes WireEnvelope.snapshot required while still permitting an
explicit null value. Clarify that replacing it with a bare Option<WireSnapshot>
would let Serde treat a missing field as None and remove this type-level
contract guard.
- Around line 159-165: Replace the string-based classification in map_wire_error
with schema-aware unknown-field detection. Define recursive allowlist checks for
every strict object, using object_fields only for each object’s immediate
fields, and run these checks before deserialization so unknown fields
consistently map to UnexpectedField; retain MalformedDocument for other parsing
errors.

In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/duplicate/export.json`:
- Line 1: Extend the duplicate-key fixture to include a duplicate key nested
within the authorization object, and update its test assertions to expect
DuplicateJsonKey for recursive detection. Also verify the fixture directory is
excluded from Biome’s lint configuration so the intentionally invalid JSON
remains exempt from noDuplicateObjectKeys checks.

In `@crates/cmtraceopen-parser/tests/sccm_site_database_export_contract.rs`:
- Around line 122-212: Split rejects_or_preserves_only_coverage_for_failed_gates
into focused tests, each covering one contract behavior so failures identify the
violated rule. Add mutation cases asserting InvalidOpaqueHandle,
InvalidTimestamp, InvalidSummaryCount, ContractViolation,
AuthorizationContractViolation, and ProvenanceContractViolation, using the
described field/value mutations. Add oracle comparisons for the denied and
partial fixtures alongside the existing captured projection check, reading their
expected files.

In `@docs/sccm/contracts/sccm-site-database-export-v1.md`:
- Line 26: Update the digest-material specification to define the canonical JSON
bytes directly: UTF-8 encoding, no insignificant whitespace, object keys emitted
in the listed order rather than sorted, and only JSON-required escaping without
escaping non-ASCII characters. Retain `serde_json::to_vec` solely as a validator
implementation note, not as the sender-facing byte specification.

In `@docs/sccm/contracts/sccm-site-database-export-v1.schema.json`:
- Around line 18-22: Add a required captureState property to the if subschema in
each allOf conditional branch, while preserving the existing const checks for
captured, partial, and accessDenied. Do not modify the corresponding then
branches.
🪄 Autofix

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b68770a1-0db6-416e-ba98-a1e66e3f0e89

📥 Commits

Reviewing files that changed from the base of the PR and between 1c5eac3 and 275b03e.

📒 Files selected for processing (26)
  • crates/cmtraceopen-parser/src/sccm/json_contract.rs
  • crates/cmtraceopen-parser/src/sccm/mod.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/mod.rs
  • crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/advanced_roles/source-cards/sql-database-export.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/unsupported-db-supplement/expected.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/unsupported-db-supplement/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/captured/expected.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/captured/export.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/denied/expected.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/denied/export.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/duplicate/export.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/malformed/export.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/oversized/export.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/partial/expected.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/partial/export.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/unknown-version/export.json
  • crates/cmtraceopen-parser/tests/sccm_server_advanced_roles_catalog.rs
  • crates/cmtraceopen-parser/tests/sccm_server_intake.rs
  • crates/cmtraceopen-parser/tests/sccm_server_intake_fixture_contract.rs
  • crates/cmtraceopen-parser/tests/sccm_site_database_export_contract.rs
  • docs/sccm/contracts/sccm-site-database-export-v1.md
  • docs/sccm/contracts/sccm-site-database-export-v1.schema.json
  • docs/sccm/source-catalog/advanced-roles.md
  • docs/superpowers/plans/2026-08-04-sccm-480-sql-database-supplement-contract.md
💤 Files with no reviewable changes (2)
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/unsupported-db-supplement/expected.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/server/intake/unsupported-db-supplement/manifest.json

Comment on lines +16 to +103
pub const MAX_SCCM_SITE_DATABASE_EXPORT_BYTES: usize = 1_048_576;

const CONTRACT_ID: &str = "sccm-site-database-export";
const EXPORT_PROFILE_ID: &str = "sccm-site-database-export-v1";
const AUTHORIZATION_ID_PREFIX: &str = "cmtraceopen.sccm.dbexport.authorization.sha256.v1:";
const AUTHORIZER_HANDLE_PREFIX: &str = "cmtraceopen.operator.sha256.v1:";
const SITE_HANDLE_PREFIX: &str = "cmtraceopen.site.sha256.v1:";
const DATABASE_HANDLE_PREFIX: &str = "cmtraceopen.database.sha256.v1:";
const EXPORTER_HOST_HANDLE_PREFIX: &str = "cmtraceopen.host.sha256.v1:";
const SNAPSHOT_ID_PREFIX: &str = "cmtraceopen.sccm.dbexport.snapshot.sha256.v1:";
const MAX_SUMMARY_COUNT: u64 = 1_000_000_000;

#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum SccmSiteDatabaseExportError {
#[error("site-database export input exceeds the contract limit")]
InputLimitExceeded,
#[error("site-database export is not a valid JSON document")]
MalformedDocument,
#[error("site-database export contains a duplicate JSON key")]
DuplicateJsonKey,
#[error("site-database export schema version {found} is unsupported")]
UnsupportedSchemaVersion { found: u32 },
#[error("site-database export contains an unexpected field")]
UnexpectedField,
#[error("site-database export does not satisfy the fixed contract literals")]
ContractViolation,
#[error("site-database export authorization is invalid or inconsistent")]
AuthorizationContractViolation,
#[error("site-database export provenance is invalid or inconsistent")]
ProvenanceContractViolation,
#[error("site-database export snapshot is invalid or inconsistent")]
SnapshotContractViolation,
#[error("site-database export contains an invalid opaque handle")]
InvalidOpaqueHandle,
#[error("site-database export contains an invalid timestamp")]
InvalidTimestamp,
#[error("site-database export contains an out-of-range aggregate count")]
InvalidSummaryCount,
#[error("site-database export integrity digest does not match")]
IntegrityMismatch,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum SccmSiteDatabaseExportCoverageState {
Captured,
Partial,
AccessDenied,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum SccmSiteDatabaseExportEvidenceDisposition {
CoverageOnly,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SccmSiteDatabaseExportCoverage {
state: SccmSiteDatabaseExportCoverageState,
gate_code: SccmSiteDatabaseExportCoverageState,
}

impl SccmSiteDatabaseExportCoverage {
pub fn state(&self) -> SccmSiteDatabaseExportCoverageState {
self.state
}
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SccmSiteDatabaseExportAssessment {
contract_id: &'static str,
schema_version: u32,
coverage: SccmSiteDatabaseExportCoverage,
#[serde(rename = "disposition")]
evidence_disposition: SccmSiteDatabaseExportEvidenceDisposition,
}

impl SccmSiteDatabaseExportAssessment {
pub fn coverage(&self) -> &SccmSiteDatabaseExportCoverage {
&self.coverage
}

pub fn evidence_disposition(&self) -> SccmSiteDatabaseExportEvidenceDisposition {
self.evidence_disposition
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Document the new public items.

MAX_SCCM_SITE_DATABASE_EXPORT_BYTES, SccmSiteDatabaseExportError and its variants, SccmSiteDatabaseExportCoverageState, SccmSiteDatabaseExportEvidenceDisposition, SccmSiteDatabaseExportCoverage, SccmSiteDatabaseExportAssessment, and the accessor methods are re-exported through pub use site_database_export::*; in crates/cmtraceopen-parser/src/sccm/server/windows/mod.rs. They become part of the published crate surface. Only assess_sccm_site_database_export carries rustdoc. Add rustdoc to each new public item, and state the semver-relevant guarantees such as the byte limit and the coverage-only disposition.

As per path instructions: "Published library crate (cmtraceopen-parser). Treat every public item as a semver commitment: flag breaking changes to public types, signatures, or enum variants, and check that new public items are documented."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs`
around lines 16 - 103, Add rustdoc to every newly public item in the site
database export module: MAX_SCCM_SITE_DATABASE_EXPORT_BYTES,
SccmSiteDatabaseExportError and each variant, both public enums and their
variants, SccmSiteDatabaseExportCoverage, SccmSiteDatabaseExportAssessment, and
all accessor methods. Document the semver-relevant guarantees, including the
one-megabyte byte limit and that the evidence disposition is coverage-only,
while preserving existing signatures and behavior.

Source: Path instructions

Comment on lines +159 to +165
fn map_wire_error(error: serde_json::Error) -> SccmSiteDatabaseExportError {
if error.to_string().starts_with("unknown field") {
SccmSiteDatabaseExportError::UnexpectedField
} else {
SccmSiteDatabaseExportError::MalformedDocument
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Inspect the shared preflight helpers to confirm an allowlist check is feasible, and find other message-text error classification.
set -euo pipefail

fd -t f 'json_contract.rs' crates | xargs -r cat -n

# Other places that classify serde errors by message text.
rg -nP -C3 'to_string\(\)\s*\.\s*(starts_with|contains)\("unknown field' crates

Repository: adamgell/cmtraceopen

Length of output: 6379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs"
printf '%s\n' '--- target file outline ---'
ast-grep outline "$file" --lang rust
printf '%s\n' '--- target implementation ---'
sed -n '1,230p' "$file"
printf '%s\n' '--- related field and error definitions/usages ---'
rg -n -C4 'SccmSiteDatabaseExportError|UnexpectedField|object_fields|parse_preserved_json|deny_unknown_fields|Deserialize' crates/cmtraceopen-parser/src/sccm/server/windows crates/cmtraceopen-parser/src

Repository: adamgell/cmtraceopen

Length of output: 50377


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs"

printf '%s\n' '--- parser entry and error mapping ---'
sed -n '1,180p' "$file"

printf '%s\n' '--- wire type declarations ---'
sed -n '320,430p' "$file"

printf '%s\n' '--- public error definition and parser call sites ---'
rg -n -C8 'pub enum SccmSiteDatabaseExportError|from_json|map_wire_error|parse_preserved_json|reject_duplicate_object_keys' \
  crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs \
  crates/cmtraceopen-parser/src/sccm/server/windows

Repository: adamgell/cmtraceopen

Length of output: 34948


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- dependency versions ---'
rg -n -C2 '^(name|version) = "(serde|serde_json)"' Cargo.lock
rg -n -C3 'serde(_json)?' Cargo.toml crates/*/Cargo.toml

printf '%s\n' '--- relevant tests ---'
rg -n -C12 'UnexpectedField|unknown field|MalformedDocument|deny_unknown_fields' \
  crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs

printf '%s\n' '--- preflight helper callers ---'
rg -n -C5 'object_fields\(|field\(' crates/cmtraceopen-parser/src/sccm

Repository: adamgell/cmtraceopen

Length of output: 36446


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path

helper = Path("crates/cmtraceopen-parser/src/sccm/json_contract.rs").read_text()
target = Path("crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs").read_text()

assert "pub(crate) fn object_fields" in helper
assert "let PreservedJsonValue::Object(fields) = value else" in helper
assert "Some(fields)" in helper
assert target.count("deny_unknown_fields") == 6
assert 'error.to_string().starts_with("unknown field")' in target

print("object_fields returns only the matched object's immediate field slice")
print("site_database_export.rs contains six nested deny_unknown_fields structs")
print("map_wire_error depends on serde_json::Error display text")
PY

printf '%s\n' '--- cached serde_json error construction, if available ---'
find "${CARGO_HOME:-$HOME/.cargo}/registry/src" -type f -path '*/serde_json-*/src/error.rs' \
  -print 2>/dev/null | head -n 5 | while read -r file; do
    printf '%s\n' "--- $file ---"
    rg -n -C3 'unknown field|impl fmt::Display|classify\(' "$file"
  done

Repository: adamgell/cmtraceopen

Length of output: 416


Replace the error-message classifier with a schema-aware discriminator.

map_wire_error depends on serde_json::Error::to_string(), so a dependency update can map unknown fields to MalformedDocument instead of the public UnexpectedField variant. object_fields returns only immediate fields, not a recursive allowlist. Add recursive checks for each strict object before deserialization.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs`
around lines 159 - 165, Replace the string-based classification in
map_wire_error with schema-aware unknown-field detection. Define recursive
allowlist checks for every strict object, using object_fields only for each
object’s immediate fields, and run these checks before deserialization so
unknown fields consistently map to UnexpectedField; retain MalformedDocument for
other parsing errors.

Source: Path instructions

Comment on lines +269 to +277
fn opaque_handle(value: &str, prefix: &str) -> bool {
value.strip_prefix(prefix).is_some_and(|digest| {
digest.len() == 64
&& digest
.bytes()
.all(|byte| byte.is_ascii_lowercase() || byte.is_ascii_digit())
&& digest.bytes().all(|byte| byte.is_ascii_hexdigit())
})
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Deduplicate the lowercase-hex predicate.

opaque_handle validates the 64-char digest with two passes over the bytes, and lowercase_hex_digest at Lines 315-320 validates the identical predicate with a different single-pass expression. Two implementations of one security-relevant rule will drift. Call lowercase_hex_digest from opaque_handle.

♻️ Proposed refactor
 fn opaque_handle(value: &str, prefix: &str) -> bool {
-    value.strip_prefix(prefix).is_some_and(|digest| {
-        digest.len() == 64
-            && digest
-                .bytes()
-                .all(|byte| byte.is_ascii_lowercase() || byte.is_ascii_digit())
-            && digest.bytes().all(|byte| byte.is_ascii_hexdigit())
-    })
+    value.strip_prefix(prefix).is_some_and(lowercase_hex_digest)
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fn opaque_handle(value: &str, prefix: &str) -> bool {
value.strip_prefix(prefix).is_some_and(|digest| {
digest.len() == 64
&& digest
.bytes()
.all(|byte| byte.is_ascii_lowercase() || byte.is_ascii_digit())
&& digest.bytes().all(|byte| byte.is_ascii_hexdigit())
})
}
fn opaque_handle(value: &str, prefix: &str) -> bool {
value.strip_prefix(prefix).is_some_and(lowercase_hex_digest)
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs`
around lines 269 - 277, Update opaque_handle to delegate digest validation to
the existing lowercase_hex_digest helper after stripping the prefix, while
preserving the required 64-character length check. Remove the duplicated
lowercase-hex byte predicates and keep opaque_handle’s boolean result unchanged
for valid and invalid handles.

Comment on lines +349 to +357
#[derive(Deserialize)]
#[serde(transparent)]
struct WireSnapshotMember(Option<WireSnapshot>);

impl WireSnapshotMember {
fn as_ref(&self) -> Option<&WireSnapshot> {
self.0.as_ref()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does serde treat a struct field of type Option<T> as optional and default to None when the field is missing during deserialization?

💡 Result:

Yes, Serde treats a struct field of type Option as optional by default, and if the field is missing during deserialization, it will be set to None [1][2][3]. This behavior is built into Serde's deserialization logic for Option types [4][2]. Because Option::None is a standard way to represent the absence of a value, Serde automatically resolves a missing field to None without requiring additional attributes [3]. Consequently, applying the #[serde(default)] attribute to an Option field is redundant, as it performs the same action as the default behavior [2][3]. It is important to note that this implicit behavior can be overridden if you use certain attributes like #[serde(deserialize_with = "...")] [1][5]. When a custom deserialization function is provided, Serde may no longer treat the missing field as an Option-specific "none" and may instead throw a "missing field" error, unless #[serde(default)] is explicitly added to handle the missing case [1][5].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
file="crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs"
printf '%s\n' '--- target implementation ---'
sed -n '110,145p;320,370p' "$file"
printf '%s\n' '--- related type and field references ---'
rg -n -C 3 'WireSnapshotMember|snapshot:|SnapshotContractViolation' "$file"
printf '%s\n' '--- contract reference ---'
fd -i 'sccm-site-database-export-v1.md' .

Repository: adamgell/cmtraceopen

Length of output: 5722


🏁 Script executed:

#!/bin/bash
set -eu
contract="docs/sccm/contracts/sccm-site-database-export-v1.md"
printf '%s\n' '--- contract requirements ---'
cat -n "$contract" | sed -n '1,20p'
printf '%s\n' '--- serde documentation search in repository ---'
rg -n -i 'required|missing field|Option<|snapshot' "$contract" crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs

Repository: adamgell/cmtraceopen

Length of output: 6501


🌐 Web query:

Serde derive newtype wrapper around Option field missing struct field required transparent deserialize

💡 Result:

In Serde, you can create a newtype wrapper around an Option field that behaves as though it were transparent—meaning it serializes and deserializes the inner value directly rather than as a wrapper—by using the #[serde(transparent)] attribute [1][2]. When you need to handle potential missing struct fields for this wrapper, particularly if you want to default to None when a field is missing, you should combine #[serde(transparent)] with #[serde(default)] [3]. Here is the standard pattern for a newtype wrapper that handles an Option field transparently: #[derive(Serialize, Deserialize)] #[serde(transparent)] pub struct MyWrapper(#[serde(default)] pub Option); Key considerations: 1. #[serde(transparent)]: This attribute is essential. It tells Serde to treat the newtype struct as if it were just the inner type during serialization and deserialization [1][2]. It is analogous to #[repr(transparent)] [1]. 2. Handling Missing Fields: When using #[serde(default)] on a field, Serde will use the default value of that field's type if the key is missing from the input [3]. For Option, the default value is None [4]. 3. Custom Serialization/Deserialization: If you need more complex behavior (e.g., if you are wrapping a type that does not implement Serialize/Deserialize or if you need custom logic), you can use #[serde(with = "path")] or separate #[serde(serialize_with = "...")] and #[serde(deserialize_with = "...")] attributes on the inner field [5]. If you encounter errors regarding missing fields in a larger struct, ensure that the field containing your wrapper is marked with #[serde(default)] if you want it to be optional in your input data [3]. Without this, Serde will require the field to be present during deserialization [3].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re

source = Path("crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs").read_text()
contract = Path("docs/sccm/contracts/sccm-site-database-export-v1.md").read_text()

assert re.search(
    r"struct WireEnvelope\s*\{.*?snapshot:\s*WireSnapshotMember,",
    source,
    re.S,
)
assert re.search(
    r'#\[serde\(transparent\)\]\s*struct WireSnapshotMember\(Option<WireSnapshot>\);',
    source,
)
assert 'if field(root, "snapshot").is_none()' in source
assert "- Accept one `snapshot` object" in contract
assert "accessDenied requires `snapshot: null`" in contract

print("WireSnapshotMember preserves a required envelope member while accepting null.")
print("The contract requires snapshot presence, including null for accessDenied.")
PY

Repository: adamgell/cmtraceopen

Length of output: 247


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re

source = Path("crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs").read_text()
contract = Path("docs/sccm/contracts/sccm-site-database-export-v1.md").read_text()

checks = {
    "envelope field uses wrapper": re.search(
        r"struct WireEnvelope\s*\{.*?\bsnapshot:\s*WireSnapshotMember\s*,",
        source,
        re.S,
    ),
    "wrapper is transparent over Option": re.search(
        r"#\[serde\(transparent\)\]\s*struct WireSnapshotMember\s*\(\s*Option<WireSnapshot>\s*\)\s*;",
        source,
        re.S,
    ),
    "preflight requires snapshot member": 'if field(root, "snapshot").is_none()' in source,
    "contract requires snapshot": "Accept one `snapshot` object" in contract,
    "contract permits null for accessDenied": "accessDenied requires `snapshot: null`" in contract,
}

for name, passed in checks.items():
    print(f"{'PASS' if passed else 'FAIL'}: {name}")
assert all(checks.values())
PY

Repository: adamgell/cmtraceopen

Length of output: 441


🏁 Script executed:

#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re

source = Path("crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs").read_text()
contract = Path("docs/sccm/contracts/sccm-site-database-export-v1.md").read_text()

checks = {
    "envelope field uses wrapper": re.search(
        r"struct WireEnvelope\s*\{.*?\bsnapshot:\s*WireSnapshotMember\s*,",
        source,
        re.S,
    ),
    "wrapper is transparent over Option": re.search(
        r"#\[serde\(transparent\)\]\s*struct WireSnapshotMember\s*\(\s*Option<WireSnapshot>\s*\)\s*;",
        source,
        re.S,
    ),
    "preflight requires snapshot member": 'if field(root, "snapshot").is_none()' in source,
    "contract requires snapshot": "Accept one `snapshot` object" in contract,
    "contract permits null for accessDenied":
        "`accessDenied` requires `snapshot: null`" in contract,
}

for name, passed in checks.items():
    print(f"{'PASS' if passed else 'FAIL'}: {name}")
assert all(checks.values())
PY

Repository: adamgell/cmtraceopen

Length of output: 352


Document the required-field wrapper.

Explain that WireSnapshotMember makes WireEnvelope.snapshot required while still allowing snapshot: null. A bare Option<WireSnapshot> would default a missing field to None in Serde and remove this type-level contract guard.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/sccm/server/windows/site_database_export.rs`
around lines 349 - 357, Document the purpose of WireSnapshotMember, stating that
the wrapper makes WireEnvelope.snapshot required while still permitting an
explicit null value. Clarify that replacing it with a bare Option<WireSnapshot>
would let Serde treat a missing field as None and remove this type-level
contract guard.

@@ -0,0 +1 @@
{"authorizationId":"first","authorizationId":"second"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

The duplicate fixture does not cover the recursive case.

The duplicate key sits at the root object. docs/sccm/contracts/sccm-site-database-export-v1.md Line 10 states "Reject duplicate keys recursively", and the PR objective states recursive duplicate rejection. No fixture places a duplicate key inside authorization, provenance, snapshot, or summary, so reject_duplicate_object_keys is only exercised at depth 0. A regression that stops recursing would keep this test green.

Add a nested-duplicate fixture, for example a second "scope" key inside authorization, and assert DuplicateJsonKey.

Separately, Biome reports lint/suspicious/noDuplicateObjectKeys on this file. Confirm the fixture tree is excluded from the linter so a deliberately invalid fixture does not fail the lint job.

🧰 Tools
🪛 Biome (2.5.6)

[error] 1-1: The key authorizationId was already declared.

(lint/suspicious/noDuplicateObjectKeys)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_database_export/v1/duplicate/export.json`
at line 1, Extend the duplicate-key fixture to include a duplicate key nested
within the authorization object, and update its test assertions to expect
DuplicateJsonKey for recursive detection. Also verify the fixture directory is
excluded from Biome’s lint configuration so the intentionally invalid JSON
remains exempt from noDuplicateObjectKeys checks.

Source: Linters/SAST tools

Comment on lines +29 to +38
fn assert_no_raw_identifier_markers(bytes: &[u8]) {
let document = String::from_utf8_lossy(bytes).to_ascii_lowercase();
for marker in FORBIDDEN_RAW_MARKERS {
assert!(
!document.contains(marker),
"fixture must not contain raw sensitive marker {marker}"
);
}
assert!(!document.contains("sitecode"));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Fold "sitecode" into FORBIDDEN_RAW_MARKERS.

Line 37 checks one marker outside the loop with a bare assert. It loses the fixture must not contain raw sensitive marker {marker} diagnostic that every other marker gets, and it hides sitecode from the declared marker list.

♻️ Proposed change
-const FORBIDDEN_RAW_MARKERS: [&str; 10] = [
+const FORBIDDEN_RAW_MARKERS: [&str; 11] = [
     "select ",
     "from ",
     "password",
     "connectionstring",
     "server=",
     "uid=",
     "resourceid",
     "deviceid",
     "username",
     "packageid",
+    "sitecode",
 ];
     for marker in FORBIDDEN_RAW_MARKERS {
         assert!(
             !document.contains(marker),
             "fixture must not contain raw sensitive marker {marker}"
         );
     }
-    assert!(!document.contains("sitecode"));
 }

Comment on lines +122 to +212
#[test]
fn rejects_or_preserves_only_coverage_for_failed_gates() {
let partial = assess_sccm_site_database_export(&fixture_bytes("partial"))
.expect("partial export remains a coverage result");
assert_eq!(
partial.coverage().state(),
SccmSiteDatabaseExportCoverageState::Partial
);
assert_eq!(
partial.evidence_disposition(),
SccmSiteDatabaseExportEvidenceDisposition::CoverageOnly
);

let denied = assess_sccm_site_database_export(&fixture_bytes("denied"))
.expect("denied export remains a coverage result");
assert_eq!(
denied.coverage().state(),
SccmSiteDatabaseExportCoverageState::AccessDenied
);
assert_eq!(
denied.evidence_disposition(),
SccmSiteDatabaseExportEvidenceDisposition::CoverageOnly
);

let mut denied_without_snapshot = fixture_value("denied");
denied_without_snapshot
.as_object_mut()
.expect("denied fixture root is an object")
.remove("snapshot");
assert_eq!(
assess_sccm_site_database_export(
&serde_json::to_vec(&denied_without_snapshot).expect("mutation serializes")
),
Err(SccmSiteDatabaseExportError::SnapshotContractViolation),
"an access-denied envelope must contain an explicit null snapshot member"
);

assert_eq!(
assess_sccm_site_database_export(&fixture_bytes("malformed")),
Err(SccmSiteDatabaseExportError::MalformedDocument)
);
assert_eq!(
assess_sccm_site_database_export(&fixture_bytes("unknown-version")),
Err(SccmSiteDatabaseExportError::UnsupportedSchemaVersion { found: 2 })
);
assert_eq!(
assess_sccm_site_database_export(&fixture_bytes("duplicate")),
Err(SccmSiteDatabaseExportError::DuplicateJsonKey)
);
assert_eq!(
assess_sccm_site_database_export(&fixture_bytes("oversized")),
Err(SccmSiteDatabaseExportError::InputLimitExceeded)
);

let mut bad_integrity = fixture_value("captured");
bad_integrity["integrity"]["canonicalPayloadSha256"] = Value::String("0".repeat(64));
assert_eq!(
assess_sccm_site_database_export(
&serde_json::to_vec(&bad_integrity).expect("mutation serializes")
),
Err(SccmSiteDatabaseExportError::IntegrityMismatch)
);

for field in [
"queryText",
"databaseName",
"deviceId",
"packageId",
"userName",
"siteCode",
] {
let mut document = fixture_value("captured");
document[field] = Value::String("not-admitted".to_owned());
assert_eq!(
assess_sccm_site_database_export(
&serde_json::to_vec(&document).expect("mutation serializes")
),
Err(SccmSiteDatabaseExportError::UnexpectedField),
"{field} must not be admitted"
);
}

let mut second_snapshot = fixture_value("captured");
second_snapshot["snapshots"] = Value::Array(vec![second_snapshot["snapshot"].clone()]);
assert_eq!(
assess_sccm_site_database_export(
&serde_json::to_vec(&second_snapshot).expect("mutation serializes")
),
Err(SccmSiteDatabaseExportError::SnapshotContractViolation)
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Close the contract coverage gaps and split this test.

Three problems in one function.

First, six of the thirteen public SccmSiteDatabaseExportError variants are never asserted anywhere in this suite: InvalidOpaqueHandle, InvalidTimestamp, InvalidSummaryCount, ContractViolation, AuthorizationContractViolation, and ProvenanceContractViolation. Each is a semver-committed variant and each guards a distinct privacy or consistency rule. Add mutation cases, for example an uppercase digest in siteHandle, a timestamp without Z, a count above 1_000_000_000, a captureState of captured paired with decision: "denied", and an exportCompletedUtc earlier than exportStartedUtc.

Second, denied/expected.json and partial/expected.json are committed but never read. Only the captured oracle is compared at Lines 88-95. The denied and partial public projections can drift undetected. Assert them against their oracles the same way.

Third, this one #[test] asserts eleven independent behaviors. The first failure hides every later assertion. Split it per behavior so a regression report names the broken 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/tests/sccm_site_database_export_contract.rs` around
lines 122 - 212, Split rejects_or_preserves_only_coverage_for_failed_gates into
focused tests, each covering one contract behavior so failures identify the
violated rule. Add mutation cases asserting InvalidOpaqueHandle,
InvalidTimestamp, InvalidSummaryCount, ContractViolation,
AuthorizationContractViolation, and ProvenanceContractViolation, using the
described field/value mutations. Add oracle comparisons for the denied and
partial fixtures alongside the existing captured projection check, reading their
expected files.

Source: Path instructions


## Integrity binding

The sender computes SHA-256 over `serde_json::to_vec` of an object with these fields, in exactly this order: `schemaVersion`, `contractId`, `intent`, `captureState`, `authorization`, `provenance`, `snapshot`. The `integrity` object is excluded from the material. The digest is lowercase hexadecimal. The validator compares the public integrity digests using ordinary deterministic byte equality after syntax validation; this digest is an integrity value, not a secret.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Specify the canonical bytes, not a Rust function.

The contract defines the digest material as serde_json::to_vec output. Operators produce these exports with PowerShell, Python, or C#, and none of those can call serde_json::to_vec. A sender that emits pretty-printed JSON, sorts the keys, or escapes non-ASCII as \uXXXX computes a different digest and every submission fails with IntegrityMismatch.

State the byte rules the sender must reproduce: UTF-8 output, no insignificant whitespace, keys emitted in the listed order rather than sorted, and no escaping beyond the JSON minimum. Keep the serde_json::to_vec reference as the validator implementation note, not as the specification.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/sccm/contracts/sccm-site-database-export-v1.md` at line 26, Update the
digest-material specification to define the canonical JSON bytes directly: UTF-8
encoding, no insignificant whitespace, object keys emitted in the listed order
rather than sorted, and only JSON-required escaping without escaping non-ASCII
characters. Retain `serde_json::to_vec` solely as a validator implementation
note, not as the sender-facing byte specification.

Source: Path instructions

Comment on lines +18 to +22
"allOf": [
{ "if": { "properties": { "captureState": { "const": "captured" } } }, "then": { "properties": { "authorization": { "properties": { "decision": { "const": "granted" } } }, "snapshot": { "$ref": "#/$defs/completeSnapshot" } } } },
{ "if": { "properties": { "captureState": { "const": "partial" } } }, "then": { "properties": { "authorization": { "properties": { "decision": { "const": "granted" } } }, "snapshot": { "$ref": "#/$defs/partialSnapshot" } } } },
{ "if": { "properties": { "captureState": { "const": "accessDenied" } } }, "then": { "properties": { "authorization": { "properties": { "decision": { "const": "denied" } } }, "snapshot": { "type": "null" } } } }
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add required to each if subschema.

Each if tests only properties. In JSON Schema a properties keyword succeeds vacuously when the named property is absent, so all three if conditions pass for a document with no captureState, and all three then branches apply at once. The root required list currently prevents that document from validating overall, so no bad document is accepted today. The guard is still the correct idiom and it keeps the conditional branches independent of the root keyword.

♻️ Proposed change for the first branch, apply to all three
-    { "if": { "properties": { "captureState": { "const": "captured" } } }, "then": { "properties": { "authorization": { "properties": { "decision": { "const": "granted" } } }, "snapshot": { "$ref": "`#/`$defs/completeSnapshot" } } } },
+    { "if": { "required": ["captureState"], "properties": { "captureState": { "const": "captured" } } }, "then": { "properties": { "authorization": { "properties": { "decision": { "const": "granted" } } }, "snapshot": { "$ref": "`#/`$defs/completeSnapshot" } } } },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/sccm/contracts/sccm-site-database-export-v1.schema.json` around lines 18
- 22, Add a required captureState property to the if subschema in each allOf
conditional branch, while preserving the existing const checks for captured,
partial, and accessDenied. Do not modify the corresponding then branches.

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs (3)

573-585: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Preserve SccmServerArtifactAssessment construction compatibility.

Adding public fields breaks downstream struct literals for this published type. Keep this type unchanged and expose the new contract through a new versioned assessment type, or release this change as a major version.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs` around lines 573
- 585, Adding public fields to SccmServerArtifactAssessment breaks downstream
struct-literal construction compatibility. Keep SccmServerArtifactAssessment
unchanged and expose the new supplement fields through a distinct versioned
assessment type, preserving the existing type’s API and construction behavior.

Source: Path instructions


573-585: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Document the new public contract surface.

The added public fields, structs, and enums have no rustdoc. Document their meaning, valid states, and stability expectations before publishing this API.

As per path instructions, “Treat every public item as a semver commitment: flag breaking changes to public types, signatures, or enum variants, and check that new public items are documented.”

Also applies to: 631-684

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs` around lines 573
- 585, Add rustdoc to every newly public item in the SCCM server hierarchy and
supplement models, including the fields shown and the related
SccmServerHierarchyDirection, SccmServerHierarchyAdmission, and
SccmServerSupplementAdmission structs or enums in the affected section. Describe
each item’s meaning, valid states, optionality, and stability/semver
expectations before exposing the API, while preserving existing serialization
behavior.

Source: Path instructions


1266-1270: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Sensitive Data Exposure (CWE-200): Exposure of Sensitive Information to an Unauthorized Actor

Reachability: External

Do not serialize the raw privacyClass value.

The admission check does not sanitize artifact.supplement_privacy_class. Serialize "redacted" only when it matches, or omit the field otherwise.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs` around lines
1266 - 1270, Update the serialization logic for
artifact.supplement_privacy_class near the supplement admission checks to emit
the privacyClass field only when its value is exactly "redacted"; otherwise omit
the field entirely. Do not serialize the raw value, and preserve the existing
PrivacyClassMismatch gap 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.

Outside diff comments:
In `@crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs`:
- Around line 573-585: Adding public fields to SccmServerArtifactAssessment
breaks downstream struct-literal construction compatibility. Keep
SccmServerArtifactAssessment unchanged and expose the new supplement fields
through a distinct versioned assessment type, preserving the existing type’s API
and construction behavior.
- Around line 573-585: Add rustdoc to every newly public item in the SCCM server
hierarchy and supplement models, including the fields shown and the related
SccmServerHierarchyDirection, SccmServerHierarchyAdmission, and
SccmServerSupplementAdmission structs or enums in the affected section. Describe
each item’s meaning, valid states, optionality, and stability/semver
expectations before exposing the API, while preserving existing serialization
behavior.
- Around line 1266-1270: Update the serialization logic for
artifact.supplement_privacy_class near the supplement admission checks to emit
the privacyClass field only when its value is exactly "redacted"; otherwise omit
the field entirely. Do not serialize the raw value, and preserve the existing
PrivacyClassMismatch gap behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 74a71c55-3a51-4cc0-8648-50d20225faed

📥 Commits

Reviewing files that changed from the base of the PR and between 275b03e and 4bc5d8a.

📒 Files selected for processing (1)
  • crates/cmtraceopen-parser/src/sccm/server/windows/intake.rs

@adamgell
adamgell merged commit 1f025d0 into main Aug 5, 2026
16 checks passed
@adamgell
adamgell deleted the codex/sccm-sql-supplement-contract branch September 25, 2026 13:40
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SCCM Server discovery: approve a data-minimized SQL export contract

1 participant