Skip to content

fix(sccm): canonicalize client intake fixture contracts - #344

Merged
adamgell merged 3 commits into
codex/parser-family-skeletonfrom
codex/sccm-319-canonical-contract-fix
Jul 30, 2026
Merged

fix(sccm): canonicalize client intake fixture contracts#344
adamgell merged 3 commits into
codex/parser-family-skeletonfrom
codex/sccm-319-canonical-contract-fix

Conversation

@adamgell

@adamgell adamgell commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Refs #319.

Corrects the committed client-intake preparation corpus to the documented ConfigMgr contracts.

Scope

  • pins all 6 synthetic bundle manifests to exact site code LAB
  • canonicalizes AppEnforce.log rollback to AppEnforce.lo_, including physical file, full relative path, original basename, and sanitized provenance
  • validates exact bytes, safe in-root paths, and no orphan evidence across complete/rotations/collision/missing-root/access-denied/capped scenarios
  • preserves additive SCCM-specific proposal contracts and corrects preparation-plan residual examples
  • preserves the exact 128-byte incomplete capped prefix and SHA-256 identity
  • adds no reader, reducer, Windows I/O, or native acceptance claim

Verification at 4f91993115524bfbd3f296145f1f8e7e2bb547dc

  • restacked onto current shared base 781fb9c6; both issue-scoped commits map =
  • focused client intake — 3/3 (including captured RED→GREEN non-LAB regression)
  • exact validator — 6 scenarios, 18 physical artifacts/files, no orphans; capped digest 3253f6c4bc7d74bd2dbdadbe2f6543ff61a57161f85f650869b1292556270114
  • full parser — 625/625
  • exact-head CodeRabbit and local CodeRabbit CLI — no findings
  • strict parser Clippy, wasm32, TypeScript, owned rustfmt, and diff checks — pass

Issue #319 remains open for production native intake implementation and later Windows validation.

Summary by CodeRabbit

  • Tests

    • Added validation for canonical three-character synthetic site codes across SCCM intake scenarios.
    • Added checks for rotated log filenames, referenced fixture files, and recorded byte counts.
    • Expanded synthetic rotation fixture coverage with an AppEnforce.lo_ log fragment.
  • Documentation

    • Clarified synthetic fixture privacy, provenance, and identifier requirements.
    • Updated examples and guidance to use the LAB site code and canonical .lo_ rotation naming.

Copilot AI review requested due to automatic review settings July 30, 2026 20:35
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@adamgell, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b88afe4-1fee-44af-8a1c-e20602bd8dd9

📥 Commits

Reviewing files that changed from the base of the PR and between 781fb9c and 4f91993.

⛔ Files ignored due to path filters (1)
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/complete/evidence/client-location-services-shared/current/LocationServices.log is excluded by !**/*.log
📒 Files selected for processing (11)
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/README.md
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/access-denied/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/capped/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/collision/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/complete/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/missing-root/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/rotations/evidence/client-app-enforce/lo/AppEnforce.lo_
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/rotations/manifest.json
  • crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs
  • docs/sccm/preparation/issue-319-client-intake.md
  • docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md
📝 Walkthrough

Walkthrough

SCCM client intake fixtures and documentation now use the synthetic site code LAB and canonical AppEnforce.lo_ rotation naming. A new contract test validates site-code format, rotation paths, referenced evidence, and copied byte counts.

Changes

SCCM fixture contract

Layer / File(s) Summary
Synthetic identity and manifest updates
crates/cmtraceopen-parser/tests/fixtures/sccm/client/..., docs/sccm/preparation/issue-319-client-intake.md, docs/superpowers/plans/...
Fixture manifests and guidance replace CONTOSO with LAB, expand synthetic-data constraints, and correct one copied-byte count.
Rotation evidence alignment
crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/rotations/..., docs/sccm/preparation/issue-319-client-intake.md, docs/superpowers/plans/...
Rotation metadata, evidence content, and documentation use AppEnforce.lo_ and matching canonical paths.
Fixture contract validation
crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs
Adds assertions for three-character site codes, rotation filename/path consistency, evidence existence, and bytesCopied accuracy.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related issues

  • Issue #319 — The fixture updates and contract test directly implement its synthetic identity, deterministic manifest, rotation naming, and coverage requirements.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 is concise and accurately reflects the main change: canonicalizing SCCM client intake fixture contracts.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@adamgell adamgell self-assigned this Jul 30, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Please review exact head 390733fdb6a81499847992053cfebbd3f7042c73, including the committed site-code/rollover contract test, manifest-to-file path and byte integrity, and the issue-scoped no-native-acceptance boundary. A rate-limited status is not approval.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

@adamgell Understood. I’ll perform a full review of exact head 390733fdb6a81499847992053cfebbd3f7042c73, specifically covering the committed client-intake contract test, manifest-to-file path and byte integrity, and the issue-scoped boundary excluding native acceptance work.

✅ 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 20 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

Aligns the synthetic SCCM client-intake fixture corpus (issue #319 prep assets) with documented ConfigMgr conventions, and adds a regression/contract test to prevent the fixture contract from drifting again.

Changes:

  • Canonicalizes synthetic site codes to a valid 3-character value (LAB) across the six client-intake manifests and related fixture content/docs.
  • Normalizes the standard .lo_ rollover identity (e.g., AppEnforce.lo_) and updates manifest provenance/path fields accordingly.
  • Adds a committed Rust contract test that validates site-code format, .lo_ identity, path resolution to a real fixture file, and bytesCopied integrity.

Reviewed changes

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

Show a summary per file
File Description
docs/sccm/preparation/issue-319-client-intake.md Updates the preparation/spec text and examples to reflect valid site-code and rotation naming contracts.
crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs Adds a focused contract test enforcing site-code format, canonical .lo_ rollover naming, fixture presence, and byte-count integrity.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/README.md Updates fixture privacy/identifier contract documentation to use the canonical synthetic site code.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/rotations/manifest.json Updates bundle siteCode and canonicalizes the .lo_ rollover artifact’s basename and paths.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/missing-root/manifest.json Updates bundle siteCode to the canonical 3-character value.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/complete/manifest.json Updates bundle siteCode and refreshes bytesCopied to match the updated evidence payload.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/collision/manifest.json Updates bundle siteCode to the canonical 3-character value.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/capped/manifest.json Updates bundle siteCode to the canonical 3-character value.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/access-denied/manifest.json Updates bundle siteCode to the canonical 3-character value.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/complete/evidence/client-location-services-shared/current/LocationServices.log Updates synthetic coverage marker text to reflect the canonical site code.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/rotations/evidence/client-app-enforce/lo/AppEnforce.lo_ Adds the canonical .lo_ rollover evidence fixture file used by the contract test.

@adamgell adamgell left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Independent exact-head review: PASS

No actionable findings at 390733fdb6a81499847992053cfebbd3f7042c73 against base 262a18dedff5934868ed2f89d82795c412935733.

Reviewed against issue #319 and Tasks 1–2 of the client-intake plan, including the official Microsoft contracts for replacement-extension .lo_ rollover and three-character alphanumeric, non-reserved site codes.

Verified:

  • exactly six committed intake scenarios; all manifests and expected files are valid and mutually consistent
  • every site code is synthetic LAB, matches ^[A-Z0-9]{3}$, and is not a Microsoft-reserved value
  • the standard rollover is physically renamed to AppEnforce.lo_; the old AppEnforce.log.lo_ path is absent; manifest basename, relative path, sanitized provenance, physical file, and 176-byte count agree
  • all captured/capped evidence paths resolve within their scenario; bytesCopied, limits, artifact IDs, and expected provenance agree; no unreferenced evidence remains
  • capped evidence is an exact 128-byte incomplete prefix with the expected SHA-256 and cannot form a terminal finding
  • collision candidates retain distinct IDs/fingerprints/paths; missing-root and access-denied remain coverage/request states only
  • fixtures are synthetic/sanitized and the docs explicitly make this preparation-only, with native Windows/live acceptance still open
  • the Rust contract test is cross-platform (Path::join, no Windows I/O or platform-only dependency)

Fresh verification:

  • focused contract: 2 passed
  • exact-byte corpus validator: PASS
  • full parser: 594 passed (349 unit + 222 ESP + 2 client-intake + 21 SCCM)
  • strict parser Clippy: PASS
  • wasm32 parser check: PASS
  • npx tsc --noEmit: PASS
  • Rust 1.88 formatting, JSON parse, residual CONTOSO/.log.lo_ scan, and git diff --check: PASS

CodeRabbit remains a separate required gate: its exact-range attempt is currently rate-limited, so this human PASS does not treat the bot status as approval. Issue #319 should remain open for production intake/native manifest work and real Windows validation.

@adamgell adamgell left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Correction: prior PASS retracted

My earlier review at exact head 390733fdb6a81499847992053cfebbd3f7042c73 scoped the residual scan too narrowly. This head has two blockers:

  1. The issue #319 execution-contract plan remains noncanonical:

    • docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md:22 still names invalid six-character site code CONTOSO.
    • lines 220 and 365 still prescribe AppEnforce.log.lo_ instead of replacement-extension AppEnforce.lo_.
      This contradicts the corrected fixtures and leaves the plan contract capable of reintroducing the defect.
  2. The new exact on-disk byte assertion is not cross-platform. .gitattributes protects only src-tauri/tests/fixtures/**; crates/cmtraceopen-parser/tests/fixtures/** has no byte-preserving attribute. A simulated Git-for-Windows checkout with core.autocrlf=true changes AppEnforce.lo_ from 176 bytes to 177 bytes, so the 176-byte manifest/test contract fails for checkout normalization rather than content. Add an appropriate -text rule for the byte-sensitive parser SCCM fixture tree.

Evidence:

  • git check-attr -a returns no attribute for the fixture.
  • git -c core.autocrlf=true checkout-index ... produced a 177-byte checkout from the 176-byte index fixture.
  • the residual plan scan returns the three lines above.

The earlier macOS test results remain accurate but do not prove the requested cross-platform contract. Please treat this exact head as blocked; CodeRabbit's rate-limited response is also still not approval.

Copy link
Copy Markdown
Owner Author

Correction update: exact head is now 5cfde4e65fcc46850010e802b505f145c8b4b377.

The execution-plan residual scan is clean: invalid CONTOSO and AppEnforce.log.lo_ examples were corrected to the three-character synthetic site code LAB and standard AppEnforce.lo_ replacement-extension rollover. Focused 2/2 and exact-byte corpus validation remain green.

This PR is deliberately held behind #345, which adds the shared parser-fixture -text attribute needed for cross-platform exact-byte assertions. After #345 merges, this branch will be rebased onto the updated base and all aggregate gates plus independent and CodeRabbit exact-head reviews will be rerun. The earlier PASS is retracted; no merge is authorized yet.

@adamgell
adamgell force-pushed the codex/sccm-319-canonical-contract-fix branch from 5cfde4e to 2edee99 Compare July 30, 2026 21:12

Copy link
Copy Markdown
Owner Author

Rebased cleanly onto byte-stable parser-family base 99554f4aef0c06b2ce81eaf257c76058c38c06c0; new exact head is 2edee9979c44e770d7091b6be469a7a6dbda1db8.

Fresh post-rebase verification: focused client-intake 2/2; exact-byte corpus validator PASS; full parser 595/595; strict Clippy; wasm32; npx tsc --noEmit; owned rustfmt; git diff --check — all green.

All reviews attached to the pre-rebase SHA are stale by design. Fresh independent exact-head review is pending/active.

@coderabbitai review

Review exact head 2edee9979c44e770d7091b6be469a7a6dbda1db8 against base 99554f4aef0c06b2ce81eaf257c76058c38c06c0. Do not carry forward the pre-rebase result, and do not infer native Windows acceptance. A skipped/rate-limited response is not approval.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

@adamgell Understood. I’m triggering a fresh review of PR #344 against base 99554f4aef0c06b2ce81eaf257c76058c06c0 and exact head 2edee9979c44e770d7091b6be469a7a6dbda1db8.

I will treat all pre-rebase reviews as stale, assess the committed contract test and manifest/path/byte integrity, and will not infer native Windows acceptance or approval from skipped/rate-limited status.

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

@adamgell
adamgell force-pushed the codex/sccm-319-canonical-contract-fix branch from 2edee99 to 6f1a0af Compare July 30, 2026 21:22

Copy link
Copy Markdown
Owner Author

Final base refresh: rebased onto current parser-family 690cb32240a86001fdc4c3acc58e63638814d20e; exact head is now 6f1a0af5dead462efcc6393f3d1fe507a27b3409. Fresh focused 2/2, exact-byte validator, full parser 595/595, strict Clippy, wasm32, TypeScript, owned rustfmt, and diff checks pass. All older-SHA reviews are stale.

@coderabbitai review

Review exact head 6f1a0af5dead462efcc6393f3d1fe507a27b3409 against base 690cb32240a86001fdc4c3acc58e63638814d20e. A skipped, incremental-only, or rate-limited response is not approval; do not infer native Windows acceptance.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

@adamgell I’m triggering a fresh full review of #344 against base 690cb32240a86001fdc4c3acc58e63638814d20e and exact head 6f1a0af5dead462efcc6393f3d1fe507a27b3409. I will treat prior-SHA review results as stale, review the committed fixture contracts and integrity checks, and will not infer native Windows acceptance or approval from a skipped or rate-limited result.

✅ 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 33 minutes.

@adamgell adamgell left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Independent exact-head review: PASS

No actionable findings at 6f1a0af5dead462efcc6393f3d1fe507a27b3409 against base 690cb32240a86001fdc4c3acc58e63638814d20e.

Verified:

  • exactly six intake scenarios; every manifest pins the synthetic site code LAB, retains proposalOnly/syntheticFixture, and has matching expected JSON
  • standard rollback is physically renamed to AppEnforce.lo_; manifest basename, relative path, sanitized provenance, physical file, and 176-byte index/worktree length agree; stale .log.lo_ is absent
  • inherited crates/cmtraceopen-parser/tests/fixtures/** -text makes byte-sensitive fixture assertions portable
  • all captured/capped paths are relative, remain inside their scenario, resolve to committed files, include the synthetic marker, and match bytesCopied; no unreferenced evidence remains
  • collision artifacts preserve distinct IDs, fingerprints, relative paths, and physical evidence; rotation order remains current, .lo_, numbered .2
  • access-denied, missing-root, and capped sources remain explicit coverage/request states rather than success/failure proof; the 128-byte capped prefix and SHA-256 remain exact and cannot parse as a complete CCM record
  • the client README and #319 preparation document retain additive SCCM-only proposal boundaries, safe provenance, deterministic ordering, and no native/live acceptance claim
  • the execution plan has no residual CONTOSO, AppEnforce.log.lo_, or generic .log.lo_ example in the corrected client scope
  • PR body has no closing keyword; issue #319 remains open for production/native work

Fresh verification:

  • focused client-intake contract: 2/2 passed
  • exact-byte corpus validator: PASS
  • full parser: 595/595 (349 unit + 222 ESP + 2 client-intake + 1 server-intake + 21 SCCM)
  • strict parser Clippy: PASS
  • wasm32 parser check: PASS
  • npx tsc --noEmit: PASS
  • owned Rust 1.88 formatting and git diff --check: PASS

CodeRabbit remains a separate unmet gate, not part of this PASS: exact-head GitHub status says Review rate limited, and the local exact-range CLI attempt also returned rate_limit (32 minutes). Older incremental/rate-limited responses are not substantive approval. Do not merge until CodeRabbit reviews this exact range or an explicitly accepted equivalent gate is recorded. No native Windows acceptance is inferred.

@adamgell
adamgell force-pushed the codex/sccm-319-canonical-contract-fix branch from 6f1a0af to 26697a4 Compare July 30, 2026 21:50
@adamgell

Copy link
Copy Markdown
Owner Author

Current-base refresh: PR #344 is restacked without patch drift onto merged shared interface 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea; new exact head 26697a4f96a302616c1548b9018e557f3113fb54. Both issue-scoped commits map =.

Fresh gates: focused 2/2; exact 6-scenario/18-physical-file validator with no orphans and exact 128-byte capped digest; full parser 616/616; strict Clippy; wasm32; TypeScript; owned rustfmt; diff check — all green.

@coderabbitai review

Review exact head 26697a4f96a302616c1548b9018e557f3113fb54 against exact base 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea. Confirm the six LAB manifests, canonical AppEnforce.lo_, exact storage/cap/collision/coverage semantics, and corrected plan examples. Older-SHA results are stale; skipped, incremental-only, or rate-limited is not approval.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

@adamgell Understood. I’m initiating a fresh full review of PR #344 at exact head 26697a4f96a302616c1548b9018e557f3113fb54 against base 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea.

I’ll treat all earlier-SHA review results as stale and assess the six LAB manifests, canonical AppEnforce.lo_ rollover, storage/cap/collision/coverage semantics, corrected preparation-plan examples, and the no-native-acceptance boundary. A skipped, incremental-only, or rate-limited outcome is not approval.

✅ 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 5 minutes.

@adamgell

Copy link
Copy Markdown
Owner Author

Final current-base refresh: PR #344 is restacked without patch drift onto 781fb9c6acb32a60dfa0073953b98e08417fa6c6; new exact head 64c9744da51d0c842d3a32635b2ed2c80bb45bfc. Both issue-scoped commits map =.

Fresh gates: focused 2/2; exact 6-scenario/18-file validator with no orphans and exact capped digest; full parser 624/624; strict Clippy; wasm32; TypeScript; owned rustfmt; diff check — all green.

@coderabbitai review

Review exact head 64c9744da51d0c842d3a32635b2ed2c80bb45bfc against exact base 781fb9c6acb32a60dfa0073953b98e08417fa6c6. Confirm the six LAB manifests, canonical AppEnforce.lo_, exact storage/cap/collision/coverage semantics, corrected plan examples, and no-native boundary. Older-SHA results are stale; skipped, incremental-only, or rate-limited is not approval.

@adamgell
adamgell force-pushed the codex/sccm-319-canonical-contract-fix branch from 26697a4 to 64c9744 Compare July 30, 2026 22:00
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="781fb9c6acb32a60dfa0073953b98e08417fa6c6"
head="64c9744da51d0c842d3a32635b2ed2c80bb45bfc"

printf '%s\n' '== Commit availability =='
git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"

printf '%s\n' '== Changed paths =='
git diff --name-status "$base" "$head"

printf '%s\n' '== Diff summary =='
git diff --stat "$base" "$head"

printf '%s\n' '== Relevant changed-text matches =='
git diff --unified=40 "$base" "$head" -- \
  | rg -n -C 4 'LAB|CONTOSO|AppEnforce\.(log\.lo_|lo_)|native|Windows|capped|collision|orphan|manifest|site.?code' \
  || true

printf '%s\n' '== Changed source/text files (outline, where supported) =='
git diff --name-only --diff-filter=ACMR "$base" "$head" \
  | rg '\.(rs|ts|tsx|js|jsx|json|yaml|yml|md|toml)$' \
  | while IFS= read -r file; do
      echo "-- $file"
      ast-grep outline "$file" --items all 2>/dev/null || true
    done

Length of output: 57916


🏁 Script executed:

#!/bin/bash
set -euo pipefail

test_file="crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs"
fixture_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake"

printf '%s\n' '== Complete contract test =='
cat -n "$test_file"

printf '%s\n' '== Static manifest/evidence integrity check =='
python3 - <<'PY'
import hashlib
import json
from pathlib import Path, PurePosixPath

root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake")
scenarios = ("complete", "rotations", "collision", "missing-root", "access-denied", "capped")
declared = set()
errors = []

for scenario in scenarios:
    scenario_root = root / scenario
    manifest_path = scenario_root / "manifest.json"
    manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
    site_code = manifest.get("bundle", {}).get("siteCode")
    print(f"{scenario}: siteCode={site_code!r}, artifacts={len(manifest.get('artifacts', []))}")
    if site_code != "LAB":
        errors.append(f"{scenario}: expected siteCode LAB, got {site_code!r}")

    for artifact in manifest.get("artifacts", []):
        artifact_id = artifact.get("artifactId", "<missing>")
        relative_path = artifact.get("relativePath")
        bytes_copied = artifact.get("bytesCopied")
        state = artifact.get("captureState")

        if relative_path is None:
            if bytes_copied != 0:
                errors.append(f"{scenario}/{artifact_id}: null path has bytesCopied={bytes_copied}")
            continue

        posix = PurePosixPath(relative_path)
        if posix.is_absolute() or ".." in posix.parts or posix.parts[:1] != ("evidence",):
            errors.append(f"{scenario}/{artifact_id}: unsafe/non-evidence relativePath {relative_path!r}")
            continue

        full_path = scenario_root / Path(*posix.parts)
        key = full_path.resolve()
        if key in declared:
            errors.append(f"{scenario}/{artifact_id}: duplicate evidence declaration {relative_path}")
        declared.add(key)

        if not full_path.is_file():
            errors.append(f"{scenario}/{artifact_id}: declared evidence missing: {relative_path}")
            continue

        actual = full_path.stat().st_size
        if actual != bytes_copied:
            errors.append(
                f"{scenario}/{artifact_id}: bytesCopied={bytes_copied}, actual={actual}: {relative_path}"
            )

        if artifact_id == "fixture-rotations-app-enforce-root-a-lo":
            expected = "AppEnforce.lo_"
            for field in ("originalBasename", "relativePath", "sanitizedSourcePath"):
                value = artifact.get(field)
                if not isinstance(value, str) or not value.endswith(expected):
                    errors.append(f"{scenario}/{artifact_id}: {field} not canonical: {value!r}")

        if state == "capped":
            digest = hashlib.sha256(full_path.read_bytes()).hexdigest()
            print(f"  capped {relative_path}: bytes={actual}, sha256={digest}")
            if actual != 128:
                errors.append(f"{scenario}/{artifact_id}: capped file is {actual} bytes, expected 128")
            if digest != "3253f6c4bc7d74bd2dbdadbe2f6543ff61a57161f85f650869b1292556270114":
                errors.append(f"{scenario}/{artifact_id}: unexpected capped digest {digest}")

actual_evidence = {path.resolve() for path in root.glob("*/evidence/**/*") if path.is_file()}
orphans = sorted(actual_evidence - declared)
missing = sorted(declared - actual_evidence)
print(f"declared evidence files={len(declared)}; physical evidence files={len(actual_evidence)}")
for path in orphans:
    errors.append(f"orphan evidence: {path.relative_to(root.resolve())}")
for path in missing:
    errors.append(f"declared path not found by evidence scan: {path.relative_to(root.resolve())}")

if errors:
    print("FAIL")
    print("\n".join(f"- {error}" for error in errors))
    raise SystemExit(1)
print("PASS")
PY

printf '%s\n' '== Residual invalid examples in changed review scope =='
rg -n -i -C 2 'CONTOSO|AppEnforce\.log\.lo_' \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client \
  docs/sccm/preparation/issue-319-client-intake.md \
  docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md \
  || true

Length of output: 27852


@adamgell Found one regression-coverage gap in the requested exact range:

  • crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs, Line 64 — the new contract test only requires siteCode to match ^[A-Z0-9]{3}$. This accepts values such as ABC, so it does not enforce the stated invariant that all six committed intake manifests use the exact synthetic site code LAB. Assert site_code == "LAB" for each scenario (the format check can remain if useful) to lock the canonical fixture contract against future drift.

The independent static corpus check otherwise passed: all six manifests currently use LAB; the canonical AppEnforce.lo_ basename, relative path, provenance, and physical file agree; all 18 declared evidence files match physical paths and byte counts with no orphans; and the capped fixture retains the expected 128-byte SHA-256 identity. The reviewed range also contains no native intake, reader/reducer, or Windows-acceptance claim.

✅ Action performed

Full review finished.

@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

🤖 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/tests/sccm_client_intake_fixture_contract.rs`:
- Around line 64-71: Update the site code validation in the manifest contract
test to require siteCode exactly equals "LAB" for every scenario, replacing the
current three-character uppercase alphanumeric check while preserving the
existing failure reporting.
🪄 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: bff92dcc-5ae8-47db-99c2-0a18451e1deb

📥 Commits

Reviewing files that changed from the base of the PR and between 781fb9c and 64c9744.

⛔ Files ignored due to path filters (1)
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/complete/evidence/client-location-services-shared/current/LocationServices.log is excluded by !**/*.log
📒 Files selected for processing (11)
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/README.md
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/access-denied/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/capped/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/collision/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/complete/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/missing-root/manifest.json
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/rotations/evidence/client-app-enforce/lo/AppEnforce.lo_
  • crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/rotations/manifest.json
  • crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs
  • docs/sccm/preparation/issue-319-client-intake.md
  • docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md

Comment thread crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs Outdated

@adamgell adamgell left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Exact-head independent review: BLOCKED

Reviewed 64c9744da51d0c842d3a32635b2ed2c80bb45bfc against exact base 781fb9c6acb32a60dfa0073953b98e08417fa6c6. The committed corpus is currently coherent, but four regression-contract gaps leave the stated exact invariants unprotected.

Actionable blockers

  1. Line 64 — pin the exact site code, not only its shape. The current ^[A-Z0-9]{3}$ logic accepts ABC; it does not enforce the stated six-manifest canonical value LAB. CodeRabbit independently identified this same gap in exact-head comment 5136711179. Add an exact-value assertion (and preferably an adversarial valid-but-wrong mutation) for every scenario.

  2. Lines 94–108 — pin both full rollover paths. ends_with("/AppEnforce.lo_") accepts alternate layout/provenance values. For example, SYNTHETIC://different-root/AppEnforce.lo_ passes without any other change; a paired physical-file move lets evidence/other/AppEnforce.lo_ pass. Assert exact equality to:

    • evidence/client-app-enforce/lo/AppEnforce.lo_
    • SYNTHETIC://root-a/CCM/Logs/AppEnforce.lo_
      Add adversarial same-suffix mutations proving both fail closed.
  3. Lines 79–129 — require exact-one rollover cardinality and literal 176-byte identity. .find(...) silently validates only the first .lo_; appending a second .lo_ leaves the test green. Filter all rotation.kind == "lo" entries and fail unless there is exactly one, with a duplicate adversarial mutation. The current byte check only compares manifest value to physical length, so coordinated drift is accepted; pin bytesCopied == actual == 176.

  4. Lines 12–26 — pin the capped fixture’s exact bytes/SHA. The test checks length, a prefix, one marker, and parser shape, but never the committed SHA-256 or complete 128-byte payload. A one-byte message mutation (coveragecoveragf) retains all current text predicates while changing the digest from 3253f6c4… to 7320968f…. Assert the complete expected bytes or verify SHA-256 3253f6c4bc7d74bd2dbdadbe2f6543ff61a57161f85f650869b1292556270114, then keep the incomplete-CCM parser assertions.

What independently passed

  • Both restacked commits map identically (=) from the prior stack.
  • Current corpus validator: 6 scenarios, all 6 manifests presently LAB, 18 declared/physical evidence files, no missing files or orphans.
  • Canonical physical rollover currently has the exact basename/full paths, 176-byte size, and byte-identical pre/post-rename Git blob e34f04d74b9cd22f38121392fa270b142afdfcd8 (SHA-256 9f3315789657fe70d0a35e241f0c6e2dda12cc2ee792a993c8073d8294761cd5).
  • Collision preserves two distinct roots, IDs, fingerprints, paths, and contents. Rotation ordering is current/lo/numbered-2. Missing-root remains 11 absent coverage entries. Access-denied remains policy-agent denied plus separately captured policy-state. Capped remains a 128-byte incomplete prefix with the expected current SHA and no terminal diagnosis.
  • Additive proposal markers and expected proposedPending318 state remain intact; residual CONTOSO/AppEnforce.log.lo_ plan examples are corrected.
  • No production/native source, Cargo dependency, live-Windows acceptance claim, issue-family overlap, secret, or closing keyword was introduced.

Fresh exact-head gates

  • Focused client-intake contract: 2/2 passed
  • Independent exact validator: PASS (6 scenarios, 18 files, no orphans, exact current rollover/cap identities and scenario semantics)
  • Full parser: 624/624 passed (351 + 222 + 3 + 2 + 1 + 5 + 40)
  • Strict parser Clippy, wasm32 check, npx tsc --noEmit, Rust 1.88/current owned rustfmt, git diff --check, privacy, scope/no-overlap, no-native-production, secret, and no-closing-keyword checks: passed
  • Exact-head worktree remained clean

CodeRabbit’s response is substantive and exact-head, not skipped/rate-limited/incremental; it confirms current corpus integrity and identifies blocker 1. The additional three gaps above come from independent adversarial inspection. No merge is authorized until all four contracts fail closed and a fresh exact-head review is completed.

@adamgell

adamgell commented Jul 30, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Please perform a fresh substantive exact-head review of 4f91993115524bfbd3f296145f1f8e7e2bb547dc against base 781fb9c6acb32a60dfa0073953b98e08417fa6c6. This is the review-fix commit for the four blocked fixture-contract gaps. Verify literal LAB, exact rollover relative/provenance paths, exact-one .lo_, literal 176 bytes, and the byte-for-byte 128-byte capped payload contract. The focused non-LAB regression test was first observed RED and is now GREEN; focused 3/3, parser aggregate 625/625, strict Clippy, wasm32, TypeScript, owned rustfmt, and git diff --check pass. No production/native behavior or acceptance claim is added.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="781fb9c6acb32a60dfa0073953b98e08417fa6c6"
head="4f91993115524bfbd3f296145f1f8e7e2bb547dc"
test_file="crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs"
fixture_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake"

git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"

printf '\n== Exact range ==\n'
git diff --name-status "$base" "$head"
git diff --check "$base" "$head"
printf '\n== Exact diff ==\n'
git diff --find-renames --find-copies --unified=80 "$base" "$head" -- \
  "$test_file" \
  "$fixture_root" \
  "crates/cmtraceopen-parser/tests/fixtures/sccm/client/README.md" \
  "docs/sccm/preparation/issue-319-client-intake.md" \
  "docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md"

printf '\n== Contract test outline and contents ==\n'
ast-grep outline "$test_file" --items all
cat -n "$test_file"

printf '\n== Independent manifest/evidence contract validation ==\n'
python3 - <<'PY'
import hashlib
import json
from pathlib import Path, PurePosixPath

root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake")
scenarios = ("complete", "rotations", "collision", "missing-root", "access-denied", "capped")
errors = []
declared_paths = set()

for scenario in scenarios:
    scenario_root = root / scenario
    manifest = json.loads((scenario_root / "manifest.json").read_text(encoding="utf-8"))
    artifacts = manifest.get("artifacts", [])
    site_code = manifest.get("bundle", {}).get("siteCode")
    print(f"{scenario}: siteCode={site_code!r}; artifacts={len(artifacts)}")
    if site_code != "LAB":
        errors.append(f"{scenario}: bundle.siteCode must equal 'LAB', got {site_code!r}")

    lo_artifacts = [
        artifact for artifact in artifacts
        if artifact.get("rotation") == "lo"
        or artifact.get("rotationKind") == "lo"
        or artifact.get("originalBasename") == "AppEnforce.lo_"
    ]
    if scenario == "rotations":
        if len(lo_artifacts) != 1:
            errors.append(f"rotations: expected exactly one .lo_ artifact, got {len(lo_artifacts)}")
        else:
            artifact = lo_artifacts[0]
            expected_path = "evidence/client-app-enforce/lo/AppEnforce.lo_"
            expected_provenance_suffix = "/AppEnforce.lo_"
            for field, expected in (
                ("originalBasename", "AppEnforce.lo_"),
                ("relativePath", expected_path),
            ):
                if artifact.get(field) != expected:
                    errors.append(f"rotations/{artifact.get('artifactId')}: {field}={artifact.get(field)!r}, expected {expected!r}")
            source = artifact.get("sanitizedSourcePath")
            if not isinstance(source, str) or not source.endswith(expected_provenance_suffix):
                errors.append(f"rotations/{artifact.get('artifactId')}: sanitizedSourcePath={source!r} must end with {expected_provenance_suffix!r}")

    for artifact in artifacts:
        artifact_id = artifact.get("artifactId", "<missing>")
        relative_path = artifact.get("relativePath")
        copied = artifact.get("bytesCopied")
        if relative_path is None:
            if copied != 0:
                errors.append(f"{scenario}/{artifact_id}: missing relativePath has bytesCopied={copied!r}")
            continue
        posix_path = PurePosixPath(relative_path)
        if posix_path.is_absolute() or ".." in posix_path.parts or posix_path.parts[:1] != ("evidence",):
            errors.append(f"{scenario}/{artifact_id}: unsafe relativePath {relative_path!r}")
            continue
        path = scenario_root.joinpath(*posix_path.parts)
        declared_paths.add(path.resolve())
        if not path.is_file():
            errors.append(f"{scenario}/{artifact_id}: missing physical file {relative_path!r}")
            continue
        actual = path.stat().st_size
        if copied != actual:
            errors.append(f"{scenario}/{artifact_id}: bytesCopied={copied!r}, physical={actual} for {relative_path!r}")
        if scenario == "rotations" and artifact.get("originalBasename") == "AppEnforce.lo_":
            print(f"  rollover: bytes={actual}; sha256={hashlib.sha256(path.read_bytes()).hexdigest()}")
            if actual != 176:
                errors.append(f"rotations/{artifact_id}: rollover must be exactly 176 bytes, got {actual}")
        if artifact.get("captureState") == "capped":
            digest = hashlib.sha256(path.read_bytes()).hexdigest()
            print(f"  capped: path={relative_path}; bytes={actual}; sha256={digest}")
            if actual != 128:
                errors.append(f"{scenario}/{artifact_id}: capped payload must be exactly 128 bytes, got {actual}")
            expected_digest = "3253f6c4bc7d74bd2dbdadbe2f6543ff61a57161f85f650869b1292556270114"
            if digest != expected_digest:
                errors.append(f"{scenario}/{artifact_id}: capped SHA-256={digest}, expected {expected_digest}")

physical_paths = {path.resolve() for path in root.glob("*/evidence/**/*") if path.is_file()}
for path in sorted(physical_paths - declared_paths):
    errors.append(f"orphan evidence file: {path.relative_to(root.resolve())}")
for path in sorted(declared_paths - physical_paths):
    errors.append(f"declared non-evidence path: {path.relative_to(root.resolve())}")
print(f"declared={len(declared_paths)} physical={len(physical_paths)}")
if errors:
    print("FAIL")
    print("\n".join(f"- {e}" for e in errors))
    raise SystemExit(1)
print("PASS")
PY

printf '\n== Residual noncanonical identifiers and forbidden-scope claims in reviewed files ==\n'
rg -n -i -C 2 'CONTOSO|AppEnforce\.log\.lo_|native (intake|acceptance)|Windows[- ]acceptance|reader|reducer' \
  "$test_file" \
  "$fixture_root" \
  "crates/cmtraceopen-parser/tests/fixtures/sccm/client/README.md" \
  "docs/sccm/preparation/issue-319-client-intake.md" \
  "docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md" \
  || true

Length of output: 112937


@adamgell Full substantive review of exact head 4f91993115524bfbd3f296145f1f8e7e2bb547dc against 781fb9c6acb32a60dfa0073953b98e08417fa6c6 is complete. No findings.

Verified in the committed contract test and independently against the fixture corpus:

  • All six manifests require literal bundle.siteCode == "LAB"; the focused negative test rejects ABC.
  • The rotations manifest has exactly one rotation.kind == "lo" artifact, with exact basename AppEnforce.lo_, relative path evidence/client-app-enforce/lo/AppEnforce.lo_, and provenance SYNTHETIC://root-a/CCM/Logs/AppEnforce.lo_.
  • The rollover manifest declaration and physical evidence file are both exactly 176 bytes.
  • The capped payload is locked byte-for-byte by a 128-byte literal expected buffer. Independent validation confirmed its SHA-256 remains 3253f6c4bc7d74bd2dbdadbe2f6543ff61a57161f85f650869b1292556270114.
  • All 18 declared evidence files resolve safely, exist, and match their declared byte counts; there are no orphan evidence files.
  • The range contains no production/native intake implementation or native/Windows acceptance claim. The documentation continues to state the proposed-fixture and dependency boundary.

I did not independently execute the reported Rust/TypeScript/Clippy/wasm test commands in this static-inspection sandbox, but the committed coverage and corpus integrity checks are consistent with the reported green results.

✅ 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 12 minutes.

@adamgell

Copy link
Copy Markdown
Owner Author

Independent corrected-head review: PASS

No actionable findings at exact head 4f91993115524bfbd3f296145f1f8e7e2bb547dc against exact base 781fb9c6acb32a60dfa0073953b98e08417fa6c6.

All four prior regression blockers are closed:

  • every intake manifest is required to equal literal LAB, and the committed ABC negative proves valid-shape/wrong-value rejection
  • rollover relativePath and sanitizedSourcePath are pinned to the full canonical values evidence/client-app-enforce/lo/AppEnforce.lo_ and SYNTHETIC://root-a/CCM/Logs/AppEnforce.lo_
  • the rotation contract requires exactly one lo artifact and pins bytesCopied == actual file length == 176; duplicate and coordinated-byte-drift adversarial cases fail closed
  • the test pins the complete 128-byte capped payload; independent SHA-256 is 3253f6c4bc7d74bd2dbdadbe2f6543ff61a57161f85f650869b1292556270114, and a same-shape one-byte mutation is rejected

Independent corpus validation also found 6 scenarios, 30 artifact records, 18 declared/physical evidence files, and zero missing files or orphans. Index/worktree Git blobs agree for the capped and rollover fixtures, and inherited -text attributes preserve exact bytes.

Fresh verification at this exact head:

  • cargo test --locked -p cmtraceopen-parser --test sccm_client_intake_fixture_contract — 3/3 passed
  • cargo test --locked -p cmtraceopen-parser — 625/625 passed
  • cargo clippy --locked -p cmtraceopen-parser --all-targets -- -D warnings — passed
  • cargo check --locked -p cmtraceopen-parser --target wasm32-unknown-unknown — passed
  • npx tsc --noEmit — passed
  • Rust 1.88 and current-toolchain scoped rustfmt --check, git diff --check, and clean-worktree check — passed

Count correction: the current aggregate is 625 tests (not the earlier stated 626): 351 unit + 222 ESP + 3 health + 3 client-intake + 1 server-intake + 5 site-core + 40 spine.

CodeRabbit is in the completed loop: its original exact-range LAB finding is resolved and confirmed addressed, the current PR check is successful with an exact-head approval, and a fresh local CodeRabbit committed review of 781fb9c6..4f919931 completed with 0 findings across all 12 changed files, including the .log fixture omitted by GitHub path filtering.

The range changes only synthetic fixtures, fixture tests, and preparation/plan documentation. It adds no production reader, native collection, parser kind, dependency, or live-Windows acceptance claim. The PR body has no closing keyword; #319 remains open for production/native implementation and eventual Windows acceptance. Review only; I did not merge.

@adamgell
adamgell merged commit c342e94 into codex/parser-family-skeleton Jul 30, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="781fb9c6acb32a60dfa0073953b98e08417fa6c6"
head="4f91993115524bfbd3f296145f1f8e7e2bb547dc"
test_file="crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs"
fixture_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake"

git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"

printf '%s\n' '== Exact range: changed files =='
git diff --name-status "$base" "$head"
printf '%s\n' '== Exact range: whitespace =='
git diff --check "$base" "$head"
printf '%s\n' '== Contract-test outline and source =='
ast-grep outline "$test_file" --items all
cat -n "$test_file"
printf '%s\n' '== Relevant exact diff =='
git diff --find-renames --unified=25 "$base" "$head" -- \
  "$test_file" "$fixture_root" \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client/README.md \
  docs/sccm/preparation/issue-319-client-intake.md \
  docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md

printf '%s\n' '== Independent fixture-corpus validation =='
python3 - <<'PY'
import hashlib
import json
from pathlib import Path, PurePosixPath

root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake")
scenarios = ("complete", "rotations", "collision", "missing-root", "access-denied", "capped")
expected_rollover_path = "evidence/client-app-enforce/lo/AppEnforce.lo_"
expected_provenance = "SYNTHETIC://root-a/CCM/Logs/AppEnforce.lo_"
expected_capped = bytes([
    60,33,91,76,79,71,91,83,78,84,72,69,84,73,67,93,76,79,71,93,60,47,33,62,60,116,105,109,101,32,100,
    97,116,101,61,34,48,49,45,48,49,45,50,48,50,54,34,32,116,105,109,101,61,34,48,48,58,48,48,58,48,
    48,46,48,48,48,43,48,48,48,34,32,99,111,109,112,111,110,101,110,116,61,34,67,97,112,112,101,100,
    34,32,99,111,110,116,101,120,116,61,34,83,89,78,84,72,69,84,73,67,34,32,116,121,112,101,61,34,50,
    34,32,116,104,114,101,97,100,61,34,49,34,32,102,105,108,101,61,34,99,97,112,112,101,100,46,108,111,
    103,34,62,60,47,116,105,109,101,62
])
errors, declared = [], set()

for scenario in scenarios:
    scenario_root = root / scenario
    manifest = json.loads((scenario_root / "manifest.json").read_text(encoding="utf-8"))
    artifacts = manifest.get("artifacts", [])
    if manifest.get("bundle", {}).get("siteCode") != "LAB":
        errors.append(f"{scenario}: bundle.siteCode is not literal LAB")

    lo = [a for a in artifacts if a.get("rotation", {}).get("kind") == "lo"]
    if scenario == "rotations":
        if len(lo) != 1:
            errors.append(f"rotations: expected exactly one rotation.kind=lo, got {len(lo)}")
        else:
            artifact = lo[0]
            for field, expected in (
                ("originalBasename", "AppEnforce.lo_"),
                ("relativePath", expected_rollover_path),
                ("sanitizedSourcePath", expected_provenance),
            ):
                if artifact.get(field) != expected:
                    errors.append(f"rotations: {field} is {artifact.get(field)!r}, expected {expected!r}")

    for artifact in artifacts:
        artifact_id = artifact.get("artifactId", "<missing>")
        relative_path = artifact.get("relativePath")
        copied = artifact.get("bytesCopied")
        if relative_path is None:
            if copied != 0:
                errors.append(f"{scenario}/{artifact_id}: null relativePath has bytesCopied={copied!r}")
            continue
        posix = PurePosixPath(relative_path)
        if posix.is_absolute() or ".." in posix.parts or posix.parts[:1] != ("evidence",):
            errors.append(f"{scenario}/{artifact_id}: unsafe evidence path {relative_path!r}")
            continue
        path = scenario_root.joinpath(*posix.parts)
        declared.add(path.resolve())
        if not path.is_file():
            errors.append(f"{scenario}/{artifact_id}: declared file missing: {relative_path}")
            continue
        data = path.read_bytes()
        if len(data) != copied:
            errors.append(f"{scenario}/{artifact_id}: bytesCopied={copied}, actual={len(data)}")
        if scenario == "rotations" and artifact.get("rotation", {}).get("kind") == "lo" and len(data) != 176:
            errors.append(f"{scenario}/{artifact_id}: rollover length is {len(data)}, expected 176")
        if artifact.get("captureState") == "capped":
            if data != expected_capped:
                errors.append(f"{scenario}/{artifact_id}: capped payload differs from literal expected bytes")
            if len(data) != 128:
                errors.append(f"{scenario}/{artifact_id}: capped length is {len(data)}, expected 128")
            print(f"capped SHA-256: {hashlib.sha256(data).hexdigest()}")

physical = {p.resolve() for p in root.glob("*/evidence/**/*") if p.is_file()}
if physical - declared:
    errors.extend(f"orphan: {p.relative_to(root.resolve())}" for p in sorted(physical - declared))
if declared - physical:
    errors.extend(f"not in evidence scan: {p.relative_to(root.resolve())}" for p in sorted(declared - physical))
print(f"scenarios={len(scenarios)} records={sum(len(json.loads((root / s / 'manifest.json').read_text())['artifacts']) for s in scenarios)} declared={len(declared)} physical={len(physical)}")
if errors:
    print("FAIL")
    print("\n".join(f"- {error}" for error in errors))
    raise SystemExit(1)
print("PASS")
PY

printf '%s\n' '== Noncanonical identifiers and out-of-scope claims =='
rg -n -i -C 2 'CONTOSO|AppEnforce\.log\.lo_|native (intake|acceptance)|Windows[- ]acceptance|production (reader|intake)|\breader\b|\breducer\b' \
  "$test_file" "$fixture_root" \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client/README.md \
  docs/sccm/preparation/issue-319-client-intake.md \
  docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md \
  || true

Length of output: 71916


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="781fb9c6acb32a60dfa0073953b98e08417fa6c6"
head="4f91993115524bfbd3f296145f1f8e7e2bb547dc"
test_file="crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs"
fixture_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake"

printf '%s\n' '== Decode committed capped literal and compare fixture bytes =='
python3 - <<'PY'
import ast
import hashlib
import re
from pathlib import Path

test = Path("crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs").read_text(encoding="utf-8")
fixture = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/capped/evidence/client-content/current/DataTransferService.log").read_bytes()
match = re.search(r'const EXPECTED_CAPPED_CONTENT: &\[u8\] = (b"(?:[^"\\\\]|\\\\.)*");', test)
if not match:
    raise SystemExit("FAIL: could not locate EXPECTED_CAPPED_CONTENT byte literal")
expected = ast.literal_eval(match.group(1))
if not isinstance(expected, bytes):
    raise SystemExit("FAIL: decoded expected literal is not bytes")
print(f"expected length={len(expected)} actual length={len(fixture)}")
print(f"expected SHA-256={hashlib.sha256(expected).hexdigest()}")
print(f"actual   SHA-256={hashlib.sha256(fixture).hexdigest()}")
if fixture != expected:
    raise SystemExit("FAIL: committed expected byte literal and capped fixture differ")
if len(fixture) != 128:
    raise SystemExit(f"FAIL: capped fixture has {len(fixture)} bytes, expected 128")
print("PASS")
PY

printf '%s\n' '== Full corrected static corpus integrity =='
python3 - <<'PY'
import json
from pathlib import Path, PurePosixPath
root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake")
scenarios = ("complete", "rotations", "collision", "missing-root", "access-denied", "capped")
errors, declared = [], set()
for scenario in scenarios:
    sr = root / scenario
    m = json.loads((sr / "manifest.json").read_text(encoding="utf-8"))
    if m["bundle"].get("siteCode") != "LAB":
        errors.append(f"{scenario}: siteCode is not LAB")
    lo = [a for a in m["artifacts"] if a.get("rotation", {}).get("kind") == "lo"]
    if scenario == "rotations":
        if len(lo) != 1:
            errors.append(f"rotations: expected one lo artifact, got {len(lo)}")
        elif (lo[0].get("originalBasename"), lo[0].get("relativePath"), lo[0].get("sanitizedSourcePath")) != (
            "AppEnforce.lo_",
            "evidence/client-app-enforce/lo/AppEnforce.lo_",
            "SYNTHETIC://root-a/CCM/Logs/AppEnforce.lo_",
        ):
            errors.append("rotations: noncanonical rollover contract")
    for a in m["artifacts"]:
        p = a.get("relativePath")
        if p is None:
            if a.get("bytesCopied") != 0:
                errors.append(f"{scenario}/{a.get('artifactId')}: null path has nonzero bytes")
            continue
        q = PurePosixPath(p)
        if q.is_absolute() or ".." in q.parts or q.parts[:1] != ("evidence",):
            errors.append(f"{scenario}/{a.get('artifactId')}: unsafe path {p!r}")
            continue
        f = sr.joinpath(*q.parts)
        declared.add(f.resolve())
        if not f.is_file():
            errors.append(f"{scenario}/{a.get('artifactId')}: missing file {p}")
        elif f.stat().st_size != a.get("bytesCopied"):
            errors.append(f"{scenario}/{a.get('artifactId')}: byte count mismatch")
        elif scenario == "rotations" and a.get("rotation", {}).get("kind") == "lo" and f.stat().st_size != 176:
            errors.append("rotations: rollover is not 176 bytes")
physical = {p.resolve() for p in root.glob("*/evidence/**/*") if p.is_file()}
errors += [f"orphan: {p.relative_to(root.resolve())}" for p in sorted(physical - declared)]
errors += [f"undeclared: {p.relative_to(root.resolve())}" for p in sorted(declared - physical)]
print(f"scenarios={len(scenarios)} artifacts={sum(len(json.loads((root/s/'manifest.json').read_text())['artifacts']) for s in scenarios)} declared={len(declared)} physical={len(physical)}")
if errors:
    print("FAIL\n" + "\n".join(errors)); raise SystemExit(1)
print("PASS")
PY

printf '%s\n' '== Exact-head Git blob identity for byte-sensitive fixtures =='
for file in \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/capped/evidence/client-content/current/DataTransferService.log \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/rotations/evidence/client-app-enforce/lo/AppEnforce.lo_
do
  printf '%s: ' "$file"
  git rev-parse "${head}:${file}"
  git hash-object "$file"
done

printf '%s\n' '== Residual invalid identifiers and prohibited implementation claims =='
rg -n -i -C 2 'CONTOSO|AppEnforce\.log\.lo_|production (reader|intake)|native (intake|acceptance)|Windows[- ]acceptance' \
  "$test_file" "$fixture_root" \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client/README.md \
  docs/sccm/preparation/issue-319-client-intake.md \
  docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md \
  || true

Length of output: 5411


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head="4f91993115524bfbd3f296145f1f8e7e2bb547dc"
test_file="crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs"
fixture_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake"

printf '%s\n' '== Decode committed capped literal and compare fixture bytes =='
python3 - <<'PY'
import ast
import hashlib
from pathlib import Path

test_path = Path("crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs")
fixture_path = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/capped/evidence/client-content/current/DataTransferService.log")
line = next(
    (line.strip() for line in test_path.read_text(encoding="utf-8").splitlines()
     if line.strip().startswith("const EXPECTED_CAPPED_CONTENT:")),
    None,
)
if line is None:
    raise SystemExit("FAIL: EXPECTED_CAPPED_CONTENT declaration missing")
literal = line.split("=", 1)[1].strip().rstrip(";")
expected = ast.literal_eval(literal)
actual = fixture_path.read_bytes()
print(f"expected length={len(expected)} actual length={len(actual)}")
print(f"expected SHA-256={hashlib.sha256(expected).hexdigest()}")
print(f"actual   SHA-256={hashlib.sha256(actual).hexdigest()}")
if expected != actual:
    raise SystemExit("FAIL: committed expected byte literal differs from capped fixture")
if len(actual) != 128:
    raise SystemExit(f"FAIL: capped fixture has {len(actual)} bytes, expected 128")
print("PASS")
PY

printf '%s\n' '== Full static corpus integrity =='
python3 - <<'PY'
import json
from pathlib import Path, PurePosixPath
root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake")
scenarios = ("complete", "rotations", "collision", "missing-root", "access-denied", "capped")
errors, declared, records = [], set(), 0
for scenario in scenarios:
    sr = root / scenario
    manifest = json.loads((sr / "manifest.json").read_text(encoding="utf-8"))
    artifacts = manifest["artifacts"]
    records += len(artifacts)
    if manifest["bundle"].get("siteCode") != "LAB":
        errors.append(f"{scenario}: siteCode is not literal LAB")
    rollover = [a for a in artifacts if a.get("rotation", {}).get("kind") == "lo"]
    if scenario == "rotations":
        expected = ("AppEnforce.lo_", "evidence/client-app-enforce/lo/AppEnforce.lo_", "SYNTHETIC://root-a/CCM/Logs/AppEnforce.lo_")
        actual = tuple(rollover[0].get(k) for k in ("originalBasename", "relativePath", "sanitizedSourcePath")) if len(rollover) == 1 else ()
        if len(rollover) != 1 or actual != expected:
            errors.append(f"rotations: rollover contract mismatch: count={len(rollover)}, values={actual!r}")
    for artifact in artifacts:
        relative = artifact.get("relativePath")
        if relative is None:
            if artifact.get("bytesCopied") != 0:
                errors.append(f"{scenario}/{artifact['artifactId']}: null path has nonzero bytes")
            continue
        posix = PurePosixPath(relative)
        if posix.is_absolute() or ".." in posix.parts or posix.parts[:1] != ("evidence",):
            errors.append(f"{scenario}/{artifact['artifactId']}: unsafe path")
            continue
        physical = sr.joinpath(*posix.parts)
        declared.add(physical.resolve())
        if not physical.is_file():
            errors.append(f"{scenario}/{artifact['artifactId']}: missing declared file")
        elif physical.stat().st_size != artifact.get("bytesCopied"):
            errors.append(f"{scenario}/{artifact['artifactId']}: byte count mismatch")
        elif scenario == "rotations" and artifact.get("rotation", {}).get("kind") == "lo" and physical.stat().st_size != 176:
            errors.append(f"{scenario}/{artifact['artifactId']}: rollover is not 176 bytes")
physical_files = {p.resolve() for p in root.glob("*/evidence/**/*") if p.is_file()}
errors.extend(f"orphan {p.relative_to(root.resolve())}" for p in sorted(physical_files - declared))
errors.extend(f"undeclared {p.relative_to(root.resolve())}" for p in sorted(declared - physical_files))
print(f"scenarios={len(scenarios)} artifacts={records} declared={len(declared)} physical={len(physical_files)}")
if errors:
    raise SystemExit("FAIL:\n- " + "\n- ".join(errors))
print("PASS")
PY

printf '%s\n' '== Exact-head Git blob identity for byte-sensitive fixtures =='
for file in \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/capped/evidence/client-content/current/DataTransferService.log \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client/intake/rotations/evidence/client-app-enforce/lo/AppEnforce.lo_
do
  printf '%s\n' "$file"
  git rev-parse "${head}:${file}"
  git hash-object "$file"
done

printf '%s\n' '== Residual invalid identifiers and prohibited implementation claims =='
rg -n -i -C 2 'CONTOSO|AppEnforce\.log\.lo_|production (reader|intake)|native (intake|acceptance)|Windows[- ]acceptance' \
  "$test_file" "$fixture_root" \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client/README.md \
  docs/sccm/preparation/issue-319-client-intake.md \
  docs/superpowers/plans/2026-07-30-sccm-client-intake-and-core.md \
  || true

Length of output: 8439


@adamgell Fresh substantive review of exact head 4f91993115524bfbd3f296145f1f8e7e2bb547dc against base 781fb9c6acb32a60dfa0073953b98e08417fa6c6 is complete. No findings.

Verified:

  • All six committed manifests are enforced as literal bundle.siteCode == "LAB"; the committed negative test rejects shape-valid ABC.
  • The rotations fixture has exactly one rotation.kind == "lo" artifact, with exact values:
    • AppEnforce.lo_
    • evidence/client-app-enforce/lo/AppEnforce.lo_
    • SYNTHETIC://root-a/CCM/Logs/AppEnforce.lo_
  • The rollover’s manifest byte count and physical evidence file are both exactly 176 bytes.
  • The capped file exactly equals the committed 128-byte expected literal; both hash to 3253f6c4bc7d74bd2dbdadbe2f6543ff61a57161f85f650869b1292556270114.
  • Independent corpus validation found 6 scenarios, 30 artifact records, and 18 declared / 18 physical evidence files, with no unsafe paths, missing files, byte-count mismatches, or orphans.
  • Git blob identities for both byte-sensitive fixture files match the exact reviewed head.
  • The range adds fixture/test/documentation contract coverage only. The plan’s native and Windows references describe future or pending work; it does not claim production/native implementation or native acceptance.

I did not execute the reported Rust, Clippy, wasm32, or TypeScript commands in this static-inspection environment.

✅ 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 3 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants