MeSH validation strips valid MeSH tags when NLM is unreachable

Open
#2,730 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Read backend/src/services/llm-enrich.ts, focusing on validateMeshTerms, queryMesh, and the no-match branch. Trace how network, timeout, and HTTP errors are handled and how scheme_removed is logged. Done means lookup results distinguish found, not found, and unavailable; unavailable preserves the MeSH scheme without a value_uri and records a distinct log action.

Written by the indexing model from the issue text.

Description

validateMeshTerms (backend/src/services/llm-enrich.ts, queryMesh and the no-match branch) treats a network error, timeout or HTTP error from NLM's MeSH lookup API exactly like "no such term": it strips subject_scheme: "MeSH" from the keyword and logs scheme_removed. During an NLM outage (id.nlm.nih.gov reset every connection for more than two hours on 2026-12-03), every enrichment run therefore silently drops valid MeSH tags, and the log records a verdict that was never made.

Expected: an infrastructure failure is not a verdict. queryMesh should return found / not found / unavailable, and on unavailable the keyword keeps its scheme unchanged (no value_uri), with a distinct log action, so a later run can confirm it.

Related: the live NLM tests now skip on an outage (#2729). A local MeSH mirror (D1, synced from NLM's annual descriptor release) is being considered as the primary source; it would also remove this dependency, but the tri-state handling is needed either way.

Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
4h 48m
Merged PRs (30d)
468

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nemarOrg/nemar-cli

All issues in nemarOrg/nemar-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.