One refusal for a bad limit

Every list route under /api/v1 reads ?limit= through src/contract/page_query.ts. A value that is not a whole number from 1 to the route's own maximum (the maximum the route states in contract/openapi.json) is a 422:

{ "error": "invalid_limit", "field": "limit", "message": "limit is a whole number from 1 to 100" }

A bad cursor is a 422 invalid_cursor with field: "cursor", from the same file (parseCursor). Nothing is clamped. parseLimit and parseCursor in src/contract/page_query.ts are the only parsers: a whole number is one to six digits everywhere.

What changed for a caller

This is breaking where a route used to be lenient:

GET /api/v1/explore used to answer error: "invalid". That code rides as legacy_error: "invalid" for one release, then goes.

test/list-limit-shape.test.ts walks the contract's list routes and fails when one answers its own shape.

The list routes

Every GET route the contract gives a limit, read by parseLimit (directly, or through offsetQuery, keyedWindow, readLimit, eventsLimit, decisionsLimit, searchRefusal). The test walks this list from the contract, so a box is ticked only while the walk passes. Not ticked, and why:

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs