Named Zod schemas live per package
Reading of harness/docs/decisions/schemas-per-package.md. If this page and that file disagree, the source file wins.
Named Zod schemas live per package
Section titled “Named Zod schemas live per package”Decision
Section titled “Decision”Named Zod parsers sit under each package’s own src/schemas/. That directory is the sole definition home.
Files that were the established public import seat re-export from there, so existing imports do not fan out: protocol.ts, driver config.ts, register.ts, channel.ts.
There is no monorepo-wide schema dump and no dual definitions. Do not add either.
These stay in place, not moved: Arrival sz + EnvCapability.define configuration, openai-compat adapter wireSchema, inline InhumanTool input:, merge.ts stem-name refine, and the JSON-Schema interpreters in pretty-mcp / schema-repair.
dist/ from before this move may still point at well-known/, shape.js, or tingle types.js. Rebuild those packages before publishing.
See also: fail-laws-are-load-bearing.md.
Forced by
Section titled “Forced by”A schema’s home is the package that owns the shape. A single shared dump inverts that. Every package imports across the workspace, and a change to one shape recompiles everything. Re-export hops keep the public surface where consumers already point, so a schema move is a one-line re-export rather than an import rewrite across packages.