You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(devx): read NAME.enum.MEMBER so 36 real producers leave the unresolved census (#15736)
`check:error-status-conformance` derives the runtime side of the code/status
reconciliation out of source, and REPORTS every declaration it cannot read
rather than dropping it. 36 of the 50 declarations in that census were one
mechanical shape: a producer stamping `err.code = StandardErrorCode.enum.X`
beside a literal status. `buildConstantIndex` recorded nothing at all for a
`z.enum([...])` declaration, and `lookup()` walks at most one dot, so the whole
family resolved to `undefined` — 36 genuine producers, every one of them with
its status already a literal, sat outside the derivation.
Index a `z.enum([...])` declaration as `NAME.enum.MEMBER -> 'MEMBER'`, one entry
per literal (a Zod enum member's value equals its own name by construction), and
let `lookup()` walk that ONE extra segment. A name the array does not list stays
absent from the index and its declaration is reported unresolved, never invented;
dotted paths in general are still refused, deliberately.
Self-test battery 25 pins the shape in all three directions (member resolves,
non-member reported, `.enum.` is the only way in); the roster floor and case
count move with it: 47 cases -> 50, floor 25 -> 26.
Measured on this tree, before -> after:
producer sites derived 279 -> 315 (+36, exactly the 36 `.enum.` rows)
unresolved declarations 50 -> 14 (0 of them `.enum.` now)
reconciled 25 codes / 26 pairs -> unchanged
unpinned census 26 (baselined 26) -> unchanged
The baseline shrink the card anticipated is EMPTY on today's main, and that is a
reading rather than an omission: the 36 sites introduce zero NEW (code, status)
pairs. All six codes they name (VALIDATION_ERROR, INVALID_FIELD, INVALID_FILTER,
INVALID_QUERY, NOT_IMPLEMENTED, DATABASE_ERROR) already had a derived producer
via another rule, and none of the six appears in
`scripts/error-status-unpinned-baseline.json`. No row becomes `nowPinned`, so the
baseline is untouched.
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
Co-authored-by: Claude <noreply@anthropic.com>
// ── The floor: every declared battery RAN, and ran its cases (#13489) ───
1387
1464
//
1388
1465
// Evaluated after every battery has had its chance and BEFORE the verdict, so
@@ -1441,8 +1518,8 @@ function selfTest() {
1441
1518
+'narrated envelopes in comments are not producers, unresolvable declarations are reported, a LEDGER code '
1442
1519
+'the docs publish a status for is reconciled in both directions while one no page publishes stays out of '
1443
1520
+'the vocabulary, an entry heading in an unrecognised shape is reported instead of silently dropped, the '
1444
-
+'baseline-expanding remedy stays maintainer-only, and a baselined code leaving the unpinned census is '
1445
-
+'named a producer or a removed doc entry — never the wrong one of the two.',
1521
+
+'baseline-expanding remedy stays maintainer-only, a baselined code leaving the unpinned census is '
1522
+
+'named a producer or a removed doc entry — never the wrong one of the two — and a `z.enum([...])` member resolves through `NAME.enum.MEMBER` while a name that array does not list stays unresolved.',
0 commit comments