Skip to content

fix(json): index the WordPress block manifest - #3576

Open
L4XB wants to merge 1 commit into
Graphify-Labs:v8from
L4XB:fix/3574-block-json-manifest
Open

L4XB wants to merge 1 commit into
Graphify-Labs:v8from
L4XB:fix/3574-block-json-manifest

Conversation

@L4XB

@L4XB L4XB commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Part 1 of #3574.

block.json is in neither _CONFIG_JSON_NAMES nor the top-level key probe, so _is_config_json reads it as data JSON and the structural pass skips it (the #1224 behaviour). On the reporter's repo of 73 WordPress blocks, 72 produced zero nodes. The one that did produce nodes declared a top-level "$schema", which trips the probe by accident rather than by intent.

It belongs on the allowlist. It is a manifest in the same sense package.json is, and it carries exactly the relationships a block graph exists to answer questions about: parent, ancestor, allowedBlocks, providesContext / usesContext, and the editorScript / style handles. It is the file that says which blocks may nest inside which.

The workaround available today is adding "$schema": "https://schemas.wp.org/trunk/block.json" to every block, which is valid WordPress practice but means touching every block in the repo to get a graph.

Test

One cell in tests/test_extract.py, next to the existing filename and key-probe cells. It uses a manifest with no $schema, so it grades the allowlist rather than the probe. On v8:

>       assert len(result["nodes"]) > 0
E       assert 0 > 0
FAILED tests/test_extract.py::test_extract_json_wordpress_block_manifest

tests/test_extract.py is green at 227 passed, 4 skipped.

Parts 2 and 3 of #3574 are separate: the AST cache pinning node IDs to the original extraction root is the serious one and is not touched here.

`block.json` was in neither `_CONFIG_JSON_NAMES` nor the top-level key probe,
so the structural pass treated it as data JSON and skipped it. On a repo of 73
blocks only one produced nodes, and only because it happened to declare
`$schema`, which trips the probe by accident.

It is a manifest in the same sense `package.json` is, and it carries the
relationships a block graph exists for: `parent`, `ancestor`, `allowedBlocks`,
`providesContext` / `usesContext`, and the `editorScript` / `style` handles.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).


Graphify review — findings

Adds block.json to the JSON config filename allowlist so WordPress block manifests are indexed by name rather than only when they declare a $schema key, and covers it with a test asserting such a manifest produces nodes instead of being skipped.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 427 functions depend on the 427 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract_json() — 17 callers, 7 callees
  • new: walk_object() — 1 callers, 7 callees

Verification — 427 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 427 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

1 of 275 test file(s) selected (0%) via static blast radius.

  • tests/test_extract.py — impact, changed-test

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

· 2 more finding(s) on lines outside this diff (see the check run).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant