Validate published errors against API-owned response contracts
Projects authentication can return {status, message}, while the published 401 schema required error. This preserves the existing wire behavior, derives the shared error schemas from API-owned Zod types, and validates selected published schemas against actual Artist Profile and Project GET exports. Shared auth helpers now use typed response constructors. Projects' authentication union is limited to 401; its 400, 404 and 500 responses still require error.
Merge this API change before recoupable/marketing#175, then the generated copy recoupable/docs#376. Marketing pins API 4dd3a1debfed685930cbb50e83d9a08e3ecc5818; the API fixture records Marketing source-file hashes rather than a circular commit pin. The cohesive generated schema artifact and existing shared fixture remain single files so the pinned export/check boundary stays atomic.
Validation: 105 focused contract/auth/project/networking/artist tests and strict response type checks pass; changed TypeScript lint passes and repository lint/format/OAuth compatibility CI are green. Tests reject the historical Artist schema and missing producer fields. The distinct project/account fixture rejects swapped access arguments. All 28 published error responses across seven Projects operations accept message-only bodies only at 401. Deliberately dropping resolver required-fields or exporter method identity still exports fixtures but makes the API contract gate fail; restoring the code passes. Profile, project-access and credential dependencies are mocked in local route tests.
On the exact Vercel deployment for dcd8022ceecc0cea09a61c0791ad9444ee0c7814, a Projects GET without credentials returned the expected 401 {status, error}, and malformed Authorization: invalid-token returned the expected 401 {status, message}. The auth helpers, response constructors, access function, handlers and route exports remain byte-identical to that observed revision. No valid identity, customer access or paid operation was used.
Scope note: the existing token-verification catch can return a caught Error.message to the caller. That behavior predates this change and is deliberately preserved; sanitization requires a separately scoped compatibility/security change and is not claimed fixed here.