A pagination design retrieves one extra record while scanning newest to oldest, then presents the retained records oldest to newest. The key question is which end contains the lookahead record and which retained boundary should anchor the next older-page request. A small ordered example can reveal gaps or duplicates. No implementation evidence or tests are involved.
Correct lookahead trimming and cursors for reverse-ordered pagination
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.