Skip to content

Preserve runtime entity binding anchors through shared-shell extraction #688

Description

@chubes4

Problem

The canonical WordPress site-plan compiler can generate runtime entity bindings for a commerce/forms artifact, then remove the binding’s declared page anchor during shared-shell extraction. WordPressSitePlan::assertEntityBindingsRemainPageOwned() correctly rejects the resulting detached binding, so no canonical site plan is produced.

This blocks the WooCommerce interoperability fixture used by Automattic/wp-codebox#1974. WooCommerce and Jetpack provision successfully before compilation; this is not a plugin dependency failure.

Reproduction

Fixture: fixtures/websites/20-switchback-woocommerce-extra-hard

Revisions:

  • Blocks Engine: 2adb310a6094949d206eaaaeebe43bb08d42c559
  • Static Site Importer: 9414dc69ec8e44cf42e34a37c4db59c5b14a5331
  • Homeboy run: ae30feeb-062e-4f3f-aa21-8bef32d08f2b
node tools/run-fixture-matrix.mjs \
  --runner homeboy-lab \
  --static-site-importer /path/to/static-site-importer \
  --blocks-engine /path/to/blocks-engine \
  --target-fixture 20-switchback-woocommerce-extra-hard \
  --batch-size 1 \
  --concurrency 1 \
  --run-id wp-codebox-1974-woocommerce-9414dc69-2adb310a

Observed error:

wordpress_site_plan_not_self_contained
A runtime entity binding no longer has its declared source-page block anchor after shell extraction.

The failure originates at php-transformer/src/WordPressSitePlan/WordPressSitePlan.php after sharedShells() rewrites pages and before plan construction.

Expected

Shared-shell extraction must preserve entity ownership deterministically. A binding anchored in markup moved to a shared template part should either:

  • remain page-owned through a retained page anchor, or
  • be canonically rebound to the extracted owning surface with corresponding schema/validation semantics.

Acceptance

  • the fixture compiles a valid blocks-engine/wordpress-site-plan/v2
  • every runtime entity binding remains attached to canonical materialized markup
  • product/form provider bindings still seed and replace the intended blocks
  • WordPressSitePlan::assertValid() remains fail-closed for truly detached bindings
  • add deterministic contract coverage for bindings whose candidate markup participates in shared-shell extraction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions