mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-12-03 22:12:01 +09:00
zod < 4.6.6 can exhaust memory validating oversized constrained collections
(GHSA-mrhx-c7xc-m3w5, high) and has no 3.x fix. This ports the zod 3 APIs
that break under zod 4:
- ZodError.errors -> .issues (shared config validator, gastown sanitizers,
validators, sync bridge)
- one-argument z.record(value) -> z.record(z.string(), value)
- z.ZodType<Out, ZodTypeDef, In> -> z.ZodType<Out, In>
- prime-radiant: `.default({})` no longer parses the default under zod 4, so
nested defaults were dropped; the default now parses `{}`
- gastown: MCP inputSchema conversion reads zod 4's `_def.shape`/`_def.type`
The shared and plugin source ports are taken from #4535 by Dragan
Spiridonov (proffesor-for-testing), applied onto current main.
gastown-bridge also drops `uuid` (GHSA-w5hq-g745-h8pq): it only generated
v4 convoy IDs, now `crypto.randomUUID()`.
Tests: every v3 plugin gets a red/green zod floor test against its real
input schema. An oversized bounded array of invalid elements yields one
`too_big` issue under zod >= 4.6.6 and one issue per element below it; the
tests fail on main's source with zod 3.25.76 and pass here.
Co-authored-by: Dragan Spiridonov <spiridonovdragan@gmail.com>
Co-Authored-By: claude-flow <ruv@ruv.net>