Polls page, and paging never strands the caller
A first poll used to select every terminal run the installation had ever produced and load the lot, which is an out-of-memory failure rather than a slow query.
The rule
- Every poll is bounded to a page: a first poll, or one whose cursor is empty or unparseable, costs no more than any other.
- Paging is only sound if the caller can always walk to the end, so two things bind.
- A page ordered by completion time is extended to cover every run sharing the last row's completion value, because completion times are not unique and a caller advancing its cursor past a split group would skip the remainder for good; the ordering is made total by a unique tiebreak so the held-back group is a clean suffix.
- And a poll must not answer empty while rows remain: where scoping (OCX-3) is applied after the page is read, a page can filter down to nothing, and an empty answer reads to the caller as "nothing new" and parks its cursor forever, so paging continues until something is emitted or the result set is exhausted.
What it means
Paging exists so a caller with a large backlog can walk it without the poll itself failing or blocking on an unbounded read, but a page bound only works if the caller is guaranteed to reach the end by walking it. Two things make that guarantee hold. First, if the row that ends a page shares its completion time with rows the page cut off, the page is extended past its nominal size to sweep in the whole group — a caller advancing its cursor to a split group's timestamp would otherwise skip whatever got split off, for good, because completion times repeat and are not themselves a safe cursor. Second, a page that happens to filter down to nothing must never come back as an empty answer while rows genuinely remain past the cursor: an empty answer reads to a caller as "there is nothing new," and a caller that parks its cursor there never asks again.
Example
More runs than a page holds, none of them externally invoked, sit ahead of the one run the caller needs; the first poll, by timestamp or by id, still surfaces it rather than answering empty.
["external"]