testing/surface_invariants.ts view source
(surface: AppSurface): void Routes declaring 404 error schemas should use specific z.literal() or z.enum()
error codes, not generic z.string().
A generic 404 schema (ApiError with z.string()) means the error code is
unconstrained — the handler could return any string, making client error handling
fragile. Routes with params (:id) are the primary 404 producers; their error
schemas should use specific constants like ERROR_ACCOUNT_NOT_FOUND.
Only flags routes that have params_schema (param-driven resource lookup) — routes
declaring 404 for other reasons (e.g., bootstrap not configured) may legitimately
use generic schemas.
surface
returns
void