Skip to content

feat(a2ui): validation checks + client error message (Phase 3 of the v0.9 migration) - #819

Merged
blove merged 4 commits into
mainfrom
blove/a2ui-v09-phase3
Aug 17, 2026
Merged

feat(a2ui): validation checks + client error message (Phase 3 of the v0.9 migration)#819
blove merged 4 commits into
mainfrom
blove/a2ui-v09-phase3

Conversation

@blove

@blove blove commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 3 of the A2UI v0.9.1 migration (follows #817, #818): client-side validation per the official CheckRule schema, plus a correctness fix that makes event-time values live.

  • @threadplane/a2ui: A2uiCheck corrected to the official CheckRule shape ({condition: DynamicBoolean, message}); validator functions added to the standard registry — required, regex, length, numeric, email (all linear-time; composable with and/or/not).
  • @threadplane/chat: <a2ui-surface> now owns the render StateStore (seed-preserve semantics copied from chat-generative-ui) and passes it to <render-spec>, so event-time logic sees current user input. On an event action: every check rule evaluates against dataModel ∪ store snapshot; failures block the action, write per-component messages to reserved /_a2uiChecks/<id> store paths that checkable catalog inputs bind for reactive inline display, and emit a spec {"error":{"code":"VALIDATION_FAILED",...}} through the new validationError output. TextField.validationRegexp (with a bound value) is enforced as an implicit regex rule. Action-context {path} values are now live $bindState markers substituted at dispatch time — fixing the pre-existing gap where contexts froze the agent-seeded snapshot and user-typed values never reached the agent.
  • Prompts/docs: schema prompt (byte-identical twins) documents checks + validators; docs updated from "typed, not enforced" to shipped semantics; api-docs regenerated.

Additive; the only public-type change (A2uiCheck) was unused before this phase. Plan: docs/superpowers/plans/2026-08-17-a2ui-v09-phase3-checks.md.

Verification

  • libs/a2ui 92 unit tests, libs/chat 1133 — green; both libs build + lint clean; pytest twins 56 + 23 passed
  • nx affected -t lint test build: green except the pre-existing cockpit-telemetry:lint worktree-environment failure (untouched project)
  • Live Chrome smoke (real gpt-5-mini): prompted for a signup form with required + email checks. Empty submit → inline "Email is required", no agent turn; invalid value → "Enter a valid email" (live-typed value); valid value → action dispatched and the agent replied "got the subscribe event with email: brian@cacheplane.ai" — the live-typed context value round-tripped.

🤖 Generated with Claude Code

blove and others added 4 commits August 17, 2026 10:18
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntext (Phase 3)

<a2ui-surface> owns the render state store (seed-preserve semantics), so
checks and {path} action-context values resolve against current user input;
failing checks block the event, render inline messages via /_a2uiChecks/<id>
bindings, and emit a VALIDATION_FAILED A2uiErrorMessage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview Aug 17, 2026 5:30pm

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@blove
blove merged commit 10b5ea8 into main Aug 17, 2026
68 of 70 checks passed
@blove
blove deleted the blove/a2ui-v09-phase3 branch August 17, 2026 17:54
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