Skip to content

improvement(repo): zod based client-server boundary#4355

Merged
icecrasher321 merged 11 commits intostagingfrom
dev
Apr 30, 2026
Merged

improvement(repo): zod based client-server boundary#4355
icecrasher321 merged 11 commits intostagingfrom
dev

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

@icecrasher321 icecrasher321 commented Apr 30, 2026

Summary

Zod v4 based client-server boundary. Linters to enforce best practices with baseline exceptions.

Type of Change

  • Other: Code Refactor

Testing

Tested all core paths manually with @TheodoreSpeaks

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

icecrasher321 and others added 4 commits April 29, 2026 10:27
* improvement(repo): zod schema contracts

* type checks

* fix(notion): correctly register tool (#4337)

* fix func blokc

* more improvements

* fix tests

* type check

* remove v3 refs

* minor type improvements

* address comments
… usage (#4352)

* improvement(repo): consolidation of boundary helpers + better unknown usage

* address comments
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 30, 2026 7:16pm

Request Review

@icecrasher321 icecrasher321 changed the title improvement(types): zod base client-server boundary improvement(types): zod based client-server boundary Apr 30, 2026
@icecrasher321 icecrasher321 changed the title improvement(types): zod based client-server boundary improvement(repo): zod based client-server boundary Apr 30, 2026
@icecrasher321 icecrasher321 marked this pull request as ready for review April 30, 2026 19:04
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 30, 2026

PR Summary

Medium Risk
Touches many API route boundaries and validation/error-handling paths, plus adds a strict CI audit; regressions could surface as 400/401 behavior changes or unexpected validation failures. Upgrade to Zod v4 in apps/realtime also changes error shapes (issues vs errors) and env parsing output.

Overview
Enforces a contract-driven client/server boundary policy across apps/sim by documenting and standardizing that API routes must validate via shared contracts (no route-local Zod schemas) and clients must use requestJson(contract, ...) with contract-exported type aliases.

Updates multiple apps/sim/app/api/** routes (auth, billing, chat, audit logs, A2A) to replace request.json() + local Zod parsing with parseRequest(contract, ...), improving consistent validation responses and removing ad-hoc query/body handling.

Adds a strict API boundary audit to CI (bun run check:api-validation:strict) and expands internal docs/rules (AGENTS/Claude/Cursor skills) describing allowed exception annotations and enforcement.

Separately upgrades apps/realtime to Zod v4, adjusting env error formatting and validation error handling (error.issues), plus a small bugfix in variable operations using workflowId from outer scope.

Reviewed by Cursor Bugbot for commit 02ecefe. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 02ecefe. Configure here.

Comment thread apps/sim/lib/api/contracts/selectors/wealthbox.ts
@icecrasher321 icecrasher321 merged commit b8959eb into staging Apr 30, 2026
20 checks passed
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