Skip to content

Intent: reject malformed input without partial content - #135

Merged
noeltock merged 3 commits into
mainfrom
fix/127-malformed-intent
Oct 4, 2026
Merged

noeltock merged 3 commits into
mainfrom
fix/127-malformed-intent

Conversation

@noeltock

@noeltock noeltock commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Problem

Malformed intent nodes, list items and table cells could disappear or become empty content while reporting success. Closes #127.

Solution

Reject malformed values where the existing assembly walk consumes them. Errors identify the input path and expected shape; realize returns its existing failed report and low-level assemble rejects.

Behaviour Read first Proof
Invalid nodes, children, items and cells report their locations src/intent/index.ts Parameterized intent regressions
Valid wrappers, native tables and unused shorthand retain precedence dev/test/intent.test.ts Positive controls
Fail before media processing and preserve existing output dev/test/intent.test.ts; dev/test/cli.test.ts Resolver spy and CLI output sentinel

Diff

+100 / −19 across three files.

 assembleWithWp(nodes, intentPath)
- missing block name -> skip node
+ malformed node or children -> throw path-located error
 assembleNode
- consume unchecked list items / table cells
+ check consumed string values at their input paths
 realize catch -> invalid report, empty output

Testing & verification

Reviewed revision: de9f02a60a098e2404dfb6b94352569b004ba730 · Environment: Node 24.18.0, macOS arm64.

Not verified: destination-site rendering or manual editor acceptance. These are input-construction checks against the pinned headless runtime.

Risk / rollout

Malformed input now fails instead of returning partial content. The attribute envelope remains open; no preflight schema or coercion is introduced.

Detection: input-path regression tests and CLI sentinel checks. Rollback: revert this PR; doing so restores the previous partial-output behavior.

@noeltock
noeltock merged commit b97b523 into main Oct 4, 2026
9 checks passed
@noeltock
noeltock deleted the fix/127-malformed-intent branch October 4, 2026 03:55
@noeltock noeltock mentioned this pull request Oct 4, 2026
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.

Intent: stop turning malformed input into partial content

1 participant