chore(deps): upgrade zod to v4 - #35
Conversation
Bump zod from ^3.23.0 to ^4.4.3 and migrate the breaking/deprecated APIs: - `ZodError.errors` was removed in v4; `createTrajectory`/`completeTrajectory` now read `error.issues[0]` (typecheck failed on the old property). - `z.string().url()` -> `z.url()` and `z.string().datetime()` -> `z.iso.datetime()`, the non-deprecated v4 top-level forms. Custom validation messages, issue paths, and the `describeReadFailure` / `FileStorage.save` error rendering all keep their existing shape. Typecheck, build, lint, and the full 257-test suite pass, and a CLI smoke test (start -> decision -> complete -> list) round-trips through the write-side `validateTrajectory` and read-side schema parse. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K2zPEUnsjW36Ezbg7gYm9x
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR upgrades Zod from 3.23.0 to 4.4.3, updates validation error access, and replaces URL and generic datetime validators with Zod 4 URL and ISO datetime validators across trajectory schemas. ChangesZod 4 validation migration
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bumps
zodfrom^3.23.0to^4.4.3and migrates the affected APIs.Changes
One hard break.
ZodError.errorswas removed in v4.createTrajectoryandcompleteTrajectory(src/core/trajectory.ts:48,:218) readvalidation.error.errors[0]to surface the first message to the user; both now read.issues[0].tsccaught these two and nothing else.Deprecated spellings updated.
z.string().url()→z.url()(2 sites) andz.string().datetime()→z.iso.datetime()(9 sites) insrc/core/schema.ts. These still function in v4 but are deprecated in favour of the top-level forms.Everything else was already v4-compatible. Notably
describeReadFailure(src/storage/file.ts:164) andFileStorage.save(:427) both walk.issueswithpath/message, which is unchanged, so the quarantine and save-rejection messages keep their existing shape.Verification
npm run typecheck,npm run build,npm run lint— cleannpm run test:run— 257/257 passdist:start → decision → complete → list, which exercises the write-sidevalidateTrajectoryand the read-side schema parseid: Invalid trajectory ID formatrather than v4's new generic wordingNote for whoever cuts the release
tsupexternalizes dependencies, so zod is not bundled intodist— the publishedagent-trajectoriespackage imports it at runtime. This bump therefore reaches consumers: anyone installing the next release pulls zod v4 instead of v3. npm resolution handles it fine (a consumer pinned to v3 just gets a nested v4), but it's a real dependency change in a published package rather than a dev-only bump, so it may warrant a minor rather than a patch.Releases here are cut by pushing a
v*tag, so that version choice is a manual call — nothing in this PR forces it.CHANGELOG.mdis left untouched since it's generated.Generated by Claude Code