What
#16337 retired the last server-built wire-dialect findData literals in packages/rest/src/rest-server.ts — all four now spell the canonical QueryAST, and the wireDialectQuery helper that cast the slot is gone. The same package's packages/rest/src/import-runner.ts still has three, and they are invisible to the compiler for a different reason.
Where
packages/rest/src/import-runner.ts:
const findArgsBase = (query: any) => ({ // line 360 — the erasure vehicle
object: '',
query,
...(environmentId ? { environmentId } : {}),
...(context ? { context } : {}),
});
...findArgsBase({ $filter: { [f]: display }, $top: 2 }), // line 389, reference resolver
p.findData({ ...findArgsBase({ $filter: filter, $top: 2 }), object: objectName }) // line 431, duplicate probe
...findArgsBase({ $filter: { id: { $in: ids } }, $top: ids.length }), // line 552, id recheck
Why this is a contract violation and not a style note
FindDataRequestSchema declares query: QuerySchema.optional() (packages/spec/src/api/protocol.zod.ts), and QuerySchema declares where / limit / offset / fields / orderBy / expand — it declares neither $filter nor $top. Those two are wire-only spellings, and the normalizer's own table calls them exactly that: "the wire-only spellings no schema declares" (WIRE_QUERY_ALIAS_SLOTS, packages/metadata-protocol/src/protocol.ts). A server-built literal has no transport to be liberal with — it is the server constructing its own query — so this is the same declared-vs-shipped mismatch #16337 was filed for, in the sibling file.
The reason nothing reddens is findArgsBase(query: any): the parameter is any, so the literal is type-checked by nothing at all and the undeclared keys cost no diagnostic. That is the same mechanism as the fourth literal #16337 found in rest-server.ts (loadImportJob, whose protocol handle was any) — a literal nobody could see, named by no card.
No behaviour is at stake
The aliases DO fold: $filter resolves to where and $top to limit by the spec's own RPC_QUERY_ALIAS_SLOTS, with the value moved verbatim, so these three calls reach engine.find with the same option bag a canonical literal would produce. This is a typing and one-dialect question, not a defect — which is why it is filed rather than folded into #16337, whose scope its card fixes to rest-server.ts.
Suggested shape
The mechanical rewrite is the one #16337 already applied four times: $filter to where, $top to limit, add the required object, and type findArgsBase's parameter as FindDataRequest['query'] (or drop the helper and annotate each literal ServerScopedDataRequest<FindDataRequest>) so the compiler holds the ground afterwards. The pin added by #16337 (packages/rest/src/rest-server-canonical-query-ast.test.ts) is keyed to rest-server.ts; widening its source census to cover import-runner.ts would close the class for the whole package.
Related
Generated by Claude Code
What
#16337 retired the last server-built wire-dialect
findDataliterals inpackages/rest/src/rest-server.ts— all four now spell the canonical QueryAST, and thewireDialectQueryhelper that cast the slot is gone. The same package'spackages/rest/src/import-runner.tsstill has three, and they are invisible to the compiler for a different reason.Where
packages/rest/src/import-runner.ts:Why this is a contract violation and not a style note
FindDataRequestSchemadeclaresquery: QuerySchema.optional()(packages/spec/src/api/protocol.zod.ts), andQuerySchemadeclareswhere/limit/offset/fields/orderBy/expand— it declares neither$filternor$top. Those two are wire-only spellings, and the normalizer's own table calls them exactly that: "the wire-only spellings no schema declares" (WIRE_QUERY_ALIAS_SLOTS,packages/metadata-protocol/src/protocol.ts). A server-built literal has no transport to be liberal with — it is the server constructing its own query — so this is the same declared-vs-shipped mismatch #16337 was filed for, in the sibling file.The reason nothing reddens is
findArgsBase(query: any): the parameter isany, so the literal is type-checked by nothing at all and the undeclared keys cost no diagnostic. That is the same mechanism as the fourth literal #16337 found inrest-server.ts(loadImportJob, whose protocol handle wasany) — a literal nobody could see, named by no card.No behaviour is at stake
The aliases DO fold:
$filterresolves towhereand$toptolimitby the spec's ownRPC_QUERY_ALIAS_SLOTS, with the value moved verbatim, so these three calls reachengine.findwith the same option bag a canonical literal would produce. This is a typing and one-dialect question, not a defect — which is why it is filed rather than folded into #16337, whose scope its card fixes torest-server.ts.Suggested shape
The mechanical rewrite is the one #16337 already applied four times:
$filtertowhere,$toptolimit, add the requiredobject, and typefindArgsBase's parameter asFindDataRequest['query'](or drop the helper and annotate each literalServerScopedDataRequest<FindDataRequest>) so the compiler holds the ground afterwards. The pin added by #16337 (packages/rest/src/rest-server-canonical-query-ast.test.ts) is keyed torest-server.ts; widening its source census to coverimport-runner.tswould close the class for the whole package.Related
findDataliterals speak the canonical QueryAST; retirewireDialectQuery(consumer half of #16066) #16337 — the same class, closed inrest-server.ts; this file was explicitly out of that card's scope.FindDataRequest.querydeclares the QueryAST, but the shippedfindDataingress also accepts an undeclared wire dialect — so that one slot cannot be compiled #16066 — the spec half: whether the transport aliases get declared at the HTTP door. Independent of this card, which is about the server's own literals.Generated by Claude Code