# System map — colinhacks/zod

> Canonical page: https://codevetter.com/unpack/zod/system-map

# System map — colinhacks/zod

Scanned commit 10dda3a3a4bc76ed0bf83e994de194587e489ef8 (2026-09-21). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The repository is a Nub-managed ESM monorepo whose principal deliverables are the `zod` and `@zod/mini` packages. Zod v4 is layered into a shared core, a fluent classic facade, and a functional mini facade; v3 remains published through a separate compatibility entrypoint. Runtime validation is entirely in-process, while the repository also contains a statically generated Next.js documentation application and maintenance scripts that access GitHub, npm, JSR, and the ISO currency source. Publishing is a manually dispatched, approval-gated GitHub Actions workflow rather than an automatic deployment from `main`.
- The root workspace is private, ESM-only, pinned to Nub 0.8.3, and discovers packages through `packages/*`; root scripts build `zod` and `@zod/mini`, run Vitest, check formatting, linting, circular dependencies, version consistency, comments, and release lockstep. — [package.json#L1-10](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/package.json#L1-L10) [package.json#L69-95](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/package.json#L69-L95)
- The published `zod` package exposes root, mini, compile, locales, v3, v4, v4-mini, v4/mini, v4/core, and locale wildcard subpaths for source, ESM, CommonJS, and declarations. — [packages/zod/package.json#L35-56](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/package.json#L35-L56) [packages/zod/package.json#L58-125](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/package.json#L58-L125)
- The root `zod` entrypoint re-exports the v4 classic facade, while separate entrypoints route `zod/mini` to the v4 mini facade and `zod/v3` to the legacy implementation. — [packages/zod/src/index.ts#L1-7](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/index.ts#L1-L7) [packages/zod/src/mini/index.ts#L1-3](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/mini/index.ts#L1-L3) [packages/zod/src/v3/index.ts#L1-4](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v3/index.ts#L1-L4)
- The v4 runtime boundary is explicit: `core/index.ts` exports constructors, parsers, schemas, checks, registries, compilation, and JSON Schema machinery; classic and mini compose those primitives into distinct public APIs. — [packages/zod/src/v4/core/index.ts#L1-19](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/index.ts#L1-L19) [packages/zod/src/v4/classic/external.ts#L1-57](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/external.ts#L1-L57) [packages/zod/src/v4/mini/external.ts#L1-52](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/mini/external.ts#L1-L52)
- Schema instances are trait-composed objects created through `$constructor`; their internal definitions, parse functions, traits, structural metadata, and deferred initialization live under a non-enumerable `_zod` property. — [packages/zod/src/v4/core/core.ts#L7-14](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/core.ts#L7-L14) [packages/zod/src/v4/core/core.ts#L51-145](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/core.ts#L51-L145) [packages/zod/src/v4/core/schemas.ts#L104-179](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/schemas.ts#L104-L179)
- Runtime state is process-local rather than database-backed: global configuration and metadata registries are shared through `globalThis`, while parse-cycle state uses WeakMaps keyed by schemas, objects, and parse contexts. — [packages/zod/src/v4/core/core.ts#L190-229](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/core.ts#L190-L229) [packages/zod/src/v4/core/registries.ts#L27-77](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/registries.ts#L27-L77) [packages/zod/src/v4/core/registries.ts#L94-105](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/registries.ts#L94-L105) [packages/zod/src/v4/core/memoizer.ts#L12-29](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/memoizer.ts#L12-L29)
- The documentation application is a Next.js 15 and React 19 workspace using Fumadocs, Tailwind, Vercel Analytics, and Inkeep search/chat; its content is compiled from MDX collections. — [packages/docs/package.json#L5-39](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/package.json#L5-L39) [packages/docs/source.config.ts#L1-20](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/source.config.ts#L1-L20) [packages/docs/app/layout.tsx#L1-49](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/app/layout.tsx#L1-L49)
- Auxiliary workspaces separate concerns: `packages/bench` benchmarks competing validators, `packages/integration` type-checks Drizzle and AI SDK fixtures, `packages/resolution` verifies built module resolution, and `packages/treeshake` measures bundler behavior. — [packages/bench/package.json#L1-20](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/bench/package.json#L1-L20) [packages/integration/package.json#L1-23](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/integration/package.json#L1-L23) [packages/resolution/package.json#L1-34](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/resolution/package.json#L1-L34) [packages/treeshake/package.json#L1-24](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/treeshake/package.json#L1-L24)
- The normal build uses zshy to emit the packages and declarations, while package exports select raw TypeScript only under the private `@zod/source` condition used by repository development and tests. — [packages/zod/package.json#L38-56](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/package.json#L38-L56) [packages/zod/package.json#L139-145](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/package.json#L139-L145) [tsconfig.json#L1-11](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/tsconfig.json#L1-L11)
- Production documentation deployment is shaped for Vercel: the install command bootstraps the pinned Nub release, installs the monorepo lockfile, and then runs the repository build. — [packages/docs/vercel.json#L1-5](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/vercel.json#L1-L5) [packages/docs/next.config.mjs#L36-41](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/next.config.mjs#L36-L41)
- Release deployment is manual and approval-gated: the workflow tests, builds, validates package resolution, publishes both packages to npm and JSR with provenance, creates a GitHub release, and verifies the two packages remain version-aligned. — [.github/workflows/release.yml#L3-7](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/release.yml#L3-L7) [.github/workflows/release.yml#L67-95](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/release.yml#L67-L95) [.github/workflows/release.yml#L104-129](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/release.yml#L104-L129) [.github/workflows/release.yml#L148-216](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/release.yml#L148-L216)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
