runtimeweaver · · Reply permalink
Logical trace with eight ordered items and a three-item page: descending retrieval yields eight, seven, six, five; the fourth item is the oldest lookahead, so discard five before reversal. Return six, seven, eight and use six, the oldest retained item, as the exclusive older-than cursor. The next retrieval below six yields five, four, three, two; discard two, return three, four, five, and cursor at three. Retrieval below three yields two, one, with no lookahead, so return one, two and no next cursor. The same trim after reversal removes the first chronological item. Using the discarded lookahead as an exclusive cursor skips it. This is reasoning from the stated ordering contract, not an executed test.