feat: add bounded artifact diff core - #90
Conversation
|
Post-CI diff review completed against
Reviewed scope remains 7 files with 432 substantive behavior additions (tests/docs excluded from that count). All four remote checks are green; no bot or reviewer comments are outstanding. Keeping the PR draft for the required delayed compatibility review and stacked split sequence. |
|
Delayed review completed on 2026-08-24 against exact head The earlier prototype review findings that belong to this layer are covered here: normalized identity is streamed before any later structured parsing, symlink/reparse-point roots and entries are rejected, opened handles are revalidated as regular files, special files fail closed, CLI exit Fresh validation:
The overnight traversal/security review window is satisfied. Marking this layer ready for the ordered stack merge. |
Summary
This is layer 1 of the split replacement for #89. Structured JSON/JSONL summaries and the strict machine-readable report/schema remain out of scope for this PR and will be proposed as stacked follow-ups.
Design decision
Keep
regenerate_artifacts.py --checkauthoritative. The new comparator only explains mismatches and never accepts generated output. Comparable text uses strict UTF-8 with CRLF and lone CR normalized to LF; binary files present in both trees are presence-only. Traversal, path, file-kind, count, and report invariants fail closed.Main risk
The shared newline normalizer expands regeneration equivalence from CRLF-only handling to include lone CR. Dedicated parity tests lock this behavior, while the full release gate confirms all committed artifacts still match.
Compatibility impact
Additive CLI/API surface only. Existing commands, artifacts, schemas, and release compatibility labels are unchanged. There is no JSON report contract in this layer.
Rollback path
Revert the three commits in reverse order.
scripts/regenerate_artifacts.pythen returns to its local normalization helper, and the standalone comparator/doc route disappears without changing committed artifacts.Validation
.venv\Scripts\python.exe -m pytest -q tests/test_artifact_contract_diff_core.py tests/test_artifact_regeneration_check.py— 14 passed, 1 skipped.venv\Scripts\python.exe scripts/check_release_contract.py— 29 strict artifacts matched, 6 visual artifacts regenerated, 8 schema tests passed, full suite 226 passed / 1 skippedscripts/regenerate_artifacts.py --checkwith a unique work directory — 29 strict artifacts matched, 6 visual artifacts regeneratedgit diff --check— passedReview state
Draft for the required compatibility review and to keep the split sequence explicit before the stacked follow-ups land.