Skip to content

php-transformer: emit content-box restatements in the after-author support stylesheet - #3570

Merged
chubes4 merged 5 commits into
trunkfrom
fix/issue-3565-blocks-engine
Oct 27, 2026
Merged

chubes4 merged 5 commits into
trunkfrom
fix/issue-3565-blocks-engine

Conversation

@chubes4

@chubes4 chubes4 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix #3565 in php-transformer/. Read the issue and its acceptance comment first.

What changed

  • Updated php-transformer/composer.json in the delivered candidate.
  • Updated php-transformer/src/HtmlToBlocks/HtmlCompilation.php in the delivered candidate.
  • Updated php-transformer/src/HtmlToBlocks/Style/AuthorStyleRuleProjector.php in the delivered candidate.
  • Updated php-transformer/src/HtmlToBlocks/Style/AuthorStylesheetProjectionContext.php in the delivered candidate.
  • Updated php-transformer/src/HtmlToBlocks/Style/AuthorStylesheetProjector.php in the delivered candidate.
  • Updated php-transformer/src/HtmlToBlocks/Style/CascadeLayer.php in the delivered candidate.
  • Updated php-transformer/src/HtmlToBlocks/Style/ContentBoxRestatements.php in the delivered candidate.
  • Updated php-transformer/tests/unit/artifact-author-stylesheet-projection.php in the delivered candidate.
  • Updated php-transformer/tests/unit/content-box-min-max-size.php in the delivered candidate.
  • Updated php-transformer/tests/unit/content-box-support-sheet.php in the delivered candidate.
  • Updated php-transformer/tests/unit/css-comment-in-declarations.php in the delivered candidate.
  • Updated php-transformer/tests/unit/html-transformer-session-state.php in the delivered candidate.
  • Delivered candidate verified with 1 deterministic Cook gate(s); no separate compatibility assessment was recorded by the implementation attempt.

Verification

  • passed on faeec3f. Base trunk@e392171 unchanged.
cd php-transformer || exit 1
echo "== composer install"; composer install --no-interaction --no-progress --quiet || exit 1
echo "== phpstan"; composer run-script lint:types || exit 1
echo "== phpcs"; vendor/bin/phpcs --standard=phpcs.xml.dist -p --report=summary || exit 1
echo "== acceptance (issue #3565; readable source in the issue comments)"
echo 3c3f7068700a2f2f20416363657074616e63653a20626f782d73697a696e673a636f6e74656e742d626f7820726573746174656d656e74732061726520737570706f7274204353532e205468657920676f20696e207468650a2f2f2061667465722d617574686f7220737570706f7274207374796c6573686565742c20776869636820657665727920686f737420696e7374616c6c732c206e6f74206f6e6c7920696e207468650a2f2f2072657772697474656e20617574686f72207374796c65736865657420287374617469632d7374796c652e637373292c207768696368206120686f73742074686174206b6565707320697473206f776e0a2f2f207468656d65207374796c6573686565742061732074686520617574686f722043535320646f6573206e6f7420696e7374616c6c2e0a72657175697265202776656e646f722f6175746f6c6f61642e706870273b0a757365204175746f6d61747469635c426c6f636b73456e67696e655c5068705472616e73666f726d65725c48746d6c546f426c6f636b735c48746d6c5472616e73666f726d65723b0a0a246661696c75726573203d20303b0a24636865636b203d207374617469632066756e6374696f6e2028626f6f6c20246f6b2c20737472696e672024776861742c20737472696e67202464657461696c203d2027272920757365202826246661696c75726573293a20766f6964207b0a202020206563686f2028246f6b203f20276f6b20202027203a20274641494c2027292c2024776861742c2028246f6b207c7c202727203d3d3d202464657461696c203f202727203a20225c6e202020202022202e20737562737472282464657461696c2c20302c2036303029292c20225c6e223b0a20202020246661696c75726573202b3d20246f6b203f2030203a20313b0a7d3b0a2468746d6c203d20273c68656164657220636c6173733d22736974652d686561646572223e3c64697620636c6173733d22736974652d6865616465725f5f696e6e6572223e3c6120636c6173733d22736974652d7469746c652220687265663d222f223e5061777320576869736b6572733c2f613e3c6e617620636c6173733d22736974652d6865616465725f5f6e6176223e3c756c20636c6173733d22736974652d6865616465725f5f6d656e75223e3c6c693e3c6120687265663d222f223e486f6d653c2f613e3c2f6c693e3c6c693e3c6120687265663d222f73686f702f223e53686f703c2f613e3c2f6c693e3c2f756c3e3c2f6e61763e3c2f6469763e3c2f6865616465723e273b0a24637373203d20272e736974652d686561646572202e736974652d6865616465725f5f696e6e65727b646973706c61793a666c65783b6a7573746966792d636f6e74656e743a73706163652d6265747765656e3b6d61782d77696474683a3132343070783b6d617267696e3a30206175746f3b70616464696e673a312e3172656d203272656d7d270a202020202e2027406d6564696120286d61782d77696474683a203738327078297b2e736974652d6865616465725f5f696e6e65727b70616464696e673a2e3972656d20312e323572656d3b666c65782d777261703a777261707d7d270a202020202e20272e736974652d6865616465725f5f6d656e757b646973706c61793a666c65783b6761703a3172656d3b6c6973742d7374796c653a6e6f6e653b6d617267696e3a303b70616464696e673a307d273b0a24736865657473203d207374617469632066756e6374696f6e202861727261792024726573756c74293a206172726179207b0a20202020246279203d2061727261792820276265666f72652d617574686f7227203d3e2027272c2027617574686f7227203d3e2027272c202761667465722d617574686f7227203d3e20272720293b0a20202020666f726561636820282024726573756c745b27617373657473275d206173202461737365742029207b0a202020202020202024706c6163656d656e74203d202461737365745b277374796c6573686565745f706c6163656d656e74275d203f3f2028202461737365745b27706c6163656d656e74275d203f3f20272720293b0a202020202020202069662028206973736574282462795b24706c6163656d656e745d292029207b202462795b24706c6163656d656e745d202e3d2028202461737365745b27636f6e74656e74275d203f3f2027272029202e20225c6e223b207d0a202020207d0a2020202072657475726e202462793b0a7d3b0a2f2f20576869746573706163652d696e73656e7369746976653a20612072756c6520666f72202473656c6563746f7220286f7074696f6e616c6c7920696e7369646520246d65646961292074686174206465636c6172657320626f782d73697a696e673a636f6e74656e742d626f782e0a246465636c61726573203d207374617469632066756e6374696f6e2028737472696e6720246373732c20737472696e67202473656c6563746f722c203f737472696e6720246d65646961293a20626f6f6c207b0a2020202024666c6174203d20707265675f7265706c61636528272f5c732b2f272c202720272c2024637373293b0a202020202472756c65203d20707265675f71756f7465282473656c6563746f722c20272f2729202e2027203f5c7b5b5e7b7d5d2a626f782d73697a696e67203f3a203f636f6e74656e742d626f78273b0a2020202069662028206e756c6c203d3d3d20246d656469612029207b0a20202020202020202f2f204f75747369646520616e7920406d6564696120626c6f636b2e0a2020202020202020246f757473696465203d20707265675f7265706c61636528272f406d656469615b5e7b5d2a5c7b283f3a5b5e7b7d5d2a5c7b5b5e7b7d5d2a5c7d292a5b5e7b7d5d2a5c7d2f272c2027272c2024666c6174293b0a202020202020202072657475726e2031203d3d3d20707265675f6d6174636828272f285e7c5c7d29203f27202e202472756c65202e20272f272c20246f757473696465293b0a202020207d0a20202020707265675f6d617463685f616c6c28272f406d65646961203f27202e20707265675f71756f746528246d656469612c20272f2729202e2027203f5c7b28283f3a5b5e7b7d5d2a5c7b5b5e7b7d5d2a5c7d292a295b5e7b7d5d2a5c7d2f272c2024666c61742c2024626c6f636b73293b0a20202020666f726561636820282024626c6f636b735b315d2061732024696e6e65722029207b0a2020202020202020696620282031203d3d3d20707265675f6d6174636828272f285e7c5c7d29203f27202e202472756c65202e20272f272c2024696e6e6572292029207b2072657475726e20747275653b207d0a202020207d0a2020202072657475726e2066616c73653b0a7d3b0a0a666f7265616368202820617272617928202764656661756c7427203d3e20617272617928292c2027686f73745f626c6f636b5f67617027203d3e206172726179282027686f73745f626c6f636b5f67617027203d3e2027312e3572656d272029202920617320246e616d65203d3e202465787472612029207b0a2020202024726573756c74203d20286e65772048746d6c5472616e73666f726d65722829292d3e7472616e73666f726d282468746d6c2c2061727261792820277374617469635f63737327203d3e20246373732029202b20246578747261292d3e746f417272617928293b0a20202020246279203d20247368656574732824726573756c74293b0a2020202024636865636b287374725f636f6e7461696e732824726573756c745b2773657269616c697a65645f626c6f636b73275d2c2027736974652d6865616465725f5f696e6e657227292c2022246e616d653a207468652068656164657220696e6e657220626f78206973206120626c6f636b22293b0a2020202024636865636b28246465636c61726573282462795b2761667465722d617574686f72275d2c20272e736974652d686561646572202e736974652d6865616465725f5f696e6e6572272c206e756c6c292c2022246e616d653a2061667465722d617574686f7220736865657420726573746174657320626f782d73697a696e673a636f6e74656e742d626f7820666f72202e736974652d686561646572202e736974652d6865616465725f5f696e6e6572222c202462795b2761667465722d617574686f72275d293b0a2020202024636865636b28246465636c61726573282462795b2761667465722d617574686f72275d2c20272e736974652d6865616465725f5f696e6e6572272c2027286d61782d77696474683a2037383270782927292c2022246e616d653a2061667465722d617574686f7220736865657420726573746174657320697420666f72202e736974652d6865616465725f5f696e6e657220696e7369646520406d6564696120286d61782d77696474683a20373832707829222c202462795b2761667465722d617574686f72275d293b0a2020202024636865636b2821207374725f636f6e7461696e7328707265675f7265706c61636528272f5c732b2f272c2027272c202462795b27617574686f72275d292c2027626f782d73697a696e673a636f6e74656e742d626f7827292c2022246e616d653a2074686520617574686f72207374796c6573686565742063617272696573206e6f20626f782d73697a696e673a636f6e74656e742d626f7820726573746174656d656e7420286f6e6520706c61636520666f7220697429222c202462795b27617574686f72275d293b0a2020202024636865636b2821207374725f636f6e7461696e7328707265675f7265706c61636528272f5c732b2f272c2027272c202462795b27617574686f72275d202e202462795b2761667465722d617574686f72275d292c20272e736974652d6865616465725f5f6d656e757b626f782d73697a696e6727292c2022246e616d653a206e6f20726573746174656d656e7420666f72206120626f782074686174206973206e6f742073697a656420616e642070616464656422293b0a7d0a2f2f204120736f75726365206d656469612072756c652074686174207365747320626f726465722d626f78206b656570732069742074686572653a20616e20756e636f6e646974696f6e616c2061667465722d617574686f720a2f2f20726573746174656d656e7420776f756c64206f766572726964652069742c20736f206f6e6520697320656d6974746564206f6e6c7920776974682074686174206d656469612072756c652072657374617465642061667465722069742e0a246f76657272696465203d2024637373202e2027406d6564696120286d61782d77696474683a203630307078297b2e736974652d686561646572202e736974652d6865616465725f5f696e6e65727b626f782d73697a696e673a626f726465722d626f787d7d273b0a246279203d202473686565747328286e65772048746d6c5472616e73666f726d65722829292d3e7472616e73666f726d282468746d6c2c2061727261792820277374617469635f63737327203d3e20246f766572726964652029292d3e746f41727261792829293b0a24666c61744166746572203d20707265675f7265706c61636528272f5c732b2f272c202720272c202462795b2761667465722d617574686f72275d293b0a24636865636b280a202020202120246465636c61726573282462795b2761667465722d617574686f72275d2c20272e736974652d686561646572202e736974652d6865616465725f5f696e6e6572272c206e756c6c290a20202020202020207c7c2031203d3d3d20707265675f6d6174636828272f636f6e74656e742d626f782e2a406d65646961203f5c286d61782d77696474683a2036303070785c29203f5c7b5b5e7b7d5d2a5c2e736974652d686561646572205c2e736974652d6865616465725f5f696e6e6572203f5c7b5b5e7b7d5d2a626f782d73697a696e67203f3a203f626f726465722d626f782f272c2024666c61744166746572292c0a2020202027736f7572636520626f726465722d626f7820756e64657220286d61782d77696474683a20363030707829206973206e6f74206f76657272696464656e206279207468652061667465722d617574686f72207368656574272c0a202020202462795b2761667465722d617574686f72275d0a293b0a0a6966202820676574656e7628274143434550545f53454c465445535427292029207b0a2020202024676f6f64203d20222e617b783a317d5c6e2e736974652d686561646572202e736974652d6865616465725f5f696e6e65727b626f782d73697a696e673a636f6e74656e742d626f787d5c6e406d6564696120286d61782d77696474683a203738327078297b2e736974652d6865616465725f5f696e6e65727b626f782d73697a696e673a636f6e74656e742d626f787d7d223b0a2020202024636865636b28246465636c617265732824676f6f642c20272e736974652d686561646572202e736974652d6865616465725f5f696e6e6572272c206e756c6c292c202773656c66746573743a20756e636f6e646974696f6e616c2072756c6520666f756e6427293b0a2020202024636865636b28246465636c617265732824676f6f642c20272e736974652d6865616465725f5f696e6e6572272c2027286d61782d77696474683a2037383270782927292c202773656c66746573743a206d656469612072756c6520666f756e6427293b0a2020202024636865636b282120246465636c617265732827406d6564696120286d61782d77696474683a203738327078297b2e736974652d686561646572202e736974652d6865616465725f5f696e6e65727b626f782d73697a696e673a636f6e74656e742d626f787d7d272c20272e736974652d686561646572202e736974652d6865616465725f5f696e6e6572272c206e756c6c292c202773656c66746573743a206d656469612d6f6e6c792072756c65206973206e6f7420756e636f6e646974696f6e616c27293b0a2020202024636865636b282120246465636c6172657328272e736974652d6865616465725f5f696e6e65727b626f782d73697a696e673a636f6e74656e742d626f787d272c20272e736974652d6865616465725f5f696e6e6572272c2027286d61782d77696474683a2037383270782927292c202773656c66746573743a20756e636f6e646974696f6e616c2072756c65206973206e6f7420696e206d6564696127293b0a7d0a6578697428246661696c75726573203e2030203f2031203a2030293b0a | php -r '$f = tempnam(sys_get_temp_dir(), "acc"); file_put_contents($f, hex2bin(trim(stream_get_contents(STDIN)))); $c = 0; passthru(PHP_BINARY . " " . escapeshellarg($f), $c); unlink($f); exit($c);' || exit 1
echo "== new test"; php tests/unit/content-box-support-sheet.php || exit 1
grep -q 'tests/unit/content-box-support-sheet.php' composer.json || { echo "content-box-support-sheet.php is not registered in test:unit"; exit 1; }
echo "== unit + canonical suites"
tests=$(php -r '$s=json_decode(file_get_contents("composer.json"),true)["scripts"]; foreach(array_merge($s["test:unit"],$s["test:canonical"]) as $c) if ($c[0] !== "@") echo $c,"\n";' | sort -u | grep -v 'generated-artifact-provenance')
failed=0
while read -r c; do
  if out=$(timeout 300 bash -c "$c" 2>&1); then echo "ok   $c"; else echo "FAIL $c"; echo "$out" | tail -20; failed=1; fi
done <<TESTS
$tests
TESTS
[ "$failed" = 0 ] || exit 1
echo "== parity"; composer run-script test:parity || exit 1
echo "all gates passed"
  • CI: pending
Cook run
  • Gate 1: tree 08ef6e37adcf947acf66a95c88f3eac3e62a2803, fingerprint 1c44a5c4fc036f0b7cb6ab5c9d100a66b8819a817001f75cd02941c0b50d841f
  • Publication identity: ambient_gh

AI assistance

Tool: Implementation: Homeboy (pi); review form: Homeboy (pi) · Model: Implementation: claude-opus-5-5 (tier roadie/anthropic-claude-opus-5-5); review form: claude-opus-5-5 (tier roadie/anthropic-claude-opus-5-5) · Used for: Implementation: Homeboy (pi) authored the delivered candidate changes and deterministic verification evidence. Review form: Homeboy (pi) reviewed the validated candidate and supplied the reviewer metadata.

Closes #3565

Homeboy and others added 5 commits October 27, 2026 04:29
…class

Core's group stylesheet (.wp-block-group{box-sizing:border-box}) already sizes a
source box that carries the group class, so the source renders it border-box,
as the output does. Restating content-box for it after the author rules grew
the pet-store product cards (raw HTML with class="wp-block-group paw-card",
height:100%, padding:1.5rem) by 50px past their columns at 390px.
…omattic/blocks-engine into HEAD

# Conflicts:
#	php-transformer/tests/unit/content-box-support-sheet.php
@chubes4
chubes4 merged commit c7abdba into trunk Oct 27, 2026
15 checks passed
@chubes4
chubes4 deleted the fix/issue-3565-blocks-engine branch October 27, 2026 11:20
@chubes4

chubes4 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Context for this merge

The first commit came from the Homeboy cook. Its first attempt ended candidate_recoverable after composer install stalled during gate setup. The recovery commands reported a no-op, so the operator authorized finishing outside Homeboy. A second cook attempt then opened this PR. Two later commits were added by hand:

  • Group-class guard (450eb5418). A source box that already carries wp-block-group gets no box-sizing:content-box restatement. On the source WordPress, core's .wp-block-group{box-sizing:border-box} already renders it border-box, as the output does. Without the guard, the pet-store product cards (raw HTML wp-block-group paw-card, height:100%; padding:1.5rem) ran 50px past their columns at 390px. A test case was added in tests/unit/content-box-support-sheet.php. It fails without the guard.
  • Merges of trunk and the cook's branch tip. Neither changed the tree.

Pixel difference against the source on a pet-store block theme. The host keeps the theme stylesheet and installs only the support sheets.

Page trunk merged
home 1280 0.40% 0.06%
shop 1280 0.55% 0.09%
home / shop 390 0.54% / 0.54% 0.54% / 0.54%

Before merge, the following passed: all 627 test:unit + test:parity scripts, the 13-check acceptance script on #3565, phpcs, phpstan and 15/15 CI checks.


How AI was used: Claude (via the Pi coding agent in a Roadie session) wrote the guard and its test, measured the theme and merged; the cook (Homeboy, Pi) wrote the first commit. Reviewed by a human.

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.

php-transformer: content-box restatements reach only hosts that install the rewritten author stylesheet

1 participant