Repository navigation
Conversation
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe rotation-boundary SCCM site-core fixture now consistently uses ChangesSCCM site-core fixture validation
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
|
@coderabbitai full review Please review exact head |
|
Your plan includes PR reviews subject to rate limits. More reviews will be available in 1 minute. |
There was a problem hiding this comment.
Pull request overview
This PR aligns the SCCM site-core test corpus and its contract checks with ConfigMgr’s documented rollover grammar by treating sitecomp.log rollovers as sitecomp.lo_ (not sitecomp.log.lo_). It also adds a focused, cross-platform contract test to ensure the committed fixtures remain internally consistent (paths, bytes copied, and requested-artifact basenames).
Changes:
- Added a new
sccm_site_core_fixture_contracttest that validates scenario matrix invariants (site code format, coverage/fragment semantics, canonical.lo_rollover basename, resolvable paths, and exact bytes). - Updated the
rotation-boundarysite-core fixture manifest and expected output to use the canonicalsitecomp.lo_rollover basename/path. - Added/renamed the committed rollover fixture file to match the updated manifest path and basename.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs | New contract test for site-core fixtures (site code, coverage semantics, canonical rollover basename/path, bytes, and requested-artifact basenames). |
| crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/manifest.json | Corrects rollover artifact originalBasename and relativePath to sitecomp.lo_. |
| crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/expected.json | Updates requested-artifact basenames to request sitecomp.lo_ and forbid sitecomp.log.lo_. |
| crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/evidence/sccm/server/site-core/sitecomp/lo_/sitecomp.lo_ | Adds/renames the .lo_ rollover fixture file to match the corrected contract paths. |
|
@coderabbitai review Review exact head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
head='02bd3727a6be42e3625e3239d268941087cd3d9b'
git cat-file -e "${head}^{commit}"
printf '%s\n' '== HEAD =='
git show -s --format='%H%nParents: %P%nSubject: %s' "$head"
base="$(git merge-base "$head" origin/main 2>/dev/null || git merge-base "$head" main)"
printf '%s\n' "== MERGE BASE: $base =="
printf '%s\n' '== DIFF STAT =='
git diff --stat "$base" "$head"
printf '%s\n' '== CHANGED FILES =='
git diff --name-status "$base" "$head"
printf '%s\n' '== OUTLINES FOR CHANGED SOURCE FILES =='
git diff --name-only "$base" "$head" | while IFS= read -r f; do
case "$f" in
*.rs|*.py)
echo "--- $f"
ast-grep outline "$f" --items all || true
;;
esac
doneLength of output: 35453 🏁 Script executed: #!/bin/bash
set -euo pipefail
head='02bd3727a6be42e3625e3239d268941087cd3d9b'
parent="$(git rev-parse "${head}^")"
printf '%s\n' '== INCREMENTAL PATCH =='
git diff --find-renames --find-copies --no-ext-diff "$parent" "$head" -- \
crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs \
crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core \
crates/cmtraceopen-parser/tests/sccm_spine_contract.rs \
crates/cmtraceopen-parser/src/sccm/catalog.rs
printf '%s\n' '== SITE-CORE FIXTURE CONTRACT TEST =='
cat -n crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs
printf '%s\n' '== CATALOG SITE COMPONENT ENTRIES AND NAME PARSING =='
sed -n '100,190p' crates/cmtraceopen-parser/src/sccm/catalog.rs
sed -n '401,535p' crates/cmtraceopen-parser/src/sccm/catalog.rs
printf '%s\n' '== ROTATION GRAMMAR TESTS =='
sed -n '249,430p' crates/cmtraceopen-parser/tests/sccm_spine_contract.rs
printf '%s\n' '== SITE-CORE MANIFEST STATIC CONSISTENCY =='
python3 - <<'PY'
import hashlib
import json
from pathlib import Path
root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core")
errors = []
for manifest_path in sorted(root.glob("*/manifest.json")):
doc = json.loads(manifest_path.read_text())
for i, artifact in enumerate(doc.get("artifacts", [])):
evidence = artifact.get("evidence")
if evidence is not None:
path = manifest_path.parent / evidence
if not path.is_file():
errors.append(f"{manifest_path}: artifacts[{i}] missing evidence {evidence}")
requested = artifact.get("requestedArtifact", "")
if requested.endswith(".log.lo_") and "sitecomp" in requested.lower():
errors.append(f"{manifest_path}: artifacts[{i}] forbidden sitecomp rollover {requested}")
if "sitecomp.log.lo_" in str(artifact):
errors.append(f"{manifest_path}: artifacts[{i}] contains forbidden sitecomp.log.lo_")
print("manifests:", len(list(root.glob("*/manifest.json"))))
print("errors:", len(errors))
print("\n".join(errors))
PY
printf '%s\n' '== RELEVANT FIXTURE FILES (PATH, SIZE, SHA-256) =='
find crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core \
-type f \( -name 'manifest.json' -o -name 'sitecomp.log' -o -name 'sitecomp.lo_' \) \
-print0 | sort -z | xargs -0 sha256sumLength of output: 25837 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== ROTATION-BOUNDARY MANIFEST AND EXPECTED OUTPUT =='
cat -n crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/manifest.json
cat -n crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/expected.json
printf '%s\n' '== CAPPED/INCOMPLETE SITE-CORE MANIFESTS =='
for f in \
crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/incomplete/manifest.json \
crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/malformed/manifest.json; do
echo "--- $f"
cat -n "$f"
done
printf '%s\n' '== DOCUMENTED COVERAGE AND ROTATION CONTRACT EXCERPTS =='
rg -n -i -C 4 'fragmentComplete|captureState|capped|sitecomp\.lo_|sitecomp\.log\.lo_' \
docs/sccm/preparation/issue-327-server-site-core-corpus.md \
docs/superpowers/plans/2026-07-30-sccm-server-intake-and-core.md
printf '%s\n' '== COMPLETE SITE-CORE STATIC INVARIANTS =='
python3 - <<'PY'
import json
from collections import Counter, defaultdict
from pathlib import Path
root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core")
counts = Counter()
complete_by_state = defaultdict(list)
errors = []
for manifest_path in sorted(root.glob("*/manifest.json")):
doc = json.loads(manifest_path.read_text(encoding="utf-8"))
scenario = manifest_path.parent.name
artifacts = doc.get("artifacts", [])
for n, artifact in enumerate(artifacts):
state = artifact.get("captureState", "<missing>")
rotation = artifact.get("rotation", {})
complete = rotation.get("fragmentComplete", "<missing>")
counts[state] += 1
if complete is True:
complete_by_state[state].append(f"{scenario}[{n}]")
rel = artifact.get("relativePath")
if rel is not None and not (manifest_path.parent / rel).is_file():
errors.append(f"{scenario}[{n}]: unresolvable relativePath {rel!r}")
if state == "captured" and rel is not None:
declared = artifact.get("bytesCopied")
actual = (manifest_path.parent / rel).stat().st_size
if declared != actual:
errors.append(f"{scenario}[{n}]: bytesCopied={declared!r}, actual={actual}")
print("captureState counts:", dict(sorted(counts.items())))
print("complete fragments by state:", dict(sorted(complete_by_state.items())))
print("errors:", errors)
rotation_manifest = root / "rotation-boundary" / "manifest.json"
rotation = json.loads(rotation_manifest.read_text())
rollovers = [a for a in rotation["artifacts"] if a.get("rotation", {}).get("kind") == "loUnderscore"]
print("lo_ artifacts:", [(a.get("originalBasename"), a.get("relativePath"), a.get("bytesCopied")) for a in rollovers])
PY
printf '%s\n' '== ALL SITE-COMP ROLLOVER REFERENCES =='
rg -n -i -C 2 'sitecomp(\.log)?\.lo_' \
crates/cmtraceopen-parser/tests \
docs/sccm/preparation/issue-327-server-site-core-corpus.mdLength of output: 38294
No actionable findings in the capped-fragment negative test or canonical site-core rollover correction. The corpus consistently uses ✅ Action performedReview finished.
|
02bd372 to
cb3e153
Compare
|
Rebased cleanly onto byte-stable parser-family base Fresh post-rebase verification: focused site-core 2/2; exact-byte corpus validator PASS; full parser 596/596; strict Clippy; wasm32; 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 |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='99554f4aef0c06b2ce81eaf257c76058c38c06c0'
head='cb3e153143b7e86db0e19b46f54855c59443cb42'
git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"
git merge-base --is-ancestor "$base" "$head"
printf '%s\n' '== REQUESTED RANGE =='
git show -s --format='base: %H%nparents: %P%nsubject: %s' "$base"
git show -s --format='head: %H%nparents: %P%nsubject: %s' "$head"
printf '%s\n' '== CHANGED FILES =='
git diff --find-renames --find-copies --name-status "$base" "$head"
printf '%s\n' '== DIFF STAT =='
git diff --stat "$base" "$head"
printf '%s\n' '== COMPLETE PATCH =='
git diff --find-renames --find-copies --no-ext-diff "$base" "$head"
printf '%s\n' '== CHANGED RUST OUTLINES =='
git diff --name-only "$base" "$head" | while IFS= read -r path; do
case "$path" in
*.rs)
printf '%s\n' "--- $path"
ast-grep outline "$path" --items all
;;
esac
done
printf '%s\n' '== SITE-CORE CONTRACT TEST =='
contract_path="$(fd -t f '^sccm_site_core_fixture_contract\.rs$' crates)"
test -n "$contract_path"
cat -n "$contract_path"
printf '%s\n' '== CHANGED FIXTURE JSON =='
git diff --name-only "$base" "$head" | while IFS= read -r path; do
case "$path" in
*.json)
printf '%s\n' "--- $path"
cat -n "$path"
;;
esac
doneLength of output: 24575 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== CANDIDATE DOCUMENTATION AND PARSER FILES =='
fd -t f . docs crates | rg '(^|/)(issue-327-server-site-core-corpus|2026-07-30-sccm-server-intake-and-core|catalog|sccm_spine_contract)\.(md|rs)$' || true
printf '%s\n' '== DOCUMENTED COVERAGE / ROTATION CONTRACT =='
rg -n -i -C 5 'fragmentComplete|captureState|capped|accessDenied|unsupported|sitecomp\.lo_|sitecomp\.log\.lo_|loUnderscore' \
docs crates/cmtraceopen-parser/tests/sccm_spine_contract.rs \
crates/cmtraceopen-parser/src/sccm/catalog.rs || true
printf '%s\n' '== PARSER ROTATION GRAMMAR CONTEXT =='
catalog_path="$(fd -t f '^catalog\.rs$' crates/cmtraceopen-parser/src)"
if test -n "$catalog_path"; then
rg -n -i -C 8 'loUnderscore|\.lo_|rotation|basename|sitecomp' "$catalog_path"
fi
printf '%s\n' '== WHOLE SITE-CORE CORPUS STATIC AUDIT =='
python3 - <<'PY'
import json
from pathlib import Path
root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core")
errors = []
summary = []
for manifest_path in sorted(root.glob("*/manifest.json")):
scenario = manifest_path.parent.name
document = json.loads(manifest_path.read_text(encoding="utf-8"))
artifacts = document.get("artifacts")
if not isinstance(artifacts, list):
errors.append(f"{scenario}: artifacts is not an array")
continue
for index, artifact in enumerate(artifacts):
ident = f"{scenario}.artifacts[{index}]"
state = artifact.get("captureState")
rotation = artifact.get("rotation", {})
complete = rotation.get("fragmentComplete")
basename = artifact.get("originalBasename")
relative = artifact.get("relativePath")
if state in {"absent", "accessDenied", "capped", "skipped", "unsupported"} and complete is True:
errors.append(f"{ident}: {state} complete fragment")
if state == "captured":
if not isinstance(relative, str):
errors.append(f"{ident}: captured artifact lacks relativePath")
else:
fixture = manifest_path.parent / relative
if not fixture.is_file():
errors.append(f"{ident}: missing {relative}")
elif artifact.get("bytesCopied") != fixture.stat().st_size:
errors.append(f"{ident}: bytesCopied={artifact.get('bytesCopied')} actual={fixture.stat().st_size}")
if rotation.get("kind") == "loUnderscore":
if not isinstance(basename, str) or not basename.endswith(".lo_") or basename.endswith(".log.lo_"):
errors.append(f"{ident}: noncanonical loUnderscore basename={basename!r}")
if not isinstance(relative, str) or not relative.endswith(f"/{basename}"):
errors.append(f"{ident}: path/basename mismatch relativePath={relative!r} basename={basename!r}")
summary.append((scenario, artifact.get("artifactId"), state, rotation.get("kind"), complete))
print("manifests:", len(list(root.glob('*/manifest.json'))))
print("artifacts:", len(summary))
print("artifact tuples:")
for item in summary:
print(" ", item)
print("errors:", len(errors))
for error in errors:
print(" ERROR", error)
expected_path = root / "rotation-boundary" / "expected.json"
expected = json.loads(expected_path.read_text(encoding="utf-8"))
basenames = expected["unlinkedObservations"][0]["nextArtifacts"][0]["basenames"]
print("rotation-boundary requested basenames:", basenames)
PY
printf '%s\n' '== ALL CURRENT SITE-COMP ROLLOVER REFERENCES =='
rg -n -i -C 2 'sitecomp(\.log)?\.lo_|sitecomp\.lo_' \
crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core \
crates/cmtraceopen-parser/tests \
docs/sccm/preparation || trueLength of output: 168677
Finding: Please extend the per-artifact loop to validate that every The canonical ✅ Action performedReview finished.
|
|
Substantive post-rebase CodeRabbit gate: local CodeRabbit CLI 0.7.1 reviewed the exact committed range from |
adamgell
left a comment
There was a problem hiding this comment.
Independent exact-head review: BLOCKED at cb3e153143b7e86db0e19b46f54855c59443cb42 (base 99554f4aef0c06b2ce81eaf257c76058c38c06c0).
Actionable finding
crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs enumerates all nine manifests at lines 54–78, but that loop only applies the fragmentComplete: true coverage check. File resolution and bytesCopied equality are checked only for the single rotation-boundary .lo_ artifact at lines 108–128. The corpus has 14 physical captured/capped artifacts, so a missing path or stale byte count in any of the other 13 artifacts would still pass the committed Rust contract test. The exact-byte Python validator used during preparation is not tracked in this PR/repository and therefore is not a durable CI guard.
Please move/add the path and exact-byte validation to the per-artifact loop for every captured and capped artifact, with a focused red mutation/probe and green rerun. Preserve the current capped-fragment negative probe. While touching that loop, retain the documented nonphysical-state boundary (absent, accessDenied, skipped, unsupported, parseFailed: no physical path and zero copied bytes).
What is already correct
- Canonical
sitecomp.lo_rename, manifest basename/path, and bounded requested basename are consistent. - All 9 scenarios, 18 artifacts, and 46 manifest/expected/evidence references currently audit clean; site code is synthetic
LAB; findings remain role-local and conservative; no live/native acceptance is claimed. - #345 is merged and the rebased base supplies
crates/cmtraceopen-parser/tests/fixtures/** -text; a controlledcore.autocrlf=truecheckout remains byte-identical at 196 bytes. - CodeRabbit completed a substantive review of this exact range and independently reported the same all-artifact path/byte guard gap; this is not a skipped/rate-limited result.
Verification on the exact head: focused 2/2; exact-byte corpus validator PASS; full parser 596/596; strict Clippy PASS; wasm32 PASS; npx tsc --noEmit PASS; owned-file rustfmt PASS; git diff --check PASS. cargo fmt --check --all remains nonzero only on unchanged pre-existing files outside this PR; the changed Rust file is not among its diffs.
Review scope remains synthetic fixture/test preparation only. Issue #327 must stay open for the production reducer and eventual native Windows validation.
cb3e153 to
9235f81
Compare
|
Independent review
Fresh focused 4/4, exact-byte validator, full parser 598/598, strict Clippy, wasm32, TypeScript, owned rustfmt, and diff checks are green. (The aggregate count increased by two focused regressions.) @coderabbitai review Please review exact head |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs (1)
48-116: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUnrecognized
captureStatevalues silently pass validation.
artifact_storage_failuresonly branches on"captured" | "capped"and the five non-physical states; any other/typoedcaptureStatevalue falls through both branches and returns no failures — and is also excluded from thephysical_artifactstally in the calling test. A typo in a fixture manifest (e.g. wrong casing) would silently bypass path/byte validation instead of failing loudly.♻️ Proposed fix: fail closed on unrecognized states
} else if matches!( state, "absent" | "accessDenied" | "skipped" | "unsupported" | "parseFailed" ) { if !artifact["relativePath"].is_null() { failures.push(format!( "{state} artifact {artifact_id} cannot have a relativePath" )); } if artifact["bytesCopied"].as_u64() != Some(0) { failures.push(format!( "{state} artifact {artifact_id} must record zero bytesCopied" )); } + } else { + failures.push(format!( + "artifact {artifact_id} has unrecognized captureState {state:?}" + )); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs` around lines 48 - 116, Update artifact_storage_failures to explicitly reject any captureState outside the recognized captured/capped and absent/accessDenied/skipped/unsupported/parseFailed values, adding a failure for the unknown state and artifact ID. Ensure the calling physical_artifacts tally also handles unknown states consistently so unrecognized values cannot bypass validation or be silently excluded.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs`:
- Around line 48-116: Update artifact_storage_failures to explicitly reject any
captureState outside the recognized captured/capped and
absent/accessDenied/skipped/unsupported/parseFailed values, adding a failure for
the unknown state and artifact ID. Ensure the calling physical_artifacts tally
also handles unknown states consistently so unrecognized values cannot bypass
validation or be silently excluded.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fe805779-03f8-4b32-b01d-f29baef690d1
📒 Files selected for processing (4)
crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/evidence/sccm/server/site-core/sitecomp/lo_/sitecomp.lo_crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/expected.jsoncrates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/manifest.jsoncrates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/evidence/sccm/server/site-core/sitecomp/lo_/sitecomp.lo_
adamgell
left a comment
There was a problem hiding this comment.
Independent exact-head re-review: BLOCKED at 84a784c8f69f0cae12a7f02f4289516fabc443dd (base 690cb32240a86001fdc4c3acc58e63638814d20e).
The prior all-artifact blocker is fixed: all 14 captured/capped artifacts now traverse the safe-relative-path, existing-file, and exact-bytesCopied checks, and the missing/wrong/unsafe/missing-byte probes exercise those paths.
Remaining actionable finding
artifact_storage_failures handles the two physical states and five declared nonphysical states, but any missing, misspelled, or unrecognized captureState falls through and returns no failure. Changing an existing nonphysical state such as accessDenied to a typo leaves physical_artifacts == 14, so the main test also continues to pass while path/byte/fragment validation is silently bypassed. CodeRabbit’s substantive exact-head review independently reported this at review 4823345266; it was not a skipped or rate-limited result.
Please fail closed for every state outside captured, capped, absent, accessDenied, skipped, unsupported, and parseFailed, and add a focused unknown/missing-state negative probe. The calling test then cannot silently admit an unversioned coverage state.
Verified on this exact head
- Focused site-core contract: 4/4 PASS.
- Exact corpus validator: PASS.
- Full parser suite: 598/598 PASS.
- Strict Clippy, wasm32 check,
npx tsc --noEmit, owned-file rustfmt, andgit diff --check: PASS. - Independent corpus audit: 9 scenarios, 18 artifacts, 14 physical artifacts, 46 evidence/coverage references, zero inconsistencies.
- Canonical
sitecomp.lo_, syntheticLABtopology, privacy boundaries, conservative role-local claims, and no-native-acceptance boundary remain correct. - Local CodeRabbit CLI 0.7.1 was authenticated but rate-limited for 41 minutes; that invocation was not counted as approval. GitHub CodeRabbit did complete the substantive review cited above.
cargo fmt --check --all remains nonzero only on unchanged pre-existing files outside this PR; the changed Rust test is clean under rustfmt 1.88. Issue #327 remains open for production reducer/native validation work.
|
CodeRabbit review TDD red reproduced both missing and misspelled Focused 5/5, exact-byte corpus validator, full parser 599/599, strict Clippy, wasm32, TypeScript, owned rustfmt, and diff checks pass. @coderabbitai review Review exact head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
head='fcfcd29f518d1c9bc5e706f1c2417cabe1a71263'
git cat-file -e "${head}^{commit}"
parent="$(git rev-parse "${head}^")"
printf '%s\n' '== REQUESTED HEAD =='
git show -s --format='%H%nParents: %P%nSubject: %s' "$head"
printf '%s\n' '== INCREMENTAL CHANGED FILES =='
git diff --find-renames --find-copies --name-status "$parent" "$head"
printf '%s\n' '== INCREMENTAL PATCH =='
git diff --find-renames --find-copies --no-ext-diff "$parent" "$head"
contract="$(fd -t f '^sccm_site_core_fixture_contract\.rs$' crates)"
test -n "$contract"
printf '%s\n' '== CONTRACT TEST OUTLINE =='
ast-grep outline "$contract" --items all
printf '%s\n' '== CONTRACT TEST =='
cat -n "$contract"
printf '%s\n' '== SITE-CORE MANIFEST SUMMARY / STATIC STORAGE AUDIT =='
python3 - <<'PY'
import json
from collections import Counter
from pathlib import Path, PurePosixPath
root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core")
allowed = {"captured", "capped", "absent", "accessDenied", "skipped", "unsupported", "parseFailed"}
physical = {"captured", "capped"}
errors = []
counts = Counter()
physical_count = 0
for manifest_path in sorted(root.glob("*/manifest.json")):
doc = json.loads(manifest_path.read_text(encoding="utf-8"))
for index, artifact in enumerate(doc.get("artifacts", [])):
ident = f"{manifest_path.parent.name}.artifacts[{index}]"
state = artifact.get("captureState")
counts[state] += 1
rel = artifact.get("relativePath")
bytes_copied = artifact.get("bytesCopied")
complete = artifact.get("rotation", {}).get("fragmentComplete")
if state not in allowed:
errors.append(f"{ident}: invalid state {state!r}")
continue
if state in physical:
physical_count += 1
if not isinstance(rel, str) or not rel:
errors.append(f"{ident}: physical artifact lacks path")
else:
posix = PurePosixPath(rel)
if posix.is_absolute() or ".." in posix.parts:
errors.append(f"{ident}: unsafe path {rel!r}")
fixture = manifest_path.parent / rel
if not fixture.is_file():
errors.append(f"{ident}: fixture missing {rel!r}")
elif bytes_copied != fixture.stat().st_size:
errors.append(f"{ident}: declared={bytes_copied!r}, actual={fixture.stat().st_size}")
else:
if rel is not None or bytes_copied != 0 or complete is True:
errors.append(f"{ident}: nonphysical path={rel!r}, bytes={bytes_copied!r}, complete={complete!r}")
print("manifests:", len(list(root.glob("*/manifest.json"))))
print("artifacts:", sum(counts.values()))
print("physical:", physical_count)
print("states:", dict(sorted(counts.items(), key=lambda x: str(x[0]))))
print("errors:", len(errors))
for error in errors:
print("ERROR:", error)
PY
printf '%s\n' '== CURRENT SITE-CORE ROLLOVER REFERENCES =='
rg -n -i -C 2 'sitecomp(\.log)?\.lo_|sitecomp\.lo_' \
crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core \
crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rsLength of output: 25149
No actionable findings. The storage validator now fails closed for a missing or unrecognized A separate static audit of all nine site-core manifests found no unsafe paths, missing fixtures, byte-count discrepancies, or invalid nonphysical storage claims. The canonical This is a completed review, not an approval; I did not execute the test suite in the sandbox. ✅ Action performedReview finished.
|
adamgell
left a comment
There was a problem hiding this comment.
Independent exact-head review: PASS at fcfcd29f518d1c9bc5e706f1c2417cabe1a71263 against base 690cb32240a86001fdc4c3acc58e63638814d20e. No actionable findings.
Blocker disposition
- Missing and misspelled
captureStatevalues now fail closed, with dedicated missing-state andcaputredprobes. - The committed matrix pins 18 artifacts and 14 physical artifacts. Every
captured/cappedartifact receives safe-relative-path, existing-file, and exact-bytesCopiedvalidation. - The four nonphysical artifacts currently present are valid; dedicated probes cover all five declared nonphysical state types (
absent,accessDenied,skipped,unsupported,parseFailed) for no physical path, zero bytes, and no complete-fragment claim. - Missing file, wrong size, parent traversal, missing byte provenance, and capped-complete-fragment probes remain effective.
Contract and boundary verification
- Nine scenarios, 18 artifacts, 14 physical artifacts, and 46 manifest/expected/evidence references audit clean.
- Canonical
sitecomp.lo_is consistent across the physical fixture, manifest basename/path, and bounded expected request; byte-sensitive fixture attributes remaintext: unset. - Site code/topology remains synthetic
LAB/LAB-CM01; privacy scans found no live identifiers or credentials. - Findings remain conservative and role-local with explicit prohibited client-impact, absent-role, and cross-side-causality claims.
- The diff is fixture/test-only: no parser-kind duplication, Windows I/O, registry/WMI/Tauri/network/database dependency, production reducer, or native Windows acceptance claim.
Fresh verification
cargo test --locked -p cmtraceopen-parser --test sccm_site_core_fixture_contract: 5/5 PASS.- Exact-byte corpus validator: PASS.
cargo test --locked -p cmtraceopen-parser --quiet: 599/599 PASS.- Strict Clippy: PASS.
- wasm32 check: PASS.
npx tsc --noEmit: PASS.- Rustfmt 1.88 on the changed Rust file: PASS.
git diff --check: PASS; detached review worktree remained clean.
CodeRabbit exact-head comment 5136448138 reported no actionable findings after examining the incremental fix plus the full contract/static corpus. It explicitly did not execute tests and CodeRabbit is incremental, so it was not treated as approval; this PASS is based on the independent full-range inspection and fresh verification above.
This approves the preparation/test slice only. Issue #327 should remain open for the production reducer and eventual native Windows validation.
fcfcd29 to
4d31e98
Compare
|
Current-base refresh: PR #347 is restacked without patch drift onto merged shared interface Fresh gates: focused 5/5; exact 9-scenario/18-artifact validator (14 physical plus all 5 nonphysical state types); full parser 620/620; strict Clippy; wasm32; TypeScript; owned rustfmt; diff check — all green. @coderabbitai review Review exact head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea'
head='4d31e981cfab061e786b1bfba02bd4260a9750f0'
git cat-file -e "${base}^{commit}"
git cat-file -e "${head}^{commit}"
git merge-base --is-ancestor "$base" "$head"
printf '%s\n' '== REQUESTED RANGE =='
git show -s --format='base: %H%nparents: %P%nsubject: %s' "$base"
git show -s --format='head: %H%nparents: %P%nsubject: %s' "$head"
printf '%s\n' '== RANGE-DIFF / COMMITS =='
git log --oneline --decorate "${base}..${head}"
printf '%s\n' '== CHANGED FILES =='
git diff --find-renames --find-copies --name-status "$base" "$head"
printf '%s\n' '== DIFF STAT =='
git diff --stat "$base" "$head"
printf '%s\n' '== COMPLETE PATCH =='
git diff --find-renames --find-copies --no-ext-diff "$base" "$head"
contract="$(fd -t f '^sccm_site_core_fixture_contract\.rs$' crates)"
test -n "$contract"
printf '%s\n' '== CONTRACT TEST OUTLINE =='
ast-grep outline "$contract" --items all
printf '%s\n' '== CONTRACT TEST =='
cat -n "$contract"
printf '%s\n' '== FIXTURE MANIFESTS =='
fd -t f '^manifest\.json$' crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core \
-x sh -c 'echo "--- $1"; cat -n "$1"' sh {}
printf '%s\n' '== STATIC STORAGE / COVERAGE / ROTATION AUDIT =='
python3 - <<'PY'
import json
from collections import Counter
from pathlib import Path, PurePosixPath
root = Path("crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core")
allowed = {"captured", "capped", "absent", "accessDenied", "skipped", "unsupported", "parseFailed"}
physical = {"captured", "capped"}
errors = []
states = Counter()
manifests = sorted(root.glob("*/manifest.json"))
for manifest_path in manifests:
scenario = manifest_path.parent.name
doc = json.loads(manifest_path.read_text(encoding="utf-8"))
artifacts = doc.get("artifacts")
if not isinstance(artifacts, list):
errors.append(f"{scenario}: artifacts is not an array")
continue
for index, artifact in enumerate(artifacts):
ident = f"{scenario}.artifacts[{index}]"
state = artifact.get("captureState")
states[state] += 1
rel = artifact.get("relativePath")
copied = artifact.get("bytesCopied")
rotation = artifact.get("rotation")
complete = rotation.get("fragmentComplete") if isinstance(rotation, dict) else None
if state not in allowed:
errors.append(f"{ident}: invalid captureState={state!r}")
continue
if state in physical:
if not isinstance(rel, str) or not rel:
errors.append(f"{ident}: physical artifact has invalid path={rel!r}")
else:
path = PurePosixPath(rel)
if path.is_absolute() or ".." in path.parts:
errors.append(f"{ident}: unsafe path={rel!r}")
fixture = manifest_path.parent / rel
if not fixture.is_file():
errors.append(f"{ident}: missing fixture={rel!r}")
elif copied != fixture.stat().st_size:
errors.append(f"{ident}: bytesCopied={copied!r}, actual={fixture.stat().st_size}")
elif rel is not None or copied != 0 or complete is True:
errors.append(f"{ident}: nonphysical path={rel!r}, bytes={copied!r}, complete={complete!r}")
if isinstance(rotation, dict) and rotation.get("kind") == "loUnderscore":
basename = artifact.get("originalBasename")
if not isinstance(basename, str) or not basename.endswith(".lo_") or basename.endswith(".log.lo_"):
errors.append(f"{ident}: invalid lo_ basename={basename!r}")
elif not isinstance(rel, str) or not rel.endswith("/" + basename):
errors.append(f"{ident}: lo_ path/basename mismatch path={rel!r}, basename={basename!r}")
print("manifest_count:", len(manifests))
print("artifact_count:", sum(states.values()))
print("physical_count:", sum(states[s] for s in physical))
print("states:", dict(sorted(states.items(), key=lambda item: str(item[0]))))
print("errors:", len(errors))
for error in errors:
print("ERROR:", error)
PY
printf '%s\n' '== ROLLOVER REFERENCES AND TEST PROBES =='
rg -n -i -C 3 \
'sitecomp(\.log)?\.lo_|sitecomp\.lo_|captureState|caputred|missing.*state|unknown.*state' \
crates/cmtraceopen-parser/tests/sccm_site_core_fixture_contract.rs \
crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_coreLength of output: 83034 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== PARSER ROTATION GRAMMAR =='
catalog="$(fd -t f '^catalog\.rs$' crates/cmtraceopen-parser/src)"
test -n "$catalog"
rg -n -i -C 8 'loUnderscore|\.lo_|sitecomp|rotation' "$catalog"
printf '%s\n' '== EXISTING SCCM INTEGRATION TEST LAYOUT =='
fd -t f '\.rs$' crates/cmtraceopen-parser/tests \
| sort \
| sed -n '1,220p'
printf '%s\n' '== PACKAGE TEST TARGET CONFIGURATION =='
cargo_toml="$(fd -t f '^Cargo\.toml$' crates/cmtraceopen-parser)"
test -n "$cargo_toml"
cat -n "$cargo_toml"
printf '%s\n' '== EXACT ROTATION-BOUNDARY EXPECTED CONTRACT =='
cat -n crates/cmtraceopen-parser/tests/fixtures/sccm/server/site_core/rotation-boundary/expected.json
printf '%s\n' '== CURRENT HEAD DIFF CHECK =='
git diff --check 6ef2482d20e132e9ca7db920a9e1199e2f8bd7ea 4d31e981cfab061e786b1bfba02bd4260a9750f0Length of output: 14760
No actionable findings.
This is a completed static review, not an approval. I did not execute the test suite in the sandbox and do not infer native Windows acceptance. ✅ Action performedReview finished.
|
Part of #327. Canonicalize sitecomp.lo_ and enforce fail-closed site-core artifact storage, coverage, capped-fragment, and capture-state contracts. No production reducer or native acceptance.
Refs #327.
Corrects the committed site-core preparation corpus to the documented ConfigMgr rollover and fail-closed coverage contracts.
Scope
sitecomp.logrollover tositecomp.lo_, including the fixture, manifest, expected request, and full provenanceTDD corrections
Focused red→green slices covered canonical rollover identity, capped completeness, all-artifact storage integrity, nonphysical states, and missing/unknown state fail-closed behavior. Independent and CodeRabbit reviews drove the latter corpus-wide checks.
Verification at
4d31e981cfab061e786b1bfba02bd4260a9750f06ef2482d; all 5 issue-scoped commits map=npx tsc --noEmit— passgit diff --check— passIssue #327 remains open for production implementation and native validation.