What changed
Bug fixes from dogfooding
-
zod@4 compatibility —
@specferret/corenow depends onzod@4. Previously, consumers on zod@4 got type errors (_ZodBoolean is not assignable to ZodTypeAny) because the library was bound to zod@3 types. Upgrade your project tozod@4to match. -
tree-sitter instance dedup — Fixed
TypeError: SyntaxNode must belong to a Treecaused by Bun workspace loading two separate native instances oftree-sitter. All 18 TypeScript extractor tests now pass. -
Contractcomposition API —defineContractnow returnsschema: ZodObject<T>on every contract. Usecontract.schemafor safe composition (e.g.z.array(contract.schema)) instead of the rawcontract.outputshape object. -
consumes/dependsOnvariance — IntroducedContractReftype.consumesanddependsOnarrays now accept contracts with different output shapes without casting. -
CLI version no longer hardcoded —
ferret --versionreads frompackage.jsonso it can't drift.
Upgrading
bun add @specferret/core@0.4.2
# or
bun add -g @specferret/cli@0.4.2If you were on zod@3, upgrade zod alongside:
bun add zod@4