Skip to content

fix(magecommand): static verify — classify a bundle re-split as expected - #116

Open
pingiun wants to merge 1 commit into
mainfrom
fix/static-verify-bundle-resplit
Open

fix(magecommand): static verify — classify a bundle re-split as expected#116
pingiun wants to merge 1 commit into
mainfrom
fix/static-verify-bundle-resplit

Conversation

@pingiun

@pingiun pingiun commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

A pipeline turned on FAST_STATIC_DEPLOY_VERIFY and 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 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 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:

reference ours
bundled modules 1576 1579
modules missing from ours 0
shared modules with differing source 0

A strict superset. The three extras (csso.js, jquery.ui.touch-punch.js, slick.js) each have a deployed .min.js sibling — 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 resplit bucket — 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:

  • 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. (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:

  • a module the reference bundles and we lack — a real defect;
  • an extra module with no .min sibling — nothing could have dropped it;
  • a shared module whose source differs — the split is irrelevant, the content is wrong.

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 the sri-hashes.json they 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

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>
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.

1 participant