Skip to content

Delete specific runs, archiving them first - #100

Merged
nojibe merged 1 commit into
mainfrom
claude/delete-runs
Oct 2, 2026
Merged

nojibe merged 1 commit into
mainfrom
claude/delete-runs

Conversation

@nojibe

@nojibe nojibe commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Why

Model pages (/model/...) average every stored run of every blueprint. When a run is re-done because its judging failed, the broken copy stays in storage and keeps counting. Apertus 1.5 70B's model page currently averages in 12 such runs (YKA Disability Rights ×7, YKA Set ×4, Web Design 101 ×1, several scored 0%), so it shows 0.670 and lists YKA Disability Rights as its weakest blueprint at 19% (its real score is 86.5%).

There was no working way to remove a single run:

  • delete-config removes a whole blueprint, every run and every model.
  • deleteResultByFileName is unused and still points at the old multi/ layout, so it would not touch live runs (live/blueprints/<config>/…).
  • Runs have no hide flag.

What this adds

  • storageService.archiveAndDeleteRun(configId, fileName, archiveName, dryRun) removes one run: its …_comparison.json and the artefact folder beside it (core, responses, coverage, histories). Each object is first copied to archive/deleted-runs/<archiveName>/<original key>, and nothing is deleted unless every copy succeeded, so a run can be put back by copying it back. The archive sits outside backups/ on purpose: restore-data replaces all live data with what a backup holds, and a one-run archive must never be mistaken for one. It also drops the server's local artefact cache for the run.
  • POST /api/internal/delete-runs (background-function auth, same as add-models):
    • Checks every listed run before touching anything: it must exist, must not be listed twice, and must not be its blueprint's latest run, so a blueprint always keeps the run its pages and leaderboards use.
    • Dry run is the default and answers 200 with each run's object count.
    • dryRun: false answers 202 and works in the background, logging [DeleteRuns] under delete-runs:. With rebuildSummaries it then rebuilds the homepage, leaderboards and model summaries, which re-read the run list from storage, so the removed runs drop out.
  • "Delete Runs" workflow (workflow_dispatch): runs as comma-separated configId/fileName, with dry_run ticked by default and rebuild_summaries on by default.

Card and leaderboard numbers don't change; they already use each blueprint's latest run only.

Plan once merged

  1. Dry run on the 12 broken Apertus runs and check the list.
  2. Real run with rebuild.
  3. Check that the model page no longer shows them.

Tests

  • Route: dry-run default, real run in background plus rebuild, keeps going after a failure, refuses latest, unknown and duplicate runs, auth, input validation (8 tests).
  • archiveAndDeleteRun on local storage, as a round trip with real files (3 tests).
  • archiveAndDeleteRun on S3 with a mocked client (4 tests): paginated listing, URL-encoded CopySource, nothing deleted when a copy fails, refuses a missing run.
  • tsc --noEmit clean. Full suite: 1194 passed, 2 skipped. ESLint not run locally (repo lint config doesn't run in this sandbox).

Noticed, not changed

backup-data/restore-data scan only multi/ and sandbox/, not live/, so they don't back up current results.

🤖 Generated with Claude Code

https://claude.ai/code/session_015roAwvpcszBvjX1Ce5NFuj


Generated by Claude Code

Adds a way to remove individual published runs (for example, runs whose
judging failed) so they stop counting towards model pages, which average
every stored run. There was no working way to do this: the only delete
command removes a whole blueprint, and deleteResultByFileName still points
at the old multi/ layout.

- storageService.archiveAndDeleteRun copies a run's comparison file and its
  artefact folder to archive/deleted-runs/<name>/ under their original keys,
  and deletes them only if every copy succeeded. The archive is outside
  backups/ so restore-data can never mistake it for a full backup.
- POST /api/internal/delete-runs checks every run first (it must exist and
  must not be its blueprint's latest run), dry-runs by default, and on a real
  run works in the background and can rebuild summaries afterwards.
- The "Delete Runs" workflow calls it; dry run is ticked by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015roAwvpcszBvjX1Ce5NFuj

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@railway-app

railway-app Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🚅 Deployed to the app-pr-100 environment in weval

Service Status Web Updated
weval-app ✅ Success (View Logs) Web Oct 2, 2026 at 1:04 am UTC

@railway-app
railway-app Bot temporarily deployed to weval / app-pr-100 October 2, 2026 00:55 Destroyed
@nojibe
nojibe merged commit e34db8b into main Oct 2, 2026
2 checks passed

This branch was successfully deployed

No deployments
weval / app-pr-100 — caf2e90e Deployed Oct 2, 2026 by railway-app[bot]
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.

2 participants