Skip to content

fix(sccm): canonicalize client health fixture contracts - #346

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

adamgell merged 4 commits into
codex/parser-family-skeletonfrom
codex/sccm-320-canonical-contract-fix

Conversation

@adamgell

@adamgell adamgell commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Corrects the already-merged #320 health/location preparation corpus to match documented ConfigMgr contracts:

  • pins all 9 synthetic manifests to exact LAB and exactly four manifest-bound LocationServices facts on Lines 1–2
  • canonicalizes ccmsetup.lo_ and pins its basename, full relative path, full sanitized provenance, physical file, and bytes
  • fails closed for wrong-valid, missing, mismatched, moved, alternate-path, alternate-provenance, and duplicate-rollover mutations
  • adds no workflow reducer, Windows I/O, live collection, or native acceptance claim

Microsoft references:

TDD and review corrections

Initial red coverage exposed 16 corpus defects. Independent review then drove non-vacuous exact evidence assertions. CodeRabbit exact-head reviews drove full path equality and exact-one rollover cardinality; both findings were reproduced red and closed with adversarial tests.

Verification at c8b69439ac3663f712ca8ea712a81d910fc51f61

  • first 3 issue-scoped commits preserve patch equality after restack; the fourth is the reviewed duplicate-rollover correction
  • focused client-health — 3/3
  • exact validator — 9 manifests, 23 physical artifacts, exactly 1 rollover
  • full branch parser — 618/618
  • strict parser Clippy, wasm32, TypeScript, owned rustfmt, and diff checks — pass
  • independent exact-head review 4823561575 — pass
  • CodeRabbit exact-head closure 5136652227 — no further issue

Issue #320 remains open for production analyzer implementation and later native validation.

Part of #320.

Copilot AI review requested due to automatic review settings July 30, 2026 20:48
@adamgell adamgell self-assigned this Jul 30, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Please review exact head afb6d2804b146902122c2379da740a1a5840eb26, including the cross-platform manifest/evidence site-code and rollover path/provenance/byte contract test. A rate-limited response is not approval.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the SCCM client health fixture corpus (#320) with documented ConfigMgr contracts by enforcing valid 3-character site codes and canonical log rollover naming, and adds a regression test to prevent future fixture drift.

Changes:

  • Replaces invalid CONTOSO site codes with a valid three-character synthetic LAB across all nine health manifests and directly-evidenced log facts.
  • Canonicalizes the rollover fixture naming from ccmsetup.log.lo_ to ccmsetup.lo_, updating identity/path/provenance and ensuring the physical fixture exists.
  • Adds a focused fixture-contract test to validate scenario count, site-code shape, rollover path/basename, fixture presence, and byte-length integrity.

Reviewed changes

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

Show a summary per file
File Description
docs/sccm/preparation/issue-320-client-health-corpus.md Updates documentation to reflect the canonical 3-character site code contract used by fixtures.
crates/cmtraceopen-parser/tests/sccm_client_health_fixture_contract.rs Adds a committed regression test enforcing site-code + rollover + byte-integrity fixture contracts.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/transport-failure/manifest.json Updates bundle siteCode to LAB and corrects bytesCopied for LocationServices artifact.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/transport-failure/evidence/client-location-services-shared/current/LocationServices.log Replaces directly-evidenced siteCode=CONTOSO with siteCode=LAB.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/success/manifest.json Updates bundle siteCode to LAB and corrects bytesCopied for LocationServices artifact.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/success/evidence/client-location-services-shared/current/LocationServices.log Replaces directly-evidenced siteCode=CONTOSO with siteCode=LAB.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/setup-failure/manifest.json Updates bundle siteCode to LAB.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/rotation-boundary/manifest.json Updates bundle siteCode to LAB and canonicalizes rollover artifact basename/path to ccmsetup.lo_.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/rotation-boundary/evidence/client-ccmsetup/lo/ccmsetup.lo_ Adds the canonical .lo_ rollover fixture file referenced by the manifest.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/no-site-or-mp/manifest.json Updates bundle siteCode to LAB.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/malformed/manifest.json Updates bundle siteCode to LAB.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/incomplete/manifest.json Updates bundle siteCode to LAB.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/identity-failure/manifest.json Updates bundle siteCode to LAB.
crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/contradictory/manifest.json Updates bundle siteCode to LAB.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b1eb699b-6db5-449c-abd1-c6190adf6c1c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

@adamgell Understood. I’m triggering a full review of exact head afb6d2804b146902122c2379da740a1a5840eb26, including the cross-platform fixture contract coverage and the manifest/evidence site-code, rollover identity/path/provenance, physical-presence, and exact-byte assertions. This is not an 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 3 minutes.

Copy link
Copy Markdown
Owner Author

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

Fresh post-rebase verification: focused client-health 1/1; 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 c59ea8fc333f26423ed0d1ce5bc59261c14a96ee 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, independent review of exact head c59ea8fc333f26423ed0d1ce5bc59261c14a96ee against base 99554f4aef0c06b2ce81eaf257c76058c38c06c0. I will treat pre-rebase review results as stale and will not infer native Windows acceptance from the cross-platform fixture coverage.

✅ 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-320-canonical-contract-fix branch from c59ea8f to 4326820 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 4326820b7e0ce47bf8bcefef6561467e97cd37a7. Fresh focused 1/1, 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 4326820b7e0ce47bf8bcefef6561467e97cd37a7 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 Understood. I’m requesting a fresh full review of exact head 4326820b7e0ce47bf8bcefef6561467e97cd37a7 against base 690cb32240a86001fdc4c3acc58e63638814d20e. Prior results for older commits will not be treated as current, and cross-platform fixture coverage will not be represented as native Windows acceptance.

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

Exact-head independent review: BLOCKED at 4326820b7e0ce47bf8bcefef6561467e97cd37a7 on base 690cb32240a86001fdc4c3acc58e63638814d20e.

[Major] Make the committed evidence-key test non-vacuous — crates/cmtraceopen-parser/tests/sccm_client_health_fixture_contract.rs:119-139

The loop validates the shape of whatever siteCode= values happen to exist, but it never asserts that the four intended site facts remain present, that they are exactly the corpus key LAB, or that each evidence key matches its scenario manifest. Removing all four facts makes the loop execute zero assertions; changing a manifest to ABC and its evidence to a different valid XYZ also passes. Either mutation breaks the evidence-first site/MP transaction contract this correction is meant to lock. Assert the exact nine manifest LAB values plus the expected four evidence occurrences (success lines 1-2 and transport-failure lines 1-2), and bind each occurrence to that scenario's manifest site code.

Everything else inspected is coherent at this SHA: nine scenarios; current manifest/evidence values are LAB; canonical ccmsetup.lo_ rename/basename/relative path/sanitized provenance/118-byte identity; inherited parser-fixture -text attribute; expected/evidence references; exact-byte corpus integrity; conservative client-only coverage; privacy/synthetic/native boundaries; no #319 README/plan overlap; no PR closing keyword.

Fresh verification passed: focused 1/1; exact-byte validator; full parser 595/595 (349 + 222 + 1 health + 1 client intake + 1 server intake + 21 SCCM); strict Clippy; wasm32; npx tsc --noEmit; owned Rust 1.88 formatting; git diff --check.

CodeRabbit is not an approval at this SHA: commit status description is Review rate limited; the exact local CLI attempt also returned rate_limit (40 minutes). The GitHub incremental response belongs to stale head c59ea8f. A substantive exact-head CodeRabbit review remains required after the test fix.

@adamgell

Copy link
Copy Markdown
Owner Author

Review correction pushed at exact head 12a1d9e (test(sccm): pin client health site evidence).

TDD red: the new focused test initially failed to compile because the exact site-contract validator did not exist. The correction now fails closed for a valid-but-wrong manifest code, a missing fact, a valid-but-mismatched evidence code, and a fact moved off its contracted line.

Pinned contract: all 9 health manifests use LAB; only the success and transport-failure LocationServices fixtures contain site facts; each has exactly 2 facts on lines 1–2; all 4 facts equal the matching scenario manifest. Canonical ccmsetup.lo_ and its path/provenance/bytes contract remain unchanged.

Fresh exact-head verification: focused health 2/2; exact-byte validator PASS (9 scenarios, 23 physical artifacts); full parser 596/596; strict Clippy; wasm32; npx tsc --noEmit; owned rustfmt; git diff --check — all green. No native Windows acceptance is claimed.

@coderabbitai review

Review exact head 12a1d9e against base 690cb32240a86001fdc4c3acc58e63638814d20e, including the non-vacuous adversarial mutations. A skipped, incremental-only, or rate-limited response is not approval.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="690cb32240a86001fdc4c3acc58e63638814d20e"
head_short="12a1d9e"

echo "== HEAD identity =="
git rev-parse HEAD
git show -s --format='%H%n%P%n%s' HEAD

echo "== Base availability and ancestry =="
git cat-file -e "${base}^{commit}"
git merge-base --is-ancestor "$base" HEAD
echo "base_is_ancestor=yes"

echo "== Changed files (base...HEAD) =="
git diff --name-status "$base"...HEAD
echo
echo "== Diff stat =="
git diff --stat "$base"...HEAD
echo
echo "== Candidate test/fixture paths =="
fd . | rg -i 'sccm|health|locationservices|ccmsetup|fixture'

Length of output: 58894


🏁 Script executed:

#!/bin/bash
set -euo pipefail

test_file="crates/cmtraceopen-parser/tests/sccm_client_health_fixture_contract.rs"
health_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/health"
base="690cb32240a86001fdc4c3acc58e63638814d20e"

echo "== Test structure =="
ast-grep outline "$test_file" --items all

echo
echo "== New contract test =="
cat -n "$test_file"

echo
echo "== Exact diff for changed manifests and artifacts =="
git diff --find-renames --find-copies --unified=40 "$base"...HEAD -- "$health_root" 'docs/sccm/preparation/issue-320-client-health-corpus.md'

echo
echo "== Independent manifest/filesystem byte validation =="
python3 - <<'PY'
import json
from pathlib import Path

root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/client/health")
manifests = sorted(root.glob("*/manifest.json"))
print(f"scenario_count={len(manifests)}")
for manifest_path in manifests:
    data = json.loads(manifest_path.read_text())
    scenario = manifest_path.parent.name
    print(f"\n[{scenario}]")
    print(f"  siteCode={data.get('siteCode')!r}")
    artifacts = data.get("artifacts", [])
    print(f"  artifact_count={len(artifacts)}")
    for artifact in artifacts:
        rel = artifact.get("relativePath")
        declared = artifact.get("byteCount")
        if rel is None:
            continue
        physical = manifest_path.parent / rel
        actual = physical.stat().st_size if physical.is_file() else None
        status = "OK" if actual == declared else "MISMATCH"
        print(f"  {status}: {rel} declared={declared} actual={actual} source={artifact.get('sourcePath')!r} provenance={artifact.get('provenance')!r}")
PY

echo
echo "== Site-code evidence occurrences in health artifacts =="
rg -n -i -C1 'siteCode\s*=\s*|site code|LAB|CONTOSO' "$health_root"

Length of output: 83424


🏁 Script executed:

#!/bin/bash
set -euo pipefail

health_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/health"
rotation_manifest="$health_root/rotation-boundary/manifest.json"

echo "== Comparable fixture-contract assertions =="
for f in \
  crates/cmtraceopen-parser/tests/sccm_client_intake_fixture_contract.rs \
  crates/cmtraceopen-parser/tests/sccm_server_intake_fixture_contract.rs \
  crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
do
  if [ -f "$f" ]; then
    echo "-- $f"
    rg -n -C2 'relativePath|sanitizedSourcePath|originalBasename|bytesCopied|ends_with|assert_eq!' "$f"
  fi
done

echo
echo "== Rotation rollover metadata =="
python3 - "$rotation_manifest" <<'PY'
import json, sys
from pathlib import Path
p = Path(sys.argv[1])
m = json.loads(p.read_text())
r = next(a for a in m["artifacts"] if a["rotation"]["kind"] == "lo")
for key in ("originalBasename", "relativePath", "sanitizedSourcePath", "bytesCopied", "pathFingerprint"):
    print(f"{key}={r.get(key)!r}")
fixture = p.parent / r["relativePath"]
print(f"fixture={fixture}")
print(f"is_file={fixture.is_file()}")
print(f"actual_bytes={fixture.stat().st_size if fixture.is_file() else None}")
PY

echo
echo "== Corrected whole-health manifest/filesystem validation =="
python3 - "$health_root" <<'PY'
import json, sys
from pathlib import Path
root = Path(sys.argv[1])
failures = []
total_physical = 0
for p in sorted(root.glob("*/manifest.json")):
    m = json.loads(p.read_text())
    scenario = p.parent.name
    code = m.get("bundle", {}).get("siteCode")
    if code != "LAB":
        failures.append(f"{scenario}: bundle.siteCode={code!r}")
    for a in m["artifacts"]:
        rel = a.get("relativePath")
        if rel is None:
            continue
        total_physical += 1
        f = p.parent / rel
        if not f.is_file():
            failures.append(f"{scenario}: missing {rel}")
        elif f.stat().st_size != a["bytesCopied"]:
            failures.append(f"{scenario}: bytes {rel}: declared={a['bytesCopied']} actual={f.stat().st_size}")
print(f"manifests={len(list(root.glob('*/manifest.json')))}")
print(f"referenced_physical_artifacts={total_physical}")
print("PASS" if not failures else "FAIL\n" + "\n".join(failures))
PY

echo
echo "== Legacy rollover spelling in health/docs paths =="
rg -n -i 'ccmsetup[.]log[.]lo_|CONTOSO' "$health_root" docs/sccm/preparation/issue-320-client-health-corpus.md || true

Length of output: 16788


@adamgell I reviewed exact head 12a1d9ea245a2c9b27322136a047126320e4b278 against base 690cb32240a86001fdc4c3acc58e63638814d20e.

Finding

  • Line 292 / Line 300: The rollover contract only checks that relativePath and sanitizedSourcePath end with /ccmsetup.lo_. This does not pin the canonical paths claimed by the PR: a change to, for example, evidence/other/ccmsetup.lo_ together with a matching physical file—or SYNTHETIC://different-root/ccmsetup.lo_—would pass despite changing the fixture layout/provenance. Assert the full expected values:
    • evidence/client-ccmsetup/lo/ccmsetup.lo_
    • SYNTHETIC://root-a/ccmsetup/Logs/ccmsetup.lo_

The site-evidence validator is otherwise non-vacuous: it pins all nine manifest codes to LAB, restricts facts to the two expected LocationServices files, requires exactly two facts on Lines 1–2, validates their manifest agreement, and its four adversarial mutations exercise the intended failure modes. Independent inspection also confirmed 9 manifests, 23 referenced physical artifacts with matching byte counts, and no scoped legacy CONTOSO or ccmsetup.log.lo_ occurrences. No native Windows acceptance was inferred.

You are interacting with an AI system.

@adamgell

Copy link
Copy Markdown
Owner Author

CodeRabbit finding at comment 5136529483 is fixed in exact head 23350d7 (test(sccm): pin client health rollover paths).

TDD red: client_health_rotation_contract_pins_full_paths initially failed to compile because the exact rollover validator did not exist. The new adversarial cases mutate the relative path to evidence/other/ccmsetup.lo_ and the provenance to SYNTHETIC://different-root/ccmsetup.lo_; both now fail closed even though the filename suffix remains canonical.

The committed contract pins:

  • relativePath = evidence/client-ccmsetup/lo/ccmsetup.lo_
  • sanitizedSourcePath = SYNTHETIC://root-a/ccmsetup/Logs/ccmsetup.lo_
  • exact basename, physical presence, and byte identity

Fresh exact-head gates: focused health 3/3; exact-byte validator PASS (9 scenarios, 23 physical artifacts); full parser 597/597; strict Clippy; wasm32; TypeScript; owned rustfmt; diff check — all green.

@coderabbitai review

Re-review exact head 23350d7 against base 690cb32240a86001fdc4c3acc58e63638814d20e and confirm the full-path finding is closed. A skipped, incremental-only, or rate-limited response is not approval.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="690cb32240a86001fdc4c3acc58e63638814d20e"
head="23350d7"

echo "== Commit identity and ancestry =="
git rev-parse HEAD
git rev-parse "$head^{commit}"
git show -s --format='%H%n%P%n%s' "$head"
git cat-file -e "${base}^{commit}"
git merge-base --is-ancestor "$base" "$head"
echo "base_is_ancestor=yes"

echo
echo "== Changed files (base...head) =="
git diff --name-status "$base...$head"
echo
git diff --stat "$base...$head"

echo
echo "== Contract test outline =="
test_file="crates/cmtraceopen-parser/tests/sccm_client_health_fixture_contract.rs"
ast-grep outline "$test_file" --items all

echo
echo "== Full-path assertions and adversarial mutations =="
rg -n -C5 \
  'client_health_rotation_contract_pins_full_paths|evidence/client-ccmsetup/lo/ccmsetup[.]lo_|SYNTHETIC://root-a/ccmsetup/Logs/ccmsetup[.]lo_|evidence/other/ccmsetup[.]lo_|SYNTHETIC://different-root/ccmsetup/Logs/ccmsetup[.]lo_|sanitizedSourcePath|relativePath' \
  "$test_file"

echo
echo "== Diff for contract test and rotation manifest =="
git diff --find-renames --unified=30 "$base...$head" -- \
  "$test_file" \
  crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/rotation-boundary/manifest.json

echo
echo "== Independently inspect rollover artifact metadata and physical file =="
python3 - <<'PY'
import json
from pathlib import Path

manifest_path = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/client/health/rotation-boundary/manifest.json")
manifest = json.loads(manifest_path.read_text())
matches = [
    artifact for artifact in manifest["artifacts"]
    if artifact.get("rotation", {}).get("kind") == "lo"
]
assert len(matches) == 1, f"expected one lo artifact, found {len(matches)}"
artifact = matches[0]
for key in ("originalBasename", "relativePath", "sanitizedSourcePath", "bytesCopied"):
    print(f"{key}={artifact.get(key)!r}")
physical = manifest_path.parent / artifact["relativePath"]
print(f"physical_path={physical}")
print(f"is_file={physical.is_file()}")
print(f"actual_bytes={physical.stat().st_size if physical.is_file() else None}")
PY

echo
echo "== Detect remaining suffix-only rollover checks in this contract test =="
rg -n -C3 'ends_with\([^)]*ccmsetup[.]lo_|ends_with\([^)]*ccmsetup' "$test_file" || true

Length of output: 30630


@adamgell The full-path finding is closed at exact head 23350d7f9b4f53ca3a8d95db5cd02ae0984067f5 against base 690cb32240a86001fdc4c3acc58e63638814d20e.

Verified in crates/cmtraceopen-parser/tests/sccm_client_health_fixture_contract.rs:

  • relativePath is pinned by exact equality to evidence/client-ccmsetup/lo/ccmsetup.lo_.
  • sanitizedSourcePath is pinned by exact equality to SYNTHETIC://root-a/ccmsetup/Logs/ccmsetup.lo_.
  • The adversarial mutations to evidence/other/ccmsetup.lo_ and SYNTHETIC://different-root/ccmsetup.lo_ fail closed.
  • The fixture’s basename is ccmsetup.lo_; its physical file is present at the canonical path; and bytesCopied matches the physical size of 118 bytes.
  • No suffix-only ends_with rollover assertion remains in this contract test.

No further issue found in the requested full-path contract scope.

You are interacting with an AI system.

@adamgell
adamgell force-pushed the codex/sccm-320-canonical-contract-fix branch from 23350d7 to e515f44 Compare July 30, 2026 21:46
@adamgell

Copy link
Copy Markdown
Owner Author

Base refresh after #342 merged: the same three #320 correction commits were restacked without patch drift onto current parser-family 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea. New exact head is e515f44adc0382a41293f9eab8fb928c9f72dc71; range-diff maps all three commits =.

Fresh current-base gates: focused 3/3; exact-byte validator (9 scenarios, 23 physical artifacts); full parser 618/618; strict Clippy; wasm32; TypeScript; owned rustfmt; diff check — all green.

@coderabbitai review

Review exact head e515f44adc0382a41293f9eab8fb928c9f72dc71 against exact base 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea. Confirm the prior full-path finding remains closed. 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

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea"
head="e515f44adc0382a41293f9eab8fb928c9f72dc71"
test_file="crates/cmtraceopen-parser/tests/sccm_client_health_fixture_contract.rs"
health_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/health"
rotation_manifest="$health_root/rotation-boundary/manifest.json"

echo "== Requested commit identity and ancestry =="
printf 'checked_head='; git rev-parse "$head^{commit}"
git show -s --format='parents=%P%nsubject=%s' "$head"
git cat-file -e "${base}^{commit}"
git merge-base --is-ancestor "$base" "$head"
echo "base_is_ancestor=yes"

echo
echo "== Changed paths and diff stat (base...head) =="
git diff --name-status "$base...$head"
git diff --stat "$base...$head"

echo
echo "== Contract test structure =="
ast-grep outline "$test_file" --items all

echo
echo "== Contract test source =="
cat -n "$test_file"

echo
echo "== Complete scoped diff =="
git diff --find-renames --find-copies --unified=60 "$base...$head" -- \
  "$test_file" \
  "$health_root" \
  "docs/sccm/preparation/issue-320-client-health-corpus.md"

echo
echo "== Independent fixture contract validation =="
python3 - "$health_root" "$rotation_manifest" <<'PY'
import json
import re
import sys
from pathlib import Path

root = Path(sys.argv[1])
rotation_manifest = Path(sys.argv[2])
failures = []
manifests = sorted(root.glob("*/manifest.json"))
site_fact_files = {}
physical_count = 0

for manifest_path in manifests:
    manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
    scenario = manifest_path.parent.name
    site = manifest.get("bundle", {}).get("siteCode")
    if site != "LAB":
        failures.append(f"{scenario}: bundle.siteCode expected LAB, got {site!r}")
    for artifact in manifest.get("artifacts", []):
        rel = artifact.get("relativePath")
        if rel is None:
            continue
        physical_count += 1
        path = manifest_path.parent / rel
        if not path.is_file():
            failures.append(f"{scenario}: missing physical artifact {rel}")
        elif path.stat().st_size != artifact.get("bytesCopied"):
            failures.append(
                f"{scenario}: bytesCopied for {rel}: declared={artifact.get('bytesCopied')!r}, actual={path.stat().st_size}"
            )
        if path.is_file():
            matches = [
                (i + 1, m.group(1))
                for i, line in enumerate(path.read_text(encoding="utf-8", errors="replace").splitlines())
                for m in [re.search(r"(?i)\bsite\s*code\s*[:=]\s*([A-Za-z0-9]+)", line)]
                if m
            ]
            if matches:
                site_fact_files[str(path.relative_to(root))] = matches

print(f"manifests={len(manifests)}")
print(f"referenced_physical_artifacts={physical_count}")
print("site_facts=" + repr(site_fact_files))

expected_evidence = {
    "success/evidence/client-location-services/LocationServices.log": [(1, "LAB"), (2, "LAB")],
    "transport-failure/evidence/client-location-services/LocationServices.log": [(1, "LAB"), (2, "LAB")],
}
if site_fact_files != expected_evidence:
    failures.append(
        f"site evidence expected {expected_evidence!r}, got {site_fact_files!r}"
    )

rotation = json.loads(rotation_manifest.read_text(encoding="utf-8"))
lo = [
    a for a in rotation["artifacts"]
    if a.get("rotation", {}).get("kind") == "lo"
]
if len(lo) != 1:
    failures.append(f"rotation-boundary: expected exactly one lo artifact, got {len(lo)}")
else:
    artifact = lo[0]
    expected = {
        "originalBasename": "ccmsetup.lo_",
        "relativePath": "evidence/client-ccmsetup/lo/ccmsetup.lo_",
        "sanitizedSourcePath": "SYNTHETIC://root-a/ccmsetup/Logs/ccmsetup.lo_",
    }
    for key, value in expected.items():
        if artifact.get(key) != value:
            failures.append(f"rollover {key}: expected {value!r}, got {artifact.get(key)!r}")
    physical = rotation_manifest.parent / expected["relativePath"]
    if not physical.is_file():
        failures.append(f"rollover physical artifact missing: {physical}")
    elif physical.stat().st_size != artifact.get("bytesCopied"):
        failures.append(
            f"rollover byte mismatch: declared={artifact.get('bytesCopied')!r}, actual={physical.stat().st_size}"
        )

print("RESULT=PASS" if not failures else "RESULT=FAIL\n" + "\n".join(failures))
PY

echo
echo "== Search for legacy values and suffix-only rollover checks =="
rg -n -i -C2 'CONTOSO|ccmsetup[.]log[.]lo_' "$health_root" \
  "docs/sccm/preparation/issue-320-client-health-corpus.md" "$test_file" || true
rg -n -C2 'ends_with\([^)]*(ccmsetup[.]lo_|ccmsetup)' "$test_file" || true

Length of output: 93532


@adamgell I reviewed exact head e515f44adc0382a41293f9eab8fb928c9f72dc71 against exact base 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea.

The prior full-path finding remains closed: relativePath and sanitizedSourcePath are now full-string equality checks, and the adversarial alternate-layout and alternate-provenance mutations fail closed. Static inspection also confirmed the nine LAB manifests, the two expected shared LocationServices evidence files with LAB facts on Lines 1–2, and 23 referenced physical artifacts with matching declared sizes. No native Windows acceptance is inferred.

Finding

  • Line 255: The rollover contract selects the first .lo_ artifact with .find(...), but never requires that it is the only .lo_ artifact. Adding a second .lo_ manifest entry—potentially with a different basename, path, provenance, or bytes—after the canonical entry would leave all three focused tests green. Require exactly one rotation.kind == "lo" artifact before validating its exact fields, and add an adversarial duplicate-.lo_ mutation to prove the contract fails closed.

You are interacting with an AI system.

@adamgell

Copy link
Copy Markdown
Owner Author

CodeRabbit exact-head finding at comment 5136609770 is fixed in c8b69439ac3663f712ca8ea712a81d910fc51f61 (test(sccm): reject duplicate health rollovers).

TDD red reproduced the gap: duplicating the canonical .lo_ artifact left the focused rotation test green until the new adversarial assertion failed. The validator now requires exactly one rotation.kind == "lo" artifact before checking its exact basename, full relative path, full sanitized provenance, physical file, and bytes.

Fresh gates: focused health 3/3; exact-byte validator (9 scenarios, 23 physical artifacts); full parser 618/618; strict Clippy; wasm32; TypeScript; owned rustfmt; diff check — all green.

@coderabbitai review

Review exact head c8b69439ac3663f712ca8ea712a81d910fc51f61 against exact base 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea and confirm the duplicate-.lo_ finding is closed. 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

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea"
head="c8b69439ac3663f712ca8ea712a81d910fc51f61"
test_file="crates/cmtraceopen-parser/tests/sccm_client_health_fixture_contract.rs"
health_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/health"
rotation_manifest="$health_root/rotation-boundary/manifest.json"

echo "== Commit identity and ancestry =="
printf "checked_head="; git rev-parse "${head}^{commit}"
git show -s --format='parents=%P%nsubject=%s' "$head"
git cat-file -e "${base}^{commit}"
git merge-base --is-ancestor "$base" "$head"
echo "base_is_ancestor=yes"

echo
echo "== Changed paths and stat (base...head) =="
git diff --name-status "$base...$head"
git diff --stat "$base...$head"

echo
echo "== Contract test outline =="
ast-grep outline "$test_file" --items all

echo
echo "== Exact duplicate-rollover contract implementation and test coverage =="
rg -n -C8 \
  'rotation.*kind|[.]lo_|exactly one|duplicate|assert.*eq|client_health_rotation' \
  "$test_file"

echo
echo "== Scoped base-to-head diff =="
git diff --find-renames --find-copies --unified=50 "$base...$head" -- \
  "$test_file" \
  "$health_root" \
  "docs/sccm/preparation/issue-320-client-health-corpus.md"

echo
echo "== Independent fixture invariant validation =="
python3 - "$health_root" "$rotation_manifest" <<'PY'
import json
import re
import sys
from pathlib import Path

root = Path(sys.argv[1])
rotation_manifest = Path(sys.argv[2])
failures = []
manifests = sorted(root.glob("*/manifest.json"))
physical_count = 0
site_fact_files = {}

for manifest_path in manifests:
    manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
    scenario = manifest_path.parent.name
    if manifest.get("bundle", {}).get("siteCode") != "LAB":
        failures.append(f"{scenario}: siteCode is not LAB")
    for artifact in manifest.get("artifacts", []):
        relative_path = artifact.get("relativePath")
        if relative_path is None:
            continue
        physical_count += 1
        physical = manifest_path.parent / relative_path
        if not physical.is_file():
            failures.append(f"{scenario}: missing {relative_path}")
            continue
        if physical.stat().st_size != artifact.get("bytesCopied"):
            failures.append(f"{scenario}: byte mismatch for {relative_path}")
        facts = [
            (line_number, match.group(1))
            for line_number, line in enumerate(
                physical.read_text(encoding="utf-8", errors="replace").splitlines(), 1
            )
            for match in [re.search(r"(?i)\bsite\s*code\s*[:=]\s*([A-Za-z0-9]+)", line)]
            if match
        ]
        if facts:
            site_fact_files[str(physical.relative_to(root))] = facts

expected_facts = {
    "success/evidence/client-location-services/LocationServices.log": [(1, "LAB"), (2, "LAB")],
    "transport-failure/evidence/client-location-services/LocationServices.log": [(1, "LAB"), (2, "LAB")],
}
if site_fact_files != expected_facts:
    failures.append(f"site facts mismatch: {site_fact_files!r}")

rotation = json.loads(rotation_manifest.read_text(encoding="utf-8"))
rollovers = [a for a in rotation["artifacts"] if a.get("rotation", {}).get("kind") == "lo"]
if len(rollovers) != 1:
    failures.append(f"expected exactly one lo rollover, got {len(rollovers)}")
else:
    rollover = rollovers[0]
    expected = {
        "originalBasename": "ccmsetup.lo_",
        "relativePath": "evidence/client-ccmsetup/lo/ccmsetup.lo_",
        "sanitizedSourcePath": "SYNTHETIC://root-a/ccmsetup/Logs/ccmsetup.lo_",
    }
    for key, value in expected.items():
        if rollover.get(key) != value:
            failures.append(f"{key}: expected {value!r}, got {rollover.get(key)!r}")
    physical = rotation_manifest.parent / expected["relativePath"]
    if not physical.is_file():
        failures.append(f"missing canonical rollover file: {physical}")
    elif physical.stat().st_size != rollover.get("bytesCopied"):
        failures.append("canonical rollover bytesCopied does not match physical size")

print(f"manifests={len(manifests)}")
print(f"referenced_physical_artifacts={physical_count}")
print(f"lo_rollover_count={len(rollovers)}")
print("RESULT=PASS" if not failures else "RESULT=FAIL\n" + "\n".join(failures))
PY

echo
echo "== Legacy fixture names and suffix-only assertions =="
rg -n -i -C2 'CONTOSO|ccmsetup[.]log[.]lo_' \
  "$health_root" "docs/sccm/preparation/issue-320-client-health-corpus.md" "$test_file" || true
rg -n -C2 'ends_with\([^)]*(ccmsetup[.]lo_|ccmsetup)' "$test_file" || true

Length of output: 81547


🏁 Script executed:

#!/bin/bash
set -euo pipefail

health_root="crates/cmtraceopen-parser/tests/fixtures/sccm/client/health"
rotation_manifest="$health_root/rotation-boundary/manifest.json"

python3 - "$health_root" "$rotation_manifest" <<'PY'
import json
import re
import sys
from pathlib import Path

root = Path(sys.argv[1])
rotation_manifest = Path(sys.argv[2])
failures = []
site_fact_files = {}
physical_count = 0
manifests = sorted(root.glob("*/manifest.json"))

for manifest_path in manifests:
    manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
    scenario = manifest_path.parent.name
    if manifest.get("bundle", {}).get("siteCode") != "LAB":
        failures.append(f"{scenario}: bundle.siteCode must be LAB")

    for artifact in manifest.get("artifacts", []):
        relative_path = artifact.get("relativePath")
        if relative_path is None:
            continue
        physical_count += 1
        physical = manifest_path.parent / relative_path
        if not physical.is_file():
            failures.append(f"{scenario}: missing artifact {relative_path}")
            continue
        if physical.stat().st_size != artifact.get("bytesCopied"):
            failures.append(f"{scenario}: byte mismatch for {relative_path}")

        facts = []
        for line_number, line in enumerate(
            physical.read_text(encoding="utf-8", errors="replace").splitlines(), 1
        ):
            facts.extend(
                (line_number, match.group(1))
                for match in re.finditer(r"siteCode=([A-Za-z0-9]+)", line)
            )
        if facts:
            site_fact_files[str(physical.relative_to(root))] = facts

expected_site_facts = {
    "success/evidence/client-location-services-shared/current/LocationServices.log": [
        (1, "LAB"), (2, "LAB")
    ],
    "transport-failure/evidence/client-location-services-shared/current/LocationServices.log": [
        (1, "LAB"), (2, "LAB")
    ],
}
if site_fact_files != expected_site_facts:
    failures.append(f"site facts mismatch: {site_fact_files!r}")

rotation = json.loads(rotation_manifest.read_text(encoding="utf-8"))
rollovers = [
    artifact for artifact in rotation["artifacts"]
    if artifact.get("rotation", {}).get("kind") == "lo"
]
expected_rollover = {
    "originalBasename": "ccmsetup.lo_",
    "relativePath": "evidence/client-ccmsetup/lo/ccmsetup.lo_",
    "sanitizedSourcePath": "SYNTHETIC://root-a/ccmsetup/Logs/ccmsetup.lo_",
}
if len(rollovers) != 1:
    failures.append(f"expected exactly one rollover, got {len(rollovers)}")
else:
    rollover = rollovers[0]
    for key, expected in expected_rollover.items():
        if rollover.get(key) != expected:
            failures.append(f"{key}: expected {expected!r}, got {rollover.get(key)!r}")
    physical = rotation_manifest.parent / expected_rollover["relativePath"]
    if not physical.is_file():
        failures.append("canonical rollover physical artifact is absent")
    elif physical.stat().st_size != rollover.get("bytesCopied"):
        failures.append(
            f"rollover bytes: declared={rollover.get('bytesCopied')!r}, "
            f"actual={physical.stat().st_size}"
        )

print(f"manifests={len(manifests)}")
print(f"referenced_physical_artifacts={physical_count}")
print(f"lo_rollover_count={len(rollovers)}")
print("RESULT=PASS" if not failures else "RESULT=FAIL\n" + "\n".join(failures))
PY

Length of output: 3597


@adamgell The duplicate-.lo_ finding is closed at exact head c8b69439ac3663f712ca8ea712a81d910fc51f61 against base 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea.

Verified in crates/cmtraceopen-parser/tests/sccm_client_health_fixture_contract.rs:

  • The validator filters all rotation.kind == "lo" artifacts and fails unless there is exactly one.
  • The duplicate adversarial mutation appends a cloned canonical rollover and asserts the exact-one failure, so the prior first-match gap fails closed.
  • The unique rollover remains pinned to its exact basename, full relative path, full sanitized provenance, physical fixture, and byte count.
  • Independent validation passed for all 9 manifests, 23 referenced physical artifacts, the two contracted LAB evidence files, and exactly one rollover artifact.

No further issue found in the requested scope. No native Windows acceptance is inferred.

You are interacting with an AI system.

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

Reviewed c8b69439ac3663f712ca8ea712a81d910fc51f61 against exact base 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea. I found no actionable blocker in the #320 correction scope.

Contract verification

  • All 9 manifests use exact synthetic site code LAB.
  • Site evidence is non-vacuously pinned to exactly four facts: success and transport-failure LocationServices.log, lines 1–2, both values matching their scenario manifest.
  • The wrong-valid manifest, missing fact, mismatched valid evidence value, and moved-line mutations all fail closed (4/4 independently reproduced).
  • The rollover validator requires exactly one rotation.kind == "lo" artifact before field validation. The duplicate-.lo_ mutation fails with the exact-one contract, closing the prior first-match gap.
  • The unique rollover is pinned to:
    • originalBasename = ccmsetup.lo_
    • relativePath = evidence/client-ccmsetup/lo/ccmsetup.lo_
    • sanitizedSourcePath = SYNTHETIC://root-a/ccmsetup/Logs/ccmsetup.lo_
  • Both alternate suffix-matching relative/provenance mutations fail closed.
  • The physical rollover is present and exactly 118 bytes. The pre-rename and post-rename Git blobs are identical (f0067020d55609858d56fe9ed909bb31fdbe3936; SHA-256 1db27c27ba131e2313e885b1db41f1bb8e24eaf3c223d747d78f586e82d99bd8).

Stack and boundaries

  • git range-diff maps all three pre-restack commits identically (=); c8b6943 is the sole additional duplicate-rollover correction.
  • All 14 changed paths are confined to the #320 health fixture corpus, its fixture-contract test, and its preparation document.
  • No parser production source, Tauri/native collection, Windows I/O, Cargo dependency, or another issue family's files changed.
  • All manifests remain proposalOnly and syntheticFixture; every non-null source path uses SYNTHETIC://, fingerprints are synthetic, and versions are test-only.
  • No PR/commit closing keyword is present; issue #320 remains open. No native Windows acceptance is inferred.

Fresh verification at this exact SHA

  • cargo test --locked -p cmtraceopen-parser --test sccm_client_health_fixture_contract --quiet — 3/3 passed
  • Independent exact contract/byte validator — 9 manifests, 23 referenced physical artifacts, 4/4 site adversarial mutations rejected, 3/3 rollover mutations rejected (relative path, provenance path, duplicate), PASS
  • cargo test --locked -p cmtraceopen-parser --quiet — 618 passed (351 + 222 + 3 + 1 + 1 + 40)
  • cargo clippy --locked -p cmtraceopen-parser --all-targets --all-features -- -D warnings — passed
  • cargo check --locked -p cmtraceopen-parser --target wasm32-unknown-unknown — passed
  • npx tsc --noEmit — passed
  • Rust 1.88 and current rustfmt on the owned Rust test — passed
  • git diff --check, issue-scope/no-overlap, no-native-production, privacy/provenance, secret, and no-closing-keyword checks — passed
  • Exact-head review worktree remained clean

CodeRabbit

CodeRabbit’s fresh response 5136652227 is substantive and explicitly anchored to this exact base/head. It confirms the exact-one filter, duplicate adversarial mutation, canonical paths/provenance/physical bytes, 9 manifests, 23 artifacts, and closure of the prior finding. This is not a skipped, incremental-only, or rate-limited response.

This PASS supersedes my stale older-SHA blocker review. It is limited to the synthetic preparation/corpus correction and does not close #320 or authorize production/native expansion.

@adamgell
adamgell merged commit 781fb9c into codex/parser-family-skeleton Jul 30, 2026
1 check passed
adamgell added a commit that referenced this pull request Aug 4, 2026
Part of #320. Pin exact LAB site evidence and the canonical unique ccmsetup.lo_ rollover contract with fail-closed adversarial fixture tests. No production reducer or native acceptance.
adamgell added a commit that referenced this pull request Sep 18, 2026
…t-1.6.0 fixes (#633)

* docs(changelog): cite the shipped issue numbers and record main's post-1.6.0 fixes

Three things were wrong with the changelog as it stood after the 1.6.0 cut.

**The 1.6.0 section under-cited its own SCCM work.** A check across every commit
in the tag (`v1.5.2..9bbaf67`) found twelve issue numbers that shipped without
appearing anywhere in the section: #335, #336, #342, #344, #346, #348, #350,
#394, #404, #418, #444, #458. They are the foundation and hardening under the one
SCCM bullet — diagnostic spine, evidence framing, canonical intake and health
contracts, signal tokens, correlation keys, coverage assessment, bounded ids,
overlapping evidence ranges, client discovery, DP-to-intake binding. The bullet
now names them. Two more were folded into bullets that described their work
without citing them: the CodeRabbit retarget and review charter (#537, #538 under
the agent-tooling bullet) and the framework's own extraction (#543, #548 under
Reducer Framework v1).

**Main carries two fixes the 1.6.0 tag does not.** `[Unreleased]` was empty while
`9bbaf67e..main` held the updater-manifest publisher fix and the `rustls` advisory
bump, so both are recorded now.

Verified: a script that walks every `feat`/`fix`/`perf`/`refactor`/`build`/`ci`
commit in the tag, extracts its issue references and checks them against both the
1.6.0 and 1.5.2 sections now reports zero undocumented references. The one that
looked missing before, #521, is documented under 1.5.2 where it shipped.

* docs(changelog): name the redaction boundary decision in the 1.6.0 section

The section cited the work but never named ADR-004 revision 1 or the ruling that
makes it load-bearing. The changelog is the durable record, so the decision now
appears there with the audit finding that motivated it, what changed (projected
form is the only constructible public form, preserving variants are explicitly
named local-only entry points), and a pointer to the document that carries the
eight rulings.

* docs(changelog): say the redaction decision in plain English

Same decision, no jargon: 'covered almost none of the places data actually leaves
the app' rather than 'binds at almost no real export surface', 'the version
holding the real values' rather than 'the preserving variant', and the check
described as following through nested data rather than as structural enforcement
being recursive. The eight rulings and the ADR link are unchanged.
@adamgell
adamgell deleted the codex/sccm-320-canonical-contract-fix 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants