Files
ruflo/v3/plugins/quantum-optimizer/tests
2d789faadc fix(zod4): port shared and v3 plugin schemas to zod 4; gastown convoy IDs from crypto.randomUUID
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>
2026-11-09 02:20:56 -05:00
..