Skip to content

Offer a gene list however it is handed over, and remember it - #299

Merged
adamjohnwright merged 2 commits into
mainfrom
gene-list-after-invitation
Sep 29, 2026
Merged

adamjohnwright merged 2 commits into
mainfrom
gene-list-after-invitation

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Two conversations reported on 2026-09-29. In both, the model answered with website instructions, and those instructions were wrong: they sent a gene list to ReactomeGSA, which takes a matrix.

  1. The chat said "include the genes in your message", and the reply "here is my gene list TP53, ERBB3 and JAX9" was not recognised.
  2. "can you analyze the gene list that I gave you" was not recognised either; the list was in an earlier message.

Now

  • Hand-over phrasing counts as a request: "here is / here's my gene list …", "my genes are …", "these are my genes …", "gene list: …".
  • A reply to an invitation: straight after the GSA how-to asks for genes, the next message that lists them is offered, however it is phrased. It must look like genes: three or more items, or at least one gene-shaped token. Group labels such as "control, control, treated, treated" are not offered.
  • Pointing back: the last list a reader sent is remembered, including one from a question the model answered. "analyse the gene list I gave you" offers that list, marked as coming from an earlier message.
    • If no list was sent yet, the chat asks for one; the model is not asked.
    • A message that points at a matrix, a file, a GSA or results is not treated as pointing back at a list.
  • Declining an earlier-list offer names the genes to the model.
  • One function decides. gene_list.read_message makes all of these decisions, as a pure function, and runs off the event loop.

Review

One round of adversarial review. It found two regressions in this flow, which are fixed and tested:

  • the how-to's own group example was offered as a gene list;
  • matrix requests that pointed back got "no gene list".

It also found chit-chat overwriting the remembered list, the word "are" opening lists everywhere, and 4× parse cost. All are fixed. Each guard has a test that fails when the guard is sabotaged. One sabotage survived at first, so I added cases that only that guard catches.

Measured

A fresh set for the new routes, written after review and measured once before its fixes: 13/16. The two misses fixed since are marked as tuned. The third, "BRCA1 and BRCA2" as a reply to an invitation, is pinned as a known limit. A case earlier moved into held-out set 4 after a fix aimed at it now sits in TUNED_LATER.

Verified

  • ./checks.sh passes.
  • In a browser against a local instance, both reported conversations were replayed verbatim:
    • the offer appears;
    • Run gives "Matched 2 of 3";
    • JAX9 is listed as not found.
  • Also checked in the browser: a bare list after the how-to; an earlier list offered by name; "no list yet" followed by a pasted list; group labels not offered; a matrix request pointing back still gets the matrix how-to.
  • The earlier 23-check suite still passes.

Not fixed here

The model's own answers about gene lists come from the website's user guide, and they tell people to paste a gene list into ReactomeGSA. That answer path is shared with the search page, so it needs a separate change.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits September 29, 2026 15:00
Reported 2026-09-29, both answered by the model with website instructions:
- "here is my gene list TP53, ERBB3 and JAX9", sent straight after the
  chat said "include the genes in your message";
- "can you analyze the gene list that I gave you", with the list in an
  earlier message.

Now:
- "here is my gene list ...", "my genes are ...", "these are my genes"
  count as a request.
- After the how-to invites a list, the next message that lists two or
  more identifiers is offered, however phrased.
- The last list a reader sends is remembered (in the process store, not
  the saved session), and a request that points back at it offers that
  list, saying it came from an earlier message. With no list yet, the chat
  asks for one instead of the model sending them to the website.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round four of adversarial review, on the hand-over / invitation /
pointing-back routes:
- After the how-to, its own group example ("control, control, treated,
  treated"), "yes, great" and "WT, KO" were offered as gene lists. A
  reply to an invitation now needs three items or one gene-shaped token,
  and sample, group and cell-line labels are not identifiers.
- "run a gene set analysis on my expression data I sent before" got "I
  don't have a gene list" instead of the matrix how-to. Pointing back now
  has to name a gene list, and not a matrix, file, GSA or results.
- Chit-chat ("hmm, interesting") replaced the remembered list. A list is
  remembered only with three items, one gene-shaped.
- "are" no longer opens lists in general; a hand-over reads the list
  after its phrase, and prose after it is not a list.
- Declining an offer of an earlier list names the genes to the model.
- All decisions are one pure function, run off the event loop.

A fresh set for these routes, measured once before its fixes: 13/16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 078d5d2 into main Sep 29, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the gene-list-after-invitation branch September 29, 2026 15:24
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