Skip to content

refactor(blocks-engine): add a provider-neutral form materializer seam - #1561

Merged
chubes4 merged 1 commit into
trunkfrom
refactor/1554-form-strategy
Sep 3, 2026
Merged

refactor(blocks-engine): add a provider-neutral form materializer seam#1561
chubes4 merged 1 commit into
trunkfrom
refactor/1554-form-strategy

Conversation

@chubes4

@chubes4 chubes4 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Closes #1554

What

Introduces a typed FormMaterializer contract (markup, unsupported, diagnostics) and threads it through SiteToThemeOptions and SectionRenderOptions, so a consumer can decide how captured forms are materialized. Jetpack Forms becomes an explicit named adapter (jetpackFormMaterializer) rather than logic hardcoded into reconstruction.

Why

reconstruct.ts called formToBlocks() directly, so the generic engine could only emit jetpack/* blocks and there was no seam for any other provider.

Default behavior is unchanged

The default remains the Jetpack adapter. An earlier draft defaulted to a reconstructed core/html form; that was rejected because this stack treats core/html in page content as a conversion-quality bug, #220 explicitly targets working form blocks over preserved-but-dead markup, and the change measurably dropped section coverage from 1 to 0 in the reconstruct suite.

Verification

  • pnpm exec tsc --noEmit clean.
  • Full package suite: 103 files / 496 tests pass.
  • Engine reconstruct DLA baseline parity: cases=35 diffs=0, so emitted markup and provenance flags are byte-identical to trunk.
  • Added coverage proving a consumer-supplied materializer is honored and reports unsupported controls.

AI assistance

OpenAI gpt-5.6-sol running in OpenCode designed and implemented the seam, corrected the default-behavior regression, and ran the verification above. A human directed the work and reviewed the result.

@chubes4
chubes4 merged commit 598942b into trunk Sep 3, 2026
2 checks passed
@chubes4
chubes4 deleted the refactor/1554-form-strategy branch September 3, 2026 20:24
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.

Make theme form reconstruction provider-neutral

1 participant