Skip to content

Validate conditional branch structure when requested - #400

Closed
fzdwx wants to merge 1 commit into
vercel-labs:mainfrom
fzdwx:codex/validate-conditional-branches
Closed

fzdwx wants to merge 1 commit into
vercel-labs:mainfrom
fzdwx:codex/validate-conditional-branches

Conversation

@fzdwx

@fzdwx fzdwx commented Oct 17, 2026

Copy link
Copy Markdown

When a model puts $then and $else inside $cond, structural validation currently accepts the spec even though the conditional resolver expects sibling branches. Hosts can then render an object as a label or write an unintended value instead of requesting a repair.

Add the opt-in checkConditionalBranches option to validateSpec. It walks props, event actions and watchers, including nested values, and reports invalid_conditional_branches with the expression’s JSON Pointer in both issue.path and the formatted message. The default remains off, initial state is excluded, and no expression is evaluated or rewritten. README, API documentation and the core skill describe the option.

Validation: all 40 spec-validator tests pass, the existing core tsconfig.check.json check passes, and ESM/CJS/declaration builds pass. The whole-workspace type-check could not run in this isolated checkout because its workspace dependencies are not installed; the package-manager attempt triggered an automatic install and was stopped.

@vercel

vercel Bot commented Oct 17, 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.

@fzdwx fzdwx closed this Oct 17, 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.

1 participant