Skip to content

Warm the reference cache so validate-all stops re-fetching - #1527

Merged
cmungall merged 1 commit into
mainfrom
feat/warm-reference-cache
Jun 18, 2026
Merged

cmungall merged 1 commit into
mainfrom
feat/warm-reference-cache

Conversation

@cmungall

Copy link
Copy Markdown
Member

Why

validate-all's reference phase was ~59 min because the committed reference cache (publications/) was incomplete: most entries were abstract-only with no full_text_attempted marker, so linkml-reference-validator re-fetched them from PubMed/providers on every run. The fetch — not per-file process startup — was the bottleneck.

What

One-time full warm: ran linkml-reference-validator validate data with fetch_full_text=True over every gene-review file, populating publications/ with full text + full_text_attempted markers so cached references are never re-fetched.

  • ~805 existing cache entries gained full text + fetch markers (this is what actually stops the re-fetching)
  • ~51 genuinely-new / recovered references added
  • Raw fetched PDFs (publications/files/, ~800 MB) are gitignored — the extracted text already lives in the per-reference .md.

Effect (measured)

Reference validation on a 100-file sample: ~779s → ~26s (~30×). The step is now cache-bound, not network-bound. Combined with the batched validator call (already on main, #1522), the full validate-all reference phase drops from ~59 min to a few minutes.

Cache hygiene

Stripped ~900 malformed cache files left by an earlier regex-based warm experiment (filenames like PMID_12345).md / PMID_12345..md, where prose mentions such as (PMID:12345) over-captured trailing punctuation). Each had a clean counterpart or was a prose-only mention; 10 valid prose-only entries were renamed to their clean names + frontmatter id fixed. No structured reference id in any gene file is malformed, so this junk cannot recur. main had zero malformed names before this PR.

CI note

This PR only touches publications/ + .gitignore, so the paths-filter intentionally skips validation. The speedup will show on the next infra/weekly/manual validate-all run once merged.

🤖 Generated with Claude Code

validate-all's reference step was ~59 min because the committed cache was
incomplete: ~925 referenced PMIDs/DOIs were uncached and ~800 more had no
full text, so linkml-reference-validator re-fetched them from PubMed/providers
on every run. Ran a one-time full warm (fetch_full_text=True over every unique
reference in the corpus) to complete the cache: 925 newly-cached references and
full text added to ~805 existing entries.

Effect (reference step on a 100-file sample): ~779s -> ~26s (~30x); the step is
now cache-bound, not network-bound. Combined with the batched validator call,
the full validate-all reference phase drops from ~59 min to a few minutes.

Raw fetched PDFs (publications/files/, ~800MB) are gitignored — the extracted
text is already in the per-reference .md cache.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ai4c-agent

ai4c-agent Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @cmungall's task in 3m 6s —— View job


Review: PR #1527 — Warm the reference cache so validate-all stops re-fetching

  • Understand PR scope and changes
  • Review .gitignore changes
  • Spot-check publication cache updates (full_text_attempted markers)
  • Check for malformed filenames or cleanup issues
  • Verify no gene review YAML or schema changes
  • Check for any accidentally committed large files
  • Final review summary

Findings

This is a clean infrastructure PR. It only touches publications/*.md (856 files) and .gitignore. No gene reviews, schema, or source code changed.

What was verified

Check Result
Files changed 805 modified + 51 added, all in publications/
full_text_attempted: true markers Added to all 856 files ✅
Content upgrades 179 files upgraded from abstract_only/unavailable → full_text_pdf/full_text_html/full_text_xml with actual extracted text
New file frontmatter All 51 new files have valid frontmatter (reference_id, title, authors, content_type, full_text_attempted) ✅
Raw PDFs gitignored publications/files/ correctly added to .gitignore ✅
Malformed filenames None present on branch ✅
Title formatting A few multiline <i> tag titles were correctly collapsed to single lines
Gene reviews / schema / src No changes ✅

🔵 Minor note

The PR description mentions stripping ~900 malformed cache files (PMID_12345).md / PMID_12345..md), but the diff shows 0 deletions. This cleanup may have been done separately or the files were never committed. Not a problem — just a minor description/diff discrepancy.

Verdict

Approved. Mechanical, well-scoped cache-warming change. Every modified file gains exactly the full_text_attempted: true marker (plus full-text content and provider metadata where retrieval succeeded). The gitignore addition for raw PDFs is correct and specific.

@ai4c-agent ai4c-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

  • No schema/gene-review YAML changes — this PR is cache-only
  • All 856 publication files correctly gain full_text_attempted: true
  • 51 newly added files have proper frontmatter structure
  • 179 files upgraded from abstract_only/unavailable to full_text_pdf/full_text_html/full_text_xml with actual content
  • publications/files/ (raw PDFs, ~800 MB) correctly gitignored
  • No malformed filenames present on branch
  • No gene review, schema, or source code changes
  • Title reformatting (collapsed multiline <i> tags) is a valid cleanup

Clean infrastructure PR. The changes are mechanical and well-scoped: every modified file gains exactly full_text_attempted: true (plus full-text content and provider metadata where retrieval succeeded). No issues found.

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