Repository navigation
feat(runs): delete a launch that has ended - #156
Merged
Merged
Conversation
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.
This was referenced Nov 16, 2026
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.
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:
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:
execution.deleterefuses it too, and deletes nothing: " is running: stop it before you delete it".execution.deletealso refuses a name that is not a folder directly in the runs directory with itsrun.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>/deletetakes 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.htmlwrites without thepopoverattribute. When a dialog opens or closes, the observer innotifications.jsmoves the tray into it and callsshowPopover. On that tray the call throws: a page JavaScript error. The observer now setspopover="manual"first, asnulliusNotifydoes. 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 inbase.htmlwould 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.
The dialog (after only):
The job page, and where its link leads:
Verified
On this branch, rebased on
mainatce8b39db, 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.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).RunDeleteinapp/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). Onmain, all of these tests fail: there is noexecution.deleteand 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
sshthat logs and answers), and a running launch (sleep 900):main: no Delete anywhere.sshgotrm -rf "$HOME/.nullius/runs/gsm8k-1116-1431-s1"on ubuntu@10.0.0.4 only. The job pages give 404. No page JavaScript errors.main:POST /workspaces/open/nopeflashes "No workspace called nope." on the Workspaces page, and the Settings link then opens its dialog over it. Onmain, 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 onmain: 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.