Skip to content

fix(deps): bump zod to 4 past the oversized-collection advisory - #28

Merged
tms-anhnguyen1 merged 1 commit into
mainfrom
fix/zod-4
Oct 28, 2026
Merged

tms-anhnguyen1 merged 1 commit into
mainfrom
fix/zod-4

Conversation

@tms-anhnguyen1

Copy link
Copy Markdown
Contributor

Zod before 4.6.6 can exhaust memory while validating oversized constrained collections (Dependabot alert #12, high). No 3.x release carries the fix, so this moves zod from ^3.24.1 to ^4.6.7.

  • Schemas unchanged except the deprecated z.string().url() becoming z.url() in src/upstream.ts.
  • New test: upstream.yaml still rejects a non-https repo and a relative license_url. It passes on zod 3 and 4 alike, so URL validation did not shift.
  • npm run check: 190 tests, 100% coverage. npm audit --omit=dev: 0 vulnerabilities.
  • Smoke test: generate --framework rails --framework react --write then check exits 0.

Trade-off: dist/agent-stack.mjs grows from about 432 kB to 1.05 MB, because zod 4's classic API pulls in its locales.

Zod before 4.6.6 can exhaust memory while validating oversized constrained collections (Dependabot alert #12, high). No 3.x release carries the fix, so this moves to zod 4.

The schemas need no change beyond replacing the deprecated z.string().url() with z.url(). A test now pins that upstream.yaml still rejects a non-https repo and a relative licence URL; it passes on zod 3 and 4 alike.

The bundle grows from about 432 kB to 1.05 MB, since zod 4 ships its locales with the classic API.
@tms-anhnguyen1
tms-anhnguyen1 merged commit d57f2e4 into main Oct 28, 2026
2 checks passed
@tms-anhnguyen1
tms-anhnguyen1 deleted the fix/zod-4 branch October 28, 2026 07:00
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