Uh oh!
There was an error while loading. Please reload this page.
feat(devx): reach the INLINE literal expression at an object-literal code: - #14625
Conversation
…`code:` The vocabulary gate reached a `code:` whose value is a quoted literal (`objlit`), a SCREAMING_SNAKE constant (`objlitconst`), a template (`objlittemplate`) or a helper parameter (`objlithelper`), but not an INLINE literal EXPRESSION — a ternary or a `||`/`??` chain written at the stamp with every branch already a literal. That is no site AND no unresolved: the one way the gate's "REPORTED as unresolved, never dropped" bound cannot notice itself failing, in a third stamp position. Adds the fifth object-literal shape, `objlitexpr`. It needs no resolver — `literalCodeValues` reduces the value text between `code:` and the property's terminating top-level comma directly, and `resolveIdent` is left at its default so an identifier limb keeps the expression unreducible, which is what keeps this shape out of the lower-case-LOCAL position that stays censused and open. Precision measured BEFORE implementing, over the gate's own population: of 902 `code:` tokens the shape reaches 346, three guards reject 130, 216 reach the reduction and 214 decline — including every type annotation — leaving 2 live positions, 5 values, 2 verdict rows and 0 unregistered wire codes hiding. The ALL-OR-NOTHING reduction IS the guard against the type-annotation noise the helper position pays per value stamp. Frozen in INLINE_LITERAL_EXPRESSION_CENSUS, printed in the bounds line, arithmetic pinned. The two rows the widening owes land in the same commit, after the widening, because the reconciliation runs in both directions: the ADR-0112 D6 field-addressed validation catalog in `domains/automation.ts`. They are reported here rather than delegated to check:error-code-casing because that gate needs a quoted literal beside the token `code` and an inline ternary has none — measured, and pinned against its real detector. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
📓 Docs Drift CheckThis PR changes 1 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 24 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin fe7200da54d381d2c79d8544c2737f8478bc7139 && git checkout fe7200da54d381d2c79d8544c2737f8478bc7139
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 87ad30c103bb4e8c5d7b8a399634b59716f3c21f 8a10049e48beaa67589d72c742355f2a55bc29ae && git checkout -B drift-repro 87ad30c103bb4e8c5d7b8a399634b59716f3c21f && git merge --no-ff 8a10049e48beaa67589d72c742355f2a55bc29ae
node scripts/docs-audit/affected-docs.mjs --json 87ad30c103bb4e8c5d7b8a399634b59716f3c21f
|
Uh oh!
There was an error while loading. Please reload this page.
Fixes#13790
scripts/check-dispatcher-error-vocabulary.mjsreached no INLINE literal expression at an object-literalcode:— a ternary, or a||/??chain, written at the stamp itself with every branch already a literal. That is no site AND no unresolved, the one way the gate's own "REPORTED as unresolved, never dropped" bound cannot notice itself failing, in a third stamp position after #9223'scode: CONSTand #13233's{ code }helper.This adds the fifth object-literal shape,
objlitexpr. Per the triage's ⭐ it needs no resolver:literalCodeValuesalready reduces the expression, so the shape is the reduction of the value text betweencode:and the property's terminating top-level comma.The precision measurement, first
The triage refused to authorise the widening until the precision cost was measured (
objlithelperreaches 65 type annotations per value stamp). It was measured over the gate's own population —packages/**non-test source, 2186 files — with the gate's own primitives, before the shape was written. The finding: the ALL-OR-NOTHING reduction is the guard. A type annotation reduces to nothing for the same reason a runtime expression does, so it costs acontinueand no verdict row.code:tokens in the population{(41 parameter lists, 33 inside a string)objlit's (4),objlitconst's (40),objlittemplate's (3)objlithelper's candidate / #13478's remainder)code: T extends X ? 'A' : 'B')⇒ preventive, not a live defect — the same disposition and evidence standard #13478 and #13233 were closed on. Every figure is frozen in
INLINE_LITERAL_EXPRESSION_CENSUS, printed on every run in the bounds line, and its arithmetic is pinned by--self-test.Every position reached, with its classification
packages/rest/src/error-response.ts:1250—code: isProvisioning ? 'PROJECT_PROVISIONING' : isFailed ? 'PROJECT_PROVISIONING_FAILED' : 'PROJECT_NOT_FOUND'. All three are inERROR_CODE_LEDGER, so the scan derives no site and owes no row. This is the REST door file, stamped straight into an HTTP error envelope'sbody.code— registered today, and now no longer invisible to the gate tomorrow.packages/runtime/src/domains/automation.ts:1125—code: body.name === undefined ? 'required' : 'invalid_type'. An ADR-0112 D6 field-addressed validation catalog reachingdetails.fields[].code, nevererror.code. Two rows,foreign-vocabulary/door: 'none'.code: string | undefined,code: FieldErrorCode,code?: 'a' | 'b') and runtime expressions (code: typeof issue.code === 'string' ? issue.code : 'unknown').Where the lowercase catalog is reported, and why — measured, not assumed
The shape carries
lowercase: 'here'. Every patterncheck:error-code-casinghas needs a quoted literal beside the tokencode; at an inline ternary there is none. Measured:findViolations()returns 0 findings fordomains/automation.ts, while the literally-spelledcode: 'invalid_type'a few lines up it does see and correctly skips as D6. That gate's own verdict text says the same thing from its side — "a code value with NO literal at the position — a constant, a template, a ternary, a helper parameter — is out of reach for every pattern here by construction; that half belongs tocheck:dispatcher-error-vocabulary". So acasing-gatedelegation here would be the seam the gate's header describes, not a hand-off.--self-testpins this against that gate's real detector rather than against this paragraph. ⛔check-error-code-casing.mjsis untouched.Two deliberate boundaries, declared rather than discovered later
code:, notobjlithelper'scode\s*:\s*. Measured: the loose spelling matches the colon of a ternary, sotypeof issue.code === 'string' ? issue.code : 'unknown'reads as acode :stamp of'unknown'— a false position with no structural tell.objlithelpercan afford the loose anchor because its parameter guard rejects that; this shape's guard is the reduction, which accepts it.(?!\s*'[^']*'\s*[,;}\n])). [finding] a kebab-case diagnostic code is invisible to both vocabulary gates as a literal, and an undischargeable finding as a constant — the two gates' grammars have no spelling that classifies it #12925 pins the kebab-diagnostic declaration by counting recognizer matches, not findings; a barecode:anchor matchescode: 'unknown-component'even though every guard then declines it, and that reds the kebab pin. A bare literal isobjlit's anyway. The cost is one declared remainder: a chain whose first operand is a bare quoted literal (code: 'A' || 'B') is handed toobjlit, which reports'A'and not'B'— partial reporting rather than silence, zero live instances, counted aschainWhoseFirstOperandIsABareLiteraland pinned.Ablation — every guard proved to fail
Run from a committed tree; each leg proved on disk by blob hash before/after, restored to the HEAD blob and verified equal, with a
trapon EXIT/INT/TERM.--self-testobjlitexprSHAPES entrySHAPE 'objlitexpr' matched nothing in its own sample+ the nested-ternary pina CONDITIONAL type at a code: derived ["INLINE_A","INLINE_B"]a code: in a function PARAMETER LIST derived ["INLINE_PARAM_A","INLINE_PARAM_B"](code: number | null, signal), whose value text the reduction declines anyway — a pin measuring nothing. It now uses a parameter default (code: string = down ? 'A' : 'B'), a value expression only the bracket rejects. And the bare-identifier partition is documented as what it is: with no resolver it changes no output today, so it is declared as a reader-facing statement of the partition rather than as a guard an ablation can see.What is NOT here
pending-registrationrow: the widening surfaced no unregistered wire code.check-error-code-casing.mjs,scripts/pm/dispatch-gates.mjsand every other gate untouched.code:fed by a lower-case LOCAL in an object literal is reached by no vocabulary shape — the object-literal twin of the repaired assign-position gap #13478's lower-case-LOCAL resolver is not folded in — a bare identifier is declined, so that position stays censused-and-open under its own card.Known limitation found on the way (filed, not fixed here)
The gate's shared textual scanners (
enclosingOpeners,sliceBalanced,scanTopLevel) skip a string by seeking its closing quote, so a nested template literal —`a ${xs.map((k) => `\`${k}\).join(', ')} b`` — closes the outer template at the first inner backtick and desynchronises everycode:position after it in that file.domains/automation.tscarries one at line 1285, and **two further instances of the identical catalog ternary** (the clone door'snameandlabelchecks,:1384and:1399) sit behind it, invisible to guard ①. Same values, same verdict, so the zero for hidden wire codes is unaffected — but the position count is a floor, not a total. Pre-existing and shared withobjlithelper, recorded in the census and in theinvalid_type` row rather than repaired inside a shape widening.Verification
git diff --stat origin/main..HEAD— 2 files, exactly the declared surface:pnpm check:dispatcher-error-vocabulary— exit 0:OK — 59 unregistered code-stamping site(s), all classified; 1 awaiting a ledger entry (#8846).(57 → 59 sites, 57 → 59 classified.)--self-test— exit 0:10 shapes + 261 assertions OK (vocabulary + #9098 door typing)(9 shapes + 226 before).pnpm check:error-code-casing— exit 0, unchanged.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands …(31 commands) — run in full; results and the two NOT-MEASURED prerequisites are in the report comment on [finding] An INLINE literal ternary at an object-literalcode:is reached by no vocabulary shape — the third stamp position, censused at zero #13790.Changeset
skip-changeset. The diff is one gate script pluspackages/runtime/src/dispatcher-error-vocabulary.ts, which is a declaration table read textually by the gate and by tests: nothing inpackages/runtime/srcimports it, it is not re-exported fromsrc/index.ts, and the package publishes only.— so no published bytes change. If a reviewer reads that differently, a changeset is cheap to add.🤖 Generated with Claude Code
https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
Generated by Claude Code