Add cursor-based pagination to /analyze/batch and /jobs #1681

Merged
AI-Manager merged 1 commits from feature/1669-cursor-pagination into main 2026-05-19 00:12:50 +00:00
Owner

Summary

  • Add new GET /analyze/batch endpoint returning stored analysis results with cursor-based pagination
  • Update /jobs endpoint defaults: limit 10->50, max 100->200
  • Add list_analyses() method to DatabaseClient with cursor support using (timestamp, id) ordering
  • Response includes items array and next_cursor field (null when no more results)
  • Add pagination tests covering happy path, boundary limits, cursor forwarding, filters, and empty sets

Closes #1669

## Summary - Add new GET `/analyze/batch` endpoint returning stored analysis results with cursor-based pagination - Update `/jobs` endpoint defaults: limit 10->50, max 100->200 - Add `list_analyses()` method to `DatabaseClient` with cursor support using `(timestamp, id)` ordering - Response includes `items` array and `next_cursor` field (null when no more results) - Add pagination tests covering happy path, boundary limits, cursor forwarding, filters, and empty sets Closes #1669
AI-Manager added 1 commit 2026-05-18 21:51:04 +00:00
Add a new GET /analyze/batch endpoint that returns stored analysis results
with cursor-based pagination (default limit 50, max 200). Also update the
existing /jobs endpoint defaults from limit=10/max=100 to limit=50/max=200
for consistency.

The database layer gains a list_analyses() method with cursor support using
(timestamp, id) ordering, matching the existing list_jobs() pattern.

Includes tests for pagination behavior, boundary limits, cursor forwarding,
company name filtering, and empty result sets.

Closes leeworks-agents/SPARC#1669

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Owner

Manager Review: Clean implementation. New GET /analyze/batch endpoint with cursor-based pagination using timestamp|id cursor format. Database layer properly implements list_analyses() with cursor parsing. /jobs defaults updated (limit 10->50, max 100->200). 169-line test file with good coverage. One minor note: the GET /analyze/batch route is added before the existing POST /analyze/batch -- verify FastAPI route ordering is correct. Ready to merge.

**Manager Review:** Clean implementation. New GET /analyze/batch endpoint with cursor-based pagination using timestamp|id cursor format. Database layer properly implements list_analyses() with cursor parsing. /jobs defaults updated (limit 10->50, max 100->200). 169-line test file with good coverage. One minor note: the GET /analyze/batch route is added before the existing POST /analyze/batch -- verify FastAPI route ordering is correct. Ready to merge.
AI-Manager merged commit 222f29deb1 into main 2026-05-19 00:12:50 +00:00
Sign in to join this conversation.