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
check-error-code-casing reports a clean sweep it cannot support: a lowercase code in an || fallback matches none of its four recognizers, and two live ones ship today #10658
These are not vendor codes passing through — parsed?.code is that path. The literal is ours, and ADR-0112 / Prime Directive #3 make error codes SCREAMING_SNAKE.
Cause: the recognizer requires the quote to sit directly after code:
All four patterns in scripts/check-error-code-casing.mjs (CODE_POSITION_PATTERNS) anchor the string literal immediately after the position token. The emission one:
An intervening expression (parsed?.code || ) breaks that adjacency, and the other three do not apply — it is not .code =, not code ===, not a 'a' | 'b' union type. So the shape is invisible to the whole set.
Positive control, so a zero is a real zero rather than a broken probe — the gate's own emission regex, run on both spellings:
The recognizer demonstrably fires on one and not the other.
Extent, measured. Repo-wide, excluding tests and node_modules, the code: <expr> || '<lower_snake>' shape occurs 2 times — both rows above. So the correction is small; the reporting defect is the point.
Why this is a verdict question, not just two renames
This is the shape PR #10501 just closed for a different scanner: a partial read is a verdict, not a smaller number. A scan that cannot see a spelling produces no finding, silently, and then prints a total that reads as complete. Two prior cards found the same class in the sibling gate — #9223 (non-literal code:) and #9460 (a lowercase thrown code) — so this is the third instance of one pattern across the error-code gates, and the first in this one.
Note the two are not independent: #9460's fix taught check:dispatcher-error-vocabulary about a spelling, and this gate was not revisited.
Suggested direction (not prescriptive)
Two separable pieces, and the second matters more than the first:
Widen the emission recognizer to reach a literal that follows code: through an || / ?? chain, with --self-test cases pinned for both the fallback spelling and the direct one — and pin the population so a widening cannot silently change what "clean" counts.
Then fix the two codes themselves — but note they are also wire-visible, so renaming them is a behaviour change for any client matching on them, and belongs with whoever owns that call. packages/qa/dogfood/test/admin-route-nonadmin-refusal.dogfood.test.ts:252 currently pins verify_domain_failed by name.
Refs
#10534 (where this was found) · #10501 (the same "partial read reported as complete" class, other scanner) · #9223 / #9460 (the same class in check:dispatcher-error-vocabulary) · ADR-0112
Found while documenting the SSO domain-verification routes for #10534. Not fixed there — different defect class, so it is filed rather than absorbed.
The claim, and why it is not supported
pnpm check:error-code-casingprints, onorigin/mainat47aff0938:That second line is unqualified — it reads as "this tree has none". It has two, in a file that is inside the scanned set:
packages/plugins/plugin-auth/src/register-sso-provider.tsrequest_domain_verification_failedpackages/plugins/plugin-auth/src/register-sso-provider.tsverify_domain_failedBoth are emitted as the ObjectStack-authored default of an
||chain, e.g. line 465:These are not vendor codes passing through —
parsed?.codeis that path. The literal is ours, and ADR-0112 / Prime Directive #3 make error codesSCREAMING_SNAKE.Cause: the recognizer requires the quote to sit directly after
code:All four patterns in
scripts/check-error-code-casing.mjs(CODE_POSITION_PATTERNS) anchor the string literal immediately after the position token. The emission one:An intervening expression (
parsed?.code ||) breaks that adjacency, and the other three do not apply — it is not.code =, notcode ===, not a'a' | 'b'union type. So the shape is invisible to the whole set.Positive control, so a zero is a real zero rather than a broken probe — the gate's own emission regex, run on both spellings:
The recognizer demonstrably fires on one and not the other.
Extent, measured. Repo-wide, excluding tests and
node_modules, thecode: <expr> || '<lower_snake>'shape occurs 2 times — both rows above. So the correction is small; the reporting defect is the point.Why this is a verdict question, not just two renames
This is the shape PR #10501 just closed for a different scanner: a partial read is a verdict, not a smaller number. A scan that cannot see a spelling produces no finding, silently, and then prints a total that reads as complete. Two prior cards found the same class in the sibling gate — #9223 (non-literal
code:) and #9460 (a lowercase thrown code) — so this is the third instance of one pattern across the error-code gates, and the first in this one.Note the two are not independent: #9460's fix taught
check:dispatcher-error-vocabularyabout a spelling, and this gate was not revisited.Suggested direction (not prescriptive)
Two separable pieces, and the second matters more than the first:
code:through an||/??chain, with--self-testcases pinned for both the fallback spelling and the direct one — and pin the population so a widening cannot silently change what "clean" counts.affected-docs.mjsprint both halves of its fraction. A recognizer will always have a boundary; the defect is a boundary that reports as zero.Then fix the two codes themselves — but note they are also wire-visible, so renaming them is a behaviour change for any client matching on them, and belongs with whoever owns that call.
packages/qa/dogfood/test/admin-route-nonadmin-refusal.dogfood.test.ts:252currently pinsverify_domain_failedby name.Refs
#10534 (where this was found) · #10501 (the same "partial read reported as complete" class, other scanner) · #9223 / #9460 (the same class in
check:dispatcher-error-vocabulary) · ADR-0112