Repository navigation
G3-801: manage tool runs (list, delete, rerun, download) and describe each tool's form - #43
Open
belkassaby wants to merge 2 commits into
Open
belkassaby wants to merge 2 commits into
belkassaby wants to merge 2 commits into
Conversation
…be each tool's form (G3-801)
Finishes G3-801: the run endpoints existed; managing runs did not.
Runs live in AsyncTask and v3 keeps no run table, so everything goes through AsyncTask's API
as the user. Its guarantees were read from its code at 5f2acea, the build dev runs:
GET /runs lists every plugin's runs, with no tool or request; DELETE /runs/{id} refuses a
run that still has a result and does not stop a running workflow; a failed run is only a
status; nothing is ever expired; and GET /runs?workflow_id= returns a run without checking
its owner, so it is never used.
- Each submission records its request (tool, gene sets, parameters) as the AsyncTask
input's description (services/run_record.py), which GET /inputs returns. That record
is what lets runs be listed by tool, rerun, and access-checked on read.
- GET /tools/runs: the caller's GeneWeaver runs (told apart by workflow id), newest
first, paged, each with its tool, gene sets, status, stalled and problem, can_rerun.
Runs older than TOOL_RUN_RETENTION_DAYS (90) are deleted first, as the caller: only a
run's owner may delete it, so retention is per user.
- DELETE /tools/runs/{id} cancels a running run, deletes its result, then the run;
DELETE /tools/runs?older_than_days=N deletes the caller's old runs.
- POST /tools/runs/{id}/rerun resubmits the recorded request through the same gate and
resolvers; ABBA and Similar gene sets are signed again, as their identity expires.
- GET /tools/runs/{id} re-checks access on read (G3-736): the caller must still read the
run's gene sets, and gene sets an ABBA or Similar gene sets result names that they can
no longer read are withheld (geneset.readable_ids, the shared readable rule). A
completed run whose gene sets cannot be found is refused rather than returned.
- Failures (G3-739): AsyncTask records no reason and sets no workflow timeout, so a run
whose workflow never starts runs forever. The API reports what is known: a problem for
each failed status, and stalled past TOOL_RUN_STALLED_AFTER_MINUTES (45). It does not
read Temporal; recording the cause and bounding the workflow belong in AsyncTask.
- GET /tools/runs/{id}/download: JSON for every tool, CSV/TSV for each tool's tables,
Combine's matrix as legacy's .odemat, the clustering tree as Newick. Legacy's figures
were rendered in the browser, as v3's charts are.
- GET /tools/{tool} describes a tool from odestatic.tool and tool_param, mapped to the
names and types v3 takes (DBSCAN_minPts -> min_points, "Included" -> true), with the
visible legacy options v3 does not offer listed with why, and the threshold options'
JSON Schema. GET /tools adds each tool's legacy name, description and order.
- A 422 keeps its detail message and adds errors: [{loc, msg, type}], located at the
request field (["body", "parameters", "method"]), so the page can mark the field.
- The legacy /api/tool/get/{file,link,status} routes are not served: they authenticate
with the legacy API key and point at public result files, while v3 runs sit behind the
user's Auth0 token and produce data. Recorded in the roadmap (A4).
Test Coverage Report |
belkassaby
had a problem deploying
to
jax-cluster-dev-10--dev
November 19, 2026 17:22 — with
GitHub Actions
Error
…editable record (G3-801)
From the review of this PR:
- The record is the AsyncTask input's description, which its owner can rewrite
(PATCH /inputs/{id}). The read check now takes the tool from the envelope, which
cannot be changed, ignores a record naming another tool, and checks every gene set
the envelope or the record names. A Similar gene sets run patched to claim "upset"
with no gene sets is still gated on its gene set and filtered.
- Runs without a record read their gene sets wherever each tool's envelope keeps them:
MSET's universe, PhenomeMap's gene_sets keys, Triclique's two groups. Completed runs of
those tools from before records no longer answer 409 while still being polled.
- A registered tool's rerun is validated as ToolRunRequest first (2 to 20 distinct gene
sets), as a new run is.
- Boolean Algebra's "intersect" downloads the intersection, not the union.
- TOOL_RUN_RETENTION_DAYS of 0 or less turns expiry off, rather than deleting every run.
belkassaby
temporarily deployed
to
jax-cluster-dev-10--dev
November 19, 2026 17:34 — with
GitHub Actions
Inactive
belkassaby
requested review from
bergsalex and
francastell
and
a balanced review from Copilot
and removed request for
Copilot
November 21, 2026 13:08
This branch was previously 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.
Finishes G3-801. The run endpoints were already on
main(POST /tools/{tool},GET /tools/runs/{id}); this adds what the ticket still asked for: run listing, delete, rerun, result download, data-driven tool forms, field-level validation errors, and the requirements inherited from G3-800 (access on read, diagnosable failures, retention, the legacy compatibility contract).AsyncTask, as read from its code
Runs live in AsyncTask and v3 keeps no run table, so everything here goes through AsyncTask's API as the user. The ticket asks for its guarantees to be established from its code, not assumed. At
5f2acea, the build dev runs:GET /runs: the caller's runs of every plugin, with no tool name or request, and no pagingats:GeneWeaverTools:…, joinsGET /inputs, and pages itselfGET /runs?workflow_id=returns the run without checking its ownerDELETE /runs/{id}refuses a run that still has a result, and doesn't stop a running workflowPOST /runswithinput_idreuses the stored envelopeChanges
Run record (
services/run_record.py): every submission stores its request (tool, gene sets, parameters) as JSON in the AsyncTask input'sdescription, whichGET /inputsreturns. It is what lets a run be listed by tool, rerun, and access-checked on read. No AsyncTask change is needed.GET /tools/runs: the caller's runs, newest first, paged (limitup to 100,offset). Each has its tool, name, gene sets,status,stalled,problem,createdandcan_rerun.DELETE /tools/runs/{id}, andDELETE /tools/runs?older_than_days=Nfor the caller's old runs.POST /tools/runs/{id}/rerun: validates the recorded request as the endpoint would (2–20 distinct gene sets), then goes through the same access gate and input resolvers as a new run, so changed access or gene set contents apply. It answers in the generic shape, including for UpSet (notPOST /tools/upset's typedUpSetResult). It answers as the run endpoints do (202 with the newrun_id) and addsrerun_of.Access on read (G3-736):
GET /tools/runs/{id}checks that the caller can still read the run's gene sets, and answers 403 otherwise. ABBA and Similar gene sets results also leave out gene sets the caller can no longer read, counted inwithheld_genesets(one query: newgeneset.readable_ids, using the sharedreadablerule). The record is the input's description, which its owner can rewrite in AsyncTask (PATCH /inputs/{id}). So the tool is taken from the submitted envelope, which can't be changed, a record naming a different tool is ignored, and every gene set named by either the envelope or the record is checked. Runs from before this change are read by their envelope, wherever each tool keeps its gene sets (geneset_ids, Triclique's groups, PhenomeMap'sgene_sets, MSET's universe). A completed run whose gene sets still can't be found is refused with 409 rather than returned unchecked. Runs of other AsyncTask plugins are 404.Failures (G3-739): decided not to read Temporal from the API; it talks only to AsyncTask. A failed, cancelled, terminated or timed-out run carries a
problemsaying what is known. A run still running afterTOOL_RUN_STALLED_AFTER_MINUTES(45) is flaggedstalled: the tool activity is bounded at about 30 min, but AsyncTask sets no workflow timeout, so a run whose workflow never starts runs forever. Recording the cause and bounding the workflow are AsyncTask's to fix: G3-839.Retention: runs older than
TOOL_RUN_RETENTION_DAYS(90) are deleted, as the caller, when they list their runs (0 or less turns expiry off). Only a run's owner may delete it, so a user who never lists again keeps their runs until AsyncTask expires runs itself.GET /tools/runs/{id}/download?format=…&table=…:.odemat;Legacy's figures were rendered in the browser, and so are v3's charts, which the page downloads as SVG.
GET /tools/{tool}: the tool's form fields fromodestatic.tool/tool_param(newgeneweaver.db.tool). Each is mapped to the name and type v3 takes, e.g.DBSCAN_minPtsbecomesmin_pointsand"Included"becomestrue, and carries its label, description, default, choices, widget and legacy name. Also returned: the visible legacy options v3 does not offer, with why (PhenomeMap's MaxInNode, permutations and emphasis; Triclique's methods), and the JSON Schema of the threshold options.GET /toolsadds each tool's legacy name, description and order. Similar gene sets is described but not listed, since the Analyze page offers every listed tool.422s keep
detail(the message the page shows) and adderrors: [{loc, msg, type}], located at the request field, e.g.["body", "parameters", "method"].Legacy
/api/tool/get/{file,link,status}: documented, not served.statustakes no credential at all./results/directory.Recorded in
docs/v3/V3_ROADMAP_AND_GAP.md(A4).Testing
pytest tests: 887 passed, 33 skipped. The one failure,test_first_party_subpackage_is_importable[client], also fails before this change (geneweaver.clientisn't installed locally).packages/db/tests/unit: 56,542 passed.packages/tools/tests/unit: 300 passed, 5 skipped.packages/tools-plugin: 62 passed.ruff checkandruff format --checkare clean on every changed file.5f2aceadoes and records every call, including the order a delete must follow.tool_paramrows, typos and placeholders included, and was also run over the live rows from dev./api/openapi.json.5f2acea.intersectdownloading the union, and retention 0 deleting everything. Each is fixed, with a regression test.init_timeas a timestamp without a time zone, and v3 reads a naive time as UTC. That's right only while the Cloud SQLTimeZoneis UTC (the default). Otherwise stalled detection and retention shift by the offset.