Commit eda6a60
docs(api): the 409 unique-constraint entry is UNIQUE_VIOLATION on the wire, not DUPLICATE_RECORD (#15750)
* docs(api): the 409 unique-constraint entry is UNIQUE_VIOLATION on the wire (#15631)
`content/docs/api/error-catalog.mdx` catalogued `DUPLICATE_RECORD` under
`## Conflict Errors (409)` and in the HTTP Status Quick Reference. Per the
maintainer ruling on #14723 (2026-09-03) a unique-constraint refusal has ONE
wire spelling on every route, `UNIQUE_VIOLATION`; `DuplicateRecordError.code`
stays `DUPLICATE_RECORD` in-process only, translated at the REST door
(`packages/rest/src/error-response.ts`, the `DuplicateRecordError` arm of
`structuredCodeAnswer`). A client branching on the catalogued constant never
matched.
The entry is renamed to the wire code with a one-sentence cross-reference to
the in-process spelling, and the quick-reference row follows.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
* test(spec): re-point the ADR-0112 D7 catalog guard at the published wire face
The guard asserted that the error-catalog page's `### `CODE`` headings and the
`StandardErrorCode` enum agree in both directions. That premise broke twice:
- A translated code is not on the wire. `DuplicateRecordError` declares
`code = 'DUPLICATE_RECORD'` and the REST door translates the envelope at the
boundary, so every route answers `UNIQUE_VIOLATION` (#14723). Demanding a
`DUPLICATE_RECORD` heading on a page that documents the wire demands the page
publish a code no client can receive.
- A ledger code IS on the wire. `INVALID_REQUEST` is not an enum member, yet the
catalog publishes two `/meta` entries for it. "Every heading is an enum member"
should have failed on them and did not: the old regex was anchored and both
headings carry a descriptive suffix. They passed by accident.
Per the maintainer ruling on #15631, the page catalogs the WIRE FACE and the guard
compares against that, in both directions. An enum member the translation census
marks as translated is exempt from "must have a heading" — because it is not a wire
code, not by a special case — and must instead be named by the cross-reference
sentence under its wire code's entry, which the guard now asserts.
The wire face and the translation set come from the one place that already derives
them. `check-error-status-conformance.mjs` grows `deriveWireFace()` — the corpus
walk, the runtime side, the doc side, the reconciled vocabulary and that vocabulary
minus the door's translations — and `main()` becomes a consumer of it rather than an
inlining of it. A second hand-written list of translated codes here would be exactly
the copy that file's header argues against. Matching headings by that module's
`ENTRY_HEADING_SHAPES` rather than by a regex of the test's own is the same move, and
is what closes the `INVALID_REQUEST` suffix accident.
The advertised count on the page becomes what the page now promises: 51 codes
reachable on the wire, not 50 enum members.
`scripts/check-error-status-conformance.d.mts` declares the one supported export for
the TS consumer, per the `check-declaration-mirrors` convention.
Gate output and `--self-test` are byte-identical before and after the refactor.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TezFG8ZMrNH6n5VTNpPpdH
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent f4e6adf commit eda6a60
4 files changed
Lines changed: 301 additions & 38 deletions
File tree
- content/docs/api
- packages/spec/src/api
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
361 | 367 | | |
362 | 368 | | |
363 | 369 | | |
364 | | - | |
| 370 | + | |
365 | 371 | | |
366 | 372 | | |
367 | 373 | | |
368 | 374 | | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
369 | 380 | | |
370 | 381 | | |
371 | 382 | | |
| |||
802 | 813 | | |
803 | 814 | | |
804 | 815 | | |
805 | | - | |
| 816 | + | |
806 | 817 | | |
807 | 818 | | |
808 | 819 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
14 | 51 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
28 | 96 | | |
29 | 97 | | |
30 | 98 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
35 | 119 | | |
36 | 120 | | |
37 | 121 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
42 | 126 | | |
43 | 127 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
0 commit comments