Skip to content

Commit 278c9c6

Browse files
committed
docs(tooling): record the fifth casing-gate recognizer and who owns a runtime-limbed chain
`scripts/check-dispatcher-error-vocabulary.mjs` documents its delegation contract with `check:error-code-casing` by enumerating that gate's recognizers. PR #10760 added a fifth — the OUR-DEFAULT slot of a `||`/`??` fallback chain — and the enumerations were left short by one. Comment-only. Both enumerations now carry the fifth spelling as the owning gate spells it, and the #9568 ALL-OR-NOTHING bound now records who owns a runtime-limbed chain, split by position because the two answers differ: delegated to `check:error-code-casing` at the stamp site, owned by nobody in a local's initializer (filed as #10897). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_c970724d-303c-5614-9d20-a3f92205cfad
1 parent 9faa9bc commit 278c9c6

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

scripts/check-dispatcher-error-vocabulary.mjs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,14 @@
8989
* is WHICH gate reports it. `check:error-code-casing` owns the lowercase
9090
* sweep, and every pattern it has needs a QUOTED lowercase literal beside
9191
* the token `code` — `code: 'x'`, `.code = 'x'`, `code === 'x'`,
92-
* `code?: 'x' | 'y'`. In those positions (`objlit`, `assign`) the
92+
* `code?: 'x' | 'y'`, and [#10760] `code: parsed?.code || 'x'` /
93+
* `.code = e?.code ?? 'x'` — the OUR-DEFAULT slot of a `||`/`??`
94+
* fallback chain, that gate's `fallback` pattern. It still captures only
95+
* a string literal, and a literal in our source is by construction the
96+
* default WE author. That fifth one is a position this gate has NO shape
97+
* for rather than one it hands over: an intervening expression leaves
98+
* `objlit` and `assign` with no quote to match.
99+
* In those positions (`objlit`, `assign`) the
93100
* delegation is real: that gate reads the same characters and carries the
94101
* D6/D6b/D6c discrimination — field-addressed catalogs, persisted audit
95102
* columns, diagnostics payloads, Zod's own issue codes — that decides which
@@ -126,6 +133,22 @@
126133
* Reduction is ALL-OR-NOTHING — a chain with one runtime limb reduces to
127134
* nothing rather than to its literal half, since half an expression's
128135
* values is a finding that is wrong in both directions at once.
136+
* [#10762] WHO owns a runtime-limbed chain then depends on WHERE it sits,
137+
* and the two answers differ — measured against both gates' recognizers,
138+
* not inferred from either one's prose. At the STAMP SITE
139+
* (`{ code: parsed?.code || 'lit' }`, `err.code = e?.code ?? 'lit'`) no
140+
* reduction is involved at all: `objlit`/`assign` need the quote
141+
* immediately, so this gate never had a shape there — and since #10760
142+
* `check:error-code-casing`'s `fallback` pattern reads that literal, so
143+
* the shape is DELEGATED, not dropped. That is the position the two live
144+
* SSO codes in `register-sso-provider.ts` shipped through. In a LOCAL'S
145+
* INITIALIZER (`const code = parsed?.code || 'lit'; err.code = code`) it
146+
* is neither: the ALL-OR-NOTHING rule above declines it here, and that
147+
* gate's `fallback` pattern anchors on `code:`/`code?:`/`.code =`, so a
148+
* `const code =` is out of ITS reach too. That one is still owned by
149+
* NOBODY — deliberately on this side, filed as #10897 for the other.
150+
* Stated so the next reader does not re-derive the hole and close it in
151+
* the wrong gate.
129152
* - A constant this gate cannot resolve is REPORTED as unresolved, never
130153
* dropped: a deriver that goes quietly blind is the same failure one layer
131154
* down. [#9223] A constant imported from a WORKSPACE package is resolved
@@ -801,7 +824,11 @@ export function deriveSites({ registered, files, readFile, packageDirs = new Map
801824
*
802825
* `check:error-code-casing` owns the lowercase sweep, and every pattern it
803826
* has requires a QUOTED lowercase literal sitting next to the token `code`:
804-
* `code: 'x'`, `.code = 'x'`, `code === 'x'`, `code?: 'x' | 'y'`. Where this
827+
* `code: 'x'`, `.code = 'x'`, `code === 'x'`, `code?: 'x' | 'y'`, and
828+
* [#10760] `code: parsed?.code || 'x'` / `.code = e?.code ?? 'x'`, the
829+
* OUR-DEFAULT slot of a `||`/`??` fallback chain (that gate's `fallback`
830+
* pattern; it still captures only a literal, which in our source is the
831+
* default we author). Where this
805832
* gate finds a lowercase code in one of those same positions — `objlit`,
806833
* `assign` — the delegation is real: that gate sees the identical text, and
807834
* it carries the D6/D6b/D6c discrimination (field-addressed catalogs,

0 commit comments

Comments
 (0)