- Fix route ordering bug: GET /analyze/batch was shadowed by
GET /analyze/{company_name} causing all GET requests to /analyze/batch
to be erroneously handled as single-company analysis (503). Move
/analyze/batch GET registration to before the {company_name} route.
- Update TypeScript schema.d.ts: add AnalysisRecord, PaginatedAnalysisResponse,
PaginatedJobsResponse schemas; add GET /analyze/batch operation with
cursor+limit+company_name params; update list_jobs_jobs_get to include
cursor param and return PaginatedJobsResponse.
- Update frontend/src/api/client.ts: add listBatchAnalyses() method with
cursor/limit support; update listJobs() to accept cursor and return
PaginatedJobsResponse; default limit changed from 10 to 50.
- Update frontend/src/types/index.ts: export AnalysisRecord,
PaginatedAnalysisResponse, PaginatedJobsResponse.
- Expand tests/test_pagination.py: add auth fixture so tests pass JWT
validation; add 11 new /jobs tests covering first page, last page,
subsequent pages, empty results, status filter, limit boundaries, cursor
forwarding, and paginated response shape.
Closesleeworks-agents/SPARC#1684
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Closesleeworks-agents/SPARC#1669
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>