Skip to content

Commit a5eccf9

Browse files
claude[bot]claude
andauthored
docs(rest): state what the genericDeclared docblock's file actually holds (#16504)
The docblock claimed reachability of the generic passthrough "is asserted rather than assumed", but nothing in the file asserts it — §1 reads only the two doors' answers, never `structuredCodeAnswer`'s arms. A bespoke arm added later for one of §1's codes would leave those cases green while they quietly measure the bespoke path instead. Replace the claim with what measurement shows actually holds it: a hand-run ablation (naming the limb to delete), the three sibling pins that redden with it, and the measured limit that §3 keys on one of §1's own codes and so migrates along with it. Comment-only; no behaviour change. Claude-Session: https://claude.ai/code/session_01YFY46JydE1gMxQG1TqBcMZ Co-authored-by: Claude <noreply@anthropic.com>
1 parent c677cda commit a5eccf9

1 file changed

Lines changed: 33 additions & 3 deletions

File tree

packages/rest/src/error-response-generic-passthrough-object-parity.test.ts

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,39 @@ const singleDoor = (error: unknown, object?: string): Wire => mapDataError(error
9393
/**
9494
* A producer that declares `code` + `status` and NOTHING a bespoke arm keys
9595
* on — no `name`, no envelope class — so it reaches the generic passthrough at
96-
* both doors. That reachability is the whole point of the case, so it is
97-
* asserted rather than assumed: `structuredCodeAnswer` recognising the code
98-
* later would make these pins measure the bespoke path instead.
96+
* both doors.
97+
*
98+
* ⛔ That reachability is NOT asserted anywhere in this file. §1 reads only the
99+
* two doors' answers; nothing here reads `structuredCodeAnswer`'s arms. An arm
100+
* added later for one of §1's codes therefore leaves those cases GREEN while
101+
* they quietly measure the bespoke path instead — the pin's subject migrates
102+
* without changing colour. What actually holds the reachability, named so a
103+
* reader can re-run it rather than trust this sentence:
104+
*
105+
* - **An ablation, run by hand — ⛔ not a standing assertion.** Deleting
106+
* `resolveErrorResponse`'s generic 4xx `...(object ? { object } : {})` limb
107+
* reddens §1's three code cases, its `handleRouteError` case, and the three
108+
* siblings below. No gate re-runs it, so it demonstrates reachability at the
109+
* moment it is run and pins nothing afterwards.
110+
* - **§2's "declared status + door-supplied object: both doors answer 404 with
111+
* `object`"** — `recordNotFoundError` (`@objectstack/core`) declares
112+
* `status = 404`, which carries it PAST the `RECORD_NOT_FOUND` arm into this
113+
* same passthrough.
114+
* - **§3's "a sniff-matching message with a DIFFERENT declared code keeps the
115+
* declared answer on both doors"** — a declared 409 that no arm claims.
116+
* - **`error-response-structured-arm-door-parity.test.ts` §4's "CONVERGED: a
117+
* 5xx ARM never displaces a status the producer declared in the 4xx band"**
118+
* — `ERR_DATASOURCE_UNAVAILABLE` HAS an arm, and that arm is declined for a
119+
* declared 4xx, so it reaches this passthrough structurally rather than by
120+
* the absence of an arm.
121+
*
122+
* ⚠️ "Three siblings" is itself easy to over-read, so the measured limit: §3
123+
* keys on `RECORD_LOCKED`, one of §1's OWN codes, so an arm for that code
124+
* migrates §3 along with §1. Only §2 and #14541's §4 are independent of the
125+
* codes below. #14541 §5's "every arm in the SHARED classification has a §1
126+
* parity case" reddens when an arm ARRIVES, but goes green again as soon as its
127+
* author adds the parity case it asks for — it does not hold THIS file's §1 to
128+
* the passthrough.
99129
*/
100130
function genericDeclared(code: string, status: number, message: string): any {
101131
const err: any = new Error(message);

0 commit comments

Comments
 (0)