Repository navigation
Allocate engine-support CSS by exact owner set - #5278
Merged
Merged
Conversation
chubes4
force-pushed
the
fix/5212-owner-set-support
branch
from
November 9, 2026 18:45
00e622b to
479d6fa
Compare
Contributor
Author
|
Pushed AI disclosure: Franklin (Claude Code, Claude Opus) made this fix and gated it on Lab. |
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.
Fixes #5212.
Problem
Engine-support CSS was written per route, so a rule needed on N routes was copied into N stylesheets. Each copy also got its own ~600-byte enqueue condition that resolved the current document inline.
Change
allocateDocumentSupport()splits engine-support rules by the exact set of documents that consume them, keeping before-author and after-author support separate. A rule set consumed by every canonical page becomes global, as trunk's dedup path already did. Subsets keep exact owner scopes, so the Page-owned engine-support stylesheets are enqueued unconditionally on every route #4007/Preserve document scopes when deduplicating support stylesheets #4016 invariant holds anddocument-support-stylesheet-scope.phpis unchanged. Sheets withurl(references or at-rule statements keep their original resource.wp_enqueue_scriptscallback resolves the document id, reconciliation identity and page-uri fallback at the top. Each resource then gets one enqueue that tests membership in its owner list.Evidence
Real site: the tarotkarima.carrd.co capture (10 routes), compiled by
ArtifactCompiler, trunk vs fix:Most of what remains in functions.php is the editor presentation tables (~16.5 KB), which is out of scope here.
support-owner-set-allocation.php(with a realistic 6-page fixture): every rule is written once, all-pages rules are global, subset rules have exact owner scopes, no empty support or editor-state assets, and per-document cascade order holds. It fails on trunk (Each generated rule is written exactly once: all-copy).00e622be30:composer test:canonicalGATE=0.declaration-addressed-chrome.phpnow expects that editor-state sheets left empty after chrome extraction are not published.AI disclosure: Implemented across three Homeboy Cooks (pi, gpt-6.1-sol). Franklin (Claude Code, Claude Opus) rejected the first design for regressing #4007, reviewed the revisions, gated on Lab, measured the real site, and wrote this PR.