non core block: authored-input

Open
#6,168 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
html, javascript, node.js, php, wordpress
Domain
frontend, tooling

Research direction

Start from tools/import-loop/predicates/non_core_block.mjs in a static-site-importer checkout at 4be4e5ec; run it with reduced.html against <blocks-engine>/php-transformer as the command shows, and read emits.mjs/gates/collateral.mjs for the pass condition. Then trace where php-transformer turns the reduced input into an authored-input block and find the core-block equivalent. Done means the predicate no longer exits 0 on this page and the pixel-parity gate still passes.

Written by the indexing model from the issue text.

Description

Finding

editability/non_core_block on authored-input, seen in 1 route/width cell(s) of an imported site:

route width evidence
/advisor/ 1440 {"count":1,"of":22}

Reduced page (364 bytes)

Reduced from 101635 bytes in 37 predicate calls.

<!DOCTYPE html><html><head></head><body><input data-blocks-engine-capture-native-control-state="{&quot;version&quot;:1,&quot;kind&quot;:&quot;input&quot;,&quot;type&quot;:&quot;text&quot;,&quot;value&quot;:&quot;&quot;,&quot;defaultValue&quot;:&quot;&quot;,&quot;checked&quot;:false,&quot;defaultChecked&quot;:false,&quot;indeterminate&quot;:false}"></body></html>

Reproduce

The predicate exits 0 while the defect reproduces (checked against blocks-engine trunk 3d3f7d6ad). Run it from a static-site-importer checkout at 4be4e5ec, with the reduced page saved as reduced.html:

PREDICATE_TARGET='{"subject":"authored-input","route":"/advisor/","width":1440,"evidence":{"count":1,"of":22}}' \
  WORDPRESS_PATH=<wordpress with static-site-importer active> WP_CLI='studio wp' \
  node tools/import-loop/predicates/non_core_block.mjs <blocks-engine>/php-transformer reduced.html
predicates/non_core_block.mjs
// Exit 0 while the Blocks Engine output of a page still emits the generated
// block <prefix>/<subject>, a block outside WordPress core. An editor can only
// change its structure through the importer's own block, not with core tools.
// The defect is gone when the same content is built from core blocks and the
// page renders exactly as before; the acceptance gate holds the whole import to
// pixel parity (see emits.mjs, gates/collateral.mjs).
import { exitWhileEmitted } from './emits.mjs';
exitWhileEmitted();

Loop signature: d48272d9ff75


AI disclosure: filed by the static-site import findings loop (Homeboy workflow on the Lab). The finding, reduction, and body are generated by deterministic scripts; Claude (Anthropic) wrote those scripts with Chris Huber.

Dominant language
PHP
Stars
28
Forks
5
Avg merge
2h 59m
Merged PRs (30d)
942

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Automattic/blocks-engine

All issues in Automattic/blocks-engine

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.