feat: classify structured artifact changes - #91
Conversation
|
Post-CI diff review completed against
Reviewed relative scope is 3 files and 234 substantive behavior additions. All four remote checks are green; no bot or reviewer comments are outstanding. Keeping the PR draft for delayed compatibility review and the final stacked schema projection. |
|
Delayed structured-compatibility review completed on 2026-08-24 against exact head The prototype review findings assigned to this layer are covered: identical JSON/JSONL is not parsed after normalized identity matches; changed/missing/extra structured artifacts are bounded; run-manifest digest scalars/maps and relative keys are validated before projection; unsafe schema markers, malformed JSON/JSONL, oversized summaries, and non-deterministic ordering fail closed or have regressions. Fresh validation:
The delayed report-behavior review requirement is satisfied. Marking this layer ready for the ordered stack merge. |
Summary
This is layer 2 of the split replacement for #89 and is stacked on #90. The strict machine-readable report/schema remains out of scope for a separate follow-up.
Design decision
The comparator still performs normalized digest/size identity first. Only non-identical or one-sided JSON/JSONL receives a bounded deterministic summary: container, record count, sorted top-level-key union, safe schema markers, and validated run-manifest digest fields.
Main risk
Changed structured artifacts can now fail with exit 2 when JSON/JSONL or provenance fields are malformed instead of being reported as an opaque content difference. Dedicated error-path tests define that fail-closed boundary.
Compatibility impact
Additive enrichment of the stacked comparator only. Existing repository artifacts, schemas, regeneration behavior, and commands are unchanged. Human output may add stable reason labels (
structure-changed,schema-version-changed, orrun-manifest-digest-changed) aftercontent-changed.Rollback path
Revert this PR's docs, behavior, and tests commits in reverse order. #90 remains a complete human comparator with
content-changedclassification only.Validation
.venv\Scripts\python.exe -m pytest -q tests/test_artifact_contract_diff_structured.py tests/test_artifact_contract_diff_core.py tests/test_artifact_regeneration_check.py— 28 passed, 1 skipped.venv\Scripts\python.exe -m pytest -q tests/test_markdown_links.py tests/test_reviewer_docs.py— 22 passed.venv\Scripts\python.exe scripts/check_release_contract.py— 29 strict artifacts matched, 6 visual artifacts regenerated, 8 schema tests passed, full suite 240 passed / 1 skippedpython -m py_compile src/telemetry_lab/artifact_contract_diff.py— passedgit diff --check— passedReview state
Draft for the required delayed compatibility review. Relative to #90 this PR changes 3 files and adds 234 substantive behavior lines.