From 3b4dd2a05979ad74be6bdd964b40069f5246c2db Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Tue, 13 Oct 2026 00:18:14 -0400 Subject: [PATCH 1/3] refactor(php-transformer)!: read capture evidence through a producer-neutral vocabulary Publish the capture-evidence input contract as Contract\CaptureEvidence and docs/contracts/capture-evidence.md. Every attribute, class, id suffix, probe token, sidecar schema and recognized runtime identity the transformer reads or emits now comes from that vocabulary under data-blocks-engine-capture-* and blocks-engine-capture/*; the producer-specific names are no longer read. Add the equivalence gate (344 harvested pre-move entry-point calls replayed byte-identically), the vocabulary completeness contract and the producer-neutral source guard. --- ...-dispatch-renderer-reference-goldens.json} | 0 ...> native-low-level-reference-goldens.json} | 0 ...e-section-renderer-reference-goldens.json} | 0 ...tive-text-renderer-reference-goldens.json} | 0 ...-reconstruct-reference-baseline.corpus.ts} | 0 ...construct-reference-baseline.goldens.json} | 0 ...on => region-audit-reference-goldens.json} | 0 ...=> variation-hoist-reference-goldens.json} | 0 ...nstruct-reference-baseline-parity.test.ts} | 0 php-transformer/README.md | 4 +- php-transformer/composer.json | 3 + php-transformer/docs/captured-galleries.md | 6 +- php-transformer/docs/collection-filters.md | 8 +- .../docs/contracts/capture-evidence.md | 176 ++ .../docs/declared-document-controls.md | 6 +- php-transformer/docs/document-head-runtime.md | 4 +- php-transformer/docs/glyph-color.md | 4 +- php-transformer/docs/native-control-state.md | 2 +- .../src/ArtifactCompiler/ArtifactCompiler.php | 15 +- .../ArtifactCompiler/ArtifactNormalizer.php | 3 +- .../CapturedChoiceGroupProjector.php | 11 +- .../CapturedCollectionFilterProjector.php | 15 +- .../CapturedCollectionProjector.php | 55 +- .../CapturedDialogProjector.php | 102 +- .../CapturedSelectableSetProjector.php | 9 +- .../RuntimeDependencyParityReport.php | 5 +- .../src/Contract/CaptureEvidence.php | 181 ++ .../Classification/FormControlClassifier.php | 5 +- .../SourceElementClassifier.php | 7 +- .../AuthoredFormControlBlockConverter.php | 7 +- .../Elements/CapturedChoiceGroupConverter.php | 5 +- .../Elements/CapturedDialogConverter.php | 5 +- .../Elements/CapturedListboxConverter.php | 5 +- .../Elements/ElementConversionPrelude.php | 7 +- .../Elements/FormControlMetadataBuilder.php | 15 +- .../NativeGetFormControlConverter.php | 5 +- .../ReadableFormControlBlockConverter.php | 3 +- .../Elements/RuntimeIslandAnalyzer.php | 9 +- .../AuthoredCarouselBlockGenerator.php | 29 +- .../Generators/AuthoredControlState.php | 9 +- .../CapturedDialogBlockGenerator.php | 6 +- .../CollectionFilterBlockGenerator.php | 19 +- .../src/HtmlToBlocks/HtmlCompilation.php | 11 +- .../NavigationBlockNormalizer.php | 3 +- .../Patterns/AccordionPattern.php | 5 +- .../HtmlToBlocks/Patterns/DetailsPattern.php | 3 +- .../Patterns/NavigationPattern.php | 35 +- .../HtmlToBlocks/Patterns/PatternContext.php | 2 +- .../HtmlToBlocks/ResponsiveCorrespondence.php | 12 +- .../ResponsiveCounterpartEditorModule.php | 20 +- .../Style/AuthorSelectorSemanticPreparer.php | 11 +- .../Style/AuthorStyleRuleProjector.php | 3 +- .../Style/DisclosureControlPresentation.php | 11 +- .../Style/ScopedAnchorSelectorProjection.php | 3 +- .../Support/CapturedGlyphColor.php | 14 +- .../Support/NativeControlState.php | 8 +- .../Support/NavigationToggleSuppressor.php | 7 +- .../src/HtmlToBlocks/Support/SourceDom.php | 18 +- .../src/Support/DocumentVariantIds.php | 21 +- .../src/Support/RenderEquivalentMarkup.php | 6 +- .../src/Support/ShellLandmarkPolicy.php | 6 +- .../src/Support/StyleTagScanner.php | 4 +- .../src/WordPressSitePlan/ShellExtraction.php | 7 +- .../WordPressSitePlan/WordPressSitePlan.php | 10 +- .../contract/capture-evidence-equivalence.php | 88 + .../contract/capture-evidence-vocabulary.php | 95 + .../contract/captured-navigation-runtime.php | 24 +- .../captured-scope-runtime-bindings.php | 24 +- .../tests/contract/dialog-document-scope.php | 6 +- .../contract/entry-point-transform-parity.php | 4 +- .../contract/form-control-not-menu-toggle.php | 6 +- .../navigation-entity-label-identity.php | 2 +- .../contract/producer-neutral-source.php | 78 + .../contract/render-equivalent-chrome.php | 2 +- php-transformer/tests/contract/run.php | 82 +- .../contract/shared-chrome-authored-rules.php | 18 +- ...hared-chrome-backdrop-containing-block.php | 16 +- .../shared-chrome-paint-order-root.php | 8 +- .../tests/contract/shared-shell-plan.php | 24 +- .../contract/staged-artifact-compilation.php | 4 +- .../support/CaptureEvidenceEquivalence.php | 201 ++ .../viewport-hidden-document-variants.php | 4 +- ...ntime.js => capture-disclosure-runtime.js} | 18 +- .../corpus.json.gz | Bin 0 -> 235390 bytes .../expected.json | 2070 +++++++++++++++++ .../tests/fixtures/capture-gallery-runtime.js | 8 + .../declared-document-role-button.php | 10 +- .../tests/fixtures/dialog-document-scope.php | 26 +- .../tests/fixtures/head-script-retirement.php | 8 +- .../navigation-list-panel-ownership.php | 4 +- .../tests/fixtures/nested-header-menu.php | 8 +- .../tests/fixtures/scoped-mixed-dropdown.php | 12 +- .../viewport-hidden-wix-mobile-document.html | 8 +- .../integration/navigation-anchor-subject.php | 4 +- .../scoped-mixed-dropdown-browser.mjs | 2 +- .../tests/native-control-state-browser.mjs | 6 +- .../tests/packaging/install-proof.php | 6 +- .../unit/accordion-presentation-browser.mjs | 2 +- .../unit/accordion-toggle-presentation.php | 6 +- .../accordion-vector-presentation-fixture.php | 2 +- .../artifact-author-stylesheet-projection.php | 6 +- .../tests/unit/artifact-report-budget.php | 4 +- .../tests/unit/author-selector-semantics.php | 4 +- .../tests/unit/authored-carousel-block.php | 24 +- .../tests/unit/authored-marquee-block.php | 2 +- .../tests/unit/authored-select-block.php | 6 +- .../tests/unit/canonical-zero-lengths.php | 2 +- .../unit/captured-choice-group-projector.php | 10 +- .../tests/unit/captured-collection-filter.php | 66 +- .../unit/captured-dialog-dropdown-panel.php | 26 +- .../tests/unit/captured-dialog-projector.php | 68 +- .../tests/unit/captured-gallery-contract.php | 20 +- .../tests/unit/captured-glyph-color.php | 28 +- .../unit/captured-listbox-materialization.php | 4 +- .../captured-selectable-set-projector.php | 4 +- .../unit/closed-details-fixed-overlay.php | 2 +- .../tests/unit/collection-filter-block.php | 12 +- .../tests/unit/collection-filter-browser.mjs | 6 +- .../unit/collection-filter-finite-fixture.php | 28 +- ...onal-definite-parent-percentage-height.php | 2 +- .../declared-canvas-selector-identity.php | 4 +- .../unit/declared-document-role-button.php | 8 +- .../details-control-presentation-fixture.php | 4 +- .../device-style-synthetic-anchor-carrier.php | 16 +- .../unit/disclosure-panel-navigation.php | 8 +- .../unit/disclosure-responsive-display.php | 8 +- .../unit/form-adjacent-source-choice.php | 46 +- .../unit/form-entity-in-form-context.php | 6 +- .../unit/form-listbox-option-context.php | 4 +- .../tests/unit/hash-anchor-menu-toggle.php | 4 +- .../tests/unit/inline-wrapper-disclosure.php | 4 +- .../media-scoped-inset-parent-fill-svg.php | 2 +- .../unit/menu-chrome-presentation-carry.php | 10 +- .../unit/named-fragment-target-geometry.php | 18 +- .../tests/unit/native-control-state.php | 9 +- .../navigation-anchor-cluster-submenu.php | 4 +- .../unit/navigation-block-normalizer.php | 16 +- .../navigation-button-dropdown-submenu.php | 18 +- .../unit/navigation-hidden-menu-hoist.php | 6 +- .../unit/navigation-opener-presentation.php | 6 +- .../tests/unit/responsive-canvas-geometry.php | 2 +- .../unit/responsive-counterpart-contracts.php | 16 +- .../unit/responsive-document-variants.php | 42 +- .../unit/responsive-hidden-flex-blockgap.php | 2 +- .../unit/runtime-data-target-layout-shell.php | 20 +- .../unit/runtime-dialog-trigger-button.php | 60 +- .../unit/runtime-selected-device-document.php | 34 +- .../tests/unit/scoped-mixed-dropdown.php | 16 +- .../tests/unit/shell-landmark-policy.php | 2 +- .../capture-evidence-equivalence/README.md | 48 + .../capture-evidence-equivalence/baseline.php | 41 + .../build-corpus.php | 35 + .../harvest-hook.php | 49 + .../rename-checkout.php | 46 + .../semantic-report.php | 77 + .../tests/declared-document-role-button.mjs | 4 +- .../tests/dialog-document-scope.mjs | 10 +- .../tests/document-head-paired.mjs | 2 +- .../tests/integrated-document-probe.mjs | 10 +- .../responsive-counterpart-text-sync.mjs | 8 +- 160 files changed, 4073 insertions(+), 827 deletions(-) rename packages/blocks-engine/src/__fixtures__/{native-dispatch-renderer-dla-goldens.json => native-dispatch-renderer-reference-goldens.json} (100%) rename packages/blocks-engine/src/__fixtures__/{native-low-level-dla-goldens.json => native-low-level-reference-goldens.json} (100%) rename packages/blocks-engine/src/__fixtures__/{native-section-renderer-dla-goldens.json => native-section-renderer-reference-goldens.json} (100%) rename packages/blocks-engine/src/__fixtures__/{native-text-renderer-dla-goldens.json => native-text-renderer-reference-goldens.json} (100%) rename packages/blocks-engine/src/__fixtures__/{page-reconstruct-dla-baseline.corpus.ts => page-reconstruct-reference-baseline.corpus.ts} (100%) rename packages/blocks-engine/src/__fixtures__/{page-reconstruct-dla-baseline.goldens.json => page-reconstruct-reference-baseline.goldens.json} (100%) rename packages/blocks-engine/src/__fixtures__/{region-audit-dla-goldens.json => region-audit-reference-goldens.json} (100%) rename packages/blocks-engine/src/__tests__/fixtures/{variation-hoist-dla-goldens.json => variation-hoist-reference-goldens.json} (100%) rename packages/blocks-engine/src/__tests__/{theme-reconstruct-dla-baseline-parity.test.ts => theme-reconstruct-reference-baseline-parity.test.ts} (100%) create mode 100644 php-transformer/docs/contracts/capture-evidence.md create mode 100644 php-transformer/src/Contract/CaptureEvidence.php create mode 100644 php-transformer/tests/contract/capture-evidence-equivalence.php create mode 100644 php-transformer/tests/contract/capture-evidence-vocabulary.php create mode 100644 php-transformer/tests/contract/producer-neutral-source.php create mode 100644 php-transformer/tests/contract/support/CaptureEvidenceEquivalence.php rename php-transformer/tests/fixtures/{dla-disclosure-runtime.js => capture-disclosure-runtime.js} (65%) create mode 100644 php-transformer/tests/fixtures/capture-evidence-equivalence/corpus.json.gz create mode 100644 php-transformer/tests/fixtures/capture-evidence-equivalence/expected.json create mode 100644 php-transformer/tests/fixtures/capture-gallery-runtime.js create mode 100644 php-transformer/tools/capture-evidence-equivalence/README.md create mode 100644 php-transformer/tools/capture-evidence-equivalence/baseline.php create mode 100644 php-transformer/tools/capture-evidence-equivalence/build-corpus.php create mode 100644 php-transformer/tools/capture-evidence-equivalence/harvest-hook.php create mode 100644 php-transformer/tools/capture-evidence-equivalence/rename-checkout.php create mode 100644 php-transformer/tools/capture-evidence-equivalence/semantic-report.php diff --git a/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-dla-goldens.json b/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-reference-goldens.json similarity index 100% rename from packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-dla-goldens.json rename to packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-reference-goldens.json diff --git a/packages/blocks-engine/src/__fixtures__/native-low-level-dla-goldens.json b/packages/blocks-engine/src/__fixtures__/native-low-level-reference-goldens.json similarity index 100% rename from packages/blocks-engine/src/__fixtures__/native-low-level-dla-goldens.json rename to packages/blocks-engine/src/__fixtures__/native-low-level-reference-goldens.json diff --git a/packages/blocks-engine/src/__fixtures__/native-section-renderer-dla-goldens.json b/packages/blocks-engine/src/__fixtures__/native-section-renderer-reference-goldens.json similarity index 100% rename from packages/blocks-engine/src/__fixtures__/native-section-renderer-dla-goldens.json rename to packages/blocks-engine/src/__fixtures__/native-section-renderer-reference-goldens.json diff --git a/packages/blocks-engine/src/__fixtures__/native-text-renderer-dla-goldens.json b/packages/blocks-engine/src/__fixtures__/native-text-renderer-reference-goldens.json similarity index 100% rename from packages/blocks-engine/src/__fixtures__/native-text-renderer-dla-goldens.json rename to packages/blocks-engine/src/__fixtures__/native-text-renderer-reference-goldens.json diff --git a/packages/blocks-engine/src/__fixtures__/page-reconstruct-dla-baseline.corpus.ts b/packages/blocks-engine/src/__fixtures__/page-reconstruct-reference-baseline.corpus.ts similarity index 100% rename from packages/blocks-engine/src/__fixtures__/page-reconstruct-dla-baseline.corpus.ts rename to packages/blocks-engine/src/__fixtures__/page-reconstruct-reference-baseline.corpus.ts diff --git a/packages/blocks-engine/src/__fixtures__/page-reconstruct-dla-baseline.goldens.json b/packages/blocks-engine/src/__fixtures__/page-reconstruct-reference-baseline.goldens.json similarity index 100% rename from packages/blocks-engine/src/__fixtures__/page-reconstruct-dla-baseline.goldens.json rename to packages/blocks-engine/src/__fixtures__/page-reconstruct-reference-baseline.goldens.json diff --git a/packages/blocks-engine/src/__fixtures__/region-audit-dla-goldens.json b/packages/blocks-engine/src/__fixtures__/region-audit-reference-goldens.json similarity index 100% rename from packages/blocks-engine/src/__fixtures__/region-audit-dla-goldens.json rename to packages/blocks-engine/src/__fixtures__/region-audit-reference-goldens.json diff --git a/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-dla-goldens.json b/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-reference-goldens.json similarity index 100% rename from packages/blocks-engine/src/__tests__/fixtures/variation-hoist-dla-goldens.json rename to packages/blocks-engine/src/__tests__/fixtures/variation-hoist-reference-goldens.json diff --git a/packages/blocks-engine/src/__tests__/theme-reconstruct-dla-baseline-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-reconstruct-reference-baseline-parity.test.ts similarity index 100% rename from packages/blocks-engine/src/__tests__/theme-reconstruct-dla-baseline-parity.test.ts rename to packages/blocks-engine/src/__tests__/theme-reconstruct-reference-baseline-parity.test.ts diff --git a/php-transformer/README.md b/php-transformer/README.md index 6beaa48fe..df64cafb7 100644 --- a/php-transformer/README.md +++ b/php-transformer/README.md @@ -189,7 +189,9 @@ Visual parity tooling should use the product-neutral report/config contracts in WordPress materializers that consume the self-contained `wordpress-site-plan/v2` contract should use `WordPressSitePlan\WordPressSitePlanView::fromResult()`. It preserves the exact canonical plan plus Gutenberg gaps, companion-plugin payload, font materialization metadata, and plan diagnostics while omitting the duplicated compiled-site, root asset, document, and block projections. -Icon-only social rows carry a uniform glyph colour onto `core/social-links`. A captured `data-dla-glyph-color` wins over decoding the icon image, and the attribute never reaches output; see [Social icon glyph colour](docs/glyph-color.md). +Capture tools describe what they observed in a rendered source (document variants, dialog and disclosure bindings, galleries, collection filters, glyph colour) with the producer-neutral capture-evidence vocabulary: `data-blocks-engine-capture-*` attributes and classes plus `blocks-engine-capture/*` sidecar schemas, published as `Contract\CaptureEvidence` and documented in [Capture evidence](docs/contracts/capture-evidence.md). Any capture producer may emit it. + +Icon-only social rows carry a uniform glyph colour onto `core/social-links`. A captured `data-blocks-engine-capture-glyph-color` wins over decoding the icon image, and the attribute never reaches output; see [Social icon glyph colour](docs/glyph-color.md). `HtmlTransformer` preserves syntax-highlight spans inside `
` when they use safe inline tags and bounded attributes, while plain code remains escaped as text. Figure-wrapped testimonials and quote shapes are normalized to core quote or pullquote blocks with attribution from `cite`, `footer`, or `figcaption` content.
 
diff --git a/php-transformer/composer.json b/php-transformer/composer.json
index fb4092a72..86f86ebf3 100644
--- a/php-transformer/composer.json
+++ b/php-transformer/composer.json
@@ -69,6 +69,9 @@
       "php tests/contract/namespace-resolution.php",
       "php tests/contract/layer-direction.php",
       "php tests/contract/throw-classification.php",
+      "php tests/contract/producer-neutral-source.php",
+      "php tests/contract/capture-evidence-vocabulary.php",
+      "php tests/contract/capture-evidence-equivalence.php",
       "php tests/contract/runtime-no-wordpress.php",
       "php tests/contract/runtime-no-markdown.php",
       "php tests/contract/runtime-wordpress-stubs.php",
diff --git a/php-transformer/docs/captured-galleries.md b/php-transformer/docs/captured-galleries.md
index 678211158..baf10663b 100644
--- a/php-transformer/docs/captured-galleries.md
+++ b/php-transformer/docs/captured-galleries.md
@@ -18,8 +18,8 @@ different inline and expanded order; selection maps each inline frame to its
 observed expanded frame by image identity, rather than assuming equal indices.
 
 The consumer admits 2–24 frames and a complete, identity-checked selection
-bijection. The root's `data-dla-gallery-source` and
-`data-dla-gallery-capture-width` bind evidence to the emitted responsive document.
+bijection. The root's `data-blocks-engine-capture-gallery-source` and
+`data-blocks-engine-capture-gallery-capture-width` bind evidence to the emitted responsive document.
 A collapsed responsive document can retain one captured viewport. Each emitted
 native carousel keeps its own initial state. Complete inline-only evidence still
 produces native navigation; an unobserved lightbox remains unproven.
@@ -43,7 +43,7 @@ contracts used by independently authored carousels and dialogs.
 checks trigger identity and native-image roundtrip, and rejects an identity-wrong
 selection that has the correct array shape.
 
-For the actual producer-to-WordPress gate, provide a genuine portable DLA capture
+For the actual producer-to-WordPress gate, provide a genuine portable capture
 at `tests/fixtures/captured-gallery/`, including `website/`, the matching capture
 receipt, and interaction report. Then run:
 
diff --git a/php-transformer/docs/collection-filters.md b/php-transformer/docs/collection-filters.md
index 1203e8630..3d8821d47 100644
--- a/php-transformer/docs/collection-filters.md
+++ b/php-transformer/docs/collection-filters.md
@@ -1,6 +1,6 @@
 # Verified editable collection filters
 
-The collection filter companion consumes Data Liberation Agent's bounded
+The collection filter companion consumes a capture producer's bounded
 `typed-search` evidence. It is a local collection predicate, with independently
 observed category membership, rather than a site-wide WordPress search.
 
@@ -36,17 +36,17 @@ inside/after placement and is shown only when no item matches.
 
 ## Finite bootstrap
 
-`finiteBootstrap.schema` must be `data-liberation/finite-bootstrap/v1`. That
+`finiteBootstrap.schema` must be `blocks-engine-capture/finite-bootstrap/v1`. That
 record is admitted only when restoration, replay, observed-response replay,
 intercepted verification, declared count, complete text-only coverage, observed
 answers, universal-query order, and ordered global/category probes all recompute.
 Category mode shows the selected category. A nonempty query searches the whole
 universe and hides the category strip, not the input, status, or results.
-Optional `finiteBootstrap.status` uses `data-liberation/collection-status/v1`.
+Optional `finiteBootstrap.status` uses `blocks-engine-capture/collection-status/v1`.
 Absent status is valid and adds no label. A present record is projected only
 when every node has source HTML, `{count}` or `{query}` tokens, matching binds,
 `before-items` or `after-items`, and `hidesAtZero: true`. The runtime writes
-`textContent` from the editable `data-dla-status-template` attribute. An empty
+`textContent` from the editable `data-blocks-engine-capture-status-template` attribute. An empty
 query hides those labels. At zero they stay hidden. When the source empty
 state contains that count template rendered at zero with the same tag, role,
 live attributes, and class, that node remains the collection status and the
diff --git a/php-transformer/docs/contracts/capture-evidence.md b/php-transformer/docs/contracts/capture-evidence.md
new file mode 100644
index 000000000..aded24c16
--- /dev/null
+++ b/php-transformer/docs/contracts/capture-evidence.md
@@ -0,0 +1,176 @@
+# Capture evidence
+
+A capture tool renders a source site and records what it observed beside the
+captured HTML: which copy of the page is the mobile document, which control
+opens which panel, how a gallery cycles, which items a collection filter
+shows, the rendered colour of an icon. Blocks Engine reads that evidence to
+produce native, editable blocks instead of a frozen snapshot.
+
+This page is Blocks Engine's **producer-neutral input contract** for that
+evidence. Any capture tool may emit it. The names are published once in
+[`CaptureEvidence`](../../src/Contract/CaptureEvidence.php); the transformer
+never spells them anywhere else, and
+`tests/contract/capture-evidence-vocabulary.php` keeps this page, the
+constants and their use in `src/` identical.
+
+## Namespace
+
+- Every attribute, class, id suffix and probe token starts with
+  `data-blocks-engine-capture-` (id suffixes with `--data-blocks-engine-capture-`).
+  Classes use the same prefix as attributes on purpose: `blocks-engine-*`
+  classes are the engine's own generated classes, which conversion strips or
+  ignores as source styling, so capture classes must stay outside it.
+- Sidecar schemas are `blocks-engine-capture//v`.
+- A producer that observes something this page does not list may still use
+  the namespace; the transformer ignores names it does not read. Other
+  consumers follow the same rule: for example Static Site Importer reads
+  `data-blocks-engine-capture-device-style`,
+  `data-blocks-engine-capture-selected-document` and
+  `data-blocks-engine-capture-member-login`.
+- Attribute values are case-sensitive and trimmed unless noted. A flag
+  attribute is present-or-absent; its value is ignored.
+
+## Names
+
+### Prefixes
+
+| Name | Kind | Meaning |
+| ---- | ---- | ------- |
+| `data-blocks-engine-capture-` | attribute prefix | Every capture attribute. Author selectors negating a capture attribute on `html`/`:root` are runtime document state and stay live. |
+| `--data-blocks-engine-capture-` | id suffix prefix | A non-default document variant's copy of a shared source id: `--data-blocks-engine-capture-mobile`, or `--data-blocks-engine-capture-` for `site-document-variant-` and declared device documents. The transformer applies the same suffix and points variant-scoped author id selectors at it. |
+
+### Document variants
+
+| Name | Kind | Value | Meaning |
+| ---- | ---- | ----- | ------- |
+| `data-blocks-engine-capture-document-scope` | attribute (flag) | ignored | The element is a body-equivalent document root. With `device-document` it declares a device profile. |
+| `data-blocks-engine-capture-device-document` | attribute | `[a-z][a-z0-9_-]{0,63}` | Profile id of a declared document scope. |
+| `data-blocks-engine-capture-mobile-document` | class | — | Root of the mobile copy of a responsive capture. |
+| `data-blocks-engine-capture-desktop-document` | class | — | Root of the desktop (default) copy of a responsive capture. |
+| `data-blocks-engine-capture-responsive-counterpart-` | class prefix | 12 lowercase hex digits | Pairs an element in the default document with its counterpart in another variant. |
+| `data-blocks-engine-capture-responsive-source` | attribute | source id | Source identity of a responsive counterpart; ignored when comparing shared chrome. |
+| `data-blocks-engine-capture-source-media` | attribute on `'
     . '' . $body . $disclosureRuntime . '';
@@ -45,15 +45,15 @@
 // 1. A builder widget root whose class tokens look like an app root, inside a
 // declared capture scope, stays editable: its attribute-bound controls are
 // retained by native blocks instead of preserving the subtree as core/html.
-$scoped = $compile($page('
' . $feed . '
')); +$scoped = $compile($page('
' . $feed . '
')); $scopedMarkup = (string) ($scoped['serialized_blocks'] ?? ''); $assert(0 === substr_count($scopedMarkup, '

Entry 2

'), 'Widget headings materialize as native heading blocks.'); $assert(str_contains($scopedMarkup, '

Summary for entry 3.

'), 'Widget summaries materialize as native paragraph blocks.'); -$assert(3 === substr_count($scopedMarkup, 'data-dla-dialog-trigger="entry-menu-'), 'Every attribute-bound trigger keeps its runtime binding on the frontend.'); -$assert(str_contains($scopedMarkup, 'data-dla-dialog-close="entry-menu-1"'), 'The attribute-bound close control keeps its runtime binding.'); +$assert(3 === substr_count($scopedMarkup, 'data-blocks-engine-capture-dialog-trigger="entry-menu-'), 'Every attribute-bound trigger keeps its runtime binding on the frontend.'); +$assert(str_contains($scopedMarkup, 'data-blocks-engine-capture-dialog-close="entry-menu-1"'), 'The attribute-bound close control keeps its runtime binding.'); $assert(str_contains($scopedMarkup, 'feed-root blog-surface is-desktop app-desktop'), 'The widget root keeps its source classes on a native carrier.'); // 2. The same widget outside a declared capture scope keeps the established @@ -64,7 +64,7 @@ // 3. Inside a captured scope, targets addressed by identity (class or id // selectors) are still app-shell evidence. $identityAddressed = (new HtmlTransformer())->transform( - '
' + '
' . '

Cell one

Cell two

', array('source' => 'index.html', 'runtime_dom_selectors' => array('.cell'), 'runtime_behavioral_selectors' => array('.cell')) )->toArray(); @@ -74,16 +74,16 @@ // stays with the media owner, which saves the host verbatim, instead of // becoming a raw core/html island. $effectsRuntime = ''; -$host = '' +$host = '' . ''; $hostResult = $compile('Hero' - . '
' . $host . '

Welcome

' + . '
' . $host . '

Welcome

' . $effectsRuntime . ''); $hostMarkup = (string) ($hostResult['serialized_blocks'] ?? ''); $assert(0 === substr_count($hostMarkup, '

Welcome

'), 'Content beside the bound host stays native.'); $hostDomIslands = array_filter($islands($hostResult, 'dom'), static fn (array $island): bool => '#hero-frame' === ($island['selector'] ?? '')); $assert(array() === $hostDomIslands, 'Responsive media retains the runtime DOM contract natively, so no runtime DOM island is recorded for the host.'); diff --git a/php-transformer/tests/contract/dialog-document-scope.php b/php-transformer/tests/contract/dialog-document-scope.php index e3a04eead..08e287e82 100644 --- a/php-transformer/tests/contract/dialog-document-scope.php +++ b/php-transformer/tests/contract/dialog-document-scope.php @@ -19,8 +19,8 @@ $names = array_column($blocks, 'blockName'); $assert(!in_array('core/html', $names, true), 'A document-scope lookup and deeply nested dialog do not turn the page into core/html: ' . $variant); $assert(in_array('core/heading', $names, true) && in_array('core/paragraph', $names, true), 'Unrelated main/footer remain native editable blocks.'); - $assert(str_contains($result['serialized_blocks'], 'data-dla-document-scope') && str_contains($result['serialized_blocks'], 'data-dla-dialog-ancestor-unverified'), 'Document identity and unverified ancestor proof remain reviewable in emitted markup.'); - $assert(str_contains($result['serialized_blocks'], 'data-dla-dialog-panel="gallery-' . $variant . '"') && str_contains($result['serialized_blocks'], 'Captured image caption.'), 'The wired popup remains editable in its declared source document scope.'); + $assert(str_contains($result['serialized_blocks'], 'data-blocks-engine-capture-document-scope') && str_contains($result['serialized_blocks'], 'data-blocks-engine-capture-dialog-ancestor-unverified'), 'Document identity and unverified ancestor proof remain reviewable in emitted markup.'); + $assert(str_contains($result['serialized_blocks'], 'data-blocks-engine-capture-dialog-panel="gallery-' . $variant . '"') && str_contains($result['serialized_blocks'], 'Captured image caption.'), 'The wired popup remains editable in its declared source document scope.'); $assert('pass' === (new Runtime())->validateBlockSerialization($result['blocks'])['status'], 'The document and popup serialize as valid editable blocks.'); } $unknown = (new ArtifactCompiler())->compile($fixture('desktop', true))->toArray(); @@ -32,7 +32,7 @@ $static = $fixture(); $static['files']['index.html'] = str_replace(array('
', '
'), array('
', '
'), $static['files']['index.html']); -$static['files']['index.html'] = str_replace('data-liberation-desktop-document', 'site-document-variant-portrait', $static['files']['index.html']); +$static['files']['index.html'] = str_replace('data-blocks-engine-capture-desktop-document', 'site-document-variant-portrait', $static['files']['index.html']); $result = (new ArtifactCompiler())->compile($static)->toArray(); foreach (array_filter($flatten($result['blocks']), static fn(array $block): bool => 'core/html' === $block['blockName']) as $block) { $assert(!str_contains($block['innerHTML'], 'Unrelated main copy.'), 'An unrelated canvas does not move a page-wide fallback to the next static ancestor.'); diff --git a/php-transformer/tests/contract/entry-point-transform-parity.php b/php-transformer/tests/contract/entry-point-transform-parity.php index 373f13341..63343d6fa 100644 --- a/php-transformer/tests/contract/entry-point-transform-parity.php +++ b/php-transformer/tests/contract/entry-point-transform-parity.php @@ -97,8 +97,8 @@ 'responsive document variants' => array( 'files' => array( 'index.html' => '' - . '
' . $menu() . '

Home

' - . '
' . $menu() . '

Home

' + . '
' . $menu() . '

Home

' + . '
' . $menu() . '

Home

' . '', ), 'options' => array(), diff --git a/php-transformer/tests/contract/form-control-not-menu-toggle.php b/php-transformer/tests/contract/form-control-not-menu-toggle.php index f2f1b72bb..c0f5aab99 100644 --- a/php-transformer/tests/contract/form-control-not-menu-toggle.php +++ b/php-transformer/tests/contract/form-control-not-menu-toggle.php @@ -15,11 +15,11 @@ // navigation. Far below it, a contact form has a phone field whose country // picker is a labelless button with `aria-expanded`. That picker opens its own // list; it must not be taken for the menu toggle and claim the menu dialog. -$disclosure = '
' - . '' . "\n" . ''; -$roots = $method->invoke(null, $variant('data-liberation-desktop-document', 'SITE_HEADER') . "\n" . $variant('data-liberation-mobile-document', 'SITE_HEADER--dla-mobile')); -$assert(array('SITE_HEADER', 'SITE_HEADER--dla-mobile') === $roots, '4a: each viewport partition contributes its own root anchor: ' . json_encode($roots)); +$roots = $method->invoke(null, $variant('data-blocks-engine-capture-desktop-document', 'SITE_HEADER') . "\n" . $variant('data-blocks-engine-capture-mobile-document', 'SITE_HEADER--data-blocks-engine-capture-mobile')); +$assert(array('SITE_HEADER', 'SITE_HEADER--data-blocks-engine-capture-mobile') === $roots, '4a: each viewport partition contributes its own root anchor: ' . json_encode($roots)); $plain = $method->invoke(null, '
'); $assert(array('site-top') === $plain, '4b: an unpartitioned part names its single root: ' . json_encode($plain)); $wrapped = $method->invoke(null, '
'); diff --git a/php-transformer/tests/contract/shared-shell-plan.php b/php-transformer/tests/contract/shared-shell-plan.php index 3dcf02c7b..972ead5ed 100644 --- a/php-transformer/tests/contract/shared-shell-plan.php +++ b/php-transformer/tests/contract/shared-shell-plan.php @@ -541,7 +541,7 @@ $responsiveDuplicateShell = static function (string $title, bool $dual, bool $correspondence): string { $link = static function (string $href, string $label) use ($correspondence): string { $attrs = $correspondence - ? ' class="nav-link data-liberation-responsive-counterpart-f0edc2abe43b" data-dla-responsive-source="root:a:1"' + ? ' class="nav-link data-blocks-engine-capture-responsive-counterpart-f0edc2abe43b" data-blocks-engine-capture-responsive-source="root:a:1"' : ' class="nav-link"'; return '' . $label . ''; }; @@ -550,7 +550,7 @@ $body = $header . '

' . $title . '

' . $footer; if (!$dual) return '
' . $body . '
'; $document = static function (string $variant) use ($body): string { - return '
' . $body . '
'; + return '
' . $body . '
'; }; return $document('desktop') . $document('mobile'); }; @@ -816,8 +816,8 @@ $mobileVariantFooter = '

Mobile colophon

'; $variantDocument = static function (string $title) use ($desktopVariantHeader, $mobileVariantHeader, $desktopVariantFooter, $mobileVariantFooter): string { $main = '

' . $title . '

'; - return '
' . $desktopVariantHeader . $main . $desktopVariantFooter . '
' - . '
' . $mobileVariantHeader . $main . $mobileVariantFooter . '
'; + return '
' . $desktopVariantHeader . $main . $desktopVariantFooter . '
' + . '
' . $mobileVariantHeader . $main . $mobileVariantFooter . '
'; }; $variantPlan = (new ArtifactCompiler())->compile(array('entrypoint' => 'index.html', 'files' => array( 'index.html' => $variantDocument('Home'), @@ -831,8 +831,8 @@ foreach (array('index.html' => 'templates/front-page.html', 'about.html' => 'templates/page.html', 'shop.html' => 'templates/page.html') as $source => $template) { $markup = $variantPages[$source]['canonical_block_markup'] ?? ''; $templateMarkup = $variantWrites[$template]['payload']['data'] ?? ''; - $desktopAt = strpos($markup, 'data-liberation-desktop-document'); - $mobileAt = strpos($markup, 'data-liberation-mobile-document'); + $desktopAt = strpos($markup, 'data-blocks-engine-capture-desktop-document'); + $mobileAt = strpos($markup, 'data-blocks-engine-capture-mobile-document'); $desktopMarkup = false !== $desktopAt ? substr($markup, $desktopAt, (false !== $mobileAt ? $mobileAt : strlen($markup)) - $desktopAt) : ''; $mobileMarkup = false !== $mobileAt ? substr($markup, $mobileAt) : ''; $templateBindsHeader = str_contains($templateMarkup, '"slug":"header"'); @@ -846,12 +846,12 @@ $variantHeader = $variantHeaderParts[0] ?? array(); $variantHeaderMarkup = (string) ($variantHeader['canonical_block_markup'] ?? ''); $assert(1 === count($variantHeaderParts) && 'shared_shell' === ($variantHeader['placement']['kind'] ?? null) && 'responsive_variant_partition' === ($variantHeader['provenance']['reason'] ?? null), 'Divergent desktop and mobile headers that match across routes become one template-bound header part.'); -$assert(str_contains($variantHeaderMarkup, 'data-liberation-desktop-document') && str_contains($variantHeaderMarkup, 'data-liberation-mobile-document') && str_contains($variantHeaderMarkup, 'Menu') && str_contains($variantHeaderMarkup, 'Example Band'), 'The shared header part keeps each viewport\'s chrome behind the existing variant visibility class: ' . $variantHeaderMarkup); +$assert(str_contains($variantHeaderMarkup, 'data-blocks-engine-capture-desktop-document') && str_contains($variantHeaderMarkup, 'data-blocks-engine-capture-mobile-document') && str_contains($variantHeaderMarkup, 'Menu') && str_contains($variantHeaderMarkup, 'Example Band'), 'The shared header part keeps each viewport\'s chrome behind the existing variant visibility class: ' . $variantHeaderMarkup); $assert(1 === substr_count($variantWrites['templates/front-page.html']['payload']['data'] ?? '', '"slug":"header"') && 1 === substr_count($variantWrites['templates/page.html']['payload']['data'] ?? '', '"slug":"header"') && !str_contains($variantWrites['templates/page-notes.html']['payload']['data'] ?? '', '"slug":"header"'), 'Templates reference the shared header, and a route without that chrome stays excluded.'); $assert(!str_contains($variantPages['notes.html']['canonical_block_markup'] ?? '', '"tagName":"header"'), 'A route without header chrome does not gain one.'); $variantFooterParts = array_values(array_filter($variantPlan['template_parts'], static fn(array $part): bool => 'footer' === ($part['area'] ?? null) && in_array($part['placement']['kind'] ?? null, array('shared_shell', 'entry_shell'), true))); $variantFooterMarkup = (string) (($variantFooterParts[0]['canonical_block_markup'] ?? '')); -$assert(1 === count($variantFooterParts) && 'responsive_variant_partition' === ($variantFooterParts[0]['provenance']['reason'] ?? null) && str_contains($variantFooterMarkup, 'Desktop colophon') && str_contains($variantFooterMarkup, 'Mobile colophon') && str_contains($variantFooterMarkup, 'data-liberation-desktop-document') && str_contains($variantFooterMarkup, 'data-liberation-mobile-document'), 'Divergent desktop and mobile footers hoist into one visibility-partitioned footer part: ' . $variantFooterMarkup); +$assert(1 === count($variantFooterParts) && 'responsive_variant_partition' === ($variantFooterParts[0]['provenance']['reason'] ?? null) && str_contains($variantFooterMarkup, 'Desktop colophon') && str_contains($variantFooterMarkup, 'Mobile colophon') && str_contains($variantFooterMarkup, 'data-blocks-engine-capture-desktop-document') && str_contains($variantFooterMarkup, 'data-blocks-engine-capture-mobile-document'), 'Divergent desktop and mobile footers hoist into one visibility-partitioned footer part: ' . $variantFooterMarkup); foreach (array('index.html', 'about.html', 'shop.html') as $source) { $markup = $variantPages[$source]['canonical_block_markup'] ?? ''; $assert(!str_contains($markup, '"tagName":"footer"') && !str_contains($markup, '"area":"footer"'), "{$source} keeps footer landmarks out of page content."); @@ -870,8 +870,8 @@ . $partitionItem('Home', '/', false) . $partitionItem('Journal', '/journal', false) . $partitionItem('Shop', '/shop', false) . ''; $main = '

' . $title . '

'; - return '
' . $desktop . $main . '

Desktop colophon

' - . '
' . $mobile . $main . '

Mobile colophon

'; + return '
' . $desktop . $main . '

Desktop colophon

' + . '
' . $mobile . $main . '

Mobile colophon

'; }; $partitionPlan = (new ArtifactCompiler())->compile(array('entrypoint' => 'index.html', 'files' => array( 'index.html' => $partitionDocument('Home'), @@ -885,7 +885,7 @@ $partitionHeaderMarkup = (string) ($partitionHeader['canonical_block_markup'] ?? ''); $partitionMenus = array_values(array_filter($partitionPlan['menus'] ?? array(), static fn(array $menu): bool => is_string($menu['token'] ?? null) && is_string($menu['block_markup'] ?? null))); $assert('header' === ($partitionHeader['slug'] ?? null) && 'footer' === ($partitionFooter['slug'] ?? null) && 'responsive_variant_partition' === ($partitionHeader['provenance']['reason'] ?? null) && 'responsive_variant_partition' === ($partitionFooter['provenance']['reason'] ?? null), 'Viewport-partitioned chrome still extracts one shared header and footer when both viewports contain navigation: ' . json_encode(array_map(static fn(array $part): string => ($part['slug'] ?? '') . ':' . ($part['provenance']['reason'] ?? ''), $partitionPlan['template_parts']))); -$assert(str_contains($partitionHeaderMarkup, 'data-liberation-desktop-document') && str_contains($partitionHeaderMarkup, 'data-liberation-mobile-document') && 2 <= substr_count($partitionHeaderMarkup, '' - . '' - . '' - . '' - . '
'; +$portableGallerySource = '' + . ''; $portableGalleryResult = (new HtmlTransformer())->transform($portableGallerySource)->toArray(); $portableGallery = $portableGalleryResult['blocks'][0] ?? array(); $portableGalleryMarkup = (string) ($portableGalleryResult['serialized_blocks'] ?? ''); @@ -50,13 +50,13 @@ && str_contains($portableGalleryMarkup, 'actions.previous') && str_contains($portableGalleryMarkup, 'actions.next') && !str_contains($portableGalleryMarkup, 'core/html') && !str_contains($portableGalleryMarkup, 'wp-block-freeform') && !in_array('core/html', $portableBlockNames, true) && !in_array('core/freeform', $portableBlockNames, true) - && str_contains($portableGalleryMarkup, 'data-dla-gallery=""') + && str_contains($portableGalleryMarkup, 'data-blocks-engine-capture-gallery=""') && 'src-swap' === ($portableGallery['attrs']['presentation'] ?? null) && str_contains($portableGalleryMarkup, 'gallery-side-left') && str_contains($portableGalleryMarkup, 'gallery-main') && str_contains($portableGalleryMarkup, 'gallery-side-right') - && str_contains($portableGalleryMarkup, 'data-dla-gallery-slot="-1"') - && str_contains($portableGalleryMarkup, 'data-dla-gallery-slot="1"'), + && str_contains($portableGalleryMarkup, 'data-blocks-engine-capture-gallery-slot="-1"') + && str_contains($portableGalleryMarkup, 'data-blocks-engine-capture-gallery-slot="1"'), 'portable gallery keeps its source three-slot layout, editable attachments, and functional controls without fallback blocks' ); @@ -72,7 +72,7 @@ ); $runtimeNavigation = (new HtmlTransformer())->transform( '' - . '' + . '' . '', array('runtime_dom_selectors' => array('[data-x-trigger]'), 'runtime_behavioral_selectors' => array('[data-x-trigger]')) )->toArray(); @@ -193,7 +193,7 @@ $assert(1 === ($slideshow['attrs']['initialSlide'] ?? null) && true === ($slideshow['attrs']['showDots'] ?? null) && true === ($slideshow['attrs']['fullBleed'] ?? null), 'active slide, dot navigation, and viewport breakout survive conversion'); $assert(str_contains($slideshowMarkup, '--slideshow') && 2 === substr_count($slideshowMarkup, 'data-carousel-index=') && str_contains($slideshowMarkup, '--blocks-engine-carousel-height:720px'), 'slideshow markup carries stacked presentation, indexed dots, and source height'); -$wixCapture = (new HtmlTransformer())->transform('

First testimonial

First complete testimonial.

First

Second testimonial

Second complete testimonial.

Second
')->toArray(); +$wixCapture = (new HtmlTransformer())->transform('

First testimonial

First complete testimonial.

First

Second testimonial

Second complete testimonial.

Second
')->toArray(); $wixBlock = $wixCapture['blocks'][0] ?? array(); $wixMarkup = (string) ($wixCapture['serialized_blocks'] ?? ''); $assert( diff --git a/php-transformer/tests/unit/authored-marquee-block.php b/php-transformer/tests/unit/authored-marquee-block.php index b75176253..bdda90c45 100644 --- a/php-transformer/tests/unit/authored-marquee-block.php +++ b/php-transformer/tests/unit/authored-marquee-block.php @@ -137,7 +137,7 @@ $assert(!str_contains((string) ($media['serialized_blocks'] ?? ''), 'layout-shell'), 'a paragraph with media is not an empty layout shell'); $interactive = ( new HtmlTransformer() )->transform('

')->toArray(); $assert(!str_contains((string) ($interactive['serialized_blocks'] ?? ''), 'layout-shell'), 'a control without a source layout box is not claimed as empty geometry'); -$sourceParagraph = '

'; +$sourceParagraph = '

'; $sourceCss = '.teOS5h{gap:var(--spaceBetweenItems,10px);display:flex}.dblW_r{overflow-x:clip}.Qbdehy{font:var(--font);padding-right:var(--spaceBetweenItems,10px)}.Qbdehy[data-marquee-animation=left]{animation-duration:var(--marquee-duration,40s)}.kgbJ1s:not(:focus):not(:active){opacity:0;width:1px}'; $sourceCopies = ( new HtmlTransformer() )->transform($sourceParagraph . $sourceParagraph, array( 'static_css' => $sourceCss, 'runtime_dom_selectors' => array() ))->toArray(); $sourceMarkup = (string) ($sourceCopies['serialized_blocks'] ?? ''); diff --git a/php-transformer/tests/unit/authored-select-block.php b/php-transformer/tests/unit/authored-select-block.php index be51259b2..365acaec0 100644 --- a/php-transformer/tests/unit/authored-select-block.php +++ b/php-transformer/tests/unit/authored-select-block.php @@ -113,8 +113,8 @@ function walk( node ) { if ( ! node || 'object' !== typeof node ) return null; i $assert($selectedMarkup === $saveMarkup($generator, $selectedAttrs), 'selected-value companion metadata does not invalidate the saved native select'); $listboxResult = ( new HtmlTransformer() )->transform( - '
' - . '
' + '
Northwind' + . '
' . '' )->toArray(); $capturedMenuMarkup = (string) ($capturedMenu['serialized_blocks'] ?? ''); -$assertions[] = array(str_contains($capturedMenuMarkup, '"overlayMenu":"always"') && str_contains($capturedMenuMarkup, 'Social') && str_contains($capturedMenuMarkup, 'Contact') && !str_contains($capturedMenuMarkup, '/captured-dialog') && !str_contains($capturedMenuMarkup, '') && !str_contains($capturedMenuMarkup, '<!-- destination note'), 'navigation labels exclude HTML comments'); $capturedFallback = ( new HtmlTransformer() )->transform( '
' diff --git a/php-transformer/tests/unit/navigation-opener-presentation.php b/php-transformer/tests/unit/navigation-opener-presentation.php index f9bf5575b..03f5b4c18 100644 --- a/php-transformer/tests/unit/navigation-opener-presentation.php +++ b/php-transformer/tests/unit/navigation-opener-presentation.php @@ -14,9 +14,9 @@ $assert(str_contains($page, 'blocksEngineNavigationOpener'), 'source-only single passive SVG reaches native navigation metadata'); $assert(str_contains($page, 'M2 3h16v2H2zM2 9h16v2H2zM2 15h16v2H2z'), 'original source artwork is retained rather than a generic menu variant'); foreach (array( - 'mixed label' => str_replace('data-dla-dialog-trigger="phone-menu">', 'data-dla-dialog-trigger="phone-menu">Menu', $source), - 'multiple icons' => str_replace('data-dla-dialog-trigger="phone-menu">', 'data-dla-dialog-trigger="phone-menu">', $source), - 'document-dependent svg' => str_replace('data-dla-dialog-trigger="phone-menu">' . $icon, 'data-dla-dialog-trigger="phone-menu">', $source), + 'mixed label' => str_replace('data-blocks-engine-capture-dialog-trigger="phone-menu">', 'data-blocks-engine-capture-dialog-trigger="phone-menu">Menu', $source), + 'multiple icons' => str_replace('data-blocks-engine-capture-dialog-trigger="phone-menu">', 'data-blocks-engine-capture-dialog-trigger="phone-menu">', $source), + 'document-dependent svg' => str_replace('data-blocks-engine-capture-dialog-trigger="phone-menu">' . $icon, 'data-blocks-engine-capture-dialog-trigger="phone-menu">', $source), ) as $name => $negative) { $result = $compile($negative); $markup = ''; diff --git a/php-transformer/tests/unit/responsive-canvas-geometry.php b/php-transformer/tests/unit/responsive-canvas-geometry.php index dedbdcf49..6a4816aa8 100644 --- a/php-transformer/tests/unit/responsive-canvas-geometry.php +++ b/php-transformer/tests/unit/responsive-canvas-geometry.php @@ -93,7 +93,7 @@ $viewportRoot = (new HtmlTransformer())->transform( '' - . '

Hero

' + . '

Hero

' )->toArray(); $viewportRootMarkup = (string) ($viewportRoot['serialized_blocks'] ?? ''); $viewportRootCss = implode("\n", array_map(static fn (array $asset): string => (string) ($asset['content'] ?? ''), $viewportRoot['assets'] ?? array())); diff --git a/php-transformer/tests/unit/responsive-counterpart-contracts.php b/php-transformer/tests/unit/responsive-counterpart-contracts.php index a4b01f54c..8a5bcdcdb 100644 --- a/php-transformer/tests/unit/responsive-counterpart-contracts.php +++ b/php-transformer/tests/unit/responsive-counterpart-contracts.php @@ -97,9 +97,9 @@ // Both sides share the same source id, which would otherwise collide as a // duplicate HTML id once both variants compile into the same page: the // default side keeps the bare id, and the mobile side's copy is disambiguated -// with the same suffix Data Liberation Agent itself uses to pair a +// with the capture-evidence variant id suffix that pairs a // mobile-specific identity with its desktop counterpart. -$assert('hero-title' === ($hero['variants']['default']['anchor'] ?? '') && 'hero-title--dla-mobile' === ($hero['variants']['mobile']['anchor'] ?? ''), '1: both sides persist their stable source anchor, disambiguated so it stays unique on the page'); +$assert('hero-title' === ($hero['variants']['default']['anchor'] ?? '') && 'hero-title--data-blocks-engine-capture-mobile' === ($hero['variants']['mobile']['anchor'] ?? ''), '1: both sides persist their stable source anchor, disambiguated so it stays unique on the page'); $assert('blocks.0' === ($hero['variants']['default']['block_path'] ?? '') || str_starts_with((string) ($hero['variants']['default']['block_path'] ?? ''), 'blocks.'), '1: default side resolves under the default variant root'); $assert(str_starts_with((string) ($hero['variants']['mobile']['block_path'] ?? 'missing'), 'blocks.'), '1: mobile side resolves a concrete block path'); @@ -225,12 +225,12 @@ // --------------------------------------------------------------------------- // 8. Captured per-device documents retain producer-declared source slots. // --------------------------------------------------------------------------- -$captureHeadingToken = 'data-liberation-responsive-counterpart-a1b2c3d4e5f6'; -$captureNavToken = 'data-liberation-responsive-counterpart-123456abcdef'; +$captureHeadingToken = 'data-blocks-engine-capture-responsive-counterpart-a1b2c3d4e5f6'; +$captureNavToken = 'data-blocks-engine-capture-responsive-counterpart-123456abcdef'; $capturedResponsive = (new HtmlTransformer())->transform( '' - . '

Desktop title

' - . '

Mobile title

' + . '

Desktop title

' + . '

Mobile title

' . '' )->toArray(); $captureContracts = $capturedResponsive['source_reports']['responsive_counterpart_contracts'] ?? array(); @@ -239,10 +239,10 @@ $assert('hero:h1:1' === ($captureByToken[$captureHeadingToken]['source_id'] ?? null), '8: heading correspondence reports its stable ancestor-owned source slot'); $assert('content' === ($captureByToken[$captureHeadingToken]['attribute'] ?? null), '8: captured heading correspondence mirrors native heading content'); $assert('label' === ($captureByToken[$captureNavToken]['attribute'] ?? null), '8: captured navigation correspondence mirrors the native navigation label'); -$assert(str_contains((string) ($captureContracts['editor_module']['content'] ?? ''), 'data-liberation-responsive-counterpart-') && str_contains((string) ($captureContracts['editor_module']['content'] ?? ''), "'core/navigation-link': 'label'"), '8: the bounded editor module consumes captured tokens and navigation labels'); +$assert(str_contains((string) ($captureContracts['editor_module']['content'] ?? ''), 'data-blocks-engine-capture-responsive-counterpart-') && str_contains((string) ($captureContracts['editor_module']['content'] ?? ''), "'core/navigation-link': 'label'"), '8: the bounded editor module consumes captured tokens and navigation labels'); $capturedLayoutShell = (new HtmlTransformer())->transform( - '

Desktop title

Mobile title

', + '

Desktop title

Mobile title

', array('computed_layout_graph' => array( 'schema' => 'generic/computed-layout-graph/v2', 'nodes' => array(), diff --git a/php-transformer/tests/unit/responsive-document-variants.php b/php-transformer/tests/unit/responsive-document-variants.php index 983c19473..f7a7f93da 100644 --- a/php-transformer/tests/unit/responsive-document-variants.php +++ b/php-transformer/tests/unit/responsive-document-variants.php @@ -192,10 +192,10 @@ $duplicateIdResult = (new ArtifactCompiler())->compile($duplicateIdArtifact)->toArray(); $duplicateIdBlocks = (string) ($duplicateIdResult['serialized_blocks'] ?? ''); $assert(1 === substr_count($duplicateIdBlocks, 'id="PAGES_CONTAINER"'), 'Only one compiled element keeps the bare shared id: duplicate ids in the final HTML break same-page anchor navigation.'); -$assert(str_contains($duplicateIdBlocks, 'id="PAGES_CONTAINER--dla-mobile"'), 'The mobile document variant copy of a shared id is suffixed so it stays unique on the page, mirroring Data Liberation Agent\'s own --dla-mobile pairing convention.'); +$assert(str_contains($duplicateIdBlocks, 'id="PAGES_CONTAINER--data-blocks-engine-capture-mobile"'), 'The mobile document variant copy of a shared id is suffixed so it stays unique on the page, mirroring Data Liberation Agent\'s own --data-blocks-engine-capture-mobile pairing convention.'); -// A Data Liberation capture ships both documents in one page and scopes its -// mobile rules by the mobile root (`:where(.data-liberation-mobile-document) +// A responsive capture ships both documents in one page and scopes its +// mobile rules by the mobile root (`:where(.data-blocks-engine-capture-mobile-document) // #id`). Once the mobile copy of a shared id is suffixed, the stylesheets the // page loads must still reach it: otherwise every mobile id rule silently // misses and the phone layout falls apart (a static full-height page @@ -209,39 +209,39 @@ 'content' => '' . '' . '' - . '' + . '' . '' - . '

Welcome

Desktop copy

' - . '

Welcome

Mobile copy

' + . '

Welcome

Desktop copy

' + . '

Welcome

Mobile copy

' . '', ), array('path' => 'website/desktop.css', 'content' => '#hero{position:relative;padding-top:40px}'), - array('path' => 'website/mobile.css', 'content' => ':where(.data-liberation-mobile-document) #hero{position:absolute;padding-top:7px}:where(.data-liberation-mobile-document) #phone-only{margin-top:3px}'), + array('path' => 'website/mobile.css', 'content' => ':where(.data-blocks-engine-capture-mobile-document) #hero{position:absolute;padding-top:7px}:where(.data-blocks-engine-capture-mobile-document) #phone-only{margin-top:3px}'), ), ); $capturedPairResult = (new ArtifactCompiler())->compile($capturedPairArtifact)->toArray(); $capturedPairPlan = $capturedPairResult['source_reports']['wordpress_site_plan'] ?? array(); $capturedPairMarkup = implode("\n", array_map(static fn (array $page): string => (string) ($page['canonical_block_markup'] ?? ''), (array) ($capturedPairPlan['pages'] ?? array()))); $capturedPairCss = implode("\n", array_map(static fn (array $asset): string => 'css' === ($asset['kind'] ?? null) ? (string) ($asset['content'] ?? '') : '', (array) ($capturedPairPlan['assets'] ?? array()))); -$assert(str_contains($capturedPairMarkup, 'id="hero--dla-mobile"') && str_contains($capturedPairMarkup, 'id="hero"'), 'The captured mobile copy of a shared id renders suffixed beside the desktop bare id.'); -$assert(str_contains($capturedPairCss, ':where(.data-liberation-mobile-document) :is(#hero,#hero--dla-mobile){position:absolute;padding-top:7px}'), 'A mobile-scoped id rule in a delivered stylesheet reaches the suffixed mobile copy with the source specificity.'); -$assert(1 === preg_match('/:where\(\.data-liberation-mobile-document\) :is\(#phone-only,#phone-only--dla-mobile\)[^{,]*\{margin-top:3px\}/', $capturedPairCss), 'A mobile-only id keeps matching its bare id through the same rewrite.'); -$assert(!str_contains($capturedPairCss, '#blocks-engine-specificity-id-site-0--dla-mobile'), 'Engine specificity shims are not treated as source ids.'); -$assert(str_contains($capturedPairCss, '#hero{position:relative;padding-top:40px}') && !str_contains($capturedPairCss, '#hero--dla-mobile{position:relative'), 'Desktop id rules are delivered unchanged.'); +$assert(str_contains($capturedPairMarkup, 'id="hero--data-blocks-engine-capture-mobile"') && str_contains($capturedPairMarkup, 'id="hero"'), 'The captured mobile copy of a shared id renders suffixed beside the desktop bare id.'); +$assert(str_contains($capturedPairCss, ':where(.data-blocks-engine-capture-mobile-document) :is(#hero,#hero--data-blocks-engine-capture-mobile){position:absolute;padding-top:7px}'), 'A mobile-scoped id rule in a delivered stylesheet reaches the suffixed mobile copy with the source specificity.'); +$assert(1 === preg_match('/:where\(\.data-blocks-engine-capture-mobile-document\) :is\(#phone-only,#phone-only--data-blocks-engine-capture-mobile\)[^{,]*\{margin-top:3px\}/', $capturedPairCss), 'A mobile-only id keeps matching its bare id through the same rewrite.'); +$assert(!str_contains($capturedPairCss, '#blocks-engine-specificity-id-site-0--data-blocks-engine-capture-mobile'), 'Engine specificity shims are not treated as source ids.'); +$assert(str_contains($capturedPairCss, '#hero{position:relative;padding-top:40px}') && !str_contains($capturedPairCss, '#hero--data-blocks-engine-capture-mobile{position:relative'), 'Desktop id rules are delivered unchanged.'); foreach ((array) ($capturedPairPlan['assets'] ?? array()) as $asset) { if ('css' === ($asset['kind'] ?? null) && is_string($asset['content'] ?? null)) { $assert(hash('sha256', $asset['content']) === ($asset['content_hash'] ?? null), 'A rewritten stylesheet keeps a content hash that matches its delivered payload.'); } } -$scope = ':where(.data-liberation-mobile-document)'; -$assert($scope . ' div:is(#a,#a--dla-mobile).b > :is(#c,#c--dla-mobile)::before' === DocumentVariantIds::scopeIdSelector($scope . ' div#a.b > #c::before'), 'Ids keep their position next to type, class and pseudo-element parts.'); -$assert($scope . ' :has(> #x--dla-mobile)' === DocumentVariantIds::scopeIdSelector($scope . ' :has(> #x--dla-mobile)'), 'An id that already carries the variant suffix is left alone.'); -$assert($scope . ' a[href="#top"]:is(#nav,#nav--dla-mobile)' === DocumentVariantIds::scopeIdSelector($scope . ' a[href="#top"]#nav'), 'Fragments inside attribute values are not ids.'); -$assert($scope . ' :is(#a,#a--dla-mobile):not(#blocks-engine-specificity-id-site-0)' === DocumentVariantIds::scopeIdSelector($scope . ' #a:not(#blocks-engine-specificity-id-site-0)'), 'Engine specificity shim ids stay as they are.'); -$assert('#a .b' === DocumentVariantIds::scopeIdSelector('#a .b') && ':where(.data-liberation-desktop-document) #a' === DocumentVariantIds::scopeIdSelector(':where(.data-liberation-desktop-document) #a'), 'Unscoped and desktop-scoped selectors keep their bare ids.'); -$assert('#a:not(.data-liberation-mobile-document)' === DocumentVariantIds::scopeIdSelector('#a:not(.data-liberation-mobile-document)'), 'A negated variant class does not scope the selector.'); -$assert('.site-document-variant-tablet :is(#a,#a--dla-tablet)' === DocumentVariantIds::scopeIdSelector('.site-document-variant-tablet #a'), 'A named site document variant uses its own suffix.'); -$assert('@media (max-width:767px){' . $scope . ' :is(#a,#a--dla-mobile){top:0;color:#abc}}' === DocumentVariantIds::scopeIdSelectors('@media (max-width:767px){' . $scope . ' #a{top:0;color:#abc}}'), 'Nested rules are rewritten and declaration values such as hex colors are untouched.'); +$scope = ':where(.data-blocks-engine-capture-mobile-document)'; +$assert($scope . ' div:is(#a,#a--data-blocks-engine-capture-mobile).b > :is(#c,#c--data-blocks-engine-capture-mobile)::before' === DocumentVariantIds::scopeIdSelector($scope . ' div#a.b > #c::before'), 'Ids keep their position next to type, class and pseudo-element parts.'); +$assert($scope . ' :has(> #x--data-blocks-engine-capture-mobile)' === DocumentVariantIds::scopeIdSelector($scope . ' :has(> #x--data-blocks-engine-capture-mobile)'), 'An id that already carries the variant suffix is left alone.'); +$assert($scope . ' a[href="#top"]:is(#nav,#nav--data-blocks-engine-capture-mobile)' === DocumentVariantIds::scopeIdSelector($scope . ' a[href="#top"]#nav'), 'Fragments inside attribute values are not ids.'); +$assert($scope . ' :is(#a,#a--data-blocks-engine-capture-mobile):not(#blocks-engine-specificity-id-site-0)' === DocumentVariantIds::scopeIdSelector($scope . ' #a:not(#blocks-engine-specificity-id-site-0)'), 'Engine specificity shim ids stay as they are.'); +$assert('#a .b' === DocumentVariantIds::scopeIdSelector('#a .b') && ':where(.data-blocks-engine-capture-desktop-document) #a' === DocumentVariantIds::scopeIdSelector(':where(.data-blocks-engine-capture-desktop-document) #a'), 'Unscoped and desktop-scoped selectors keep their bare ids.'); +$assert('#a:not(.data-blocks-engine-capture-mobile-document)' === DocumentVariantIds::scopeIdSelector('#a:not(.data-blocks-engine-capture-mobile-document)'), 'A negated variant class does not scope the selector.'); +$assert('.site-document-variant-tablet :is(#a,#a--data-blocks-engine-capture-tablet)' === DocumentVariantIds::scopeIdSelector('.site-document-variant-tablet #a'), 'A named site document variant uses its own suffix.'); +$assert('@media (max-width:767px){' . $scope . ' :is(#a,#a--data-blocks-engine-capture-mobile){top:0;color:#abc}}' === DocumentVariantIds::scopeIdSelectors('@media (max-width:767px){' . $scope . ' #a{top:0;color:#abc}}'), 'Nested rules are rewritten and declaration values such as hex colors are untouched.'); fwrite(STDOUT, "Responsive document variant tests passed.\n"); diff --git a/php-transformer/tests/unit/responsive-hidden-flex-blockgap.php b/php-transformer/tests/unit/responsive-hidden-flex-blockgap.php index 864c82245..b80e83ac9 100644 --- a/php-transformer/tests/unit/responsive-hidden-flex-blockgap.php +++ b/php-transformer/tests/unit/responsive-hidden-flex-blockgap.php @@ -100,7 +100,7 @@ . 'Brand' . '' . '
' - . ''; + . ''; $result = ( new HtmlTransformer() )->transform($html, array())->toArray(); $navs = $findBlocks($result['blocks'] ?? array(), 'core/navigation'); diff --git a/php-transformer/tests/unit/runtime-data-target-layout-shell.php b/php-transformer/tests/unit/runtime-data-target-layout-shell.php index d3da6c9e9..ea5891e10 100644 --- a/php-transformer/tests/unit/runtime-data-target-layout-shell.php +++ b/php-transformer/tests/unit/runtime-data-target-layout-shell.php @@ -36,9 +36,9 @@ 'repeat' => false, )), ENT_QUOTES); $css = '.reveal{max-width:80rem;margin:0 auto}.opacity-0{opacity:0}.opacity-100{opacity:1}.transition-all{transition:all .7s}.translate-y-8{transform:translateY(2rem)}.translate-y-0{transform:none}'; -$script = 'document.querySelectorAll("[data-dla-viewport-entrance]").forEach(function(el){var c=JSON.parse(el.getAttribute("data-dla-viewport-entrance"));el.setAttribute("class",c.attributes.class.after);});'; +$script = 'document.querySelectorAll("[data-blocks-engine-capture-viewport-entrance]").forEach(function(el){var c=JSON.parse(el.getAttribute("data-blocks-engine-capture-viewport-entrance"));el.setAttribute("class",c.attributes.class.after);});'; $page = static fn (string $body): string => 'Reveal
' . $body . '
'; -$entranceAttr = 'data-dla-viewport-entrance="' . $entrance . '"'; +$entranceAttr = 'data-blocks-engine-capture-viewport-entrance="' . $entrance . '"'; $compiled = ( new ArtifactCompiler() )->compile(array( 'entrypoint' => 'index.html', @@ -52,7 +52,7 @@ $assert('success' === ($compiled['status'] ?? ''), 'script-addressed container compiles: ' . json_encode($contractFailures)); $assert(! in_array('core/html', $blockNames, true) && ! str_contains($markup, '/.exec(markup); - if (!match) throw new Error('Could not extract is-replica-card group from DLA output'); + if (!match) throw new Error('Could not extract is-replica-card group from the reference implementation output'); return match[0]; } const currentCommit = git(['rev-parse', 'HEAD']); -if (currentCommit !== DLA_COMMIT) { - throw new Error(`DLA checkout must be at ${DLA_COMMIT}; got ${currentCommit}`); +if (currentCommit !== REFERENCE_COMMIT) { + throw new Error(`reference checkout must be at ${REFERENCE_COMMIT}; got ${currentCommit}`); } const dirty = git(['status', '--porcelain']); if (dirty) { - throw new Error(`DLA checkout must be clean at ${DLA_COMMIT}; status:\n${dirty}`); + throw new Error(`reference checkout must be clean at ${REFERENCE_COMMIT}; status:\n${dirty}`); } const { nativeDispatchRendererCaseGroups, NATIVE_DISPATCH_RENDERER_DERIVATION } = await import(fixtureUrl); const { reconstructPagePattern } = await import( - pathToFileURL(path.join(dlaRoot, 'src/lib/replicate/page-reconstruct.ts')).href + pathToFileURL(path.join(referenceRoot, 'src/lib/replicate/page-reconstruct.ts')).href ); const cases = nativeDispatchRendererCaseGroups(); @@ -203,7 +205,7 @@ const renderSectionCase = (entry) => { return capture(entry.id, renderOutFromResult(reconstructPagePattern([section], reconstructOptions()))); }; const renderCardGroupCase = (entry) => { - const result = reconstructPagePattern([clone(entry.dlaSection)], reconstructOptions()); + const result = reconstructPagePattern([clone(entry.referenceSection)], reconstructOptions()); return capture(entry.id, { returnValue: extractCardGroup(stripFinalBodyNewline(result.body)), }); @@ -226,7 +228,7 @@ const json = stableJson(parityFile); if (shouldCheck) { const existing = readFileSync(outputPath, 'utf8'); if (existing !== json) { - throw new Error(`${outputPath} is out of date with DLA ${DLA_COMMIT}`); + throw new Error(`${outputPath} is out of date with reference ${REFERENCE_COMMIT}`); } } diff --git a/packages/blocks-engine/scripts/capture-native-section-renderer-goldens.mjs b/packages/blocks-engine/scripts/capture-native-section-renderer-goldens.mjs index cad930476..cdbc35df1 100644 --- a/packages/blocks-engine/scripts/capture-native-section-renderer-goldens.mjs +++ b/packages/blocks-engine/scripts/capture-native-section-renderer-goldens.mjs @@ -4,13 +4,12 @@ import { readFileSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -const DLA_COMMIT = '1e393c535850ee1a9482f83459f779d0e225b027'; -const DEFAULT_DLA_ROOT = '/Users/matt/projects/a8c/data-liberation-agent'; +const REFERENCE_COMMIT = '1e393c535850ee1a9482f83459f779d0e225b027'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const packageRoot = path.resolve(__dirname, '..'); const fixtureUrl = pathToFileURL(path.join(packageRoot, 'src/__fixtures__/native-section-renderer-cases.ts')).href; -const outputPath = path.join(packageRoot, 'src/__fixtures__/native-section-renderer-dla-goldens.json'); +const outputPath = path.join(packageRoot, 'src/__fixtures__/native-section-renderer-reference-goldens.json'); const TSX_BOOTSTRAP_ENV = 'BLOCKS_ENGINE_NATIVE_SECTION_GOLDENS_TSX'; function hasTsxLoader() { @@ -34,10 +33,13 @@ const args = new Set(process.argv.slice(2)); const shouldWrite = args.has('--write'); const shouldCheck = args.has('--check'); const shouldStdout = args.has('--stdout') || (!shouldWrite && !shouldCheck); -const dlaRoot = process.env.DLA_ROOT || DEFAULT_DLA_ROOT; +const referenceRoot = process.env.REFERENCE_ROOT; +if (!referenceRoot) { + throw new Error('Set REFERENCE_ROOT to a checkout of the reference implementation at the pinned commit.'); +} function git(args) { - return execFileSync('git', ['-C', dlaRoot, ...args], { encoding: 'utf8' }).trim(); + return execFileSync('git', ['-C', referenceRoot, ...args], { encoding: 'utf8' }).trim(); } function stableJson(value) { @@ -98,18 +100,18 @@ function renderOutFromResult(result) { } const currentCommit = git(['rev-parse', 'HEAD']); -if (currentCommit !== DLA_COMMIT) { - throw new Error(`DLA checkout must be at ${DLA_COMMIT}; got ${currentCommit}`); +if (currentCommit !== REFERENCE_COMMIT) { + throw new Error(`reference checkout must be at ${REFERENCE_COMMIT}; got ${currentCommit}`); } const dirty = git(['status', '--porcelain']); if (dirty) { - throw new Error(`DLA checkout must be clean at ${DLA_COMMIT}; status:\n${dirty}`); + throw new Error(`reference checkout must be clean at ${REFERENCE_COMMIT}; status:\n${dirty}`); } const { nativeSectionRendererCaseGroups, NATIVE_SECTION_RENDERER_DERIVATION } = await import(fixtureUrl); const { reconstructPagePattern } = await import( - pathToFileURL(path.join(dlaRoot, 'src/lib/replicate/page-reconstruct.ts')).href + pathToFileURL(path.join(referenceRoot, 'src/lib/replicate/page-reconstruct.ts')).href ); const cases = nativeSectionRendererCaseGroups(); @@ -130,7 +132,7 @@ const json = stableJson(parityFile); if (shouldCheck) { const existing = readFileSync(outputPath, 'utf8'); if (existing !== json) { - throw new Error(`${outputPath} is out of date with DLA ${DLA_COMMIT}`); + throw new Error(`${outputPath} is out of date with reference ${REFERENCE_COMMIT}`); } } diff --git a/packages/blocks-engine/scripts/capture-native-text-renderer-goldens.mjs b/packages/blocks-engine/scripts/capture-native-text-renderer-goldens.mjs index ace449820..62f931260 100644 --- a/packages/blocks-engine/scripts/capture-native-text-renderer-goldens.mjs +++ b/packages/blocks-engine/scripts/capture-native-text-renderer-goldens.mjs @@ -4,22 +4,24 @@ import { readFileSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -const DLA_COMMIT = '1e393c535850ee1a9482f83459f779d0e225b027'; -const DEFAULT_DLA_ROOT = '/Users/matt/projects/a8c/data-liberation-agent'; +const REFERENCE_COMMIT = '1e393c535850ee1a9482f83459f779d0e225b027'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const packageRoot = path.resolve(__dirname, '..'); const fixtureUrl = pathToFileURL(path.join(packageRoot, 'src/__fixtures__/native-text-renderer-cases.ts')).href; -const outputPath = path.join(packageRoot, 'src/__fixtures__/native-text-renderer-dla-goldens.json'); +const outputPath = path.join(packageRoot, 'src/__fixtures__/native-text-renderer-reference-goldens.json'); const args = new Set(process.argv.slice(2)); const shouldWrite = args.has('--write'); const shouldCheck = args.has('--check'); const shouldStdout = args.has('--stdout') || (!shouldWrite && !shouldCheck); -const dlaRoot = process.env.DLA_ROOT || DEFAULT_DLA_ROOT; +const referenceRoot = process.env.REFERENCE_ROOT; +if (!referenceRoot) { + throw new Error('Set REFERENCE_ROOT to a checkout of the reference implementation at the pinned commit.'); +} function git(args) { - return execFileSync('git', ['-C', dlaRoot, ...args], { encoding: 'utf8' }).trim(); + return execFileSync('git', ['-C', referenceRoot, ...args], { encoding: 'utf8' }).trim(); } function stableJson(value) { @@ -32,7 +34,7 @@ function stripFinalBodyNewline(markup) { function extractGallery(markup) { const match = markup.match(//); - if (!match) throw new Error('DLA reconstruct output did not contain a wp:gallery block'); + if (!match) throw new Error('reference reconstruct output did not contain a wp:gallery block'); return match[0]; } @@ -85,13 +87,13 @@ function renderOutFromResult(result) { } const currentCommit = git(['rev-parse', 'HEAD']); -if (currentCommit !== DLA_COMMIT) { - throw new Error(`DLA checkout must be at ${DLA_COMMIT}; got ${currentCommit}`); +if (currentCommit !== REFERENCE_COMMIT) { + throw new Error(`reference checkout must be at ${REFERENCE_COMMIT}; got ${currentCommit}`); } const { nativeTextRendererCaseGroups, NATIVE_TEXT_RENDERER_DERIVATION } = await import(fixtureUrl); const { reconstructPagePattern } = await import( - pathToFileURL(path.join(dlaRoot, 'src/lib/replicate/page-reconstruct.ts')).href + pathToFileURL(path.join(referenceRoot, 'src/lib/replicate/page-reconstruct.ts')).href ); const cases = nativeTextRendererCaseGroups(); @@ -147,7 +149,7 @@ const json = stableJson(parityFile); if (shouldCheck) { const existing = readFileSync(outputPath, 'utf8'); if (existing !== json) { - throw new Error(`${outputPath} is out of date with DLA ${DLA_COMMIT}`); + throw new Error(`${outputPath} is out of date with reference ${REFERENCE_COMMIT}`); } } diff --git a/packages/blocks-engine/scripts/capture-region-audit-goldens.mjs b/packages/blocks-engine/scripts/capture-region-audit-goldens.mjs index a2aa4cf98..71f59e080 100644 --- a/packages/blocks-engine/scripts/capture-region-audit-goldens.mjs +++ b/packages/blocks-engine/scripts/capture-region-audit-goldens.mjs @@ -4,13 +4,12 @@ import { readFileSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -const DEFAULT_DLA_ROOT = '/Users/matt/projects/a8c/data-liberation-agent'; const TSX_BOOTSTRAP_ENV = 'BLOCKS_ENGINE_REGION_AUDIT_GOLDENS_TSX'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const packageRoot = path.resolve(__dirname, '..'); const corpusUrl = pathToFileURL(path.join(packageRoot, 'src/__fixtures__/region-audit-corpus.ts')).href; -const outputPath = path.join(packageRoot, 'src/__fixtures__/region-audit-dla-goldens.json'); +const outputPath = path.join(packageRoot, 'src/__fixtures__/region-audit-reference-goldens.json'); function hasTsxLoader() { return process.execArgv.some((arg, index, argv) => { @@ -30,13 +29,13 @@ if (!process.env[TSX_BOOTSTRAP_ENV] && !hasTsxLoader()) { } const { - DLA_REGION_AUDIT_BLOB, - DLA_REGION_AUDIT_COMMIT, - DLA_REGION_AUDIT_PATH, - DLA_REGION_CENSUS_BLOB, - DLA_REGION_CENSUS_PATH, - DLA_SECTION_SELECTOR_BLOB, - DLA_SECTION_SELECTOR_PATH, + REFERENCE_REGION_AUDIT_BLOB, + REFERENCE_REGION_AUDIT_COMMIT, + REFERENCE_REGION_AUDIT_PATH, + REFERENCE_REGION_CENSUS_BLOB, + REFERENCE_REGION_CENSUS_PATH, + REFERENCE_SECTION_SELECTOR_BLOB, + REFERENCE_SECTION_SELECTOR_PATH, runRegionAuditParity, } = await import(corpusUrl); @@ -44,7 +43,10 @@ const args = new Set(process.argv.slice(2)); const shouldWrite = args.has('--write'); const shouldCheck = args.has('--check'); const shouldStdout = args.has('--stdout') || (!shouldWrite && !shouldCheck); -const dlaRoot = process.env.DLA_ROOT || DEFAULT_DLA_ROOT; +const referenceRoot = process.env.REFERENCE_ROOT; +if (!referenceRoot) { + throw new Error('Set REFERENCE_ROOT to a checkout of the reference implementation at the pinned commit.'); +} const explicitModeCount = [shouldWrite, shouldCheck, args.has('--stdout')].filter(Boolean).length; if (explicitModeCount > 1) { @@ -52,7 +54,7 @@ if (explicitModeCount > 1) { } function git(gitArgs) { - return execFileSync('git', ['-C', dlaRoot, ...gitArgs], { encoding: 'utf8' }).trim(); + return execFileSync('git', ['-C', referenceRoot, ...gitArgs], { encoding: 'utf8' }).trim(); } function stableJson(value) { @@ -62,62 +64,62 @@ function stableJson(value) { function verifyBlob(pathName, expectedBlob) { const headBlob = git(['rev-parse', `HEAD:${pathName}`]); if (headBlob !== expectedBlob) { - throw new Error(`DLA ${pathName} HEAD blob must be ${expectedBlob}; got ${headBlob}`); + throw new Error(`reference ${pathName} HEAD blob must be ${expectedBlob}; got ${headBlob}`); } const liveBlob = git(['hash-object', pathName]); if (liveBlob !== expectedBlob) { - throw new Error(`DLA ${pathName} working tree blob must be ${expectedBlob}; got ${liveBlob}`); + throw new Error(`reference ${pathName} working tree blob must be ${expectedBlob}; got ${liveBlob}`); } } -function verifyDlaOracle() { +function verifyReferenceOracle() { const currentCommit = git(['rev-parse', 'HEAD']); - if (currentCommit !== DLA_REGION_AUDIT_COMMIT) { - throw new Error(`DLA checkout must be at ${DLA_REGION_AUDIT_COMMIT}; got ${currentCommit}`); + if (currentCommit !== REFERENCE_REGION_AUDIT_COMMIT) { + throw new Error(`reference checkout must be at ${REFERENCE_REGION_AUDIT_COMMIT}; got ${currentCommit}`); } - verifyBlob(DLA_REGION_AUDIT_PATH, DLA_REGION_AUDIT_BLOB); - verifyBlob(DLA_REGION_CENSUS_PATH, DLA_REGION_CENSUS_BLOB); - verifyBlob(DLA_SECTION_SELECTOR_PATH, DLA_SECTION_SELECTOR_BLOB); + verifyBlob(REFERENCE_REGION_AUDIT_PATH, REFERENCE_REGION_AUDIT_BLOB); + verifyBlob(REFERENCE_REGION_CENSUS_PATH, REFERENCE_REGION_CENSUS_BLOB); + verifyBlob(REFERENCE_SECTION_SELECTOR_PATH, REFERENCE_SECTION_SELECTOR_BLOB); const requiredStatus = git([ 'status', '--porcelain', '--', - DLA_REGION_AUDIT_PATH, - DLA_REGION_CENSUS_PATH, - DLA_SECTION_SELECTOR_PATH, + REFERENCE_REGION_AUDIT_PATH, + REFERENCE_REGION_CENSUS_PATH, + REFERENCE_SECTION_SELECTOR_PATH, ]); if (requiredStatus) { - throw new Error(`DLA required region-audit sources must be clean:\n${requiredStatus}`); + throw new Error(`reference required region-audit sources must be clean:\n${requiredStatus}`); } } function report(mode, parityFile) { process.stderr.write( - `region-audit goldens ${mode}: DLA commit=${DLA_REGION_AUDIT_COMMIT} ` + - `regionAudit=${DLA_REGION_AUDIT_BLOB} regionCensus=${DLA_REGION_CENSUS_BLOB} ` + - `sectionSelector=${DLA_SECTION_SELECTOR_BLOB} cases=${parityFile.cases.length}\n` + `region-audit goldens ${mode}: reference commit=${REFERENCE_REGION_AUDIT_COMMIT} ` + + `regionAudit=${REFERENCE_REGION_AUDIT_BLOB} regionCensus=${REFERENCE_REGION_CENSUS_BLOB} ` + + `sectionSelector=${REFERENCE_SECTION_SELECTOR_BLOB} cases=${parityFile.cases.length}\n` ); } -verifyDlaOracle(); +verifyReferenceOracle(); -const dlaAudit = await import(pathToFileURL(path.join(dlaRoot, DLA_REGION_AUDIT_PATH)).href); -const dlaCensus = await import(pathToFileURL(path.join(dlaRoot, DLA_REGION_CENSUS_PATH)).href); +const referenceAudit = await import(pathToFileURL(path.join(referenceRoot, REFERENCE_REGION_AUDIT_PATH)).href); +const referenceCensus = await import(pathToFileURL(path.join(referenceRoot, REFERENCE_REGION_CENSUS_PATH)).href); const parityFile = runRegionAuditParity({ - reconcileRegions: dlaAudit.reconcileRegions, - extractSourceLandmarksFromHtml: dlaCensus.extractSourceLandmarksFromHtml, - selectorForHtmlRoot: dlaCensus.selectorForHtmlRoot, - landmarkRoleForHtmlRoot: dlaCensus.landmarkRoleForHtmlRoot, + reconcileRegions: referenceAudit.reconcileRegions, + extractSourceLandmarksFromHtml: referenceCensus.extractSourceLandmarksFromHtml, + selectorForHtmlRoot: referenceCensus.selectorForHtmlRoot, + landmarkRoleForHtmlRoot: referenceCensus.landmarkRoleForHtmlRoot, }); const json = stableJson(parityFile); if (shouldCheck) { const existing = readFileSync(outputPath, 'utf8'); if (existing !== json) { - throw new Error(`${outputPath} is out of date with DLA region-audit blobs`); + throw new Error(`${outputPath} is out of date with reference region-audit blobs`); } report('check', parityFile); } diff --git a/packages/blocks-engine/scripts/capture-variation-hoist-goldens.mjs b/packages/blocks-engine/scripts/capture-variation-hoist-goldens.mjs index 5766f960b..8863e3502 100644 --- a/packages/blocks-engine/scripts/capture-variation-hoist-goldens.mjs +++ b/packages/blocks-engine/scripts/capture-variation-hoist-goldens.mjs @@ -4,7 +4,6 @@ import { readFileSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -const DEFAULT_DLA_ROOT = '/Users/matt/projects/a8c/data-liberation-agent'; const TSX_BOOTSTRAP_ENV = 'BLOCKS_ENGINE_VARIATION_HOIST_GOLDENS_TSX'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -12,7 +11,7 @@ const packageRoot = path.resolve(__dirname, '..'); const corpusUrl = pathToFileURL( path.join(packageRoot, 'src/__tests__/fixtures/variation-hoist-corpus.js') ).href; -const outputPath = path.join(packageRoot, 'src/__tests__/fixtures/variation-hoist-dla-goldens.json'); +const outputPath = path.join(packageRoot, 'src/__tests__/fixtures/variation-hoist-reference-goldens.json'); function hasTsxLoader() { return process.execArgv.some((arg, index, argv) => { @@ -32,9 +31,9 @@ if (!process.env[TSX_BOOTSTRAP_ENV] && !hasTsxLoader()) { } const { - DLA_VARIATION_HOIST_BLOB, - DLA_VARIATION_HOIST_COMMIT, - DLA_VARIATION_HOIST_PATH, + REFERENCE_VARIATION_HOIST_BLOB, + REFERENCE_VARIATION_HOIST_COMMIT, + REFERENCE_VARIATION_HOIST_PATH, runVariationHoistParity, } = await import(corpusUrl); @@ -42,7 +41,10 @@ const args = new Set(process.argv.slice(2)); const shouldWrite = args.has('--write'); const shouldCheck = args.has('--check'); const shouldStdout = args.has('--stdout') || (!shouldWrite && !shouldCheck); -const dlaRoot = process.env.DLA_ROOT || DEFAULT_DLA_ROOT; +const referenceRoot = process.env.REFERENCE_ROOT; +if (!referenceRoot) { + throw new Error('Set REFERENCE_ROOT to a checkout of the reference implementation at the pinned commit.'); +} const explicitModeCount = [shouldWrite, shouldCheck, args.has('--stdout')].filter(Boolean).length; if (explicitModeCount > 1) { @@ -50,30 +52,30 @@ if (explicitModeCount > 1) { } function git(gitArgs) { - return execFileSync('git', ['-C', dlaRoot, ...gitArgs], { encoding: 'utf8' }).trim(); + return execFileSync('git', ['-C', referenceRoot, ...gitArgs], { encoding: 'utf8' }).trim(); } function stableJson(value) { return `${JSON.stringify(value, null, 2)}\n`; } -function verifyDlaOracle() { +function verifyReferenceOracle() { const currentCommit = git(['rev-parse', 'HEAD']); - if (currentCommit !== DLA_VARIATION_HOIST_COMMIT) { - throw new Error(`DLA checkout must be at ${DLA_VARIATION_HOIST_COMMIT}; got ${currentCommit}`); + if (currentCommit !== REFERENCE_VARIATION_HOIST_COMMIT) { + throw new Error(`reference checkout must be at ${REFERENCE_VARIATION_HOIST_COMMIT}; got ${currentCommit}`); } - const headBlob = git(['rev-parse', `HEAD:${DLA_VARIATION_HOIST_PATH}`]); - if (headBlob !== DLA_VARIATION_HOIST_BLOB) { + const headBlob = git(['rev-parse', `HEAD:${REFERENCE_VARIATION_HOIST_PATH}`]); + if (headBlob !== REFERENCE_VARIATION_HOIST_BLOB) { throw new Error( - `DLA ${DLA_VARIATION_HOIST_PATH} HEAD blob must be ${DLA_VARIATION_HOIST_BLOB}; got ${headBlob}` + `reference ${REFERENCE_VARIATION_HOIST_PATH} HEAD blob must be ${REFERENCE_VARIATION_HOIST_BLOB}; got ${headBlob}` ); } - const liveBlob = git(['hash-object', DLA_VARIATION_HOIST_PATH]); - if (liveBlob !== DLA_VARIATION_HOIST_BLOB) { + const liveBlob = git(['hash-object', REFERENCE_VARIATION_HOIST_PATH]); + if (liveBlob !== REFERENCE_VARIATION_HOIST_BLOB) { throw new Error( - `DLA ${DLA_VARIATION_HOIST_PATH} working tree blob must be ${DLA_VARIATION_HOIST_BLOB}; got ${liveBlob}` + `reference ${REFERENCE_VARIATION_HOIST_PATH} working tree blob must be ${REFERENCE_VARIATION_HOIST_BLOB}; got ${liveBlob}` ); } @@ -81,33 +83,33 @@ function verifyDlaOracle() { 'status', '--porcelain', '--', - DLA_VARIATION_HOIST_PATH, + REFERENCE_VARIATION_HOIST_PATH, 'src/lib/replicate/form-blocks.ts', ]); if (requiredStatus) { - throw new Error(`DLA required variation-hoist sources must be clean:\n${requiredStatus}`); + throw new Error(`reference required variation-hoist sources must be clean:\n${requiredStatus}`); } } function report(mode, parityFile) { process.stderr.write( - `variation-hoist goldens ${mode}: DLA commit=${DLA_VARIATION_HOIST_COMMIT} blob=${DLA_VARIATION_HOIST_BLOB} cases=${parityFile.cases.length}\n` + `variation-hoist goldens ${mode}: reference commit=${REFERENCE_VARIATION_HOIST_COMMIT} blob=${REFERENCE_VARIATION_HOIST_BLOB} cases=${parityFile.cases.length}\n` ); } -verifyDlaOracle(); +verifyReferenceOracle(); -const dlaVariationHoist = await import(pathToFileURL(path.join(dlaRoot, DLA_VARIATION_HOIST_PATH)).href); +const referenceVariationHoist = await import(pathToFileURL(path.join(referenceRoot, REFERENCE_VARIATION_HOIST_PATH)).href); const parityFile = runVariationHoistParity({ - hoistVariations: dlaVariationHoist.hoistVariations, - applyHoistSwaps: dlaVariationHoist.applyHoistSwaps, + hoistVariations: referenceVariationHoist.hoistVariations, + applyHoistSwaps: referenceVariationHoist.applyHoistSwaps, }); const json = stableJson(parityFile); if (shouldCheck) { const existing = readFileSync(outputPath, 'utf8'); if (existing !== json) { - throw new Error(`${outputPath} is out of date with DLA blob ${DLA_VARIATION_HOIST_BLOB}`); + throw new Error(`${outputPath} is out of date with reference blob ${REFERENCE_VARIATION_HOIST_BLOB}`); } report('check', parityFile); } diff --git a/packages/blocks-engine/scripts/tuner/corpus.ts b/packages/blocks-engine/scripts/tuner/corpus.ts index 2832bd5ec..20678d439 100644 --- a/packages/blocks-engine/scripts/tuner/corpus.ts +++ b/packages/blocks-engine/scripts/tuner/corpus.ts @@ -14,7 +14,7 @@ import { nativeDispatchRendererCaseGroups } from '../../src/__fixtures__/native-dispatch-renderer-cases.js'; import { nativeSectionRendererCaseGroups } from '../../src/__fixtures__/native-section-renderer-cases.js'; import { nativeTextRendererCaseGroups } from '../../src/__fixtures__/native-text-renderer-cases.js'; -import { reconstructBaselineCases } from '../../src/__fixtures__/page-reconstruct-dla-baseline.corpus.js'; +import { reconstructBaselineCases } from '../../src/__fixtures__/page-reconstruct-reference-baseline.corpus.js'; import type { SectionSpec } from '../../src/theme/section-spec.js'; export interface BenchFixture { diff --git a/packages/blocks-engine/scripts/tuner/engines/hook-stub.ts b/packages/blocks-engine/scripts/tuner/engines/hook-stub.ts index 7f9f86215..fb7313a5d 100644 --- a/packages/blocks-engine/scripts/tuner/engines/hook-stub.ts +++ b/packages/blocks-engine/scripts/tuner/engines/hook-stub.ts @@ -1,7 +1,7 @@ /** * Tier-B seam — deterministic stub hook (v1 wiring only, NOT ratcheted). * - * Proves the propose/realize/cache contract the real DLA hook will plug into, + * Proves the propose/realize/cache contract the real reference hook will plug into, * with no model call and no network: * - propose(specs): the costly, non-deterministic step in a real hook (an LLM * polish/repair pass). Here it is a deterministic stand-in, cached by @@ -9,7 +9,7 @@ * cache instead of recomputing. * - realize(raw): the deterministic tail — validate the cached artifact. * - * A real DLA-hook capture lands as a fast follow by populating the cache with + * A real reference-hook capture lands as a fast follow by populating the cache with * actual hook output; nothing in this file's shape changes. */ import { reconstructEngine } from './reconstruct.js'; diff --git a/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-cases.ts b/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-cases.ts index 32a0cc4d6..e6ce7ebd8 100644 --- a/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-cases.ts +++ b/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-cases.ts @@ -9,7 +9,7 @@ import type { import type { CardGroupPadding } from '../theme/native-renderers-grid.js'; export const NATIVE_DISPATCH_RENDERER_DERIVATION = - 'Mechanically generated from DLA src/lib/replicate/page-reconstruct.ts reconstructPagePattern at DLA commit 1e393c5; renderer markup strips the final reconstruct body newline, and footer/nav renderSection cases are sandwiched between non-chrome sentinels so DLA stripChrome does not remove them before dispatch.'; + 'Mechanically generated from the reference implementation src/lib/replicate/page-reconstruct.ts reconstructPagePattern at reference commit 1e393c5; renderer markup strips the final reconstruct body newline, and footer/nav renderSection cases are sandwiched between non-chrome sentinels so reference stripChrome does not remove them before dispatch.'; export const ALL_RENDER_SECTION_INTERACTION_MODELS: InteractionModel[] = [ 'static', @@ -68,7 +68,7 @@ export interface NativeCardGroupRendererCase { dark: boolean; radius: number; padding: CardGroupPadding | null; - dlaSection: SectionSpec; + referenceSection: SectionSpec; } export interface NativeRenderSectionCase extends NativeRendererSectionCase { @@ -303,7 +303,7 @@ const fullBleedCells = section({ layout: { containerWidth: 1440, padding: '0px', childLayout: 'grid', columnCount: 2, gap: '0px' }, }); -const cardGroupDlaSection = section({ +const cardGroupReferenceSection = section({ sectionIndex: 68, interactionModel: 'static', cells: [ @@ -550,7 +550,7 @@ export function nativeDispatchRendererCaseGroups(): NativeDispatchRendererCaseGr dark: true, radius: 24, padding: { top: 24, right: 32, bottom: 28, left: 32 }, - dlaSection: cardGroupDlaSection, + referenceSection: cardGroupReferenceSection, }, ], renderSection: renderSectionCases(), diff --git a/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-reference-goldens.json b/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-reference-goldens.json index c5796cbee..de1590958 100644 --- a/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-reference-goldens.json +++ b/packages/blocks-engine/src/__fixtures__/native-dispatch-renderer-reference-goldens.json @@ -1,6 +1,6 @@ { "version": 1, - "derivation": "Mechanically generated from DLA src/lib/replicate/page-reconstruct.ts reconstructPagePattern at DLA commit 1e393c5; renderer markup strips the final reconstruct body newline, and footer/nav renderSection cases are sandwiched between non-chrome sentinels so DLA stripChrome does not remove them before dispatch.", + "derivation": "Mechanically generated from the reference implementation src/lib/replicate/page-reconstruct.ts reconstructPagePattern at reference commit 1e393c5; renderer markup strips the final reconstruct body newline, and footer/nav renderSection cases are sandwiched between non-chrome sentinels so reference stripChrome does not remove them before dispatch.", "renderers": { "renderCardGrid": [ { diff --git a/packages/blocks-engine/src/__fixtures__/native-low-level-helper-cases.ts b/packages/blocks-engine/src/__fixtures__/native-low-level-helper-cases.ts index 8aac14e39..d5db11b2c 100644 --- a/packages/blocks-engine/src/__fixtures__/native-low-level-helper-cases.ts +++ b/packages/blocks-engine/src/__fixtures__/native-low-level-helper-cases.ts @@ -196,7 +196,7 @@ export function runNativeLowLevelParity(impl: NativeLowLevelImpl): NativeLowLeve return { version: 1, derivation: - 'Mechanically generated from DLA page-reconstruct.ts low-level helpers and footer-color.ts color helpers at DLA commit 1e393c5.', + 'Mechanically generated from the reference implementation page-reconstruct.ts low-level helpers and footer-color.ts color helpers at reference commit 1e393c5.', helpers: { MISSING_IMAGE_PLACEHOLDER: [capture('constant', () => impl.MISSING_IMAGE_PLACEHOLDER)], visibleText: [ diff --git a/packages/blocks-engine/src/__fixtures__/native-low-level-reference-goldens.json b/packages/blocks-engine/src/__fixtures__/native-low-level-reference-goldens.json index cce692af0..a66cbadee 100644 --- a/packages/blocks-engine/src/__fixtures__/native-low-level-reference-goldens.json +++ b/packages/blocks-engine/src/__fixtures__/native-low-level-reference-goldens.json @@ -1,6 +1,6 @@ { "version": 1, - "derivation": "Mechanically generated from DLA page-reconstruct.ts low-level helpers and footer-color.ts color helpers at DLA commit 1e393c5.", + "derivation": "Mechanically generated from the reference implementation page-reconstruct.ts low-level helpers and footer-color.ts color helpers at reference commit 1e393c5.", "helpers": { "MISSING_IMAGE_PLACEHOLDER": [ { diff --git a/packages/blocks-engine/src/__fixtures__/native-section-renderer-cases.ts b/packages/blocks-engine/src/__fixtures__/native-section-renderer-cases.ts index 6bd846557..03da1c1cf 100644 --- a/packages/blocks-engine/src/__fixtures__/native-section-renderer-cases.ts +++ b/packages/blocks-engine/src/__fixtures__/native-section-renderer-cases.ts @@ -2,7 +2,7 @@ import type { NativeRenderOut } from '../theme/native-reconstruct-types.js'; import type { SectionSpec, SectionSpecImage } from '../theme/section-spec.js'; export const NATIVE_SECTION_RENDERER_DERIVATION = - 'Mechanically generated from DLA src/lib/replicate/page-reconstruct.ts reconstructPagePattern at DLA commit 1e393c5; section renderer markup strips the final reconstruct body newline.'; + 'Mechanically generated from the reference implementation src/lib/replicate/page-reconstruct.ts reconstructPagePattern at reference commit 1e393c5; section renderer markup strips the final reconstruct body newline.'; export interface NativeSectionRendererImpl { renderReviewGrid(section: SectionSpec): NativeRenderOut; diff --git a/packages/blocks-engine/src/__fixtures__/native-section-renderer-reference-goldens.json b/packages/blocks-engine/src/__fixtures__/native-section-renderer-reference-goldens.json index 4999cbe2d..538c206d1 100644 --- a/packages/blocks-engine/src/__fixtures__/native-section-renderer-reference-goldens.json +++ b/packages/blocks-engine/src/__fixtures__/native-section-renderer-reference-goldens.json @@ -1,6 +1,6 @@ { "version": 1, - "derivation": "Mechanically generated from DLA src/lib/replicate/page-reconstruct.ts reconstructPagePattern at DLA commit 1e393c5; section renderer markup strips the final reconstruct body newline.", + "derivation": "Mechanically generated from the reference implementation src/lib/replicate/page-reconstruct.ts reconstructPagePattern at reference commit 1e393c5; section renderer markup strips the final reconstruct body newline.", "renderers": { "renderReviewGrid": [ { diff --git a/packages/blocks-engine/src/__fixtures__/native-text-renderer-cases.ts b/packages/blocks-engine/src/__fixtures__/native-text-renderer-cases.ts index 39184a989..bf6ad49cf 100644 --- a/packages/blocks-engine/src/__fixtures__/native-text-renderer-cases.ts +++ b/packages/blocks-engine/src/__fixtures__/native-text-renderer-cases.ts @@ -3,7 +3,7 @@ import type { NativeRenderCtx, NativeRenderOut } from '../theme/native-reconstru import type { SectionSpec, SectionSpecImage } from '../theme/section-spec.js'; export const NATIVE_TEXT_RENDERER_DERIVATION = - 'Mechanically generated from DLA src/lib/replicate/page-reconstruct.ts reconstructPagePattern at DLA commit 1e393c5; section renderer markup strips the final reconstruct body newline, and direct galleryBlock outputs extract the nested wp:gallery block.'; + 'Mechanically generated from the reference implementation src/lib/replicate/page-reconstruct.ts reconstructPagePattern at reference commit 1e393c5; section renderer markup strips the final reconstruct body newline, and direct galleryBlock outputs extract the nested wp:gallery block.'; export interface NativeTextRendererImpl { renderTextBand(section: SectionSpec, ctx: NativeRenderCtx): NativeRenderOut; diff --git a/packages/blocks-engine/src/__fixtures__/native-text-renderer-reference-goldens.json b/packages/blocks-engine/src/__fixtures__/native-text-renderer-reference-goldens.json index d5ab4843e..6b5802ccd 100644 --- a/packages/blocks-engine/src/__fixtures__/native-text-renderer-reference-goldens.json +++ b/packages/blocks-engine/src/__fixtures__/native-text-renderer-reference-goldens.json @@ -1,6 +1,6 @@ { "version": 1, - "derivation": "Mechanically generated from DLA src/lib/replicate/page-reconstruct.ts reconstructPagePattern at DLA commit 1e393c5; section renderer markup strips the final reconstruct body newline, and direct galleryBlock outputs extract the nested wp:gallery block.", + "derivation": "Mechanically generated from the reference implementation src/lib/replicate/page-reconstruct.ts reconstructPagePattern at reference commit 1e393c5; section renderer markup strips the final reconstruct body newline, and direct galleryBlock outputs extract the nested wp:gallery block.", "renderers": { "renderTextBand": [ { diff --git a/packages/blocks-engine/src/__fixtures__/region-audit-corpus.ts b/packages/blocks-engine/src/__fixtures__/region-audit-corpus.ts index 9207346fa..0ce62235d 100644 --- a/packages/blocks-engine/src/__fixtures__/region-audit-corpus.ts +++ b/packages/blocks-engine/src/__fixtures__/region-audit-corpus.ts @@ -4,16 +4,16 @@ import type { SourceLandmark, } from '../theme/index.js'; -export const DLA_REGION_AUDIT_COMMIT = '1e393c535850ee1a9482f83459f779d0e225b027'; -export const DLA_REGION_AUDIT_PATH = 'src/lib/replicate/region-audit.ts'; -export const DLA_REGION_CENSUS_PATH = 'src/lib/replicate/region-census.ts'; -export const DLA_SECTION_SELECTOR_PATH = 'src/lib/replicate/section-selector.ts'; -export const DLA_REGION_AUDIT_BLOB = '3e4bff0205056183fb3b09612df6caf5018a844f'; -export const DLA_REGION_CENSUS_BLOB = 'c447895fe50d42395ea4a4b8786467bef9eeabda'; -export const DLA_SECTION_SELECTOR_BLOB = 'a900bd3d4fe719af039faf9c586b17ae19403c38'; +export const REFERENCE_REGION_AUDIT_COMMIT = '1e393c535850ee1a9482f83459f779d0e225b027'; +export const REFERENCE_REGION_AUDIT_PATH = 'src/lib/replicate/region-audit.ts'; +export const REFERENCE_REGION_CENSUS_PATH = 'src/lib/replicate/region-census.ts'; +export const REFERENCE_SECTION_SELECTOR_PATH = 'src/lib/replicate/section-selector.ts'; +export const REFERENCE_REGION_AUDIT_BLOB = '3e4bff0205056183fb3b09612df6caf5018a844f'; +export const REFERENCE_REGION_CENSUS_BLOB = 'c447895fe50d42395ea4a4b8786467bef9eeabda'; +export const REFERENCE_SECTION_SELECTOR_BLOB = 'a900bd3d4fe719af039faf9c586b17ae19403c38'; export const REGION_AUDIT_DERIVATION = - 'DLA region-audit + region-census over source HTML and explicit placed-region corpus'; + 'reference region-audit + region-census over source HTML and explicit placed-region corpus'; export interface RegionAuditCorpusCase { id: string; @@ -141,16 +141,16 @@ export function runRegionAuditParity(impl: RegionAuditImpl): RegionAuditParityFi version: 1, derivation: REGION_AUDIT_DERIVATION, oracle: { - commit: DLA_REGION_AUDIT_COMMIT, + commit: REFERENCE_REGION_AUDIT_COMMIT, paths: { - regionAudit: DLA_REGION_AUDIT_PATH, - regionCensus: DLA_REGION_CENSUS_PATH, - sectionSelector: DLA_SECTION_SELECTOR_PATH, + regionAudit: REFERENCE_REGION_AUDIT_PATH, + regionCensus: REFERENCE_REGION_CENSUS_PATH, + sectionSelector: REFERENCE_SECTION_SELECTOR_PATH, }, blobs: { - regionAudit: DLA_REGION_AUDIT_BLOB, - regionCensus: DLA_REGION_CENSUS_BLOB, - sectionSelector: DLA_SECTION_SELECTOR_BLOB, + regionAudit: REFERENCE_REGION_AUDIT_BLOB, + regionCensus: REFERENCE_REGION_CENSUS_BLOB, + sectionSelector: REFERENCE_SECTION_SELECTOR_BLOB, }, }, cases: regionAuditCases().map((testCase) => { diff --git a/packages/blocks-engine/src/__fixtures__/region-audit-reference-goldens.json b/packages/blocks-engine/src/__fixtures__/region-audit-reference-goldens.json index 886cf11f4..b70614e78 100644 --- a/packages/blocks-engine/src/__fixtures__/region-audit-reference-goldens.json +++ b/packages/blocks-engine/src/__fixtures__/region-audit-reference-goldens.json @@ -1,6 +1,6 @@ { "version": 1, - "derivation": "DLA region-audit + region-census over source HTML and explicit placed-region corpus", + "derivation": "reference region-audit + region-census over source HTML and explicit placed-region corpus", "oracle": { "commit": "1e393c535850ee1a9482f83459f779d0e225b027", "paths": { diff --git a/packages/blocks-engine/src/__tests__/block-contract.test.ts b/packages/blocks-engine/src/__tests__/block-contract.test.ts index 5f58a47cb..c6c976a64 100644 --- a/packages/blocks-engine/src/__tests__/block-contract.test.ts +++ b/packages/blocks-engine/src/__tests__/block-contract.test.ts @@ -34,9 +34,9 @@ describe('validateBlockContract', () => { }); it('skips deliberate non-core blocks and allowlisted core/html untouched', () => { - const markup = ` -
x
- + const markup = ` +
x
+
island
`; diff --git a/packages/blocks-engine/src/__tests__/canonicalize.fixture.test.ts b/packages/blocks-engine/src/__tests__/canonicalize.fixture.test.ts index 19bd3a13d..50a28167d 100644 --- a/packages/blocks-engine/src/__tests__/canonicalize.fixture.test.ts +++ b/packages/blocks-engine/src/__tests__/canonicalize.fixture.test.ts @@ -15,7 +15,7 @@ const canonicalizeCases = (cases as CanonicalizeFixture[]).filter( describe('canonicalize golden fixtures', () => { for (const fixture of canonicalizeCases) { - it(`${fixture.id} is byte-identical to the DLA golden`, () => { + it(`${fixture.id} is byte-identical to the reference golden`, () => { expect(canonicalize(fixture.input)).toMatchObject(fixture.expected); }); } diff --git a/packages/blocks-engine/src/__tests__/compose.fixture.test.ts b/packages/blocks-engine/src/__tests__/compose.fixture.test.ts index f1d24a082..c98c7ad6d 100644 --- a/packages/blocks-engine/src/__tests__/compose.fixture.test.ts +++ b/packages/blocks-engine/src/__tests__/compose.fixture.test.ts @@ -14,7 +14,7 @@ const composeCases = (cases as ComposeFixture[]).filter((fixture) => fixture.op describe('compose golden fixtures', () => { for (const fixture of composeCases) { - it(`${fixture.id} is byte-identical to the DLA golden`, () => { + it(`${fixture.id} is byte-identical to the reference golden`, () => { expect(compose(fixture.input, { url: 'https://x.test/' }, {})).toBe(fixture.expected); }); } diff --git a/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-corpus.d.ts b/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-corpus.d.ts index 5bcdca60e..238149650 100644 --- a/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-corpus.d.ts +++ b/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-corpus.d.ts @@ -1,8 +1,8 @@ import type { HoistedVariation, HoistPage, HoistResult } from '../../theme/index.js'; -export const DLA_VARIATION_HOIST_COMMIT: string; -export const DLA_VARIATION_HOIST_PATH: string; -export const DLA_VARIATION_HOIST_BLOB: string; +export const REFERENCE_VARIATION_HOIST_COMMIT: string; +export const REFERENCE_VARIATION_HOIST_PATH: string; +export const REFERENCE_VARIATION_HOIST_BLOB: string; export const VARIATION_HOIST_DERIVATION: string; export interface VariationHoistCase { diff --git a/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-corpus.js b/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-corpus.js index 46eb60ff3..a433154cc 100644 --- a/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-corpus.js +++ b/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-corpus.js @@ -1,8 +1,8 @@ -export const DLA_VARIATION_HOIST_COMMIT = '1e393c535850ee1a9482f83459f779d0e225b027'; -export const DLA_VARIATION_HOIST_PATH = 'src/lib/replicate/variation-hoist.ts'; -export const DLA_VARIATION_HOIST_BLOB = '62b9cf4c87b62dfc03bffe2e25ffbe4e6109438b'; +export const REFERENCE_VARIATION_HOIST_COMMIT = '1e393c535850ee1a9482f83459f779d0e225b027'; +export const REFERENCE_VARIATION_HOIST_PATH = 'src/lib/replicate/variation-hoist.ts'; +export const REFERENCE_VARIATION_HOIST_BLOB = '62b9cf4c87b62dfc03bffe2e25ffbe4e6109438b'; export const VARIATION_HOIST_DERIVATION = - `Mechanically generated from DLA ${DLA_VARIATION_HOIST_PATH} at commit ${DLA_VARIATION_HOIST_COMMIT} with blob ${DLA_VARIATION_HOIST_BLOB}.`; + `Mechanically generated from the reference implementation ${REFERENCE_VARIATION_HOIST_PATH} at commit ${REFERENCE_VARIATION_HOIST_COMMIT} with blob ${REFERENCE_VARIATION_HOIST_BLOB}.`; const commentEscapeName = 'Alpha \\u002d\\u002d \\u003cunsafe\\u003e \\u0026 \\u0022quoted\\u0022 value'; @@ -81,9 +81,9 @@ export function runVariationHoistParity(impl) { version: 1, derivation: VARIATION_HOIST_DERIVATION, oracle: { - commit: DLA_VARIATION_HOIST_COMMIT, - path: DLA_VARIATION_HOIST_PATH, - blob: DLA_VARIATION_HOIST_BLOB, + commit: REFERENCE_VARIATION_HOIST_COMMIT, + path: REFERENCE_VARIATION_HOIST_PATH, + blob: REFERENCE_VARIATION_HOIST_BLOB, }, cases: variationHoistCases().map((entry) => { const result = impl.hoistVariations(clone(entry.pages), entry.options ?? {}); diff --git a/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-reference-goldens.json b/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-reference-goldens.json index c8e1bd0b6..770c9941e 100644 --- a/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-reference-goldens.json +++ b/packages/blocks-engine/src/__tests__/fixtures/variation-hoist-reference-goldens.json @@ -1,6 +1,6 @@ { "version": 1, - "derivation": "Mechanically generated from DLA src/lib/replicate/variation-hoist.ts at commit 1e393c535850ee1a9482f83459f779d0e225b027 with blob 62b9cf4c87b62dfc03bffe2e25ffbe4e6109438b.", + "derivation": "Mechanically generated from the reference implementation src/lib/replicate/variation-hoist.ts at commit 1e393c535850ee1a9482f83459f779d0e225b027 with blob 62b9cf4c87b62dfc03bffe2e25ffbe4e6109438b.", "oracle": { "commit": "1e393c535850ee1a9482f83459f779d0e225b027", "path": "src/lib/replicate/variation-hoist.ts", diff --git a/packages/blocks-engine/src/__tests__/producer-neutral-source.test.ts b/packages/blocks-engine/src/__tests__/producer-neutral-source.test.ts new file mode 100644 index 000000000..ca63590d5 --- /dev/null +++ b/packages/blocks-engine/src/__tests__/producer-neutral-source.test.ts @@ -0,0 +1,56 @@ +import { readdirSync, readFileSync, statSync } from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { describe, expect, it } from 'vitest'; + +// Blocks Engine carries no knowledge of a specific capture producer; it reads +// capture evidence through its own published vocabulary +// (php-transformer/docs/contracts/capture-evidence.md). The guard is +// case-insensitive and word-ish: a token inside a longer lowercase word +// (`childLayout`) passes, while a camelCase or upper-case token fails. Tokens +// are built from fragments so this file passes its own check. +// php-transformer/tests/contract/producer-neutral-source.php applies the same +// rule to both packages. +const short = 'd' + 'la'; +const long = 'liberation'; +const SHORT_TOKEN = new RegExp( + `(?:(? SHORT_TOKEN.test(text) || LONG_TOKEN.test(text); + +const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..'); + +function filesUnder(dir: string): string[] { + return readdirSync(dir).flatMap((entry) => { + const full = path.join(dir, entry); + return statSync(full).isDirectory() ? filesUnder(full) : [full]; + }); +} + +function offendingLines(label: string, text: string): string[] { + return text + .split(/\r?\n/) + .flatMap((line, index) => (isProducerToken(line) ? [`${label}:${index + 1}: ${line.trim().slice(0, 140)}`] : [])); +} + +describe('producer-neutral source', () => { + it('keeps capture-producer names out of runtime source and package scripts', () => { + const offenders = filesUnder(path.join(packageRoot, 'src')).flatMap((file) => + offendingLines(path.relative(packageRoot, file), readFileSync(file, 'utf8')) + ); + const manifest = JSON.parse(readFileSync(path.join(packageRoot, 'package.json'), 'utf8')) as { scripts?: Record }; + offenders.push(...offendingLines('package.json scripts', JSON.stringify(manifest.scripts ?? {}, null, 2))); + + expect(offenders).toEqual([]); + }); + + it('recognizes the producer tokens it guards against', () => { + for (const sample of [`${short}-x`, `data-${short}-x`, `${short.toUpperCase()}_ROOT`, `card${'D' + short.slice(1)}Section`, `data-${long}-x`, `${long}-agent`]) { + expect(isProducerToken(sample), sample).toBe(true); + } + for (const sample of ['childLayout', 'headlamp', 'isDirectChildOfAuthorOwnedLayout']) { + expect(isProducerToken(sample), sample).toBe(false); + } + }); +}); diff --git a/packages/blocks-engine/src/__tests__/raw-convert.fixture.test.ts b/packages/blocks-engine/src/__tests__/raw-convert.fixture.test.ts index 5ba9c61f4..773ac582a 100644 --- a/packages/blocks-engine/src/__tests__/raw-convert.fixture.test.ts +++ b/packages/blocks-engine/src/__tests__/raw-convert.fixture.test.ts @@ -15,7 +15,7 @@ const rawConvertCases = (cases as RawConvertFixture[]).filter( describe('rawConvert golden fixtures', () => { for (const fixture of rawConvertCases) { - it(`${fixture.id} is byte-identical to the DLA golden`, () => { + it(`${fixture.id} is byte-identical to the reference golden`, () => { expect(rawConvert(fixture.input)).toEqual(fixture.expected); }); } diff --git a/packages/blocks-engine/src/__tests__/serialize.test.ts b/packages/blocks-engine/src/__tests__/serialize.test.ts index 17b4f7378..7cd34560b 100644 --- a/packages/blocks-engine/src/__tests__/serialize.test.ts +++ b/packages/blocks-engine/src/__tests__/serialize.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'; import { serializeBlockAttrs } from '../serialize'; -function dlaSerializeBlockAttrs(attrs: Record): string { +function referenceSerializeBlockAttrs(attrs: Record): string { return JSON.stringify(attrs) .replace(/--/g, '\\u002d\\u002d') .replace(/ { expect(JSON.parse(serialized)).toEqual({ label: 'A "quoted" value' }); }); - it('matches the DLA form-blocks serializer on a shared corpus', () => { + it('matches the reference form-blocks serializer on a shared corpus', () => { const corpus: Array> = [ {}, { name: 'plain' }, @@ -36,7 +36,7 @@ describe('serializeBlockAttrs', () => { ]; for (const attrs of corpus) { - expect(serializeBlockAttrs(attrs)).toBe(dlaSerializeBlockAttrs(attrs)); + expect(serializeBlockAttrs(attrs)).toBe(referenceSerializeBlockAttrs(attrs)); } }); }); diff --git a/packages/blocks-engine/src/__tests__/site-to-theme.e2e.test.ts b/packages/blocks-engine/src/__tests__/site-to-theme.e2e.test.ts index e97ad5bc6..4e780f97c 100644 --- a/packages/blocks-engine/src/__tests__/site-to-theme.e2e.test.ts +++ b/packages/blocks-engine/src/__tests__/site-to-theme.e2e.test.ts @@ -569,7 +569,7 @@ describe('site-to-theme P0-3 orchestration', () => { expect(carried.themeJson).not.toMatchObject({ settings: { spacing: { blockGap: false } } }); // ...while a CSS rule zeroes the gap on the carried align:full section wrappers // so reconstructed sections sit flush. CSS-only keeps the block markup - // byte-identical to the DLA reference. + // byte-identical to the reference implementation. expect(carried.styleCss).toContain( ':where(.is-layout-flow, .is-layout-constrained) > .wp-block-group.alignfull{margin-block-start:0}' ); diff --git a/packages/blocks-engine/src/__tests__/theme-chrome-parts-builders-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-chrome-parts-builders-parity.test.ts index a97726d68..f6b74b49c 100644 --- a/packages/blocks-engine/src/__tests__/theme-chrome-parts-builders-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-chrome-parts-builders-parity.test.ts @@ -12,8 +12,8 @@ import { type NavLink, } from '../theme/index.js'; -describe('chrome-parts builders DLA parity', () => { - it('buildHeaderPart emits DLA-faithful native nav markup with inNav preference', () => { +describe('chrome-parts builders reference parity', () => { + it('buildHeaderPart emits reference-faithful native nav markup with inNav preference', () => { const nav: NavLink[] = [ { fromSlug: 'home', toSlug: 'home', label: 'Brand Co' }, { fromSlug: 'home', toSlug: 'home', label: 'Home', inNav: true }, @@ -71,14 +71,14 @@ describe('chrome-parts builders DLA parity', () => { `\n` + `\n` + `\n` + - `\n` + - `\n` + - `` + `\n` + + `\n` + + `` ); expect(blockMarkupRoundtrips(html)).toEqual({ ok: true }); }); - it('buildFooterPart applies DLA footer normalization, href rewrite, and token wrapper around converted markup', async () => { + it('buildFooterPart applies reference footer normalization, href rewrite, and token wrapper around converted markup', async () => { const footer: ChromePartSection = { id: 'footer', role: 'footer', @@ -110,7 +110,7 @@ describe('chrome-parts builders DLA parity', () => { expect(blockMarkupRoundtrips(html)).toEqual({ ok: true }); }); - it('findChromeMounts discovers DLA JS-rendered chrome mounts around main', () => { + it('findChromeMounts discovers reference JS-rendered chrome mounts around main', () => { const page = `

Sale

@@ -125,7 +125,7 @@ describe('chrome-parts builders DLA parity', () => { }); }); - it('mountPartMarkup emits DLA anchored empty group markup with optional sticky state', () => { + it('mountPartMarkup emits reference anchored empty group markup with optional sticky state', () => { const html = mountPartMarkup( { id: 'siteHeader', classes: ['chrome'] }, { kind: 'sticky', toggleClass: 'is-scrolled', offset: 24 } @@ -136,9 +136,9 @@ describe('chrome-parts builders DLA parity', () => { `\n` + `\n` + `\n` + - `\n` + - `\n` + - `` + `\n` + + `\n` + + `` ); expect(blockMarkupRoundtrips(html)).toEqual({ ok: true }); }); diff --git a/packages/blocks-engine/src/__tests__/theme-chrome-signature-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-chrome-signature-parity.test.ts index a61173714..03c0644a0 100644 --- a/packages/blocks-engine/src/__tests__/theme-chrome-signature-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-chrome-signature-parity.test.ts @@ -6,8 +6,8 @@ import { stripActiveNavState, } from '../theme/index.js'; -describe('chrome signature DLA parity', () => { - it('strips active nav state exactly like DLA chrome-canonicalize', () => { +describe('chrome signature reference parity', () => { + it('strips active nav state exactly like reference chrome-canonicalize', () => { expect( stripActiveNavState( 'Home' diff --git a/packages/blocks-engine/src/__tests__/theme-contracts.test.ts b/packages/blocks-engine/src/__tests__/theme-contracts.test.ts index 0b245f4e3..e830bb6a5 100644 --- a/packages/blocks-engine/src/__tests__/theme-contracts.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-contracts.test.ts @@ -536,7 +536,7 @@ describe('theme public contract', () => { }); -describe('fallback diagnostics DLA parity', () => { +describe('fallback diagnostics reference parity', () => { it('emits dropped_images reasonCode with media-first precedence when text coverage is also below floor', () => { const section = diagnosticSection({ sectionIndex: 7, @@ -576,7 +576,7 @@ describe('fallback diagnostics DLA parity', () => { }); }); - it('emits text_coverage_below_floor reasonCode when text is below the DLA floor without dropped media', () => { + it('emits text_coverage_below_floor reasonCode when text is below the reference floor without dropped media', () => { const section = diagnosticSection({ sectionIndex: 3, interactionModel: 'cta', @@ -681,7 +681,7 @@ describe('fallback diagnostics DLA parity', () => { ]); }); - it('matches the DLA decorative_asset_triaged diagnostic record shape', () => { + it('matches the reference decorative_asset_triaged diagnostic record shape', () => { expect( buildTriageRemovalDiagnostic({ page: '/about', @@ -713,7 +713,7 @@ describe('fallback diagnostics DLA parity', () => { }); }); -describe('formToBlocks DLA parity', () => { +describe('formToBlocks reference parity', () => { it('lets a consumer supply a provider-neutral form materializer', () => { const custom: FormMaterializer = { name: 'custom-provider', @@ -748,7 +748,7 @@ describe('formToBlocks DLA parity', () => { ]); }); - it('exports the DLA form-blocks surface and emits jetpack/field-* blocks for every mapped field kind', () => { + it('exports the reference form-blocks surface and emits jetpack/field-* blocks for every mapped field kind', () => { const formToBlocksType: (form: SectionSpecForm) => FormBlocksResult = formToBlocks; void formToBlocksType; @@ -774,7 +774,7 @@ describe('formToBlocks DLA parity', () => { } }); - it('keeps authored options in DLA attr grammar for radio, select, and checkbox groups', () => { + it('keeps authored options in reference attr grammar for radio, select, and checkbox groups', () => { const radio = formToBlocks( sectionForm([formField({ kind: 'radio', label: 'Size', options: ['Small', 'Large', 'Medium'] })]), ); @@ -812,7 +812,7 @@ describe('formToBlocks DLA parity', () => { assertBalanced(result.markup); }); - it('matches the DLA multi-field golden, including stable attr order and skipped fields', () => { + it('matches the reference multi-field golden, including stable attr order and skipped fields', () => { const result = formToBlocks( sectionForm( [ @@ -850,7 +850,7 @@ describe('formToBlocks DLA parity', () => { expect(result.markup).not.toContain('Campaign id'); }); - it('matches the DLA zero-field golden and escapes hostile labels like the DLA serializer', () => { + it('matches the reference zero-field golden and escapes hostile labels like the reference serializer', () => { const result = formToBlocks(sectionForm([], 'Continue')); expect(result.markup).toBe( diff --git a/packages/blocks-engine/src/__tests__/theme-font-faces.test.ts b/packages/blocks-engine/src/__tests__/theme-font-faces.test.ts index 00b9929fa..f84545114 100644 --- a/packages/blocks-engine/src/__tests__/theme-font-faces.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-font-faces.test.ts @@ -122,7 +122,7 @@ describe('stripUnusedFontFaces', () => { }); }); -describe('font helper DLA parity surface', () => { +describe('font helper reference parity surface', () => { it('extractGoogleFontCssUrls finds unique css/css2 URLs and decodes HTML ampersands', () => { const urls = extractGoogleFontCssUrls([ '', @@ -136,7 +136,7 @@ describe('font helper DLA parity surface', () => { ]); }); - it('parseCapturedFontFaces preserves the DLA third-party host filter', () => { + it('parseCapturedFontFaces preserves the reference third-party host filter', () => { const faces = parseCapturedFontFaces(` @font-face { font-family: "Roboto"; @@ -221,7 +221,7 @@ describe('font helper DLA parity surface', () => { ); }); - it('absolutizeFontUrl and fontFilename match DLA golden behavior', () => { + it('absolutizeFontUrl and fontFilename match reference golden behavior', () => { expect(absolutizeFontUrl('//cdn.example.com/fonts/acme.woff2')).toBe( 'https://cdn.example.com/fonts/acme.woff2' ); @@ -240,7 +240,7 @@ describe('font helper DLA parity surface', () => { expect(fontFilename(face)).toBe('Acme-Display-400.woff2'); }); - it('buildFontFaceCss emits the DLA self-hosted source-font block', () => { + it('buildFontFaceCss emits the reference self-hosted source-font block', () => { const faces: LocalFontFace[] = [ { family: 'Acme Display', @@ -289,7 +289,7 @@ describe('font helper DLA parity surface', () => { ).toBe('a{}b{}'); }); - it('stripUnusedCarryFontFaces returns kept URLs and DLA stripped count', () => { + it('stripUnusedCarryFontFaces returns kept URLs and reference stripped count', () => { const usedFace = "@font-face{font-family:'Libre Baskerville';src:url(/fonts/libre.woff2) format('woff2')}"; const unusedFace = diff --git a/packages/blocks-engine/src/__tests__/theme-html-fallback-surface.test.ts b/packages/blocks-engine/src/__tests__/theme-html-fallback-surface.test.ts index 5663558ca..f28ee485e 100644 --- a/packages/blocks-engine/src/__tests__/theme-html-fallback-surface.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-html-fallback-surface.test.ts @@ -41,7 +41,7 @@ describe('theme html fallback public surface', () => { ); }); - it('classifies WordPress layout markup by the DLA marker set', () => { + it('classifies WordPress layout markup by the reference marker set', () => { expect( [ '
', @@ -137,7 +137,7 @@ describe('theme html fallback public surface', () => { ); }); - it('rewrites internal hrefs with DLA path, host, fragment, and quote semantics', () => { + it('rewrites internal hrefs with reference path, host, fragment, and quote semantics', () => { const missed: string[] = []; const linkMap: InternalLinkMap = new Map([ ['example.test/contact', '/contact/'], @@ -158,7 +158,7 @@ describe('theme html fallback public surface', () => { expect(missed).toEqual(['/missing']); }); - it('reports DLA injection vectors and allows sanctioned theme PHP forms', () => { + it('reports reference injection vectors and allows sanctioned theme PHP forms', () => { expect( scanForInjection( '', diff --git a/packages/blocks-engine/src/__tests__/theme-ingest.test.ts b/packages/blocks-engine/src/__tests__/theme-ingest.test.ts index 51e92166a..b9d5466da 100644 --- a/packages/blocks-engine/src/__tests__/theme-ingest.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-ingest.test.ts @@ -70,7 +70,7 @@ describe('theme ingest', () => { expect(services?.html).toContain('Blocks Engine Services'); }); - it('maps nested paths to DLA-compatible slugs', () => { + it('maps nested paths to reference-compatible slugs', () => { expect(slugFromRelPath(join('index.html'))).toBe('home'); expect(slugFromRelPath(join('blog', 'index.html'))).toBe('blog'); expect(slugFromRelPath(join('blog', 'Launch Notes.html'))).toBe('blog-launch-notes'); diff --git a/packages/blocks-engine/src/__tests__/theme-native-low-level-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-native-low-level-parity.test.ts index a5f165513..a7e47cd33 100644 --- a/packages/blocks-engine/src/__tests__/theme-native-low-level-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-native-low-level-parity.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import expectedGoldens from '../__fixtures__/native-low-level-dla-goldens.json' with { type: 'json' }; +import expectedGoldens from '../__fixtures__/native-low-level-reference-goldens.json' with { type: 'json' }; import { runNativeLowLevelParity, type NativeLowLevelImpl, @@ -101,8 +101,8 @@ function collectDiffs(actual: NativeLowLevelParityFile, expected: NativeLowLevel return diffs; } -describe('native low-level helper DLA-today parity', () => { - it('matches mechanically derived DLA helper outputs byte-for-byte and is stable on rerun', () => { +describe('native low-level helper reference parity', () => { + it('matches mechanically derived reference helper outputs byte-for-byte and is stable on rerun', () => { const first = runNativeLowLevelParity(engineImpl); const second = runNativeLowLevelParity(engineImpl); expect(stableJson(first)).toBe(stableJson(second)); diff --git a/packages/blocks-engine/src/__tests__/theme-native-renderers-dispatch-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-native-renderers-dispatch-parity.test.ts index 6e1e71f1d..214f4cc4a 100644 --- a/packages/blocks-engine/src/__tests__/theme-native-renderers-dispatch-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-native-renderers-dispatch-parity.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import expectedGoldens from '../__fixtures__/native-dispatch-renderer-dla-goldens.json' with { type: 'json' }; +import expectedGoldens from '../__fixtures__/native-dispatch-renderer-reference-goldens.json' with { type: 'json' }; import { ALL_RENDER_SECTION_INTERACTION_MODELS, nativeDispatchRenderCtx, @@ -97,8 +97,8 @@ function renderDirectTarget(entry: NativeRenderSectionCase): NativeRenderOut { } } -describe('native dispatch renderer DLA-today parity', () => { - it('matches mechanically derived DLA renderer outputs byte-for-byte and is stable on rerun', () => { +describe('native dispatch renderer reference parity', () => { + it('matches mechanically derived reference renderer outputs byte-for-byte and is stable on rerun', () => { const first = runNativeDispatchRendererParity(engineImpl); const second = runNativeDispatchRendererParity(engineImpl); expect(stableJson(first)).toBe(stableJson(second)); diff --git a/packages/blocks-engine/src/__tests__/theme-native-renderers-section-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-native-renderers-section-parity.test.ts index 6326514b6..6e5ae75e3 100644 --- a/packages/blocks-engine/src/__tests__/theme-native-renderers-section-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-native-renderers-section-parity.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import expectedGoldens from '../__fixtures__/native-section-renderer-dla-goldens.json' with { type: 'json' }; +import expectedGoldens from '../__fixtures__/native-section-renderer-reference-goldens.json' with { type: 'json' }; import { runNativeSectionRendererParity, type NativeSectionRendererImpl, @@ -46,8 +46,8 @@ function collectDiffs(actual: NativeSectionRendererParityFile, expected: NativeS return diffs; } -describe('native section renderer DLA-today parity', () => { - it('matches mechanically derived DLA renderer outputs byte-for-byte and is stable on rerun', () => { +describe('native section renderer reference parity', () => { + it('matches mechanically derived reference renderer outputs byte-for-byte and is stable on rerun', () => { const first = runNativeSectionRendererParity(engineImpl); const second = runNativeSectionRendererParity(engineImpl); expect(stableJson(first)).toBe(stableJson(second)); diff --git a/packages/blocks-engine/src/__tests__/theme-native-renderers-text-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-native-renderers-text-parity.test.ts index 15ba4666b..c1c826ee1 100644 --- a/packages/blocks-engine/src/__tests__/theme-native-renderers-text-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-native-renderers-text-parity.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import expectedGoldens from '../__fixtures__/native-text-renderer-dla-goldens.json' with { type: 'json' }; +import expectedGoldens from '../__fixtures__/native-text-renderer-reference-goldens.json' with { type: 'json' }; import { runNativeTextRendererParity, type NativeTextRendererImpl, @@ -53,8 +53,8 @@ function collectDiffs(actual: NativeTextRendererParityFile, expected: NativeText return diffs; } -describe('native text renderer DLA-today parity', () => { - it('matches mechanically derived DLA renderer outputs byte-for-byte and is stable on rerun', () => { +describe('native text renderer reference parity', () => { + it('matches mechanically derived reference renderer outputs byte-for-byte and is stable on rerun', () => { const first = runNativeTextRendererParity(engineImpl); const second = runNativeTextRendererParity(engineImpl); expect(stableJson(first)).toBe(stableJson(second)); diff --git a/packages/blocks-engine/src/__tests__/theme-page-reconstruct-helpers-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-page-reconstruct-helpers-parity.test.ts index 2bafddcaf..48ffe9058 100644 --- a/packages/blocks-engine/src/__tests__/theme-page-reconstruct-helpers-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-page-reconstruct-helpers-parity.test.ts @@ -40,7 +40,7 @@ function section(partial: Partial): SectionSpec { } describe('page reconstruct helper public surface', () => { - it('exports the DLA page-reconstruct helper surface from theme/index', () => { + it('exports the reference page-reconstruct helper surface from theme/index', () => { expect(theme).toEqual( expect.objectContaining({ normalizeCopy: expect.any(Function), @@ -70,14 +70,14 @@ describe('page reconstruct helper public surface', () => { }); }); -describe('normalizeCopy DLA parity', () => { +describe('normalizeCopy reference parity', () => { it('collapses whitespace and strips soft-hyphen and zero-width copy noise', () => { expect(normalizeCopy(' foo\u00ad\u200b bar\n baz ')).toBe('foo bar baz'); expect(normalizeCopy('\ufeffA\u200c\tB\u200d\r\nC\u00ad')).toBe('A B C'); }); }); -describe('sanitizePatternHeaderField DLA parity', () => { +describe('sanitizePatternHeaderField reference parity', () => { it('strips PHP doc-comment and PHP-tag delimiters without rewriting visible text', () => { expect(sanitizePatternHeaderField('*/ evil(); /*')).toBe('evil();'); expect(sanitizePatternHeaderField('a c')).toBe('a php b c'); @@ -87,7 +87,7 @@ describe('sanitizePatternHeaderField DLA parity', () => { }); }); -describe('stripChrome DLA parity', () => { +describe('stripChrome reference parity', () => { it('drops leading header chrome and trailing footer/nav chrome while preserving middle content', () => { const out = stripChrome([ section({ @@ -129,7 +129,7 @@ describe('stripChrome DLA parity', () => { }); }); -describe('sanitizeSvgAsset DLA parity', () => { +describe('sanitizeSvgAsset reference parity', () => { it('removes active SVG content and keeps inert icon markup as concrete goldens', () => { expect( sanitizeSvgAsset( diff --git a/packages/blocks-engine/src/__tests__/theme-reconstruct-reference-baseline-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-reconstruct-reference-baseline-parity.test.ts index 198896f3c..1adfcddc8 100644 --- a/packages/blocks-engine/src/__tests__/theme-reconstruct-reference-baseline-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-reconstruct-reference-baseline-parity.test.ts @@ -6,7 +6,7 @@ import { reconstructBaselineCases, type FrozenConvertedSection, type FrozenReconstructCase, -} from '../__fixtures__/page-reconstruct-dla-baseline.corpus.js'; +} from '../__fixtures__/page-reconstruct-reference-baseline.corpus.js'; import { reconstructNativeAggregate } from '../theme/reconstruct.js'; import type { SectionRenderOptions } from '../theme/native-reconstruct-types.js'; @@ -35,7 +35,7 @@ interface BaselineFile { } const GOLDEN_PATH = fileURLToPath( - new URL('../__fixtures__/page-reconstruct-dla-baseline.goldens.json', import.meta.url), + new URL('../__fixtures__/page-reconstruct-reference-baseline.goldens.json', import.meta.url), ); function hydrateOptions(testCase: FrozenReconstructCase): SectionRenderOptions { @@ -84,7 +84,7 @@ function runCorpus(): BaselineFile { function readGolden(): BaselineFile { if (!existsSync(GOLDEN_PATH)) { - throw new Error(`Missing DLA reconstruct baseline golden: ${GOLDEN_PATH}`); + throw new Error(`Missing reference reconstruct baseline golden: ${GOLDEN_PATH}`); } return JSON.parse(readFileSync(GOLDEN_PATH, 'utf8')) as BaselineFile; } @@ -119,14 +119,14 @@ function collectDiffs(actual: BaselineFile, expected: BaselineFile): string[] { return diffs; } -describe('theme reconstruct DLA-today baseline parity', () => { - it('matches the 35-case DLA baseline and is byte-stable across two runs', () => { +describe('theme reconstruct reference baseline parity', () => { + it('matches the 35-case reference baseline and is byte-stable across two runs', () => { const first = runCorpus(); const second = runCorpus(); expect(collectDiffs(first, second)).toEqual([]); const diffs = collectDiffs(first, readGolden()); - console.info(`Engine reconstruct DLA baseline parity: cases=${first.cases.length} diffs=${diffs.length}`); + console.info(`Engine reconstruct reference baseline parity: cases=${first.cases.length} diffs=${diffs.length}`); expect(diffs).toEqual([]); }); }); diff --git a/packages/blocks-engine/src/__tests__/theme-region-audit-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-region-audit-parity.test.ts index a6335c65f..24be2b1c8 100644 --- a/packages/blocks-engine/src/__tests__/theme-region-audit-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-region-audit-parity.test.ts @@ -1,4 +1,4 @@ -import expectedGoldens from '../__fixtures__/region-audit-dla-goldens.json' with { type: 'json' }; +import expectedGoldens from '../__fixtures__/region-audit-reference-goldens.json' with { type: 'json' }; import { regionAuditCases, runRegionAuditParity, @@ -26,7 +26,7 @@ function collectDiffs(actual: RegionAuditParityFile, expected: RegionAuditParity for (const actualCase of actual.cases) { const expectedCase = expectedById.get(actualCase.id); if (!expectedCase) { - diffs.push(`${actualCase.id}: missing from checked-in DLA goldens`); + diffs.push(`${actualCase.id}: missing from checked-in reference goldens`); continue; } if (stableJson(actualCase.input) !== stableJson(expectedCase.input)) { @@ -53,8 +53,8 @@ function collectDiffs(actual: RegionAuditParityFile, expected: RegionAuditParity return diffs; } -describe('region audit DLA parity', () => { - it('matches checked-in DLA region census and reconciliation goldens byte-for-byte', () => { +describe('region audit reference parity', () => { + it('matches checked-in reference region census and reconciliation goldens byte-for-byte', () => { const first = runRegionAuditParity({ extractSourceLandmarksFromHtml, selectorForHtmlRoot, diff --git a/packages/blocks-engine/src/__tests__/theme-section-coverage.test.ts b/packages/blocks-engine/src/__tests__/theme-section-coverage.test.ts index ed1bd7fde..9da144f12 100644 --- a/packages/blocks-engine/src/__tests__/theme-section-coverage.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-section-coverage.test.ts @@ -166,7 +166,7 @@ describe('theme section coverage contract', () => { }); }); - describe('measureConvertedCoverage DLA parity', () => { + describe('measureConvertedCoverage reference parity', () => { it('reports full converted text and image coverage as not lost', () => { const result = measureConvertedCoverage( captured(['Hero headline', 'Detailed copy', 'Start now'], ['assets/hero.jpg']), @@ -223,7 +223,7 @@ describe('theme section coverage contract', () => { expect(result.lost).toBe(true); }); - it('folds glyph variants like the DLA section coverage oracle', () => { + it('folds glyph variants like the reference section coverage oracle', () => { expect( foldText( '\u2018Smart\u2019 \u201cquotes\u201d \u2013 \u2014 \u2012 wait\u2026\nagain' diff --git a/packages/blocks-engine/src/__tests__/theme-segment-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-segment-parity.test.ts index 5c6767f78..b28604185 100644 --- a/packages/blocks-engine/src/__tests__/theme-segment-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-segment-parity.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'; import * as theme from '../theme/index.js'; import { segmentPage } from '../theme/index.js'; -describe('segmentPage DLA parity', () => { +describe('segmentPage reference parity', () => { it('exposes the additive segmentPage public surface from theme/index', () => { expect(theme).toEqual( expect.objectContaining({ @@ -12,7 +12,7 @@ describe('segmentPage DLA parity', () => { ); }); - it('identifies header, nav, footer, and body sections on a DLA fixture', () => { + it('identifies header, nav, footer, and body sections on a reference fixture', () => { const html = '

Hi

Feat

(c)

'; @@ -70,7 +70,7 @@ describe('segmentPage DLA parity', () => { ]); }); - it('segments a no-chrome page and escapes loose decoded text like DLA', () => { + it('segments a no-chrome page and escapes loose decoded text like reference', () => { const html = '
Hello <b>bold</b>

S text

'; diff --git a/packages/blocks-engine/src/__tests__/theme-source-assets-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-source-assets-parity.test.ts index 2bdd45521..78fedc6e7 100644 --- a/packages/blocks-engine/src/__tests__/theme-source-assets-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-source-assets-parity.test.ts @@ -14,7 +14,7 @@ import { WP_COMPAT_CSS, } from '../theme/index.js'; -const DLA_WP_COMPAT_CSS = `/* wp-compat: neutralize WP wrapper interference for carried source CSS */ +const REFERENCE_WP_COMPAT_CSS = `/* wp-compat: neutralize WP wrapper interference for carried source CSS */ /* NOTE deliberately NO .wp-block-template-part{display:contents} here: our parts use tagName header/footer, so the wrapper IS the semantic element — display:contents would destroy the box that source header{}/footer{} rules @@ -83,7 +83,7 @@ function writeFixture(dir: string, relPath: string, contents = ''): void { writeFileSync(abs, contents, 'utf8'); } -describe('source assets DLA parity', () => { +describe('source assets reference parity', () => { it('exposes the additive source-assets public surface from theme/index', () => { expect(theme).toEqual( expect.objectContaining({ @@ -105,8 +105,8 @@ describe('source assets DLA parity', () => { ); }); - it('keeps the WP compat CSS byte-for-byte equal to the DLA golden string', () => { - expect(WP_COMPAT_CSS).toBe(DLA_WP_COMPAT_CSS); + it('keeps the WP compat CSS byte-for-byte equal to the reference golden string', () => { + expect(WP_COMPAT_CSS).toBe(REFERENCE_WP_COMPAT_CSS); }); it('replays source nav anchor rules against core/navigation wrapper markup', () => { @@ -206,7 +206,7 @@ describe('source assets DLA parity', () => { }); }); - it('collects local HTML img src refs with DLA regex and path resolution semantics', () => { + it('collects local HTML img src refs with reference regex and path resolution semantics', () => { withTempDir((dir) => { writeFixture(dir, 'pages/deep/img/double.png'); writeFixture(dir, 'pages/deep/img/single.jpg'); @@ -309,7 +309,7 @@ describe('source assets DLA parity', () => { expect(result.jsFiles).toEqual(['assets/js/lib.js', 'assets/js/app.js']); expect(result.skippedUnlinked).toEqual(['stale.js', 'style.css']); const expectedBase = - DLA_WP_COMPAT_CSS + + REFERENCE_WP_COMPAT_CSS + [ '\n.base { background: url(media/bg.png); color: black; }', '.base { color: white; }', diff --git a/packages/blocks-engine/src/__tests__/theme-variation-hoist-parity.test.ts b/packages/blocks-engine/src/__tests__/theme-variation-hoist-parity.test.ts index e759d856b..17e5ceefa 100644 --- a/packages/blocks-engine/src/__tests__/theme-variation-hoist-parity.test.ts +++ b/packages/blocks-engine/src/__tests__/theme-variation-hoist-parity.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import expectedGoldens from './fixtures/variation-hoist-dla-goldens.json' with { type: 'json' }; +import expectedGoldens from './fixtures/variation-hoist-reference-goldens.json' with { type: 'json' }; import { runVariationHoistParity, variationHoistCases, @@ -58,7 +58,7 @@ function collectDiffs(actual: VariationHoistParityFile, expected: VariationHoist for (const actualCase of actual.cases) { const expectedCase = expectedById.get(actualCase.id); if (!expectedCase) { - diffs.push(`${actualCase.id}: missing from checked-in DLA goldens`); + diffs.push(`${actualCase.id}: missing from checked-in reference goldens`); continue; } if (stableJson(actualCase.options) !== stableJson(expectedCase.options)) { @@ -82,8 +82,8 @@ function collectDiffs(actual: VariationHoistParityFile, expected: VariationHoist return diffs; } -describe('variation hoist DLA parity', () => { - it('matches checked-in DLA hoistVariations and applyHoistSwaps goldens byte-for-byte', () => { +describe('variation hoist reference parity', () => { + it('matches checked-in reference hoistVariations and applyHoistSwaps goldens byte-for-byte', () => { const first = runVariationHoistParity(engineImpl) as VariationHoistParityFile; const second = runVariationHoistParity(engineImpl) as VariationHoistParityFile; expect(stableJson(first)).toBe(stableJson(second)); diff --git a/packages/blocks-engine/src/theme/assemble.ts b/packages/blocks-engine/src/theme/assemble.ts index 9e67bef10..ca3d5702d 100644 --- a/packages/blocks-engine/src/theme/assemble.ts +++ b/packages/blocks-engine/src/theme/assemble.ts @@ -100,7 +100,7 @@ export function assemble(parts: ThemeAssemblyParts): ThemeModel { * global block gap would otherwise inject a ~24px margin above every section after * the first, reading as a stray stripe above full-bleed bands. This neutralizes the * block gap on those wrappers only — via CSS, so the section block markup stays - * byte-identical to the DLA reference. Blocks the user adds in the editor are not + * byte-identical to the reference implementation. Blocks the user adds in the editor are not * align:full, so they keep WordPress's default block gap. The selector outweighs * core's zero-specificity `:where(...) > * + *` gap rule. */ diff --git a/packages/blocks-engine/src/theme/chrome-parts-builders.ts b/packages/blocks-engine/src/theme/chrome-parts-builders.ts index 84f3ddf81..c840b5cdb 100644 --- a/packages/blocks-engine/src/theme/chrome-parts-builders.ts +++ b/packages/blocks-engine/src/theme/chrome-parts-builders.ts @@ -218,10 +218,10 @@ function stickyStateBlock(sticky: StickyBehavior): string { '\\u0027' ); return ( - `\n\n` + - `