Skip to content

feat(runs): delete a launch that has ended - #156

Merged
harenome merged 3 commits into
ThinkFlowLab:mainfrom
harenome:feat/delete-a-run
Nov 16, 2026
Merged

harenome merged 3 commits into
ThinkFlowLab:mainfrom
harenome:feat/delete-a-run

Conversation

@harenome

@harenome harenome commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #155

What

You can now delete a launch that Nullius ran, on one machine or split in shards over several. In Runs, By launch, the foot of a launch's block has Delete launch after all of its runs end. It asks first, in a modal dialog:

Delete launch gsm8k-1116-1431

  • fake (2 shards)

2 folders · 6.7 kB · 2 judgements · workspace witty pelican
☑ Its copy on ubuntu@10.0.0.4
☑ Its copy on ubuntu@10.0.0.5

[Keep it] [Delete launch]

The title names the launch as its block shows it. The list gives its rows by the names the table shows (a participant's shards are one entry, with their count). One line gives the totals. Each host with a copy has a ticked box. Keep it has the focus; Esc and a click on the backdrop also close the dialog, and the focus goes back to the button. The dialog is a native <dialog> with the frame of the catalogue's Add dialog (dialog.std-how). The page has one dialog, and each launch carries its question in a <template>. The notice after a delete names the launch.

Which runs make the launch comes from the grouping that By launch uses (launches.group): the run records, and the standard's launch id that every shard records. A launch split over two machines is two runs, one per shard, and Delete takes both.

The launch goes as one: its runs ran the same tasks, its task checks check them for every agent, and a run cannot be added back to it. The job page has no delete. Its execution strip has a link, Delete its launch…, to the Runs page with the dialog of its launch open (/runs?view=launch&delete=<key>#<anchor>). All runs lists jobs and has no Delete.

For each run, Yes removes the run folder, the run's roots and parsed jobs in each workspace that holds it, the judgements of its trials in those workspaces, and the run's entry in the registry that the pages read. For each ticked host, it runs rm -rf ~/.nullius/runs/<name> there for the run on that host. If a host does not answer, the deletion continues and the notice says that the copy stays. If a run folder cannot be removed, the notice says so ("Deleted part of launch …; stays in : "), and that run keeps its jobs, judgements and host copy. Nothing else on the hosts changes.

No Delete for:

  • a launch with a row that no run of Nullius made (jobs opened from elsewhere that the Runs page groups with it);
  • a launch with a run that is preparing, running, paused or stopping. execution.delete refuses it too, and deletes nothing: " is running: stop it before you delete it".

execution.delete also refuses a name that is not a folder directly in the runs directory with its run.json (a path, .., a link, a folder without a record), and the host folder of a run that the host refused at its name check, because that folder belongs to another run. A judgement folder stays if another root in the same workspace has a job with the same id, because those judgements are shared.

POST /launch/<key>/delete takes the form token and a local client, as Stop does. It finds the launch's runs again by the same grouping, and does not trust a list from the form.

A notice and a dialog (its own commit, first in the series). A notice from the server (flash) is a toast tray that base.html writes without the popover attribute. When a dialog opens or closes, the observer in notifications.js moves the tray into it and calls showPopover. On that tray the call throws: a page JavaScript error. The observer now sets popover="manual" first, as nulliusNotify does. The bug is older than this change. Each delete ends on a notice, and the next Delete launch opens a dialog over it. So this PR makes the bug reachable after every delete. The attribute in base.html would be as small, but the browser's popover style (overflow: auto) then also clips the shadow of every flashed notice. The script line changes the tray only when a dialog moves it.

Touches

backend (execution, workspace, judge/store) · routes (web/runs) · templates and static (runs/index.html, runs/_execution.html, runs/launches.css, style.css, notifications.js) · docs and site (builder.md, judgement.md, cli/pages.md)

Before and after

Runs, By launch: an ended launch of two agents with nop and oracle, an ended launch in two shards on two hosts, and a running launch, 1280 px, light. After, both ended launches have Delete launch, the running one has none.

Before After
01-before-runs-light-1280 07-after-runs-light-1280

The dialog (after only):

Light, 1280 px Dark, 390 px
One machine 08-after-ask-light-1280 11-after-ask-dark-390
Two shards, two hosts 12-after-shards-ask-light-1280 15-after-shards-ask-dark-390

The job page, and where its link leads:

Before After The link's target
05-before-job-light-1280 16-after-job-light-1280 19-after-linked-light-1280

Verified

On this branch, rebased on main at ce8b39db, in throwaway containers (python:3.12):

  • python3 app/tests/parallel.py: 2045 tests in 119 modules, OK.
  • python3 app/tests/parallel.py app/ui_tests: 347 tests in 42 modules, OK.
  • New: app/tests/test_run_delete.py (what goes, with the totals and the copies per host; folder, roots, parsed jobs and judgements removed, other roots kept; a twin job id keeps its judgements; every alive state refused, and nothing of the launch deleted; the registry's state wins; paths, .., links and folders without a record refused; host copy removed when ticked, kept when not, kept and reported when the host does not answer, never touched after a name-check refusal; a launch of two shards on two hosts deleted whole, each copy from its own host; one shard still going refuses the whole launch; a folder that cannot be removed is reported and its run kept whole). RunDelete in app/ui_tests/test_run_routes.py (the dialog and what it names, for one machine and for two shards on two hosts; one dialog per page; no Delete in All runs; the job page's link and the launch whose dialog it opens; a sharded launch deleted with a stand-in ssh; a host that does not answer named in the notice; no Delete and a refusal for a launch with a job from elsewhere; no Delete and a refusal while a shard runs; form token; the launch gone from every page). On main, all of these tests fail: there is no execution.delete and no route.

Browser check, Chromium (Playwright 1.49), light and dark, 1280 px and 390 px. The app ran in a container with an ended launch (two agents, nop, oracle) in two workspaces with eight judgement records, an ended launch in two shards whose runs name two hosts (a stand-in ssh that logs and answers), and a running launch (sleep 900):

  • main: no Delete anywhere.
  • This branch: both ended launches have Delete launch, the running one has none. The button opens the dialog, by mouse and by keyboard. The dialog is named by its title, has the focus on Keep it, and stays inside the viewport at 390 px. Esc, the backdrop and Keep it each close it, and the focus goes back to the button. The running job page has no link. The ended job page's link, and a shard's, opens the Runs page with the dialog of that launch open. Delete launch on each: the notice reads "Deleted launch exp-1110-*." and "Deleted launch gsm8k-1116-1431.", the running launch stays, the three run folders are gone, and both workspaces have no roots of them and no judgements. For the sharded launch, the box for ubuntu@10.0.0.5 was unticked: ssh got rm -rf "$HOME/.nullius/runs/gsm8k-1116-1431-s1" on ubuntu@10.0.0.4 only. The job pages give 404. No page JavaScript errors.
  • A notice from the server (flash) and a dialog, reproduced on main: POST /workspaces/open/nope flashes "No workspace called nope." on the Workspaces page, and the Settings link then opens its dialog over it. On main, there are two page errors: one when the dialog opens, one when it closes (Failed to execute 'showPopover' on 'HTMLElement': Not supported on elements that do not have a valid value for the 'popover' attribute.). With the fix commit alone on main: no error, and the notice shows above the dialog and stays after it closes. At the tip of this branch with only the fix reverted, the delete check above fails with the same error on /runs?view=launch, when the second Delete launch opens over the first one's notice.

Not verified: host copy removal on a real host. The tests and the browser check use a stand-in for ssh.

Risk

High. This change deletes files. If the checks are wrong, a delete can remove a folder that is not a run, or judgements of another job. The guards are: each name must be a run folder directly in the runs directory with its record, links are refused, a launch with a run still going is refused whole, every row of the launch must come from those runs, and judgements are removed only for job ids that no other root in the workspace has. A deleted launch cannot be restored. A revert removes the action and leaves all data as it is.

The Runs page now reads, for each ended launch of Nullius's runs, what its deletion removes (the folder sizes and the workspaces that hold it), each time the page renders. The job page groups the workspace's jobs by launch to know whether to show its link.

A notice from the server (flash) is a toast tray that base.html writes
without the popover attribute. When a dialog opens or closes, the observer
in notifications.js moves the tray into the top dialog and calls
showPopover on it. On a tray without the attribute, that call throws, and
the page has a JavaScript error each time.

The observer now sets popover="manual" on the tray first, as nulliusNotify
does for the trays that it makes.
A run made from the builder could not be deleted. execution.delete takes
the runs of one launch: one run, or one per machine for a launch split
in shards. For each run it removes the folder, the roots and parsed jobs
in every workspace that holds it, the judgements of its trials there
and, when asked, its copy on its own host. execution.deletion says what
goes first, with the totals and the copies per host.

Only a folder directly in the runs directory with its run.json is a
run; a link or any other path is refused. If one run of the launch is
preparing, running, paused or stopping, nothing is deleted: stop it
first. A run refused at the host's name check keeps the host folder,
which is another run's.

A folder that cannot be removed is said, and its run keeps its jobs,
judgements and host copy. A host that does not answer keeps its copy,
which is said too; the local delete goes on.
A launch is the block that Runs, By launch, shows with its agents and
task checks. When every run of it has ended, and Nullius made every row
of it, the foot of its block has Delete launch. Shards on several
machines are runs of one launch, by the grouping that view uses, and go
together. A launch with a job from elsewhere has no Delete.

Delete asks first, in a modal dialog. Its title names the launch as the
block shows it. The dialog lists the rows by the names the table shows
(shards counted per participant), then one line of totals: folders,
size, judgements and the workspaces that hold it. Each host with a copy
has a ticked box. Keep it has the focus. One dialog serves every launch:
each launch carries its question in a template. The notice names the
launch and what stays.

The job page does not delete the job. It links to the Runs page with
the dialog of its launch open. POST /launch/<key>/delete takes the form
token and a local client, as Stop does, and refuses a launch with a run
still going with one line. The open workspace is read again without the
runs' roots.
@harenome
harenome merged commit b11083b into ThinkFlowLab:main Nov 16, 2026
2 checks passed
@harenome
harenome deleted the feat/delete-a-run branch November 16, 2026 14:42
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.

Runs: delete a launch that has ended

1 participant