Repository navigation
feat!: migrate public schemas to Zod 4 for Charter 3.0.0 - #413
Merged
Merged
Conversation
This was referenced Nov 1, 2026
stackbilt-admin
marked this pull request as ready for review
November 2, 2026 15:58
stackbilt-admin
added a commit
that referenced
this pull request
Nov 28, 2026
Rename the [Unreleased] content to a [3.0.0] section with a YYYY-MM-DD date placeholder for the release owner, add a fresh empty [Unreleased], and add the missing entries: the Zod 4 breaking change with the migration guide link (#310 / #413), the security pins (#404, #425), the MCP SDK 1.32.1 -> 1.32.2 bump (b38f04a) and the fixes from #398, #399, #400, #341, #389, #401, #402, #403, #409, #410 and #411. Docs only; no package versions or code change. Refs #397 Co-authored-by: Kurt Overmier <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Problem and result
Charter exports Zod schema objects from core, blast, and surface. Moving them from Zod 3 to patched Zod 4 changes their consumer-facing runtime/type APIs, so this PR prepares a unified 3.0.0 major release, rather than concealing the change in a dependency patch. It resolves the remaining HIGH Zod advisory without suppressing the audit.
All five workspace Zod declarations now require
^4.6.6(lockfile: 4.6.7), all 13 published package versions are 3.0.0, and scaffolded Zod dependencies use the same patched floor. The private root version stays 0.11.0. The MCP alias record supplies explicit key and value schemas. Governance identifiers usez.guid()to preserve previously accepted UUID-like identifiers, rather than silently adopting Zod 4's stricter version/variant checks.Migration notes:
docs/migrations/3.0.0-zod-4.md. They explain public schema extension,.issueserror handling, runtime constructor identity, safe-integer/non-finite validation changes, defaults, and unchanged Node engine declarations. No public export is removed or renamed. Existing JSON defaults, unknown-key stripping, map behavior, transforms, and notary checks are covered by regression tests.Closes #310 when merged. Related #397.
Prerequisite and review scope
This branch includes the compatible dependency repair commits from #404, whose tip is
41c32f983df6be971383fef81f2723e4824e8921. The implementation-only comparison is against that commit/branch. The PR targetsmainso the repository'spull_request: branches: [main]CI runs.#404 alone still has the Zod audit failure. This PR supplies the first complete zero-audit candidate; after approval, a merge commit preserving its included #404 ancestry can incorporate both without bypassing #404's red audit gate. Do not merge either PR or publish packages until the release coordinator receives explicit approval. Re-enable Dependabot Zod-major updates only after the migration lands.
Validation evidence
Windows Node 24.19.0 / pnpm 9.15.9, isolated worktree:
pnpm install --no-frozen-lockfileresolved the migration; a subsequent elevatedpnpm install --frozen-lockfile --forcerepaired an interrupted local install and passed without lockfile edits.pnpm run build: passed.pnpm run typecheck: passed.pnpm run publish:check: passed for all packed artifacts.pnpm audit --json: zero vulnerabilities (0 low/moderate/high/critical). Gate remains unchanged. Evidence: coordinatorevidence/issue-310-audit.json.pnpm exec vitest run packages/cli/src/__tests__/zod4-compat.test.ts packages/cli/src/__tests__/serve-zod4.test.ts: 7/7 passed after dependency repair. Includes a real MCP stdio initialize/list-tools/valid-call/invalid-call round trip.pnpm run test: 1,936 passed, 4 failed, 1,940 total, 217.11 seconds. The four failures exactly match the established Windows baseline: bootstrap's POSIX-host path premise, context-refresh and serve-context path separators, and Ctrl-D fake-TTY behavior. No additional failing test identified. Final log: worktree.cache/issue-310-tests-final.log..safeExtend()on the public refined notary schema retains all three cross-field checks.core.whitespace=cr-at-eolfor the existing CRLF core schema file.serve.ts's one-argumentz.record; that actual incompatibility is fixed here. Current context-refresh uses Charter's snapshot parser, rather than the historical Zod-based implementation mentioned in the issue.An earlier test attempt overlapped an interrupted dependency reinstall and is intentionally excluded as invalid evidence. Full Linux/Node 20 CI is required before approval; a green governance workflow summary alone does not prove its advisory
continue-on-errorsteps passed. No merging, tagging, publishing, deployment, production data modification, or remote branch deletion performed.