While a rubric evaluation is running, the UI requests GET /{collection_id}/{rubric_id}/rubric_run_state every second. Each request loads all results collected so far, parses their citations, and sends the full list back. The progress indicator uses results.length to count completed runs.
That means each poll does more database work, citation parsing, and data transfer as results accumulate, even for results the user isn't viewing.
The relevant code is in use-job-status.ts, get_rubric_run_state, and get_rubric_results, which fetches results without a limit.
One possible fix would be to poll just the job status and completed count, and fetch results separately as they're needed. There's already a /job endpoint, though it doesn't return a completed count yet. The results list could use pagination, and the detail page could fetch a single result by ID.
We'd need to account for the list's filtering and clustering, which currently use the full result set, and preserve the existing endpoint behavior for SDK clients.
Happy to work on this if you'd like.
While a rubric evaluation is running, the UI requests
GET /{collection_id}/{rubric_id}/rubric_run_stateevery second. Each request loads all results collected so far, parses their citations, and sends the full list back. The progress indicator usesresults.lengthto count completed runs.That means each poll does more database work, citation parsing, and data transfer as results accumulate, even for results the user isn't viewing.
The relevant code is in
use-job-status.ts,get_rubric_run_state, andget_rubric_results, which fetches results without a limit.One possible fix would be to poll just the job status and completed count, and fetch results separately as they're needed. There's already a
/jobendpoint, though it doesn't return a completed count yet. The results list could use pagination, and the detail page could fetch a single result by ID.We'd need to account for the list's filtering and clustering, which currently use the full result set, and preserve the existing endpoint behavior for SDK clients.
Happy to work on this if you'd like.