From 75c0e813474e3c49278662bb9ee9537200dcd2a4 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 7 Sep 2026 04:32:49 +0000 Subject: [PATCH] docs(rest): state what the `genericDeclared` docblock's file actually holds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01YFY46JydE1gMxQG1TqBcMZ --- ...-generic-passthrough-object-parity.test.ts | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/packages/rest/src/error-response-generic-passthrough-object-parity.test.ts b/packages/rest/src/error-response-generic-passthrough-object-parity.test.ts index 98f40003e7..9e9a87c384 100644 --- a/packages/rest/src/error-response-generic-passthrough-object-parity.test.ts +++ b/packages/rest/src/error-response-generic-passthrough-object-parity.test.ts @@ -93,9 +93,39 @@ const singleDoor = (error: unknown, object?: string): Wire => mapDataError(error /** * A producer that declares `code` + `status` and NOTHING a bespoke arm keys * on — no `name`, no envelope class — so it reaches the generic passthrough at - * both doors. That reachability is the whole point of the case, so it is - * asserted rather than assumed: `structuredCodeAnswer` recognising the code - * later would make these pins measure the bespoke path instead. + * both doors. + * + * ⛔ That reachability is NOT asserted anywhere in this file. §1 reads only the + * two doors' answers; nothing here reads `structuredCodeAnswer`'s arms. An arm + * added later for one of §1's codes therefore leaves those cases GREEN while + * they quietly measure the bespoke path instead — the pin's subject migrates + * without changing colour. What actually holds the reachability, named so a + * reader can re-run it rather than trust this sentence: + * + * - **An ablation, run by hand — ⛔ not a standing assertion.** Deleting + * `resolveErrorResponse`'s generic 4xx `...(object ? { object } : {})` limb + * reddens §1's three code cases, its `handleRouteError` case, and the three + * siblings below. No gate re-runs it, so it demonstrates reachability at the + * moment it is run and pins nothing afterwards. + * - **§2's "declared status + door-supplied object: both doors answer 404 with + * `object`"** — `recordNotFoundError` (`@objectstack/core`) declares + * `status = 404`, which carries it PAST the `RECORD_NOT_FOUND` arm into this + * same passthrough. + * - **§3's "a sniff-matching message with a DIFFERENT declared code keeps the + * declared answer on both doors"** — a declared 409 that no arm claims. + * - **`error-response-structured-arm-door-parity.test.ts` §4's "CONVERGED: a + * 5xx ARM never displaces a status the producer declared in the 4xx band"** + * — `ERR_DATASOURCE_UNAVAILABLE` HAS an arm, and that arm is declined for a + * declared 4xx, so it reaches this passthrough structurally rather than by + * the absence of an arm. + * + * ⚠️ "Three siblings" is itself easy to over-read, so the measured limit: §3 + * keys on `RECORD_LOCKED`, one of §1's OWN codes, so an arm for that code + * migrates §3 along with §1. Only §2 and #14541's §4 are independent of the + * codes below. #14541 §5's "every arm in the SHARED classification has a §1 + * parity case" reddens when an arm ARRIVES, but goes green again as soon as its + * author adds the parity case it asks for — it does not hold THIS file's §1 to + * the passthrough. */ function genericDeclared(code: string, status: number, message: string): any { const err: any = new Error(message);