Whether the node can be emitted: it and every node upstream of it are valid and of a registered type
The lambda that runs the query up to its capture node (the selected
node): {| <relation>->limit(rowLimit + 1)->from(runtime)}, with no
limit when rowLimit is left out. The relation
is written with its rows' order where it is used, and the capture's own
order, if any, as a sort before the limit, so the rows shown are in it.
Each node upstream of the capture whose type is an isolation boundary (a
window) is bound with a let, after the lets it reads, and read by name
(PLAN §8.6). The lambda is then
{| {| <lets>; <relation>}->from(runtime)->sort(…)->limit(rowLimit + 1)}:
a from() can't go inside a let, and the capture's sort and limit go
after it, since inside, the ORDER BY ends in a subquery that some
databases don't keep. Typing lambdas never bind: they type the same.
The relation expression of a node: its upstream tree, without limit or
from, e.g. for typing the node with the engine. The node must be one
canEmit accepts.
Builds the IR of queries, from the node types of a registry. Inference runs once, when the emitter is created, with the registry's query rules, as for the canvas.