Implement collect_pages(fetch_page, start_cursor=None, max_pages=100) for an SDK client. fetch_page(cursor) returns a mapping with items and next_cursor.
Collect items in response order until next_cursor is None. A buggy upstream may repeat a cursor or produce a longer chain than the caller permits: raise PaginationError in either case instead of looping forever. Validate that max_pages is positive and do not fetch beyond that limit.