feat: publish deterministic artifact diff report - #92
Conversation
|
Post-CI diff review completed against
Reviewed relative scope is 6 files and 382 substantive behavior/schema lines (125 Python + 257 schema). All four remote checks are green; no bot or reviewer comments are outstanding. External clean-clone reproduction also passed at this exact head: fresh venv install, 29 strict artifacts, 6 visual snapshots, 8 existing schema tests, full suite 249 passed / 1 skipped, and a schema-valid real report with SHA-256 Keeping the PR draft for delayed schema compatibility review. |
|
Delayed JSON/schema compatibility review completed on 2026-08-24 against exact head The remaining prototype review findings are covered here: output paths resolving inside either input tree fail closed before comparison; report writes are same-directory temporary files plus Fresh validation:
The overnight schema/security review and independent compatibility requirements are satisfied. Marking the final layer ready for merge; no release or tag is part of this change. |
Summary
artifact-contract-diff/v1serialization for the shared report model--json-outwith output-root isolation and atomic replacementThis is layer 3 of the split replacement for #89 and is stacked on #91.
Design decision
Keep
compare_artifact_trees()as the sole semantic core. Human output and JSON are projections of the same immutable report. JSON output contains stable relative identities and bounded summaries only—no roots, bodies, timestamps, or ambient metadata. The destination resolves outside both input trees and is replaced atomically only after a complete synchronized write.Main risk
A destination-path validation or write failure must never modify an input artifact or destroy a previous report. Root-containment, symlink-root, comparison-failure preservation, simulated
os.replacefailure, temporary-file cleanup, and deterministic-byte tests cover this boundary. The strict schema may also reject hand-authored payloads that contradict the core invariants; that is intentional.Compatibility impact
Additive optional CLI flag and new
artifact-contract-diff/v1schema. Existing human CLI behavior, regeneration authority, committed artifacts, evidence schemas, and release labels remain unchanged. Consumers that adopt the JSON report should validate against the versioned schema.Rollback path
Revert
be7c323,f775814,9b38243, then77872f6. #91 remains an independently usable human comparator with structured reason classification and no machine-readable output contract.Validation
.venv\Scripts\python.exe -m pytest -q tests/test_artifact_contract_diff_core.py tests/test_artifact_contract_diff_structured.py tests/test_artifact_contract_diff_json_report.py tests/test_artifact_regeneration_check.py— 37 passed, 1 skipped.venv\Scripts\python.exe -m pytest -q tests/test_artifact_contract_diff_json_report.py tests/test_markdown_links.py tests/test_reviewer_docs.py— 31 passed.venv\Scripts\python.exe scripts/check_release_contract.py— 29 strict artifacts matched, 6 visual artifacts regenerated, 8 existing schema tests passed, full suite 249 passed / 1 skippeddata/processedJSON report generated twice — identical SHA-256, schema-valid summary (14 total / 8 comparable / 6 presence-only), no local path, smoke report removedgit diff --check— passedReview state
Draft for the required schema compatibility and delayed review. Relative to #91 this PR changes 6 files and contains 382 substantive behavior/schema lines (125 Python + 257 schema), below the 500-line split gate.
Closes #85.