Skip to content

Intent: reject malformed input without partial content - #134

Closed
noeltock wants to merge 2 commits into
mainfrom
codex/127-reject-malformed-intent
Closed

noeltock wants to merge 2 commits into
mainfrom
codex/127-reject-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: 89d07107d2c8861f3c0758aa96c8ba63a78db455 · Environment: Node 24.18.0, macOS arm64.

  • npm run typecheck: passed.
  • git diff --check: passed.
  • npx vitest run dev/test/intent.test.ts dev/test/cli.test.ts: running; result will be recorded before merge.
  • Full PR CI is required before merge.

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 closed this Oct 4, 2026
@noeltock
noeltock deleted the codex/127-reject-malformed-intent branch October 4, 2026 03:39
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