Grasp
Public
ShowcaseRIC-1249Markdown

Exception mapping layer for the ingestion API

Every upstream failure currently surfaces as a 500. The ticket asks for a mapping layer so callers can tell a bad request from an outage, and it is blocked on three disagreements between the design and the code.

CHANGES REQUESTEDGrasp · Jul 30, 2026

Three explanations of the same brief

No jargon, about fifteen seconds

Exception mapping layer for the ingestion the part other programs plug into

Someone wrote down work that has not happened yet. Every upstream failure currently surfaces as a 500. The part to watch: Malformed payloads page a human.

Yes, the registry and its t…In scopeOut of scope
Exception to status mapping, side by side

26 words · derived from the brief below, no model involved

A translation layer between internal exceptions and HTTP status codes.

In progress, assigned, and blocked on review. The design document and the implementation disagree in three places, which is what the reviewer flagged.

The ingestion API raises domain exceptions and lets them propagate. The framework turns anything unhandled into a 500, so a malformed payload and a dead database are indistinguishable to a caller, and both page whoever is on call.

The proposal is a single mapping registry: each domain exception declares its status code, whether it is retryable, and what the caller is told. Everything unmapped stays a 500, deliberately, so adding an exception without a decision does not silently become a 400.

One registry, not per-handler try blocks

Scattered handling is how the current inconsistency happened. A single table can be reviewed in one sitting.

Unmapped means 500

The default has to be the pessimistic one. A new exception defaulting to 400 would tell callers not to retry something they should.

Retryability is part of the mapping

Clients need to know whether to back off. That is a property of the failure, not of the status code alone.

What this brief could not check

  • This brief was written by hand as a design fixture. It is modelled on real work, but no model read a diff to produce it, and its claims should not be relied on.
  • The linked design document was not read; the three disagreements are described from the review comment that lists them.
  • Whether ingestion is idempotent could not be determined from the ticket, and it decides the timeout question.