Skip to content

Produce block validity outcomes before report projection - #1635

Merged
chubes4 merged 2 commits into
trunkfrom
refactor/1360-block-validity-evaluation
Sep 9, 2026
Merged

Produce block validity outcomes before report projection#1635
chubes4 merged 2 commits into
trunkfrom
refactor/1360-block-validity-evaluation

Conversation

@chubes4

@chubes4 chubes4 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Continue #1360 after #1630: produce block-validity facts before projecting the full report.

  • BlockValidityValidator::evaluateBlocks() produces structural evaluation facts directly; its existing validateBlocks() API remains a report facade.
  • BlockValidityEvaluation::fromBlocks() adds canonical save-shape findings after structural findings, preserving counts, checked types and order.
  • Runtime::evaluateBlockSerialization() retains string parsing and the existing parse-failure behavior. validateBlockSerialization(string|array): array remains compatible.
  • HtmlCompilation consumes authoritative status/findings directly and projects the full report from the same evaluation.
  • HtmlValidationOutcome accepts plain facts, without importing the WordPress implementation class or retaining obsolete report-derived factories.

No validator, reporting mode, acceptance rule, serialization schema or block behavior changes. Full reports remain the default; this is an ownership simplification, not a performance claim.

Verification

Baseline: 058663f24bb7a5a99342d87ac738ae8f07357e7a.
Candidate: c13b10ff8712c6fa99e9578ba953ba07be6880fe.

All ten final checks passed: PHP 8.2-8.5 package and WordPress integration suites, plus generic visual parity tools, and solved-site promotion.

  • Direct contracts cover structural producer/report equality; string and array inputs; dynamic empty-save blocks; nested/mixed block inputs; structural and canonical save-shape invalidity; finding order, counts and checked types; malformed serialized comments.
  • The final PHP 8.4 lab Composer suite passed end-to-end with 512 MB configured for child processes: canonical/unit coverage, 305 parity fixtures, distribution shape and package-install proof. Baseline suite passed separately.
  • Coordinator reran the full final-source comparison after review corrections: all 385 HTML fixtures and nine targeted HTML/artifact cases match, including serialized blocks and complete envelopes excluding only recursive transform_duration_ms.
  • Artifact cases exercise nonzero companion/runtime/styles/shared-shell/responsive outputs. PHP serialization preserves binary bytes and array ordering.
  • Both final comparison files have SHA-256 90114975f9df227372f7650f78e00b3652e05092aa6e09aad33d25546cfc0f59.
  • WordPress integration was unavailable in the isolated lab; the separate final CI integration matrix and solved-site promotion passed as linked above.

Reproduce

From php-transformer with dependencies installed and sufficient PHP memory inherited by child processes:

composer test
REQUIRE_WP_TESTS=1 WP_TESTS_DIR=/path/to/wordpress-tests composer test:wordpress-integration

The full-corpus comparison command in #1627 applies unchanged to the baseline/candidate above with matching dependencies. Consumer ownership is documented in php-transformer/docs/html-validation-outcome-consumer-inventory.md.

AI Assistance

OpenAI GPT-5.6 Terra via direct OpenCode implemented and lab-tested the change and review corrections. GPT-6 Astra via OpenCode coordinated and reviewed Runtime sequencing, required the structural producer to stop reconstructing facts from report maps, kept the contract independent of the WordPress implementation layer, independently reran final full-corpus/artifact comparisons and prepared this PR under Chris Huber's direction. No release or deployment was performed.

@chubes4
chubes4 marked this pull request as ready for review September 9, 2026 19:53
@chubes4
chubes4 merged commit 16f967e into trunk Sep 9, 2026
10 checks passed
@chubes4
chubes4 deleted the refactor/1360-block-validity-evaluation branch September 9, 2026 20:02
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.

1 participant