Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

planIdentity hashes the whole site plan with the per-declaration depth cap (33), failing imports whose fallback block trees nest deeply

Chiusa
#3,091 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php, wordpress
Ambito
backend, testing

Direzione di ricerca

Start by reading WordPressSitePlan::planIdentity() and ArtifactCompiler's plan digest depth bound, then find the verifier that recomputes the identity. Add a regression test for a plan with about 40 nested innerBlocks and confirm identity remains stable while runtime declarations deeper than 33 are still rejected. Done when the regression passes and the reported import can compose successfully.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

WordPressSitePlan::planIdentity() hashes the whole site plan with RuntimeDeclarations::hash() and its default depth bound, MAX_CANONICAL_DEPTH (33). That bound exists to cap a single runtime declaration payload. The plan legitimately carries deeper data: quality.fallbacks[*].readable_blocks is a parsed block tree with recursive innerBlocks. When a page's fallback block tree nests about 30 levels deep, composing the site plan fails with:

Materialization failed (wordpress_site_plan_not_self_contained): Runtime declaration payload contains an unsupported value.

The failure arrives at the very end of an import, after every page has compiled, and the message points at runtime declarations rather than plan depth.

Evidence

Static Site Importer 1.33.40 (bundled transformer equal to trunk for this code), importing a 50-route capture of https://www.wix.com/ (Studio create --from). All 50 pages compiled in about 1965 s, then compose failed. Stack trace (vendored paths trimmed):

#34 ArtifactCompiler/RuntimeDeclarations.php(374): RuntimeDeclarations::updateCanonicalHash(HashContext, Array, 33)
#35 WordPressSitePlan/WordPressSitePlan.php(178): RuntimeDeclarations::hash(Array)
#36 WordPressSitePlan/WordPressSitePlan.php(578): WordPressSitePlan::planIdentity(Array)
#37 WordPressSitePlan/WordPressSitePlan.php(248): WordPressSitePlan->fromCompilerInput(...)
#38 ArtifactCompiler/WordPressSitePlanComposer.php(40): WordPressSitePlan->fromResult(...)

That is 34 recursion frames, so depth 34 > 33. In the homepage's compile receipt, the deepest branch is compiled_documents/…/fallbacks/0/readable_blocks/0/innerBlocks/13/innerBlocks/1/…/attrs/wrappers/0/attributes/class at depth 47. The plan copies fallbacks into quality.fallbacks (WordPressSitePlan.php:574).

Root cause

The two plan-level hashes use different bounds:

  • ArtifactCompiler hashes plans with MAX_PLAN_DIGEST_DEPTH = 512.
  • planIdentity uses the per-declaration bound of 33.

A plan-level identity should accept every plan the plan validator accepts.

Proposal

Give planIdentity (and whichever verifier recomputes it when resolving) one shared plan-level depth bound, the same one ArtifactCompiler uses for plan digests. Keep MAX_CANONICAL_DEPTH for individual runtime declarations, where it belongs.

Acceptance

  • Regression test: a plan whose quality.fallbacks[0].readable_blocks nests about 40 levels of innerBlocks gets a stable planIdentity. Resolution or validation that recomputes the identity accepts it. A runtime declaration payload deeper than 33 is still rejected.
  • The test fails before the fix with Runtime declaration payload contains an unsupported value.
  • Re-running the wix.com import composes successfully (measured after release).

AI disclosure: Claude Opus 5.5 (Roadie/Pi) captured the stack trace by temporarily instrumenting a local import, located the deep plan branch and drafted this issue with Chris Huber.

Lingua principale
PHP
Stelle
22
Fork
2
Merge medio
7h 59m
PR unite (30g)
675

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Automattic/blocks-engine

Tutte le issue di Automattic/blocks-engine

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.