fix(magecommand): static verify — classify a bundle re-split as expected - #116
Open
pingiun wants to merge 1 commit into
Open
fix(magecommand): static verify — classify a bundle re-split as expected#116pingiun wants to merge 1 commit into
pingiun wants to merge 1 commit into
Conversation
A pipeline turned on `FAST_STATIC_DEPLOY_VERIFY` and it failed on bundles. The compile is not wrong; the verifier was. Magento keeps ONE `.min`-sibling cache for a whole `setup:static-content:deploy` process, so in a combined multi-locale invocation the first locale poisons the plain name for every later one — its bundles then drop files that a solo deploy of that same locale keeps. magecommand scopes that cache per `(area, locale)`, deliberately: it makes the rayon fan-out deterministic, and equals N separate deploys. The pipeline invokes both sides combined, so the two disagree. Neither output is wrong. Measured on the store that failed: our bundles hold 1579 modules to the reference's 1576, ZERO modules missing, ZERO shared modules with differing source — a strict superset. The three extras (`csso.js`, `jquery.ui.touch-punch.js`, `slick.js`) each have a deployed `.min.js` sibling, which is the only reason the reference could drop them: a module left out of the bundle is fetched from that sibling instead. Same modules, fewer requests. And it is the ORACLE that is order-dependent here — deploying a locale alone gives a different result than deploying it second — so chasing its ordering would trade away the determinism the deploy is built around. So `verify` learns the signature instead. A package's bundle files move to a new `resplit` bucket (clean, and unaffected by `--strict`: the modules and their sources are identical, so there is no stricter reading under which they are a defect) when, across the package's whole bundle set: - every module the reference bundles is in ours with byte-identical source, and - every module we bundle that the reference does not has a deployed `.min` sibling. Only the bundle files move; anything else differing in the package keeps failing on its own merits. Three negative controls pin the claim: a module the reference has and we lack, an extra module with no `.min` sibling, and a shared module whose source differs — none may be explained away. On the affected store this takes the combined-invocation verdict to exactly the per-locale-invocation one (7 changed, 0 extra, from 12 changed + 1 extra). What remains there is unrelated and untouched: three css files per locale (the `url()` fallback relocation and cssmin serialization gaps) plus the `sri-hashes.json` those feed. Co-Authored-By: Claude Opus 5 (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.
A pipeline turned on
FAST_STATIC_DEPLOY_VERIFYand it failed on bundles. The compile is not wrong; the verifier was.Not a bug — measured, not asserted
Magento keeps one
.min-sibling cache for a wholesetup:static-content:deployprocess, so in a combined multi-locale invocation the first locale poisons the plain name for every later one — its bundles drop files a solo deploy of that same locale keeps. magecommand scopes that cache per(area, locale), deliberately: it makes the rayon fan-out deterministic and equals N separate deploys. The pipeline invokes both sides combined, so the two disagree.On the store that failed:
A strict superset. The three extras (
csso.js,jquery.ui.touch-punch.js,slick.js) each have a deployed.min.jssibling — the only reason the reference could have dropped them. A module left out of the bundle is fetched from that sibling; both trees work, ours makes fewer requests.And the oracle is the order-dependent side: deploying a locale alone gives a different result than deploying it second. Chasing that would trade away the determinism the deploy module is built around.
So the verifier learns the signature
A package's bundle files move to a new
resplitbucket — clean, and unaffected by--strict, since the modules and their sources are identical and there is no stricter reading under which they are a defect — when, across the package's whole bundle set:.minsibling.Only the bundle files move; anything else differing in the package keeps failing on its own merits. (I had this too strict at first — requiring every difference in the package to be a bundle — which meant unrelated CSS differences suppressed the classification entirely.)
Negative controls
Three, because a rule that explains everything is worthless:
.minsibling — nothing could have dropped it;None may be explained away.
Effect
On the affected store the combined-invocation verdict now equals the per-locale one exactly: 7 changed / 0 extra, from 12 changed + 1 extra.
What remains there is unrelated and untouched: three CSS files per locale (the
url()fallback relocation and cssmin serialization gaps) plus thesri-hashes.jsonthey feed. That gate cannot pass on that shop until the CSS work lands, so running it report-only until then is worth considering.🤖 Generated with Claude Code