Skip to content

spec: ADR-0112 error envelope gains an explicit producer-side refusal declaration so a deliberate 5xx refusal can keep its caller-authored message (spec half of #16146) #16335

Description

@os-zhuang

Spec half of #16146, split by director ruling (decision batch #58, 2026-09-06, option C — the refusal/fault distinction is a producer-side declaration on the published envelope, not a status heuristic and not a second allow-list).

Why

declaredServerFaultAnswer (packages/rest/src/error-response.ts) withholds the message of every error that declares status >= 500. declaresServerFault (packages/types/src/error-leak.ts) is status >= 500 && code — a deliberate refusal such as the /references 501 written under ADR-0110 D3 also satisfies it, so switching the gate to declaresServerFault (the reframing in triage comment 5556832849) withholds exactly the same messages. Nothing on the wire today lets a producer say "this 5xx is a refusal whose prose is for the caller". PR #16143 patched one route locally; #16146 shows the class recurs on every gate.

Scope

Consumer half

#16146 (relay change in error-response.ts, retire the route-local patch from #16143) is pm:blocked on this card. #14656's logging question is expected to fall out of the same field.

Acceptance

  • envelope schema declares the field with a stable TSDoc
  • api-surface baseline regenerated
  • changeset present

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions