From 4cb96e4c9611ad90d52c1876ad8483934c77e5ff Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Tue, 13 Oct 2026 08:34:43 -0400 Subject: [PATCH] fix(php-transformer): recognize the current capture disclosure and gallery runtimes Publish the producer's current runtime bodies as the recognized ones: disclosure b545f43a (ancestor class bindings replayed as tokens) and gallery 456af763 (src-swap sequence mode). One body per runtime; earlier bodies are no longer recognized and keep their captured runtime. The native replacements already do what the new bodies add: the native dialog replays class bindings as token sets, and src-swap galleries become native src-swap carousels. A Chromium parity test compares the recognized disclosure runtime with the native dialog on re-ordered, token-only and empty-class ancestor bindings. The equivalence gate neutralizes the engine_version release stamp and its expectations are regenerated from the pre-move commit with the current digests. Three corpus cases change: they carry the previous disclosure body, which now keeps its captured runtime. --- .github/workflows/php-transformer.yml | 6 + php-transformer/composer.json | 1 + .../docs/contracts/capture-evidence.md | 27 +++- .../src/Contract/CaptureEvidence.php | 4 +- .../support/CaptureEvidenceEquivalence.php | 2 + .../fixtures/capture-disclosure-runtime.js | 2 + .../expected.json | 136 +++++++++--------- .../tests/fixtures/capture-gallery-runtime.js | 4 +- .../tests/unit/authored-carousel-block.php | 7 +- ...apture-runtime-ancestor-parity-browser.mjs | 80 +++++++++++ .../unit/capture-runtime-ancestor-parity.php | 95 ++++++++++++ .../tests/unit/captured-gallery-contract.php | 17 ++- .../capture-evidence-equivalence/README.md | 5 +- .../rename-checkout.php | 9 +- 14 files changed, 312 insertions(+), 83 deletions(-) create mode 100644 php-transformer/tests/unit/capture-runtime-ancestor-parity-browser.mjs create mode 100644 php-transformer/tests/unit/capture-runtime-ancestor-parity.php diff --git a/.github/workflows/php-transformer.yml b/.github/workflows/php-transformer.yml index 78edd2813..334e3b7db 100644 --- a/.github/workflows/php-transformer.yml +++ b/.github/workflows/php-transformer.yml @@ -113,6 +113,12 @@ jobs: php tests/unit/captured-dialog-dropdown-panel.php PLAYWRIGHT_MODULE="$PWD/tools/visual-parity/node_modules/playwright/index.mjs" node tests/unit/captured-dialog-dropdown-panel-browser.mjs + - name: Verify native dialog parity with the recognized capture disclosure runtime + working-directory: php-transformer + run: | + php tests/unit/capture-runtime-ancestor-parity.php + PLAYWRIGHT_MODULE="$PWD/tools/visual-parity/node_modules/playwright/index.mjs" node tests/unit/capture-runtime-ancestor-parity-browser.mjs + - name: Verify native button default background neutralization working-directory: php-transformer run: PLAYWRIGHT_MODULE="$GITHUB_WORKSPACE/php-transformer/tools/visual-parity/node_modules/playwright/index.mjs" node tests/unit/native-button-default-background-browser.mjs diff --git a/php-transformer/composer.json b/php-transformer/composer.json index 5024d20ef..64388f646 100644 --- a/php-transformer/composer.json +++ b/php-transformer/composer.json @@ -187,6 +187,7 @@ "php tests/unit/captured-dialog-projector.php", "php tests/unit/captured-dialog-dropdown-panel.php", "php tests/unit/scoped-mixed-dropdown.php", + "php tests/unit/capture-runtime-ancestor-parity.php", "php tests/unit/captured-selectable-set-projector.php", "php tests/unit/captured-collection-filter.php", "php tests/unit/captured-choice-group-projector.php", diff --git a/php-transformer/docs/contracts/capture-evidence.md b/php-transformer/docs/contracts/capture-evidence.md index 57002f703..66de782a3 100644 --- a/php-transformer/docs/contracts/capture-evidence.md +++ b/php-transformer/docs/contracts/capture-evidence.md @@ -172,8 +172,31 @@ allowed. | Name | Kind | Meaning | | ---- | ---- | ------- | -| `3d350f5508bed44c931291f9f38e5d8d7c361d5d3ea729c51f1fe11b70ce75dc` | sha256 of the disclosure interpreter | Body: [`tests/fixtures/capture-disclosure-runtime.js`](../../tests/fixtures/capture-disclosure-runtime.js), marker `data-blocks-engine-capture-disclosure-runtime` (value `true`), in ``. | -| `0a6bf62a6d9d6a04faf10e933d2362bbbdf3b5c8351c6452174f98bf29f723aa` | sha256 of the gallery helper | Body: [`tests/fixtures/capture-gallery-runtime.js`](../../tests/fixtures/capture-gallery-runtime.js), marker `data-blocks-engine-capture-gallery-runtime`, in ``. | +| `b545f43a77b79d075373048431101fe11d7ff8cdfe7987de6d7971512763d88f` | sha256 of the disclosure interpreter | Body: [`tests/fixtures/capture-disclosure-runtime.js`](../../tests/fixtures/capture-disclosure-runtime.js), marker `data-blocks-engine-capture-disclosure-runtime` (value `true`), in ``. | +| `456af76323601e51d851d3a4d6fe4ff6e3989c9969562f425fd72103c5c57c6b` | sha256 of the gallery helper | Body: [`tests/fixtures/capture-gallery-runtime.js`](../../tests/fixtures/capture-gallery-runtime.js), marker `data-blocks-engine-capture-gallery-runtime`, in ``. | + +Blocks Engine recognizes one body per runtime: the producer's current one. +When the producer changes a body, Blocks Engine checks that its native +replacement does what the new body does, then publishes the new body and +digest in place of the old ones. An earlier body is no longer recognized: a +page that carries it keeps its captured runtime wherever recognition is +required (below). + +What the native replacement reproduces: + +- **Disclosure interpreter.** Opening and closing a dialog, and the ancestor + bindings in `data-blocks-engine-capture-dialog-ancestor-state`. A `class` + binding is replayed as tokens: tokens of the other state that the target + state lacks are removed, the target state's tokens are added, and every + other class on the ancestor is kept. The native dialog finds the ancestor by its tag and closed tokens. + `tests/unit/capture-runtime-ancestor-parity-browser.mjs` compares the two in + Chromium. +- **Gallery helper.** Frame galleries become native carousels. A src-swap + gallery (`data-blocks-engine-capture-gallery-sequence` with + `data-blocks-engine-capture-gallery-slot` images) becomes a native src-swap + carousel. It starts at index 0, wraps in both directions, sets each slot to + the sequence image at the current index plus the slot's offset, and removes + the slot's `srcset`. **How Blocks Engine verifies them.** For each page with captured dialog scopes, `CapturedDialogProjector` scans every `' +// The producer's published gallery runtime, which drives this src-swap shape. +$portableGallerySource = '' . '