Add live-WP candidate entry to static-parity runner (deterministic, real WP DOM)#348
Merged
Merged
Conversation
The render-free static-parity gate builds its candidate from serialized blocks and never exercises WordPress's own block rendering + global-styles layer (where the base64 styling regression lived). Add a deterministic variant that compares the source against a candidate produced by a real WP render — the rendered DOM HTML fetched headless — using the EXISTING probe + comparator unchanged. - StaticStyleParityRunner::compareSourceToCandidate(): new entry accepting an external candidate HTML string plus separate source/candidate CSS, running the same StaticStyleParityProbe + StaticStyleParityComparator so the report contract, score, and per-property diff are identical to the render-free gate. compareSourceToTransform() now delegates to it (same-CSS-both-sides). Source and candidate take separate CSS so the live-WP candidate is judged solely on the styling WordPress emitted; the source's author CSS is never leaked onto the candidate. - tools/live-wp-parity/run.php + composer "live-wp-parity": thin CLI taking --source/--candidate (+ optional --source-css/--candidate-css), emitting the same report contract under live_wp; --with-proxy also reports the render-free proxy score and the live-WP-vs-proxy delta for side-by-side gating. - tests/unit/live-wp-parity-runner.php: determinism (byte-identical reports), wiring proof (external entry reproduces the proxy when fed the proxy candidate + same CSS), regression detection naming the exact diverged property, and a no-CSS-leak guard. Pure PHP, no browser/network/screenshots: same inputs -> byte-identical report. Verified on 15-saas: external path reproduces the proxy score 0.7328 exactly and is byte-identical across runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a deterministic LIVE-WP variant of the static-parity gate (blocks-engine half) so the same comparator can run against REAL WordPress-rendered DOM (fetched as HTML, not screenshots), closing the gap where the render-free proxy never exercises WP block render + global-styles.
Change
Verification
AI assistance