fix: strict type safety with Zod validation and comprehensive negative tests#9
Merged
Merged
Conversation
…hensive negative tests - Regenerate types from corrected OpenAPI spec (nullable/default fixes) - Add Zod schema generation pipeline (scripts/generate-zod.mjs -> src/lib/api-zod.generated.ts) - Update YAML validator and transform to use generated Zod schemas - Fix YAML fixtures (frequencySeconds, channelType in config) to match current schema - Add ~130 negative YAML validation tests (test/yaml/negative-validation.test.ts) - Add generated file to eslint ignores - Export ChannelConfigSchema union from zod-schemas.ts Made-with: Cursor
5 tasks
caballeto
added a commit
that referenced
this pull request
May 5, 2026
…confirm (#27) The single-record table renderer used by `monitors create` (and every other CRUD `create` / `get` command) JSON-stringified nested objects in full, so a `MonitorDto.incidentPolicy` blob blew the value column out to ~1500 characters and pushed the freshly-minted monitor id off-screen. Truncate object previews to 80 chars with a `(use --output json for full)` hint so the id and the rest of the record stay readable; JSON / YAML output is untouched. `monitors delete <id>` (and every other CRUD `delete`) now prompts for confirmation showing the resource's name + id (best-effort GET — typo'd ids surface a 404 before the prompt). `--yes` / `-y` skips the prompt for scripted use. In a non-TTY context (CI, piped stdin) we refuse with an EXIT_CODES.VALIDATION error rather than hanging on a prompt that nobody can answer. Round-2 DevEx friction P1 #8 + P1 #9. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/generate-zod.mjs→src/lib/api-zod.generated.ts)frequencySeconds(notfrequency) andconfig.channelType(not top-leveltype)ChannelConfigSchemaunionTest plan
npm run typecheck— 0 errorsnpm run lint— 0 errorsnpm test— all tests passedMade with Cursor