Cursor pagination at scale
You're building a paginated list endpoint in Go that serves rows from Postgres ordered by `created_at`. You want an AI agent to write the pagination utility — encoding/decoding a cursor and producing the `WHERE` clause and `LIMIT`. Write the prompt/spec, with constraints, edge cases, and acceptance criteria, that gets it correct first try. Explain what a casual prompt ("add pagination with offset and limit") would get wrong at scale.
keyset_page(rows: list[str], after_cursor: str, page_size: int) → list[str][["2026-01-05T09:00|r1","2026-01-05T10:00|r2","2026-01-06T08:00|r3"],"",2]out["r1","r2","2026-01-05T10:00|r2"][["2026-01-05T09:00|r2","2026-01-05T09:00|r1","2026-01-06T08:00|r3"],"2026-01-05T09:00|r1",2]out["r2","r3",""]Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.