Skip to content

Deleting a launch keeps its judgements when a deleted job of the same id is still in the workspace's job index #358

Description

@harenome

Priority

high by depth: the cause is in the backend (app/nullius/execution.py, app/nullius/workspace.py). P2 is set because nothing is lost: judgements are left behind, not removed wrongly, and the delete dialog under-counts them.

Components

  • app/nullius (backend)
  • app/web (routes)
  • templates and static files
  • docs and the site
  • catalogue (benchmarks, agents, capabilities)
  • the standard (ports, kits, relay, runs)
  • CI, workflows and skills

Evidence

Deleting a launch removes the judgements of its jobs, but spares the judgement folder of a job id that another entry of the workspace's job index still names (execution._run_deletion, app/nullius/execution.py, line 1843). The job index never drops the entry of a job folder deleted on disk: workspace.load_jobs only adds entries, and workspace.forget only removes folders it still finds. So a job id that once existed twice, for example an older copy of the job in another root that was later deleted by hand, keeps the run's judgements alive after the delete. On main (3347bf3), with the script below:

job ids: ['job-x', 'job-x']
judgement folders the delete removes: []
judgement of the deleted run still on disk: True

The same script without the older copy removes them:

judgement folders the delete removes: ['.../judgements/job-x']
judgement of the deleted run still on disk: False

Screenshot

No response

Reproduction

From the repository root, with a temporary profile:

import json, os, sys, tempfile, shutil
sys.path.insert(0, "app")
os.environ["NULLIUS_HOME"] = tempfile.mkdtemp()
from nullius import execution, workspace, paths
from nullius.judge import store

def job(jd, name):      # a minimal ended Harbor job with one trial
    os.makedirs(os.path.join(jd, "t1"))
    json.dump({"id": name, "started_at": "2026-01-01T00:00:00", "finished_at": "2026-01-01T00:01:00", "n_total_trials": 1, "stats": {}}, open(os.path.join(jd, "result.json"), "w"))
    json.dump({"job_name": name, "agents": [{"name": "nop"}], "datasets": [{"name": "d"}]}, open(os.path.join(jd, "config.json"), "w"))
    json.dump({"task_name": "t", "trial_name": "t1", "started_at": "2026-01-01T00:00:00", "finished_at": "2026-01-01T00:01:00",
               "agent_info": {"name": "nop"}, "verifier_result": {"rewards": {"reward": 1}}}, open(os.path.join(jd, "t1", "result.json"), "w"))

runs = paths.runs_dir(); home = paths.workspaces_dir(); os.makedirs(home)
ex = execution.Execution(execution.Plan(name="demo", script="true\n"), root=runs, key="k", url="u")
ex.state = "done"; ex._save()
job(os.path.join(ex.jobs, "job-x"), "job-x")
other = tempfile.mkdtemp(); job(os.path.join(other, "job-x"), "job-x")     # an older copy, elsewhere
ws = workspace.create(home, [ex.jobs, other], "w")
print("job ids:", [j.job_id for j in workspace.load_jobs(ws, ws.roots)])
shutil.rmtree(os.path.join(other, "job-x"))                               # the older copy deleted by hand
store.save(ws.dir, "job-x", "t1", {"questions": "v", "answers": {"q": 1}})
print("judgement folders the delete removes:", execution.deletion(["demo"], home, runs)["runs"][0]["workspaces"][0]["judged"])
execution.delete(["demo"], home, runs)
print("judgement of the deleted run still on disk:", os.path.exists(os.path.join(ws.dir, "judgements", "job-x", "t1.json")))

Expected

Deleting a launch counts and removes the judgements of its jobs. A job that no longer exists on disk does not protect them.

Acceptance

  • load_jobs drops the index entries, and their cache files, of job folders no longer found under the workspace's roots.
  • forget drops the entries under a removed root even when its folder is gone.
  • The reproduction above removes the judgement, and a test covers it.
  • A job id that really exists in two roots still keeps its judgements when only one launch is deleted.

Dependencies and related

#317 (the moved head kept in the job index), #155 and #156 (deleting a launch).

Activity

  1. added
    bug
    P2
    on Nov 23, 2026
  2. added theissue type on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions