Skip to content

Add a rescore action, sending drafts from the web, and a Your activity page - #45

Merged
mykolamelnykml merged 1 commit into
mainfrom
my-activity
Oct 5, 2026
Merged

mykolamelnykml merged 1 commit into
mainfrom
my-activity

Conversation

@mykolamelnykml

Copy link
Copy Markdown
Contributor

A production submission showed a run as Queued with no task behind it. It looked like the worker had lost the task, but the submission was a draft: a run is created Queued as soon as its PDF is uploaded, and nothing is queued until the submitter sends it. If the submit page is closed before "Send for scoring", the draft is stranded. Neither the submitter nor staff could move it from the web, and staff had no way to re-queue a submission whose task really was lost.

Benchmarks

  • services.rescore, staff only: re-queues every run of a submission that is Scoring, Scoring failed or Awaiting review. Scoring then moves it on, emails included. It refuses, saying why:
    • drafts: never sent, and sending is the submitter's call
    • Approved, Rejected or Withdrawn submissions: a decided result would change without a review
  • Admin: a "Re-score - queue every run for scoring again" action on the submission list. It reports each refusal per submission.
  • "Not sent" replaces "Queued" for a draft's runs, in the admin's run list and on "Your submissions".
  • "Your submissions" gets a Send for scoring button on a draft that has runs, using the existing finalize endpoint.

Your activity (/activity)

  • Linked from the user menu, below "Account".
  • One page with four sections, each with a status per item and a link to the page where the work is done:
    • benchmark submissions (unsent drafts flagged)
    • listing claims
    • tools submitted to the catalog
    • listings maintained
  • Empty sections say how to start.
  • New endpoint GET /api/v1/catalog/claims/mine (list_my_claims → useListMyClaims()); claims were the one list without one. It returns ToolClaimOut plus tool_name, and leaves out the editor's internal comment. openapi.json and the generated client are regenerated.
  • The benchmark status labels are now exported from my-submissions.tsx (SUBMISSION_STATUS), so both pages use the same words.

Not included:

  • Comments. The existing "my comments" endpoint only answers for one page at a time, so an account-wide list would need a new endpoint.
  • Re-score in the staff MCP tools. It lives only in the admin for now, but sits in the shared service, so adding it there is small.

Testing

  • Backend: full suite, 716 passed, including every benchmark test (this touches apps/benchmarks/, so the Benchmarks workflow will also run here). New tests:

    • rescoring a submission stuck in Scoring
    • refusing a draft, a decided submission and a non-staff account
    • the admin action and its refusal message
    • "Not sent" in the admin
    • the claims endpoint: only your own claims, and auth required
  • Frontend: 884 passed, plus lint, format and typecheck. New tests:

    • sending a draft
    • "Not sent"
    • no Send button on an empty draft
    • each activity section and its empty state
    • the menu link

    The menu's keyboard test now counts the extra item.

  • In the browser: /activity redirects a signed-out visitor to sign-in with the callback kept. The signed-in pages and the admin action are covered by tests but weren't checked in a browser.

After deploy

The stuck keptpdf submission is a draft. Re-score will refuse it, as intended; the submitter can now send it from "Your submissions".

…y page

A run is created Queued as soon as its PDF is uploaded, but nothing is queued
until the submitter sends the submission. A draft left behind therefore looked
like a task the worker had lost, and neither the submitter nor staff could move
it from the web.

Benchmarks:
- services.rescore re-queues every run of a submission that is scoring,
  failed or awaiting review. It refuses drafts (sending is the submitter's
  call) and decided submissions (a published result would change without
  review). The submission admin gets a "Re-score" action over it.
- A draft's runs read "Not sent" instead of "Queued", in the admin and on
  "Your submissions".
- "Your submissions" sends a draft that has runs ("Send for scoring"), through
  the existing finalize endpoint.

Your activity (/activity, linked from the user menu):
- One page listing the account's benchmark submissions, listing claims, tools
  submitted to the catalog, and listings maintained. Each section shows a
  status and links to the page where the work is done.
- New GET /catalog/claims/mine (list_my_claims), the one list that had no
  endpoint. It leaves out the editor's internal comment.
@mykolamelnykml
mykolamelnykml merged commit dfd9821 into main Oct 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant