Skip to content

GSA correctness fixes (review, area 2) - #311

Merged
adamjohnwright merged 1 commit into
mainfrom
review-2-gsa
Oct 3, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
review-2-gsa

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

These come from the max-level review of the chat flow. Each was reproduced by the reviewer.

Finding Fix Test
group1/group2 came from a case-sensitive sorted(), so the baseline depended on spelling The first label given is group 1, and the result says what was compared Four label orders. Sabotaged.
An R write.table header (no gene-column cell) lost its first sample A header one cell short of the rows is all sample names Unit test. Sabotaged.
CSV uploads were submitted unconverted, and the service reads tabs only Matrix.text returns tab-separated text Unit test (quoted comma field), and in the browser
The strict decode at submit didn't match the lenient decode at validation, so Windows files passed validation and then failed every retry One decode() for both: UTF-8 (with BOM), UTF-16, Windows-1252 cp1252 and UTF-16 tests
Validation was unbounded and ran on the event loop: 21M blank lines, or a 7M-column header 1,000 samples at most; blank lines count towards the read limit; validate and the matrix read run via to_thread Too-many-columns test; 3M blank lines decided in under 1s
One 502 or timeout while polling lost a finished run Up to 4 tries per request. The failure message gives the analysis id. Survives 2 failures (fixed count). A lasting outage still ends the wait. Sabotaged.

Browser

run_flow.py ran against a stand-in ReactomeGSA that replays the recorded service responses and records what the chat submits. Two runs: the melanoma TSV, and the same matrix as a CSV. Both submitted tab-separated data with 16 samples and {"group1": "MOCK", "group2": "MCM"}, finished, and offered the 2,679-row table to download. The result reads "Compared: MOCK (group 1, the first label you gave) with MCM (group 2)."

Not changed

  • Direction sign. ReactomeGSA's documentation doesn't say which way its Direction points, so the chat doesn't claim it.
  • Data type. Uploads are still always submitted as rnaseq_counts; the review rated this medium. Proteomics and microarray uploads need asking which kind of data the reader has.
  • JSON encoding. The 20 MB JSON body at submit is still encoded on the event loop (0.3–0.6s).

./checks.sh passes.

🤖 Generated with Claude Code

- The first label given is group 1. It was the alphabetical first, so the
  baseline -- and every Up and Down -- depended on spelling ('WT, KO'
  compared against KO). The result now says which groups were compared,
  in which order. (Which way ReactomeGSA's sign points is not stated in
  its docs, so it is not claimed.)
- An R write.table header, one cell short of the rows, kept its first
  sample; header[1:] dropped it and misaligned every label.
- A CSV upload is converted to tab-separated before it is submitted; the
  service reads only tabs, and a CSV went through unconverted.
- Files are decoded the same way at validation and at submit: UTF-8,
  UTF-16, or Windows-1252. A 1252 file passed validation, was labelled,
  then failed every retry at submit.
- Validation is bounded (1,000 samples; blank lines count towards the read
  limit) and, with the matrix read at submit, runs off the event loop.
- The wait retries a failed poll or result fetch up to four times; one
  502 used to lose a finished run. A failure now gives the analysis id.

Checked end to end in a browser against a recording stand-in for
ReactomeGSA: the melanoma TSV and the same matrix as CSV both submit
tab-separated with 16 samples and group1=MOCK, and finish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 1b59013 into main Oct 3, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the review-2-gsa branch October 3, 2026 22:53
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.

1 participant