Repository navigation
Conversation
e0fc944 to
44ce499
Compare
Requester A/B and rework scopeA/B, rebased head
Why so little: I logged each
Experiment (
Rework
Acceptance: full Franklin (Claude Opus via Pi, Roadie). |
3fc21d8 to
469f02b
Compare
A/B of rebased rework
|
| trunk | #7420 | |
|---|---|---|
| Wix demo: single-child groups / groups / max depth | 225 / 369 / 13 | 225 / 369 / 13 (content byte-identical) |
| Squarespace demo: single-child groups / groups / max depth | 576 / 906 / 16 | 571 / 901 / 16 |
Squarespace editor_canvas_parity |
none | blocker (home-alt nav text loses colour and font in the editor) |
This fails acceptance, so the PR stays in draft and does not merge.
Why Wix doesn't move: every Wix wrapper that passes prove() sits on a linked page that is converted but not published (accessibility statement, terms, privacy). On the five published routes, no wrapper proves. Each Wix level carries real box styles (position, grid placement, width or max-width, min-height fixes) and ancestor-scoped skin rules, so a faithful fold rejects every level.
Assessment: per-wrapper folding guarded by the cascade has reached about 1% on Squarespace and 0% on Wix after four rounds. These wrappers are not neutral: each carries geometry. Removing them means re-synthesizing the layout: compute each subtree's resolved boxes and emit fewer native blocks whose layout (flex or grid, gap, padding, constrained width) reproduces the same geometry. It does not mean proving that a wrapper is removable. That's an architecture decision, so it's escalated to the maintainer before more Cook rounds.
Franklin (Claude Opus via Pi, Roadie).
8a407fb to
7aad41f
Compare
…d neutral wrappers around id-bearing leaves
7aad41f to
fefd015
Compare
|
Rework 3 measurement (Cook
This settles it: being geometry-neutral is necessary but not sufficient. What's missing is a restatement step: move the consumed data attribute or the inherited text style onto the surviving child, then fold. That's the third stage of the single wrapper-decision owner in #7471. The first slice, #7472, is byte-identical on all 8 corpus sites. #7420 stays in draft as the measurement record; slice 1 will be rebuilt on #7471 once restatement is a named stage. Posted by Franklin (Claude Opus via Pi, Roadie). |
Rework 3 (required): evidence-neutral wrappers are still refused by CSS-era gates
Rework 2 (
fefd0154, with a one-line comment fix forproducer-neutral-source) works on the real path: evidence is bound and v3 is read. The real-path probe classifies 156 Wix and 175 Squarespace wrappers as neutral.A/B against trunk
87654ca2:Logged refusals of evidence-neutral wrappers, real import path:
ResolvedWrapperCompositionfailurewrapper_declaration_not_composable:displayhasConsumedDataAttributes:data-interact-enter,data-testidhas_structure_signals_without_proof(class-name heuristics)repeatedMembersFoldAlike(sqs-row,sqs-html-content,sqs-block-content)color/font-size,widthorpositionresetsRequired:
ResolvedWrapperCompositiontreats the wrapper's layout and box declarations as inert. That coversdisplay, flex and grid properties,width/height/min-*/max-*, zero margins and padding,position: relativewith zero offsets,box-sizingandoverflow: visible. The evidence proved the box contributes nothing at every viewport, so these declarations need neither composition nor a pin. Inherited text properties (color, font, line-height, letter-spacing, text-align and so on) still compose onto the leaf exactly as today, and paint is already excluded by the classification.has_structure_signals_without_proofandstructural_layout_child_without_proofare class-name guesses about layout. An evidence-neutral wrapper is exempt from both, as it already is fromhas_id_attributeandnon_neutral_geometry_without_proof. Semantic checks still apply: landmark tags,role, interactive attributes and motion tokens.<script>treats Wix'sdata-testidanddata-interact-enteras consumed.Acceptance is unchanged: full tests green with none weakened; Squarespace single-child groups ≤ 556; Wix < 225; max depth not increased; no new parity blockers; the PR stays a draft.
Rework 2 (required): slice 1 is inert on real imports
A/B of
7aad41fdagainst trunk: the Wix and Squarespace demos produce byte-identical published content (single-child groups 225 and 576). I instrumented the real static-site-importer path; every item below was reproduced there.ArtifactCompiler::boxTreeForSource()hashes the document after artifact projectors re-serialize it: the newline after<!DOCTYPE html>and thestyle=""on<html>change, sosource_hashnever matches, and every Wix route loses its evidence. Verify each sidecar'ssource_hashonce, against the original artifact bytes, before any normalizer or projector rewrites them, and carry the verified tree with that source path. Node ids are attributes and survive re-serialization; elements a projector creates have no id and areload_bearing. Add one end-to-end contract test that compiles an artifact whose document is re-serialized before HTML compilation (<!DOCTYPE html><html style="">…with a sidecar bound to those raw bytes) and asserts that a neutral wrapper folds.blocks-engine/box-tree/v3. data-liberation-agent has exported compact v3 sidecars since feat(export): write box-tree sidecars as compact v3 data-liberation-agent#2063: each viewport'sused_styles(andpseudo.*.used_styles) is an integer index into the top-levelstylesarray.Contract\BoxTree::SCHEMAaccepts only v2, so every current capture, including the Squarespace demo, is rejected. Accept v2 and v3 in one contract reader that expands v3 into the v2 shape, wherever sidecars are read, including the static-site-importer binding throughBoxTree::isSidecarPathand its schema checks. Add a table-driven v2/v3 equivalence test.getComputedStylereportstop/right/bottom/leftas resolved px, soautocomes back as0px. Treat0pxas inert, and ignore offsets entirely whenpositionisstatic. A non-zero offset isload_bearing, notinset_only. On the Wix demo, 127 wrappers are currently refused asinset:top.WrapperCoalescerrefuses the fold when the leaf carries an id or anchor ('' !== trim(SourceDom::attr($leaf, 'id'))). The leaf keeps its own id after the fold, so that is not a reason to refuse. Refuse only when the wrapper's id would be dropped or would collide with the leaf's. Wix gives every element an id, so this blocks most Wix folds.~/cal/bt/v8/sdnunca.wixsite.com-my-site-1and~/cal/bt/sq5/bedford-demo.squarespace.com.Acceptance is unchanged: full tests green with none weakened; Squarespace single-child groups ≤ 556; Wix < 225; max depth not increased; no new parity blockers; the PR stays a draft.
Summary
This is slice 1 of ADR 0006. A new class reads each route's
box-tree/<route>.jsonevidence (blocks-engine/box-tree/v2). It maps source elements to evidence nodes bydata-blocks-engine-node-idand answers neutral, inset_only or load_bearing, with a reason. A node with no evidence is load_bearing. The resolved-style fold already on this branch now runs only when the wrapper, and every wrapper between it and the leaf, is neutral at every captured viewport. With that evidence, the CSS-only refusals on position, size, margin and float are relaxed. Rules whose match changes are still restated as engine-owned rules on the node they applied to; state, pseudo-element and device-gated rules still keep the wrapper. Id transfer is refused off shell edges and anchor targets, the data guard now applies only to consumed attributes, and repeated siblings must all be neutral before any of them folds. Without evidence, nothing changes: the three test files this branch had edited are restored to trunk, and a new test compares output against a golden file generated from trunk 71c4dcf. Not run: the Wix/Squarespace A/B, the fullcomposer testgate andcomposer topology-diff. Box-tree evidence reaches the per-document ArtifactCompiler path only; I didn't wire the staged transport path.What changed
src/HtmlToBlocks/Elements/BoxTreeWrapperEvidence.php, the evidence reader. It treats a wrapper as neutral when, at every viewport, it is visible, paints and clips nothing, and its single child's border box equals its own within 0.5px. It must also be static, or relative with auto insets and no absolutely positioned descendant using it as its containing block, with float none, z-index auto and animation none. A missing node, a duplicated id or a missing viewport counts as load_bearing.ArtifactCompiler::boxTreeForSource()picks the one sidecar whosesource_pathnames the document and whosesource_hashis the SHA-256 of its bytes, and passes it as thebox_treeoption. Stale, ambiguous or malformed sidecars are ignored. The session builds the evidence object from that option.WrapperCoalescer::resolvedCompositionCoalescingreturns early unless the wrapper and every intermediate wrapper are neutral. It skips the id, data and inline-geometry checks that evidence covers, and addsisReferenceTarget,hasConsumedDataAttributesand an id-aware shell-edge guard. The repeated-sibling check now applies to every block type and requires each sibling to be neutral.ResolvedWrapperComposition::prove()takes a size-transfer flag. With evidence: relative position drops, float drops only if its rule is lost, and margins move onto the leaf. Sizes move only when the leaf is border-box or has no padding or border. The leaf's own properties are still read from authored values only.tests/contract/geometry-wrapper-chain-fold.php,tests/contract/run.phpandtests/unit/author-selector-semantics.phpto their trunk versions.tests/contract/resolved-wrapper-composition.phparound a genuinely neutral, positioned, sized and centred.lane, with evidence. It checks that size, centring and position move onto the merged group and that inherited and ancestor-scoped styles still resolve at 390 and 1440px.tests/contract/box-tree-neutral-wrapper-collapse.php, a table-driven test. The neutral case folds and restates the lost child-combinator rule. Refusal cases: paint, containing block, inset, hidden at one viewport, unequal child box and missing evidence. Each refusal converts byte-identically to no evidence, stale evidence changes nothing, and no node id reaches the output.tests/contract/box-tree-evidence-monotonic.phpandtests/fixtures/box-tree-monotonic/(expected.jsongenerated from trunk 71c4dcf). Output without evidence, with node ids but no sidecar, and with another route's sidecar all match trunk exactly. Unrelated future changes to how this fixture converts will require regeneratingexpected.json.tests/contract/box-tree-evidence-fixture.php.Verification
0c7fde4. Basetrunk@469f02badvanced to9802cc2(base_behind_by: 5; rebase onto the current base before merging). 479763 ms; retained gate metadata.Cook run
84f63850649c176266f94da13a2da7fd99f01531Evidence
AI disclosure
Tool: Homeboy Cook. Agent: Homeboy (pi). Model: Pi · route roadie/cook-heavy · served claude-opus-5-5. Cook time: 31m08s.
PR #7420 rework into slice 1 of ADR 0006 (refs #7454, #7456, #7379). The PR should stay a draft until the requester's Wix/Squarespace A/B passes, under the direction of the Cook requester. Gates were run by Homeboy. A human reviews before merge.