diff --git a/php-transformer/composer.json b/php-transformer/composer.json index af3e9c21..952ec37e 100644 --- a/php-transformer/composer.json +++ b/php-transformer/composer.json @@ -37,6 +37,7 @@ "scripts": { "parity": "@test:parity", "static-parity": "php tools/static-parity/run.php", + "live-wp-parity": "php tools/live-wp-parity/run.php", "corpus-diagnostics": "php tools/corpus-diagnostics/run.php", "test": [ "@test:canonical", @@ -55,7 +56,8 @@ "php tests/unit/subtree-classifier.php", "php tests/unit/custom-block-generator.php", "php tests/unit/css-value-splitter.php", - "php tests/unit/corpus-detectors.php" + "php tests/unit/corpus-detectors.php", + "php tests/unit/live-wp-parity-runner.php" ], "test:parity": "php tests/parity/run.php", "test:migration:examples": "php tests/migration/examples.php", diff --git a/php-transformer/src/VisualParity/StaticStyleParityRunner.php b/php-transformer/src/VisualParity/StaticStyleParityRunner.php index 5d48c981..bfeab703 100644 --- a/php-transformer/src/VisualParity/StaticStyleParityRunner.php +++ b/php-transformer/src/VisualParity/StaticStyleParityRunner.php @@ -49,8 +49,51 @@ public function compareSourceToTransform(string $sourceHtml, string $authorCss = $result = $this->transformer->transform($sourceHtml, array())->toArray(); $candidateHtml = self::candidateHtmlFromSerializedBlocks((string) ($result['serialized_blocks'] ?? '')); - $sourceProbes = $this->probe->extract($sourceHtml, $authorCss); - $candidateProbes = $this->probe->extract($candidateHtml, $authorCss); + // The render-free proxy carries the SAME author CSS to both sides so the + // only variable is the transformed DOM. + return $this->compareSourceToCandidate($sourceHtml, $candidateHtml, $authorCss, $authorCss); + } + + /** + * Compare a source document against an EXTERNALLY produced candidate document. + * + * Unlike {@see compareSourceToTransform}, which builds the candidate render-free + * from serialized blocks, this entry accepts a candidate HTML string produced by + * a real WordPress render (e.g. the DOM HTML wp-codebox fetches after SSI import + * + activate). It runs the IDENTICAL deterministic probe + comparator so the + * report contract, score, and per-property diff are exactly the same shape as the + * render-free gate — only the candidate's provenance differs. + * + * This exercises WordPress's own block rendering + global-styles layer (the layer + * the render-free proxy cannot see) while staying fully deterministic: no browser, + * no rasterization, no network, no screenshots. The candidate's effective styling + * is resolved statically from whatever CSS the rendered DOM already carries + * (WP global-styles / block-supports / layout ` +
+