Skip to content

Should READ_BACK_FAILED get a named wire row, as RESUME_FAILED has? The #12769 refusal currently rides an unmapped 500 #13182

Description

@os-elon

Filed by the domain:services seat (session session_012WkdHQwHr2KQmaX7P1BHzi) out of PR #13181's report. ⛔ Recorded, not graded, not routed — filed as a card rather than left in a report, because a cross-seat follow-up written only in prose is invisible to every queue.

Where it comes from

#12769 repaired ten ApprovalService result sites that shipped a well-formed HTTP 200 whose declared-non-null request was null. The fix makes the single private readBackRequest helper throw when the post-mutation read-back is filtered out by the caller's organization narrowing:

READ_BACK_FAILED: the write to approval request '<id>' was recorded, but the updated row is not visible
inside the caller's organization scope, so the result envelope cannot be built. The write is NOT rolled
back — read the request back with a system or matching-organization context (#12769).

That is a thrown message prefix, deliberately not a code-position literal, so no error-code-ledger entry was due from that PR and the ADR-0112 content gate did not fire.

The question

Over REST the refusal surfaces through each route's existing terminal 500 armAPPROVAL_RECALL_FAILED and its siblings, all already-registered codes — with the READ_BACK_FAILED: sentence in the body. So a client sees a registered code whose name does not describe what happened, plus an accurate sentence.

shape note
A (current state) leave it unmapped Loud, honest, adds no wire vocabulary, zero packages/spec and zero packages/rest edits
B register and map a named row, the way RESUME_FAILED is handled — "a genuine server-side inconsistency, but named" Operators get a code that matches the condition. Costs an error-code-ledger entry, a handleApprovalError mapping, and a doc line

The implementing dev recommended B as a follow-up, A meanwhile, and the reviewing seat agreed. ⛔ Neither of us ruled it — it is recorded here for whoever grades it.

Why it was not done in #13181

Both files it needs are outside the domain:services lane:

  • packages/spec/** is single-owner (domain:spec seat), no matter who needs the edit;
  • the REST mapping lives in packages/rest/src/**.

⇒ Whoever grades this should expect it to land in the domain:spec lane (or be split), not in services. ⚠️ Widening the wire vocabulary is a public-surface change, so clause ② is likely yes — judge it from the content at claim time rather than inheriting that guess.

Not established here

Refs

Dedup

Searched the approvals error-code / wire-mapping family before filing: #12769 is the parent defect and does not cover this question (its own report raises it as an explicit open question rather than answering it). No existing card proposes a READ_BACK_FAILED wire row.

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