Skip to content

Add Zod input validation to server routes #115

Description

@bharatsachya

Type: refactor / robustness · Difficulty: medium

Server routes hand-roll typeof checks instead of validating with Zod, which CLAUDE.md requires before queue submission (Principle 7 + Rule of Queue Safety). @bb/mcp tools already use Zod inputSchema — mirror that pattern.

Files: packages/server/src/githubIndexRoute.ts:16, localIndexRoute.ts:18, githubPullRoute.ts:38, githubProbeRoute.ts:13, githubCommitsRoute.ts:34. @bb/server has no zod dep yet (config/mcp do).

Do: bun add zod to @bb/server; define a small request schema per route; .safeParse(req.body) and return 400 with flattened issues on failure.

Done when: each listed route validates via Zod and returns a structured 400; bad payloads no longer reach the queue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions