refactor(blocks-engine): add a provider-neutral form materializer seam - #1561
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1554
What
Introduces a typed
FormMaterializercontract (markup,unsupported,diagnostics) and threads it throughSiteToThemeOptionsandSectionRenderOptions, 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.tscalledformToBlocks()directly, so the generic engine could only emitjetpack/*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/htmlform; that was rejected because this stack treatscore/htmlin 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 --noEmitclean.Engine reconstruct DLA baseline parity: cases=35 diffs=0, so emitted markup and provenance flags are byte-identical to trunk.AI assistance
OpenAI
gpt-5.6-solrunning 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.