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:
commits, runs, gates and turns used to clamp a too-large limit to their maximum; they answer 422 now.
maintenance/runs used to fall back to 20 on a bad limit and accept any size; it is 1 to 100 now.
explore answered a bad cursor with a 400; it is a 422 now. fleet/ops and runs used to ignore a bad cursor; they refuse it.
user/repos is the exception: it keeps Gitea's clamping page and limit, because forges connecting as an origin send those, and the contract states no maximum for it.
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: