Michael Rabinovich Cursor commited on
Commit
2893b22
·
1 Parent(s): c7f83a5

leaderboard: admin rescore (selected + all) reusing the eval pipeline

Browse files

Add a maintainer-only rescore that re-evaluates submissions against the
current ground truth/data, reusing the submit worker end to end: each
target row is reset to the pending regime (scores cleared, submitted_at
preserved) and _spawn_worker is re-dispatched, which re-renders the
gallery, regenerates reports/<id>.{html,json}, and recomputes the score.

- rescore_rows(ids): selected rows; LookupError on unknown id before any
write. rescore_all(): every row with a stored zip that isn't pending
(skips legacy zip-less seed rows + in-flight evals).
- Bulk dispatch is staggered on a background thread so a board-wide
rescore doesn't fire N run_job calls at once; fully re-runnable, so an
interrupted rescore converges on a retry.
- UI in the Admin tab: "Rescore selected" behind a confirm checkbox and
"Rescore ALL" behind a type-to-confirm phrase, both admin-gated with a
server-side re-check and disarmed after firing / on load.

Co-authored-by: Cursor <cursoragent@cursor.com>

3 files changed +559 -6
Files changed (3)
admin.py+207
app.py+194-6
tests/test_admin.py+158