Commit a17fbbf
feat(objectql): the two transaction-seam refusals publish their error code as a constant (#16326)
* feat(objectql): the two transaction-seam refusals publish their code as a constant
`transaction-errors.ts` opens by telling the reader that the errors in it
identify themselves by a `code` field rather than by `instanceof`, "for the
reason `DriverConnectError` already records: the check has to survive crossing a
package boundary, where two copies of this module can exist" -- and offered
nothing to import. Following that published instruction meant re-spelling the
wire string in the consumer's own package, which acquires a
`check:error-code-provenance` stamp site there and is then free to drift from
what this engine throws with no compile error to say so.
`TRANSACTION_UNSUPPORTED_CODE` and `CROSS_DATASOURCE_TRANSACTION_WRITE_CODE`
each hold text byte-identical to the literal they replace: the quoted wire
spelling occurs exactly once per code in this file on both sides of the change,
so it moved rather than multiplied. Both classes were already exported from the
barrel and stay exported; the constants join them there.
Neither class is published from the lean `./core` entry, so the batteries-only
placement of these two constants adds nothing to #16260's population: class and
constant are reachable from exactly the same entry point.
Placement differs deliberately from the sibling batch on this card. Each
constant and its docblock sit ABOVE the class's own docblock rather than between
that docblock and the class. Measured with `tsc --declaration`: two consecutive
JSDoc blocks are both emitted against the declaration that follows, so
interposing the constant moves the class's documentation onto the CONSTANT in
the published `.d.ts` and leaves the class with none. The grouped shape already
landed in `registry.ts` avoids the same thing.
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
Co-authored-by: Claude <noreply@anthropic.com>
* test(objectql): pin TRANSACTION_UNSUPPORTED_CODE against its class and the barrel
Row 1 of this batch, graded and pinned on its own. Five cases: the literal wire
string (the byte-identity fence -- deliberately NOT a constant compare, because
a pin that reads the constant cannot catch the constant being wrong); the code a
real refusal carries, asserted with `name` and the datasource it reports rather
than a bare `toThrow()`; barrel reachability by identity; barrel-class and
barrel-constant agreement; and a cross-realm copy where `instanceof` is false
while the `code` compare holds -- the control without which the file would pass
just as happily against the `instanceof` recommendation this module tells
readers not to use.
This refusal carries no `status` field, so ADR-0112's `code` + `status` minimum
reduces here to `code` plus the fields that discriminate it; inventing a
`status` would be new published surface and is not what this card converts.
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
Co-authored-by: Claude <noreply@anthropic.com>
* test(objectql): pin CROSS_DATASOURCE_TRANSACTION_WRITE_CODE against its class and the barrel
Row 2 of this batch, graded and pinned on its own, in the shape row 1 spells
out. Case 2 drives all three write operations: the message embeds the operation
by design while the code deliberately does not, so the three messages differ and
the three codes are equal -- which is what stops a future per-operation message
split taking the code with it. It also pins the four fields a caller reads to
apply the remedy the message prescribes (split the unit per datasource), since
recognising the refusal is the step that recovery begins with.
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
Co-authored-by: Claude <noreply@anthropic.com>
* chore(changeset): minor for the two transaction-seam code constants
Both rows are additive widening of a published surface and nothing is removed,
so each is graded `minor` on its own line rather than as one lump. The entry
records what a consumer gains, why `code` and not `instanceof`, and that the
wire strings are byte-identical to the literals they replace.
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
Co-authored-by: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 91093cc commit a17fbbf
5 files changed
Lines changed: 334 additions & 4 deletions
| 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 | + | |
Lines changed: 106 additions & 0 deletions
| 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 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
249 | 254 | | |
250 | 255 | | |
251 | 256 | | |
252 | 257 | | |
253 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
254 | 269 | | |
255 | 270 | | |
256 | 271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 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 | + | |
13 | 64 | | |
14 | 65 | | |
15 | 66 | | |
| |||
23 | 74 | | |
24 | 75 | | |
25 | 76 | | |
26 | | - | |
| 77 | + | |
27 | 78 | | |
28 | 79 | | |
29 | 80 | | |
| |||
37 | 88 | | |
38 | 89 | | |
39 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
40 | 126 | | |
41 | 127 | | |
42 | 128 | | |
| |||
61 | 147 | | |
62 | 148 | | |
63 | 149 | | |
64 | | - | |
| 150 | + | |
65 | 151 | | |
66 | 152 | | |
67 | 153 | | |
| |||
0 commit comments