Skip to content

Make EvidenceItem.reference_title required - #18374

Merged
ai4c-agent[bot] merged 7 commits into
mainfrom
validator-0.5.2
Nov 23, 2026
Merged

ai4c-agent[bot] merged 7 commits into
mainfrom
validator-0.5.2

Conversation

@cmungall

@cmungall cmungall commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Every evidence item in kb/ now has a reference_title, and this PR makes the slot required in the schema. It is the second stage of the change #15612 started. That PR backfilled the KB to zero and added just check-reference-titles-present, which has held it at zero since, so open curation PRs that pass that gate will not go red when this merges.

What changed

  • Schema. EvidenceItem.reference_title goes from recommended: true to required: true. A new comment says where the title must come from: copied from the references_cache/ frontmatter (scripts/backfill_reference_titles.py), never typed by hand. The PublicationReference.title description now says its twin is required and that it stays recommended.
  • The last two gaps. Both cite PMID:23304742 (AHRQ review on restless legs treatment), a whole-book PubMed record, which the fetcher used to cache with an empty title. Take a whole-book PubMed record's title from its BookTitle linkml/linkml-reference-validator#167 fixed that, and main already pins a version containing it. I re-fetched the cache with --force and copied its title into Restless_Legs_Syndrome and the dopamine_receptor_agonism module. PMID:25695122 (the IOM ME/CFS report) is the same kind of record. It has no citer in kb/, so its cache was only refreshed.
  • PMID:31909928 is unchanged. Re-fetching this NICE guideline drops the "Guidelines." line that check-reference-cache-frontmatter uses to exempt it from needing authors or a journal, so the gate fails. Its only citer, Dravet syndrome, already has the title, so I kept main's copy. The next forced re-fetch of that reference will hit the same failure. The exemption regex will need to match the new body format.
  • Five top-level references[].title added in TOP2B-Related_Immunodeficiency_and_Congenital_Anomalies_Spectrum. That slot stays recommended; these five were simply missing.
  • Test fixtures. tests/data/valid/Disease-Antiphospholipid_Syndrome.yaml gains 97 titles, because just test-examples validates it against the schema. test_reference_range_on_biochemical_validates builds an evidence item inline and now gives it a placeholder title.
  • Docs. The gate script's docstring and the PR-review skill no longer describe the slot as recommended.
  • A history/schema/reference_title/ record.

Not changed

  • src/dismech/datamodel/dismech.py and dismech_pydantic.py. They already differ from a fresh just gen-python by about 290 lines on main, and nothing imports them. Regenerating them here would bury this change in unrelated diff.
  • examples/gene_term_example.yaml (placeholder PMID) and the dated YAML under docs/reports/senescent-cell-representation/. These are not validated as KB content.

Validation

  • CI (test (3.13)) passes on the current head, after main was merged in.
  • linkml-validate against the new schema: no issues across all disorders, plus modules, comorbidities, groupings and module collections.
  • just check-reference-titles-present: 0 gated and 0 report-only across 4,791 files after the merge.
  • The full Python suite (pytest -m "not kb_data and not oak_db") passes, after the one inline fixture above was fixed. just test-examples, just test-schema and just lint-python pass.
  • just validate-terms-schema online reports the obsolete ModifierEnum PATO terms (PATO:0002300/0002301), unrelated to this diff. Offline, it gives the same result on main and this branch.

Per the extend-schema skill, this is a schema narrowing and needs sign-off from @cmungall.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f

linkml-reference-validator 0.5.2rc1 reads a whole-book PubMed record's
title from its BookTitle (linkml/linkml-reference-validator#167). Before
that, these three records cached with no title: PMID:23304742 (AHRQ CER
86, restless legs syndrome treatment), PMID:25695122 (IOM ME/CFS report)
and PMID:31909928 (NICE cannabis-based medicinal products guideline).

Re-fetched with `just fetch-reference --force`; the abstract text is
unchanged (186/186 snippets in the citing entries still verify). The two
evidence items citing PMID:23304742 get their reference_title from the
cache via backfill_reference_titles.py, which takes the presence gate
to zero, report-only items included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f
Second stage of a two-stage narrowing. #15612 backfilled the missing
titles and made scripts/find_missing_reference_titles.py a whole-repo
CI gate; kb/ has held at zero since. The previous commit filled the
last two evidence items, whose cache files lacked a title until
linkml-reference-validator#167 (in the pinned >=0.8.0) read whole-book
PubMed titles.

Also filled from references_cache/ by backfill_reference_titles.py,
additions only: five top-level references: titles in
TOP2B-Related_Immunodeficiency_and_Congenital_Anomalies_Spectrum, and
97 evidence titles in the tests/data/valid fixture that
linkml-run-examples validates against the schema.

The generated src/dismech/datamodel/ models are not regenerated: they
already differ from a fresh regeneration by unrelated drift, and
nothing imports them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f
Re-fetching it wrote the current body format, which drops NICE's
"National Institute for Health and Care Excellence: Guidelines." line.
That line is what exempts this authorless, journal-less PubMed monograph
from check-reference-cache-frontmatter's fabrication-fingerprint rule
(#1737, #6607), so the re-fetched file failed the gate. The only entry
citing it, Dravet_syndrome, already carries its reference_title, so the
cache title is not needed for the required-slot change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f
The gate's docstring still called the slot recommended and said a whole-book
PubMed record could not be titled; both stopped being true in this branch.
The PR-review skill said the same about the schema flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f
@cmungall cmungall added the scope-override Allow an intentional curation PR exception outside the default curation-only path scope. label Nov 18, 2026 — with Claude
@ai4c-reviewer

ai4c-reviewer Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 1m 20s —— View job


Review: approved

This PR makes EvidenceItem.reference_title required in the schema, and the KB is ready for it. I submitted an APPROVE review. There are no blocking issues, only three small suggestions.

  • Read the diff for all 10 files
  • Checked the added titles against the references_cache/ frontmatter
  • Checked that the re-fetched caches cannot break any existing snippet
  • Checked scope and looked for rebase or reversion damage
  • Submitted the formal review

Findings

  • Schema: reference_title goes from recommended to required. The new comment tells curators to copy the title from the cache rather than type it.
  • Titles: both evidence items citing PMID:23304742 now carry "Treatment for Restless Legs Syndrome", which matches the cache. The five TOP2B references[].title values fit that entry.
  • PMID:25695122: no file in kb/ cites it, so reformatting its cache cannot break a snippet.
  • Scope: every file serves the change, and nothing was reverted. The PMID:31909928 cache was left at main's copy on purpose, as the PR body explains.

🔵 Suggestions

  1. The scripts/find_missing_reference_titles.py docstring says book titles arrived in validator "0.5.2", but the pin is >=0.8.0. Naming the PR instead (linkml-reference-validator#167) would avoid what looks like a contradiction.
  2. The PR body suggests both book titles went into KB entries. Only PMID:23304742 is cited there; PMID:25695122 only had its cache refreshed. The history record already says this correctly.
  3. Open a follow-up issue for the PMID:31909928 exemption regex, since the next forced re-fetch of that reference will fail the frontmatter check.

The PR body asks @cmungall to sign off on the schema change, per the extend-schema skill.

ai4c-reviewer[bot]
ai4c-reviewer Bot previously approved these changes Nov 18, 2026

@ai4c-reviewer ai4c-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: approve

This PR makes EvidenceItem.reference_title required in the schema, and the KB is ready for it. Every added title is copied from its references_cache/ frontmatter, the two re-fetched caches keep the abstract text the existing snippets quote, and nothing outside the stated scope changed. I found no blocking issues.

  • Schema validation would pass (the PR reports linkml-validate clean across the KB; check-reference-titles-present is at 0)
  • All PMIDs verified as real (no new citations; titles are on existing references)
  • Evidence snippets are exact quotes (no snippets changed; the PMID:23304742 cache body is unchanged apart from a header block)
  • Ontology terms correct and specific (N/A, no term changes)
  • evidence_source classifications correct (N/A, unchanged)
  • No pathophysiology bundling (N/A)

What I checked

  • Schema (src/dismech/schema/dismech.yaml): recommended: true becomes required: true. The new comment points curators to the cache and scripts/backfill_reference_titles.py rather than typing a title. Good.
  • Titles against caches: both PMID:23304742 citers (Restless_Legs_Syndrome, dopamine_receptor_agonism) now read "Treatment for Restless Legs Syndrome", which matches the new frontmatter. That title is the AHRQ review, which is on-topic for the dopamine-agonist claims it supports. The five TOP2B references[].title values are all TOP2B/B-cell papers, consistent with the entry.
  • PMID:25695122 re-fetch: no file in kb/ cites this reference, so the body reformat (book front matter dropped, abstract joined onto one line) cannot break a snippet.
  • Scope: all 10 files serve the narrowing. The test fixture titles are needed for just test-examples. The scope-override label covers the skill and doc edits.
  • Rebase or reversion risk: none seen. The PMID:31909928 cache was deliberately left at main's copy, as the PR body explains.

🔵 Suggestions (non-blocking)

  1. scripts/find_missing_reference_titles.py docstring says whole-book titles arrived in "linkml-reference-validator 0.5.2". The history record and pyproject.toml say the pin is >=0.8.0. If 0.5.2 is the release that first contained linkml/linkml-reference-validator#167, both are true, but it reads like a contradiction. Consider wording it "since the release containing linkml-reference-validator#167".
  2. The PR body says the two whole-book titles were "copied into Restless_Legs_Syndrome and the dopamine_receptor_agonism module". Both of those cite PMID:23304742. PMID:25695122 has no citer in kb/; its cache was only refreshed. The history record already states this correctly.
  3. The PMID:31909928 NICE-guideline exemption regex in check-reference-cache-frontmatter will break on the next forced re-fetch, as you note. A follow-up issue would keep that from surprising someone.

Schema narrowing: @cmungall's sign-off is requested in the PR body, per the extend-schema skill.

View job run

Copy link
Copy Markdown
Member Author

test (3.13) is red only because of the curation-scope check: the PR touches kb/ together with the schema, a script, a skill and a test fixture. That combination is intended, since the narrowing and the last two backfilled titles have to land together. I've added the scope-override label. The workflow doesn't rerun when a label is added, and I can't rerun jobs from here, so it needs someone to click Re-run failed jobs on run 44268157381. No other job failed.

On the review's optional suggestions:

  • 0.5.2 vs 0.8.0 in the gate's docstring: both are true. The fix first shipped in 0.5.2, and main now pins >=0.8.0. I'll reword it if this PR needs another push, but not in a push of its own, because that would dismiss the approval.
  • PR body: fixed. Only PMID:23304742 had citers. PMID:25695122's cache was refreshed only.
  • NICE exemption regex: this is worth a follow-up issue. It's noted in the PR body so it isn't lost.

Generated by Claude Code

@ai4c-reviewer

ai4c-reviewer Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 1m 31s —— View job


Re-review: approved

I re-reviewed the PR on head d64d677 and submitted an APPROVE review.

  • Schema validation would pass
  • All PMIDs verified as real
  • Evidence snippets are exact quotes
  • Ontology terms correct and specific
  • evidence_source classifications correct
  • No pathophysiology bundling (atomic entries only)

What changed since the last approval: main was merged in, and one docstring commit (d64d677) landed. That commit names linkml/linkml-reference-validator#167 where the docstring used to name version 0.5.2. It takes my earlier suggestion and changes nothing else.

What I checked on this head

  • just check-reference-titles-present across 4,791 files: 0 gated, 0 report-only. Nothing merged in from main has added an evidence item without a title, so making reference_title required turns nothing red.
  • EvidenceItem is used only in dismech.yaml. No other schema has a slot whose range is EvidenceItem, so kb/, which the gate scans, holds every instance this narrowing affects.
  • The added titles match the references_cache/ frontmatter. Nothing in kb/ cites PMID:25695122, so the reformat of its cache cannot break a snippet.

🔵 Suggestion (does not block)

  • The slot_usage comment on PublicationReference.title (around src/dismech/schema/dismech.yaml:8544) still says the title matches "the recommended: true already carried by the EvidenceItem reference_title twin". That is no longer true, and the comment could be reworded in the next push if there is one.

Per the extend-schema skill, this schema narrowing still needs sign-off from @cmungall.

ai4c-reviewer[bot]
ai4c-reviewer Bot previously approved these changes Nov 23, 2026

@ai4c-reviewer ai4c-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • Schema validation would pass
  • All PMIDs verified as real
  • Evidence snippets are exact quotes
  • Ontology terms correct and specific
  • evidence_source classifications correct
  • No pathophysiology bundling (atomic entries only)

Re-review: approved

Since my last approval the branch has had two changes: main was merged in, and one docstring commit (d64d677) landed. That commit names linkml/linkml-reference-validator#167 where the docstring used to name version 0.5.2. It takes my earlier suggestion and changes nothing else.

Checked on the current head

  • just check-reference-titles-present across 4,791 files: 0 gated, 0 report-only. Nothing merged in from main has added an evidence item without a title, so making the slot required turns nothing red.
  • EvidenceItem is used only in dismech.yaml. No other schema has a slot whose range is EvidenceItem. That means kb/, which the gate scans, holds every instance the narrowing affects.
  • The added titles match the references_cache/ frontmatter (PMID:23304742 is "Treatment for Restless Legs Syndrome"). Nothing in kb/ cites PMID:25695122, so the reformat of its cache cannot break a snippet.

🔵 Suggestion

  • The slot_usage comment on PublicationReference.title (around src/dismech/schema/dismech.yaml:8544) still says the title is recommended, "matching the recommended: true already carried by the EvidenceItem reference_title twin". That is no longer true. The comment could say the twin is now required and that this slot stays recommended on purpose. It is comment text only, so it does not block. Fold it into the next push if there is one.

Per the extend-schema skill, this schema narrowing still needs sign-off from @cmungall.

Copy link
Copy Markdown
Member Author

The PublicationReference.title description is out of date, as the review says: at dismech.yaml:8546 it still calls the reference_title twin recommended. I'm leaving it for now because it's description text only, and a push would drop this approval. If the PR needs another push, the fix goes in with it.


Generated by Claude Code

test_reference_range_on_biochemical_validates built an evidence item
without reference_title and asserted it validates; the required slot now
rejects that. Also update the PublicationReference.title description,
which still called its EvidenceItem twin recommended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f
@ai4c-reviewer

ai4c-reviewer Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 1m 13s —— View job


Re-review: approved

I re-reviewed the PR on head 305d050 and submitted an APPROVE review. Nothing blocks it.

  • Schema validation would pass
  • All PMIDs verified as real (no new citations)
  • Evidence snippets are exact quotes (no snippets changed)
  • Ontology terms correct and specific (no term changes)
  • evidence_source classifications correct (unchanged)
  • No pathophysiology bundling (N/A)

What changed since the last review: one new commit, 305d050.

  • tests/test_data.py: test_reference_range_on_biochemical_validates builds an evidence item inline, and that item now has a reference_title. Without one, the newly required slot would make the test fail, so this fix was needed. It passes when I run it.
  • src/dismech/schema/dismech.yaml: the PublicationReference.title description no longer calls its reference_title twin recommended. This was the suggestion from my last review, and the new wording is accurate.

What I checked: I ran every test that validates or rejects an inline record against the schema in test_data.py, test_conformance.py, test_gene_namespaces.py, test_gene_validity.py, test_genetic_schema.py and test_genomic_regions.py. All 66 passed. Inline records like these are where a newly required slot could still cause failures, and none failed.

Per the extend-schema skill, this schema narrowing still needs sign-off from @cmungall.

@ai4c-reviewer ai4c-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Re-review on head 305d050: approve

  • Schema validation would pass
  • All PMIDs verified as real (no new citations)
  • Evidence snippets are exact quotes (no snippets changed)
  • Ontology terms correct and specific (no term changes)
  • evidence_source classifications correct (unchanged)
  • No pathophysiology bundling (N/A)

What changed since the last review: the new commit is 305d050, and the rest is the same as before.

  • tests/test_data.py: test_reference_range_on_biochemical_validates builds an evidence item inline, and it now has a reference_title. Without one the required slot would make that test fail, so this was a real fix. I ran it locally and it passes.
  • src/dismech/schema/dismech.yaml: the PublicationReference.title description no longer calls its reference_title twin recommended. This is the suggestion from my last review, and the new wording is accurate.

Checked: I ran every test in test_data.py, test_conformance.py, test_gene_namespaces.py, test_gene_validity.py, test_genetic_schema.py and test_genomic_regions.py that validates or rejects an inline record against the schema: 66 passed. Inline fixtures like this are the place a newly required slot can still fail, and none does.

No blocking issues. As the PR body says, this schema narrowing needs sign-off from @cmungall under the extend-schema skill.

@ai4c-agent

ai4c-agent Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

🐑 PR Shepherd (deterministic sweep) — Added to the merge queue: approved, no human assignee, no conflicts, all checks green, and open longer than 3 days. GitHub will test this PR against current main and merge it if that passes; if it does not, this PR stops being eligible and needs a look.

@ai4c-agent
ai4c-agent Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 6b0b876 Nov 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope-override Allow an intentional curation PR exception outside the default curation-only path scope.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants