Delete specific runs, archiving them first - #100
Merged
Merged
Conversation
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
There was a problem hiding this comment.
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.
Contributor
|
🚅 Deployed to the app-pr-100 environment in weval
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-configremoves a whole blueprint, every run and every model.deleteResultByFileNameis unused and still points at the oldmulti/layout, so it would not touch live runs (live/blueprints/<config>/…).What this adds
storageService.archiveAndDeleteRun(configId, fileName, archiveName, dryRun)removes one run: its…_comparison.jsonand the artefact folder beside it (core, responses, coverage, histories). Each object is first copied toarchive/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 outsidebackups/on purpose:restore-datareplaces 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):dryRun: falseanswers 202 and works in the background, logging[DeleteRuns]underdelete-runs:. WithrebuildSummariesit then rebuilds the homepage, leaderboards and model summaries, which re-read the run list from storage, so the removed runs drop out.workflow_dispatch):runsas comma-separatedconfigId/fileName, withdry_runticked by default andrebuild_summarieson by default.Card and leaderboard numbers don't change; they already use each blueprint's latest run only.
Plan once merged
Tests
archiveAndDeleteRunon local storage, as a round trip with real files (3 tests).archiveAndDeleteRunon S3 with a mocked client (4 tests): paginated listing, URL-encodedCopySource, nothing deleted when a copy fails, refuses a missing run.tsc --noEmitclean. 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-datascan onlymulti/andsandbox/, notlive/, so they don't back up current results.🤖 Generated with Claude Code
https://claude.ai/code/session_015roAwvpcszBvjX1Ce5NFuj
Generated by Claude Code