Repository navigation
Cache PMID:20301328 and keep the NICE guideline exempt after a re-fetch - #18833
Conversation
Lesch-Nyhan_Syndrome cites PMID:20301328 (GeneReviews, HPRT1 Disorders) three times, but its cache file was never committed, so a fresh checkout fetched it over the network on every validation run. PMID:31909928 is a NICE guideline with no personal authors. The cache check exempts it on the 'National Institute for Health and Care Excellence: Guidelines.' line in its body, but the current fetcher no longer writes that line, so a forced re-fetch would fail the check with no body marker left to match. Add a short vetted list of corporate-author monographs, checked by hand, that pass regardless of body format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f
|
Claude finished @cmungall's task in 5m 37s —— View job PR review: approved ✅I approved this PR. Both fixes work, and the checks I re-ran pass.
Vetted list. The list in What I ran:
🔵 Suggestions, none blocking:
|
There was a problem hiding this comment.
- Schema validation would pass (no KB YAML changed)
- All PMIDs verified as real (PMID:20301328 is the GeneReviews HPRT1 Disorders chapter; the cache came from the fetcher, not written by hand)
- Evidence snippets are exact quotes:
count-verified-snippetsonLesch-Nyhan_Syndromegives 141/141 against the local cache - Ontology terms correct and specific (none touched)
- evidence_source classifications correct (none touched)
- No pathophysiology bundling (no curation content)
Approve. Both fixes do what the description says, and I re-ran the checks.
Cache file. references_cache/PMID_20301328.md has the fetcher's normal GeneReviews layout. The title matches the reference_title: HPRT1 Disorders. used in every citation in the entry, and the body is the chapter abstract the snippets quote.
Vetted-monograph list. src/dismech/reference_cache_frontmatter.py:74 is keyed on the exact reference_id, and it only sets is_monograph. That means a vetted record is still checked against every other part of the contract; only the authors/journal fingerprint is waived. The two new tests cover the important pair: the vetted ID passes in the title-plus-abstract format, and an unvetted ID in the same format still fails with the fabrication-fingerprint reason. The comment explains why the list exists and what to check before adding an entry.
What I ran:
uv run pytest tests/test_reference_cache_frontmatter.py: 21 passedjust check-reference-cache-frontmatter: OK. The 5----in-value notes it prints are already onmain.just count-verified-snippets kb/disorders/Lesch-Nyhan_Syndrome.yaml: 141/141
🔵 Suggestions, none blocking:
- The PR body says the entry cites PMID:20301328 three times. It actually cites it six times (lines 45, 143, 149, 1291, 1430, 1503). The fix is the same either way; only the count is off.
- The cached
authors:list starts with the GeneReviews series editors (Adam MP, Bick S, Mirzaa GM, Wallace SE, Amemiya A) before the chapter author, Jinnah HA. That is how the fetcher handles every Bookshelf chapter, so it is not something to fix here. Just don't read that list as the chapter's authorship.
|
🐑 PR Shepherd (deterministic sweep) — Added to the merge queue: approved, no human assignee, no conflicts, all checks green, and open longer than 0 days. GitHub will test this PR against current |
This fixes two reference-cache problems that came out of #18374.
PMID:20301328 had no cache file.
Lesch-Nyhan_Syndromecites it six times (GeneReviews, HPRT1 Disorders), but itsreferences_cache/file was never committed. Every validation run on a fresh checkout fetched it over the network, and offline runs could not verify those snippets. I fetched it withjust fetch-reference. All 141 of the entry's snippets now verify against the local cache.PMID:31909928 would fail the cache check after a re-fetch. It is a NICE guideline with a corporate author, so its cache carries neither
authors:norjournal:.check-reference-cache-frontmattertreats that as the #1737 fabrication fingerprint unless the body shows it is a monograph, and this record passed on itsNational Institute for Health and Care Excellence: Guidelines.line (#6607). The current fetcher writes only the title and abstract, so that line is gone. I re-fetched with--forceand confirmed the new file has no publisher line, no collection line, no authors and no journal, which leaves no body pattern to match.The fix is a short vetted list in
src/dismech/reference_cache_frontmatter.py. A record on it passes whatever its body format, and an entry is added only after checking PubMed by hand. It starts with PMID:31909928. The committed cache file is unchanged, still in the older format.Not changed
Validation
tests/test_reference_cache_frontmatter.py. The vetted record passes in the current fetcher format. An unvetted record in the same format still fails with the fabrication-fingerprint reason.tests/test_reference_cache_frontmatter.pyandtests/test_empty_reference_caches.pypass (37 tests).just check-reference-cache-frontmatterandjust lint-pythonpass.just count-verified-snippets kb/disorders/Lesch-Nyhan_Syndrome.yaml: 141/141.🤖 Generated with Claude Code
https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f