- validators: at most 200 operations per sync batch (SYNC_MAX_OPERATIONS),
length checked before the elements (z.array(z.unknown()).max(n).pipe),
idempotency keys must be UUIDs; same pre-check on reorder ids (1000) and
task tag ids (100).
- parseBody: a 400 carries only the first zod issue, at most 200 characters.
- idempotency: per-account store in insertion order, 5000 keys per account
(oldest evicted), cleanup drops expired keys and empty accounts; the sync
route uses it instead of its unbounded Map.
- middleware.test.ts: every matcher covers /api/sync, the condition for
Next's 10 MB body cut.
- REVIEW.md: idempotency.ts joins the high-level API row, new zone rules;
scripts/review-levels.py follows.
Refs #147
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>