Skip to content

feat: diagnose unresolved template state references - #398

Draft
fzdwx wants to merge 1 commit into
vercel-labs:mainfrom
fzdwx:codex/template-reference-validation
Draft

fzdwx wants to merge 1 commit into
vercel-labs:mainfrom
fzdwx:codex/template-reference-validation

Conversation

@fzdwx

@fzdwx fzdwx commented Oct 16, 2026

Copy link
Copy Markdown

A generated selection summary used a JavaScript conditional inside $template. The renderer treated the entire interpolation as a state path and displayed an empty value, while validateSpec reported no issue.

Add opt-in checkTemplateStateRefs validation for absolute template paths. References must resolve in initial state or be covered by a declared binding or literal action write path. Diagnostics include the exact JSON Pointer, including inactive conditional branches and action parameters. The default remains disabled; rendering and expression resolution are unchanged. Literal keys containing operator characters remain valid, and bare repeat-item names are left alone.

Validation:

  • 40 core spec-validator tests passed, including the captured failure pattern and valid literal/future-write/binding references.
  • Core tsconfig.check.json passed.
  • Matching v0.21.0 ESM, CJS and declaration build passed for the downstream consumer.
  • Downstream system Chrome verified the diagnostic and repair payload, then selection and reversible pressed icon feedback in App and a frozen offline file.
  • Full workspace pnpm type-check was attempted but could not start because Turbo/workspace dependencies are not installed in the isolated checkout.

@vercel

vercel Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

@fzdwx is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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