Skip to content

Fix keyset pagination of a SQLite feed (ties, filters before paging, exact next-cursor, rows changing between pages, cursor validation)

Exact prompt

# Task: fix the feed pagination Users report that the item feed served by `feed.py` skips items, shows duplicates, returns short pages when filtering, and sometimes offers a "next page" link that leads to an empty page. Fix `list_items` in `feed.py` (rewrite freely) so it follows `PAGINATION.md` exactly. Python standard library only (`sqlite3`). Keep the function name and signature. You may not change the table schema in `schema.sql`. No network. The grader runs a hidden unittest suite: it builds SQLite databases with `schema.sql` (hundreds of items, many sharing the same `created_at`), walks pages with various limits, filters and orders, inserts and deletes rows between page requests, and feeds invalid arguments.

The starting code paginates on created_at alone (skips ties), filters after LIMIT (short pages), emits a next cursor for an exactly-full last page, interpolates order into SQL and accepts any cursor. Hidden walks with inserts/deletes between pages expose each bug. Original benchmark task written for usecaserank.com (not based on a specific public post). Headless, offline run on a reproducible fixture. Each run's notes say how its cost was measured (estimates are marked).

Success criteria: 1. All 10 hidden unittest cases pass (schema unchanged, item shape, desc and asc walks with ties at several limits, filtered pages exactly full, exactly-full last page has no cursor, limit/order validation, injection-safe status, bad/mismatched cursors raise ValueError, inserts/deletes between pages).

Best model for this task so far: Claude Haiku 5.5 (effort default (no --effort flag) · thinking on) (success, $0.0086, 41s).

Run this on another model

All runs (4)

100% pass rate across 4 eligible runs: 4 pass, 0 partial, 0 fail. Partial and failed runs are listed below with everything else.ⓘ

Runs for this use case
ModelCostTimeStep-insⓘAutonomyOutcomeTrustⓘDateCompare
OGPT-6.1 Soldefault · thinking on$0.061m0Fully autonomouspassTrust 80%2026-10-22
AClaude Haiku 5.5default · thinking on$0.008641s0Fully autonomouspassTrust 80%2026-10-19
AClaude Opus 5.5default · thinking on$0.1838s0Fully autonomouspassTrust 80%2026-10-19
AClaude Sonnet 5.5default · thinking on$0.0721s0Fully autonomouspassTrust 80%2026-10-19

Embed this result

A live badge for this use case. It links back here and updates as new runs are published.

UseCaseRank badge for Fix keyset pagination of a SQLite feed (ties, filters before paging, exact next-cursor, rows changing between pages, cursor validation)

Get new runs and ranking changes weekly

Which models got better or cheaper on real tasks like this one.