Skip to content

Upgrade LRV to 0.3.1rc1 and remove cache-loader monkeypatch - #4947

Merged
cmungall merged 7 commits into
mainfrom
ci/upgrade-lrv-030
Oct 14, 2026
Merged

cmungall merged 7 commits into
mainfrom
ci/upgrade-lrv-030

Conversation

@cmungall

@cmungall cmungall commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Upgrade linkml-reference-validator from 0.2.1 to the published 0.3.1rc1 and remove the cache-loader monkeypatch. The upgrade includes the upstream delimiter fix and the broader cache, extraction, matching, and performance changes detailed below. Validation preserves reviewed publication text through supported trust_cached_entries; explicit warming opts out.

RC validation complete; release-candidate dependencies are accepted by the maintainer. Waiting for final 0.3.1 is not a merge requirement. The lock contains the tested PyPI wheel (SHA-256 88ba0eea05d041c30ce5af15b801072685e6fa3886b8816cd973190253568cca), not a source checkout or runtime patch. The minimum is >=0.3.1rc1,<0.4; no other package versions changed. This deliberately permits 0.3.x prereleases for installations without the lockfile; locked installations use the tested 0.3.1rc1 artifact. The final release can be adopted in a subsequent dependency update.

Upstream changes covered by this validation

The range from 0.3.0 to 0.3.1rc1 includes:

The full-corpus identical-diagnostics comparison below covers the published RC with all these changes, including cache-format and matching behavior on the committed evidence. It does not assert that every upstream feature is exercised: LRV skips file: here (the project validates those separately), and trusted existing URL caches retain their committed representation. The warming guide now explicitly documents how to refresh old URL markup in a separate, reviewed cache change. No publication cache is rewritten by this PR.

Published-package performance

Alternating three runs each on the same 100-gene manifest, same data/cache, and same configuration:

Installed PyPI package Runs (seconds) Median
0.3.0 43.47 / 48.80 / 29.32 43.47s
0.3.1rc1 25.46 / 26.15 / 11.95 25.46s

The RC is faster in every paired round: 41% lower median elapsed time, with byte-identical diagnostics in all three comparisons. The machine was busy (including a separate 0.3.0 full-corpus run), so absolute times and speedup are noisy and are not a prediction of CI duration. These measure the reference CLI after import, excluding the project shell preprocessor. The direct sample includes existing validation failures; identical diagnostics, not exit zero, establishes the comparison.

This comparison establishes the recovery from the 0.3.0 regression; it is not a same-round comparison against the original 0.2.1 dependency, so it does not establish a net speedup over 0.2.1.

This verifies the published artifact carries the optimization previously demonstrated in isolated source checkouts. Release/tag: https://github.com/linkml/linkml-reference-validator/releases/tag/v0.3.1rc1 (commit a8451d2c9cd698f10c7bd8dccb5e1089fb5b441f). Upstream CI and review passed before merge.

RC validation

  • Cache behavior, subprocess network guards, reference-curation metadata, shared configuration, and publication-warming compatibility: 125 passed.
  • uv lock --check: passes; the unrelated cffi marker churn is excluded.
  • RC full suite: 3,710 passed, 2 skipped, 79 deselected, 1 failed in 748.17s. The sole failure is the same known macOS case-insensitive DROME/Dl versus DROME/dl history-path collision seen on 0.3.0; no new test failures.
  • The network guard control now uses a complete gene record; its targeted test and Ruff pass.
  • RC doctests: 223 passed, 37 skipped. just mypy: passes (257 files). Full Ruff: passes.
  • Full-corpus reference validation passes: 6,773 reviews; 171,220 snippets checked, 79,387 skipped, 15 unavailable; 71,327 titles checked; zero errors and 49 advisory warnings across 28 files. The full RC output is identical to the released 0.3.0 run after normalizing worktree roots, random .lrv temporary suffixes, and the RC timing/exit footer. The real project wrapper exits 0 for both.
  • RC full reference phase including shell preprocessing: 1,003.55s (16m44s) elapsed, 605.13s user CPU, 20.33s system CPU under concurrent machine load. This is local reference validation, not the whole CI job.
  • Full-corpus best-practices validation passes: all 6,773 reviews valid, zero errors, 23,250 advisory warnings in 3,824 reviews. Its 23,250 TSV diagnostic rows exactly match the 0.3.0 baseline after normalizing checkout roots, timestamps, and row order.
  • Pathway references pass: all 54 pathway files containing PMID references (81 markdown files scanned).
  • No committed publication-cache files changed. Both versions fetched the same previously missing DOI cache entry, with identical bytes; that generated entry is not included in the PR.
  • The same 6,773 review inputs already pass schema and blocking ontology checks (61 advisory label issues across 56 files). Those independent validators and their dependencies are unchanged.
  • Earlier full-suite baseline with 0.3.0: 3,710 passed, 2 skipped, 79 deselected, one known macOS case-insensitive history-path collision (DROME/Dl versus DROME/dl). The RC full-suite result is recorded above.

Review follow-up

  • Merge current main, including the 18-excerpt cleanup in Replace 18 empty or editorial-only evidence snippets for LRV 0.3 #4949, which closes Replace 18 empty or editorial-only evidence snippets rejected by LRV 0.3.0 #4948. The issue contains the validator-generated 18-error inventory; the larger regex estimate does not apply literal-bracket patterns or the full-text-unavailable preprocessing convention. The broader editorial-quotation audit remains Audit remaining editorial-only evidence snippets and clarify quotation guidance #4954, now with a YAML-node inventory of 37 candidates in the named reviews (including multiline values) and an explanation of the wrapper, baseline, and literal-pattern exemptions. These are audit candidates, not 37 newly failing validations.
  • Cover modern full_text_available: false/true cache entries as well as legacy abstract/XML/HTML records, delimiter-containing titles, and LF/CRLF bytes.
  • Guard subprocess validation against actual DNS/socket attempts using a Python audit hook, record any attempt even if the validator catches the exception, and test the guard through the actual shell wrapper → uv run → project CLI path using an uncached reference. Set trust_cached_entries explicitly in the reference-curation metadata fixture.
  • Restore coverage of valid YAML with non-mapping frontmatter: upstream 0.3.0 fails without fetching or overwriting the cache; tests allow either an exception or a future clean validation failure. No local loader patch is reintroduced.
  • Clarify the schema and curation instructions: quoted text must include verbatim source content; editorial-only/empty placeholders should be omitted when no quotation is asserted. Regenerate the Pydantic descriptions and synchronize JSON Schema descriptions; add and validate the schema history record.
  • Document reviewed-cache behavior and explicit refresh commands; correct stale version floors and use the shared config builder in repair utilities.
  • Retain the temporary warming config because LRV 0.3.0 has no CLI flag to override trust_cached_entries; the opt-out is tested.
  • Remove unrelated cffi lock-marker churn; uv lock --check passes.

Latest review follow-up: RC adoption is explicitly accepted by the maintainer; the former final-release gate has been removed. The subprocess guard now records its destination arguments as well as its event. Issue #4954 was rechecked directly and contains the 37-candidate YAML-node inventory and exemption analysis requested by the reviewer.

Follow-up checks: all 54 reference-cache tests pass; Ruff passes for both modified test files.

@ai4c-reviewer

ai4c-reviewer Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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


Review: Upgrade LRV to 0.3.0 and remove cache-loader monkeypatch

  • Fetch base and read the full diff
  • Review dependency/config changes
  • Review removal of reference_cache_compat monkeypatch
  • Review cache-warming and trust_cached_entries semantics
  • Review test coverage changes
  • Assess the two stated merge blockers
  • Post review

Curation checklist (this is an infrastructure PR — no gene reviews or GOA content changed):

  • Schema validation passes — cannot run (no uv/deps in this runner); PR itself reports full-corpus reference validation does not pass
  • All PMIDs verified as real — n/a, no references added
  • Supporting text matches publication content — n/a (but see 🔴 1: the upgrade invalidates existing excerpts)
  • GO terms correct and specific — n/a
  • Review actions well-justified — n/a
  • Core functions accurately identified — n/a
  • No over-annotation issues missed — n/a

Verdict: request changes — the PR is explicitly a draft and self-declares two merge blockers. I agree with both, and found five additional items. The architectural direction (delete the backport, use the upstream trust_cached_entries setting, keep the regression tests as the proof) is right and the diff is clean; the problems are migration scope, upstream perf, and a few gaps in what the new tests actually pin down.


🔴 CRITICAL

1. The excerpt-migration scope looks understated, and the migration list should be generated by the validator, not estimated.
The PR reports "18 such excerpts in 11 files". A regex scan of the checked-out corpus finds 41 single-line empty-or-bracket-only excerpts across 18 files — an upper bound, since regex does not apply literal_bracket_patterns:

  • supporting_text: '' (6, unambiguous): genes/ARATH/CHL1/CHL1-ai-review.yaml:175, genes/MYCTU/Rv0898c/Rv0898c-ai-review.yaml:103, genes/human/OXCT1/OXCT1-ai-review.yaml:598, genes/human/SLC25A24/SLC25A24-ai-review.yaml:623, genes/human/GCDH/GCDH-ai-review.yaml:604, genes/SCHPO/ago1/ago1-ai-review.yaml:982
  • bracket-only (35 across 12 files): human/ABL1 ×7, worm/cebp-2 ×5, mouse/Notch1 ×4, SCHPO/atg2/mouse/App/mouse/Sox2/ANOGA/TEP10 ×3, human/WIPF1/mouse/Ifi204 ×2, DICDI/tlcd4b/worm/pink-1/human/SFT2D3 ×1

The gap between 18 and 41 is probably explained by conf/reference_validator_config.yaml:51-53: literal_bracket_patterns: "[^a-zA-Z\\s]" is unanchored, so any bracket body containing a digit or punctuation is treated as a literal rather than editorial. [InterPro2GO mapping] (digit → kept) passes; [PANTHER phylogenetic analysis] (pure alpha → editorial) fails. If that is what is happening, the new check is inconsistent in a way worth raising upstream: whether a placeholder excerpt is an error depends on whether it happens to contain a digit.

Please attach the validator-generated list of failing (file, path, excerpt) to the migration issue so the precursor PR is auditable. just validate-all (project.justfile:1250) and the weekly full-validation workflow will stay red until it lands, and any PR touching one of these 18 files fails PR CI too.

For the fix itself: supporting_text is recommended, not required (src/ai_gene_review/schema/gene_review.yaml:89-97), so deleting the field is schema-valid — do not invent quotes. genes/human/OXCT1/OXCT1-ai-review.yaml:595-598 is the model case: the finding is real, the cached record is a supplementary dataset with nothing quotable, so the empty key should go and the explanation stays in review_notes. For genes/worm/cebp-2/cebp-2-ai-review.yaml:429-453, [InterPro2GO mapping] / [UniProtKB keyword mapping] are evidence-provenance notes, not quotations — they belong in review.reason.

2. The performance regression is the wrong direction for a change whose stated purpose is CI speed.
+57% median on the reference CLI (12.79s → 20.03s / 100 genes) against a corpus of ~6,700 reviews validated in one process. Agreed this must be fixed upstream first. The profile you cite points at the fix: 9.16s in str.translate out of 16.44s in normalize_text suggests the ligature table is being applied to the whole publication body once per quote checked, not once per fetched record. Memoizing normalized text per reference inside LRV should recover most of it, and would be a clean upstream PR to point this one at.


🟡 IMPORTANT

3. The new fixture parametrizes content_type but never full_text_available — the case that motivated the change isn't covered.
tests/test_reference_cache_behavior.py:29-40 varies content_type: abstract_only|full_text_xml|full_text_html, but the repo treats full_text_available as authoritative and higher-precedence (src/ai_gene_review/validation/supporting_text.py:164-177), and modern cache records carry only that key (publications/PMID_7262539.md has full_text_available: false and no content_type; 1,265 legacy records have content_type). So the three params may be exercising the legacy fallback path only — or, if LRV 0.3 ignores content_type entirely, three identical runs presented as "abstract, legacy XML and legacy HTML" coverage.

The regression that trust_cached_entries exists to prevent is "an abstract-only record gets silently refreshed during validation". Please add a param with explicit full_text_available: false and assert both cache bytes unchanged and no socket connect for it. Fix this →

4. The subprocess test dropped --no-full-text with no replacement network guard.
tests/test_reference_cache_behavior.py:108-124 now relies solely on trust_cached_entries from the shared config for offline behaviour. UV_OFFLINE=1 gates uv's package resolution, not LRV's HTTP. If the trust path regresses, this test goes to the network — slow and flaky — instead of failing loudly. The in-process test gets this right with the socket.socket.connect guard (line 50-54); the subprocess case needs the env equivalent (e.g. http_proxy/https_proxy/no_proxy pointing at a closed port).

5. Lost coverage: valid-but-non-mapping frontmatter.
test_non_mapping_frontmatter_is_rejected_without_fetch covered "", plain scalar, - item, true and is gone. It had to go — it tested the deleted private function — but the invariant it guarded is precisely this PR's headline promise: a committed record whose frontmatter is readable YAML but not a mapping must not be treated as "no metadata → refetch and overwrite". test_malformed_frontmatter_is_still_rejected (line 68) only covers unparseable YAML. A black-box replacement (write such a cache file, assert validation fails, assert bytes unchanged, assert no socket) would restore it against the upstream loader rather than the backport.

6. The migration will regrow unless the schema wording changes with it.
src/ai_gene_review/schema/gene_review.yaml:92-94 says "If editorialization is necessary, put this in square brackets (this is not checked)" — which is exactly how 35 fully-bracketed excerpts got written. Add a sentence stating that an excerpt may not consist solely of bracketed editorialization, in the same change as the corpus migration.


🔵 SUGGESTIONS

7. Stale version floors — the >= 0.2.1 sentence was updated in scripts/run_reference_validator.sh:14 but not in docs/publication_fulltext_warming.md:5, src/ai_gene_review/etl/publication_warm.py:3, or project.justfile:1249.

8. Curator-visible behaviour change is undocumented. With trust_cached_entries: true, validation no longer upgrades an abstract-only cached record, so a quote taken from full text now fails until someone runs just warm-publications. That is the right trade, but it changes the "my quote doesn't validate" workflow and belongs in docs/publication_fulltext_warming.md.

9. Config duplicated in three places. scripts/extract_supporting_text_fixes.py:20-24 and scripts/mark_full_text_unavailable.py:95-99 now hardcode trust_cached_entries=True + cache_dir + literal_bracket_patterns, and still omit skip_prefixes, reference_base_dir and unknown_prefix_severity from the shared config. Loading conf/reference_validator_config.yaml (as build_supporting_text_validator does) would keep the third copy from drifting.

10. The temp-config dance may be unnecessary. scripts/warm_reference_cache.py:44-56 is sound — relative cache_dir resolves against CWD, not the config's directory (established by the existing layout, where cache_dir: publications under conf/ means repo-root publications/). But if 0.3.0 exposes a --no-trust-cached-entries-style flag, passing it is simpler than dumping a derived config. I could not check: no network tools and no installed deps in this runner.

11. Pre-existing test worth re-checking under 0.3.0. tests/test_reference_curation_metadata.py:126-127 writes a config with only cache_dir and the docstring claims "Run real LRV offline". Under the new default it may now attempt a fetch for the mismatch case; adding trust_cached_entries: True there would make the claim true.

12. Unrelated uv.lock churn. The argon2-cffi-bindings entries drop their python_full_version markers on cffi in both resolution variants. Harmless-looking resolver churn, but it is an unrelated dependency-graph change riding along in a dependency PR — worth confirming it came from a uv lock with the pinned uv version.


What I could not verify

No uv and no installed dependencies in this runner, and no network access, so I could not run just test, just validate-all, or the reference regression suite, and could not inspect LRV 0.3.0's ReferenceValidationConfig to confirm trust_cached_entries semantics (whether it keys on full_text_available, content_type, or neither) or whether a CLI equivalent exists. Findings 3, 10 and 11 hinge on that and should be checked against the installed package. Everything else is from the diff and the checked-out corpus.
· branch ci/upgrade-lrv-030

@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.

Infrastructure PR; no curated gene-review content changed. The direction is right (delete the backport, use upstream trust_cached_entries, keep the regression tests as the proof) and the diff is clean. Requesting changes on the two self-declared blockers plus four additional items.

CRITICAL

  1. Migration scope looks understated. A regex scan of the checked-out corpus finds 41 single-line empty-or-bracket-only excerpts across 18 files (upper bound; regex does not apply literal_bracket_patterns) vs the PR's 18 in 11. The gap is probably conf/reference_validator_config.yaml:51-53 — [^a-zA-Z\\s] is unanchored, so [InterPro2GO mapping] (digit) is kept as a literal while [PANTHER phylogenetic analysis] (pure alpha) errors. That inconsistency is worth raising upstream. Please attach the validator-generated failing list to the migration issue. Note supporting_text is recommended, not required (gene_review.yaml:89-97), so deleting the field is schema-valid — do not invent quotes.
  2. Performance: +57% median on the reference CLI is the wrong direction for a CI-speed change. The profile points at the fix — 9.16s of 16.44s in str.translate suggests ligature normalization runs once per quote rather than once per fetched record; memoizing normalized text per reference upstream should recover most of it.

IMPORTANT
3. tests/test_reference_cache_behavior.py:29-40 parametrizes content_type but never full_text_available, which supporting_text.py:164-177 treats as authoritative and which modern cache records carry exclusively. The case trust_cached_entries exists to prevent (an abstract-only record silently refreshed) is therefore not covered with its authoritative marker.
4. The subprocess test dropped --no-full-text with no replacement network guard; UV_OFFLINE gates uv, not LRV's HTTP, so a regression makes the test slow/flaky instead of failing.
5. Lost coverage for valid-but-non-mapping frontmatter — the invariant this PR headlines. A black-box replacement would restore it against the upstream loader.
6. gene_review.yaml:92-94 invites the fully-bracketed excerpt pattern that now errors; the wording should change alongside the corpus migration or it regrows.

Suggestions (stale >=0.2.1 version floors, undocumented curator-facing behaviour change, config duplicated across two scripts, possible CLI flag instead of the temp-config dance, test_reference_curation_metadata.py's offline claim, unrelated argon2-cffi-bindings lock churn) and the full detail are in the review comment: #4947 (comment)

Not verified: no uv/deps and no network in this runner, so no test suite, no validate-all, and no inspection of LRV 0.3.0's config semantics. Findings 3, 10 and 11 hinge on that.

@ai4c-reviewer

ai4c-reviewer Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 5m 50s —— View job


Re-review: Upgrade LRV to 0.3.0 and remove cache-loader monkeypatch

Curation checklist (infrastructure PR — no gene-review or GOA content changed on this branch):

  • Schema validation passes — cannot run (no uv, no venv, no network in this runner)
  • All PMIDs verified as real — n/a, no references added
  • Supporting text matches publication content — n/a here, but see 🟡 1 for residual corpus state
  • GO terms correct and specific — n/a
  • Review actions well-justified — n/a
  • Core functions accurately identified — n/a
  • No over-annotation issues missed — n/a

Verdict: request changes — but only because the self-declared performance blocker is untouched and the PR is still a draft. b18bf80d0 addresses 10 of my 11 prior findings cleanly, and the excerpt migration (#4949) is merged into main and into this branch. Two residual items below.


✅ Resolved since the last review

Prior Status
🔴 1 migration #4949 merged (00d0f98ed); the 18 excerpts in 11 files are replaced. Residual state in 🟡 1 below.
🟡 3 full_text_available params tests/test_reference_cache_behavior.py:28-33 adds modern-abstract/modern-fulltext params; :62 now asserts validator.config.trust_cached_entries is True on the real validator.
🟡 4 subprocess network guard tests/conftest.py:133-149 — sys.addaudithook on socket.connect/socket.getaddrinfo injected via PYTHONPATH/sitecustomize, recorded to a file and asserted at test_reference_cache_behavior.py:149. Good design: records and raises, so a trip is attributable.
🟡 5 non-mapping frontmatter test_non_mapping_cache_fails_without_fetch_or_overwrite restores it black-box (fails + no fetch + bytes unchanged).
🟡 6 schema wording gene_review.yaml:93-95, CLAUDE.md:405-410, regenerated Pydantic + JSON Schema, with a history record. The [4Fe-4S]-is-literal carve-out is the right nuance to spell out.
🔵 7 version floors project.justfile:1249, publication_warm.py:3, docs/publication_fulltext_warming.md:5 all now say ≥ 0.3.0.
🔵 8 curator-facing docs New "Validation uses the committed evidence" section, including the "never replace a missing quotation with an invented one" line.
🔵 9 config duplication Both scripts now go through build_supporting_text_validator; extract_supporting_text_fixes.py:21 derives SKIP_PREFIXES from the config instead of a third copy, and test_direct_utilities_trust_reviewed_cache:206-210 asserts skip_prefixes/literal_bracket_patterns/reference_base_dir against the YAML.
🔵 11 offline claim test_reference_curation_metadata.py:127 now sets trust_cached_entries: True and takes the guard env.
🔵 12 lock churn Markers restored (cffi gets python_full_version >= '3.14' / < '3.14' per variant) — that reads as a correct resolution now, not churn.
🔵 10 temp-config dance Kept, with a comment explaining why. Fine as-is.

🔴 CRITICAL (unchanged, still blocking)

1. The performance regression is untouched. +57% median on the reference CLI (12.79s → 20.03s / 100 genes), against a corpus of ~6,700 reviews validated in one process. Nothing in b18bf80d0 addresses it and the PR body still lists it as a blocker. The profile still points at the fix — 9.16s of 16.44s in str.translate for ligature normalization, which looks like per-quote rather than per-fetched-record work. Memoizing normalized text per reference upstream, then re-pinning here, is the clean path. Agreed this must land upstream before merge.


🟡 IMPORTANT

1. The schema wording this PR adds is now violated by 27 excerpts that survive only by regex accident. This matters because the stated mitigation for regrowth is the wording, and the wording is not what enforces it. A scan of the working tree (post-#4949) finds:

  • 1 empty: genes/ARATH/CHL1/CHL1-ai-review.yaml:175 — supporting_text: '' under PMID:31431511 with full_text_unavailable: true. It escapes the 18 because scripts/run_reference_validator.sh:76-80 strips supporting_text from full_text_unavailable entries before LRV sees them. Per the new wording ("Omit this optional field when no source quotation is being asserted"), the key should simply be deleted.
  • 26 bracket-only across 10 files, in two classes:
    • ~21 under file: prefixes — these are in conf/local_quote_baseline.yaml, so warn-only. I confirmed [WIP contains WH2 domain for actin binding] (WIPF1-ai-review.yaml:51) is not a substring of WIPF1-deep-research-falcon.md, and WIPF1 is baselined at conf/local_quote_baseline.yaml:2577. Same shape for ABL1 ×7, Notch1 ×4, Sox2 ×3, App ×3, Ifi204 ×2, tlcd4b ×1.
    • 5 under GO_REF: — atg2 ×3, TEP10 ×1, cebp-2 ×1. These confirm the hypothesis from my last review: conf/reference_validator_config.yaml:51 literal_bracket_patterns: "[^a-zA-Z\\s]" is unanchored, so [IBA annotation inferred from Drosophila and S. cerevisiae orthologs via phylogenetic analysis] (contains .), [InterPro2GO mapping] (contains 2) and [This is a curator assessment based on comparison of domain-function mapping with TEP family biology] (contains -) are all classified as literal rather than editorial, and then skipped because GO_REF is a skip prefix. Whether a placeholder excerpt is an error depends on whether it happens to contain a digit, hyphen or period.

Not blocking — CI is green on all of these today — but the PR's claim that the schema change prevents regrowth is weaker than stated, because the check does not fire for the dominant cases. Two concrete asks: (a) note explicitly in #4954 that the file:-baselined and GO_REF:-literal placeholders are not covered by the new check, with the file/line list above, so the cleanup is scoped to the real set rather than the 18; (b) anchor literal_bracket_patterns to something like ^[^a-zA-Z\s] or a notation-shaped pattern — but do it in the cleanup PR, since anchoring adds failures and would reintroduce a migration blocker here. Fix this →


🔵 SUGGESTIONS

2. The network-guard positive control doesn't traverse the path it protects. test_subprocess_network_guard_is_active (tests/test_reference_cache_behavior.py:223-232) exercises the hook via sys.executable directly, but the test it was added for runs scripts/run_reference_validator.sh → uv run python -m ai_gene_review.validation.reference_cli. If uv run ever sanitizes PYTHONPATH, sitecustomize never loads and assert not network_attempt.exists() at line 149 becomes vacuously true — exactly the silent-pass failure mode the guard exists to prevent. A cheap in-circuit control: one case citing an uncached PMID (the config comment says missing references can still be fetched) asserting the guard trips through the wrapper.

3. pytest.raises(AttributeError) pins an upstream implementation detail. test_non_mapping_cache_fails_without_fetch_or_overwrite:103 asserts the exception type; the invariant you actually care about is "fails, no fetch, no overwrite". An AttributeError from non-mapping frontmatter is arguably an upstream bug, and this codifies it as the contract — if LRV later turns it into a clean validation failure, the test goes red for the right behaviour. The sibling at line 80 gets this right with pytest.raises(Exception, match=...).

4. The five cache params assert no differential behaviour. All five run the same assertions, including "Trailing body text." in loaded.content for modern-abstract. That is useful shape-tolerance coverage, and it does now cover the modern key, but it documents that LRV ignores both content_type and full_text_available for body extraction rather than pinning any precedence. Worth a one-line comment saying that is the intent, so a future reader doesn't mistake it for precedence coverage.


What I could not verify

Same runner limitations as before: no uv, no .venv, no network. So no just test, no just validate-all, no reference regression suite, and no inspection of LRV 0.3.0's ReferenceValidationConfig. The "Build and test" run for this push was still in progress when I finished. All corpus claims in 🟡 1 are from grep over the checked-out tree plus reading conf/local_quote_baseline.yaml and scripts/run_reference_validator.sh; the full_text_unavailable explanation for CHL1 is inferred from the wrapper's strip pass, not observed from a validator run.
· branch ci/upgrade-lrv-030

@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 of b18bf80d0. 10 of my 11 prior findings are resolved, cleanly: the full_text_available fixture params, the subprocess network guard (audit-hook sitecustomize via PYTHONPATH, recorded and raising — good design), the black-box non-mapping-frontmatter test, the schema/CLAUDE.md quotation wording with the [4Fe-4S]-is-literal carve-out, the version floors, the curator-facing docs section, the config de-duplication through build_supporting_text_validator (now asserted against the YAML), the test_reference_curation_metadata offline claim, and the uv.lock markers. #4949 is merged into main and into this branch.

Requesting changes on two items.

CRITICAL (unchanged) — the performance regression is untouched. +57% median on the reference CLI (12.79s to 20.03s / 100 genes) across ~6,700 reviews in one process; nothing in this push addresses it and the PR body still lists it as a blocker. The profile still points at the fix (9.16s of 16.44s in str.translate for ligature normalization, which looks per-quote rather than per-fetched-record). Fix upstream, then re-pin.

IMPORTANT — the schema wording this PR adds is violated by 27 excerpts that survive only by regex accident, which matters because the wording is the stated mitigation for regrowth. Post-#4949 the tree still has: 1 empty (genes/ARATH/CHL1/CHL1-ai-review.yaml:175, which escapes the 18 because run_reference_validator.sh:76-80 strips supporting_text from full_text_unavailable entries); and 26 bracket-only across 10 files, split into ~21 under file: prefixes that are warn-only via conf/local_quote_baseline.yaml (confirmed: [WIP contains WH2 domain for actin binding] is not a substring of WIPF1-deep-research-falcon.md, and WIPF1 is baselined at line 2577), plus 5 under GO_REF: (atg2 x3, TEP10, cebp-2). The GO_REF five confirm the unanchored-regex hypothesis from my last review: literal_bracket_patterns: "[^a-zA-Z\\s]" (conf/reference_validator_config.yaml:51) classifies [InterPro2GO mapping] (digit), [IBA annotation inferred from ... phylogenetic analysis] (period) and [This is a curator assessment ... domain-function mapping ...] (hyphen) as literal rather than editorial, so whether a placeholder is an error depends on whether it happens to contain punctuation. Asks: (a) record in #4954 that the file:-baselined and GO_REF:-literal placeholders are not covered by the new check, with the file/line list, so the cleanup is scoped to the real set rather than the 18; (b) anchor the pattern — but in the cleanup PR, since anchoring adds failures and would reintroduce a migration blocker here.

Suggestions (network-guard positive control does not traverse the uv run wrapper it protects, so the line-149 assertion could become vacuous; pytest.raises(AttributeError) pins an upstream implementation detail where the sibling test correctly uses match=; the five cache params assert no differential behaviour) and full detail are in the review comment: #4947 (comment)

Not verified: no uv, no venv and no network in this runner, so no test suite, no validate-all, and no inspection of LRV 0.3.0's ReferenceValidationConfig. All corpus claims are from grep over the checked-out tree plus reading the baseline file and the wrapper script.

@ai4c-reviewer

ai4c-reviewer Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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


Re-review: Upgrade LRV to 0.3.0 and remove cache-loader monkeypatch

  • Fetch base and diff the new push (8a233e021) against b18bf80d0
  • Check the two outstanding findings (perf blocker, residual placeholders)
  • Review the new wrapper-level offline guard test
  • Verify the dependency is still a released pin
  • Post updated review

Curation checklist (infrastructure PR — no gene-review or GOA content changed on this branch):

  • Schema validation passes — cannot run (no uv, no .venv, no network in this runner; "Build and test" for this push was still in_progress)
  • All PMIDs verified as real — n/a, no references added
  • Supporting text matches publication content — n/a here; residual corpus state in 🟡 1
  • GO terms correct and specific — n/a
  • Review actions well-justified — n/a
  • Core functions accurately identified — n/a
  • No over-annotation issues missed — n/a

Verdict: request changes — unchanged, and for the same single reason: the self-declared performance blocker. 8a233e021 resolves all three remaining suggestions from my last pass, and the perf story in the PR body is now much better documented than my own earlier estimate. The PR is correctly still a draft.


✅ Resolved by 8a233e021

Prior Status
🔵 2 positive control doesn't traverse the protected path Fixed properly. test_subprocess_network_guard_is_active_through_wrapper (tests/test_reference_cache_behavior.py:230-251) now goes through scripts/run_reference_validator.sh → uv run python -m ...reference_cli with an uncached PMID and an empty cache dir, asserting the guard trips (attempted.exists(), and the recorded event is one of socket.connect/socket.getaddrinfo) plus not (cache_dir / "PMID_1.md").exists(). That is exactly the in-circuit control: if uv run ever sanitizes PYTHONPATH so sitecustomize never loads, this test goes red instead of the negative at line 156 going vacuous.
🔵 3 pytest.raises(AttributeError) pins an upstream detail Fixed (:98-105). Now "raises or returns is_valid is False", with the cache-bytes assertion unconditional — the invariant, not the implementation.
🔵 4 cache params assert no differential behaviour Comment added at :36-37: "these cases check cache preservation, not metadata precedence." Exactly the disclaimer I asked for.

I also confirmed the dependency claim: pyproject.toml:51 is linkml-reference-validator>=0.3.0,<0.4, uv.lock:2655 resolves 0.3.0 from the PyPI registry, and [tool.uv.sources] (:161-162) contains only the workspace self-reference. No source checkout snuck in, as the PR body states.


🔴 CRITICAL (unchanged, still blocking — correctly self-declared)

1. Released 0.3.0 still carries the slowdown. The refreshed table is worse than my earlier estimate, not better: 8.78s → 21.98s median (+150%) on the same 100-gene sample, against ~6,700 reviews validated in one process. The upstream fix (linkml/linkml-reference-validator#106, normalized-text cache per validator) brings it to 7.90s in an isolated checkout — i.e. faster than 0.2.1, and it confirms the str.translate/normalize_text diagnosis from my first review: the ligature table was being applied per quote rather than per fetched record. Reporting that the cache-only comparison produced identical diagnostics in every round is the right control to have run. Nothing to change here — merge/release #106, raise the floor, re-lock, rerun full validation.


🟡 IMPORTANT

1. Residual placeholder excerpts are unchanged, and I could not confirm the #4954 bookkeeping. My ask from last round was (a) record the out-of-scope set in #4954 and (b) anchor literal_bracket_patterns in the cleanup PR, not here — so no code change was expected on this branch, and none happened. Current tree, for the record (23 total):

  • 1 empty — genes/ARATH/CHL1/CHL1-ai-review.yaml:175, supporting_text: '' with full_text_unavailable: true. Escapes the new check because scripts/run_reference_validator.sh:76-80 strips supporting_text from full_text_unavailable entries before LRV sees them. Per the wording this PR adds ("Omit this optional field when no source quotation is being asserted", gene_review.yaml:93-95), the key should just be deleted. Fix this →
  • 22 bracket-only across 9 files — mouse/Notch1 ×4, human/ABL1 ×7, mouse/App ×3, mouse/Sox2 ×3, mouse/Ifi204 ×2, plus SCHPO/atg2 ×3, human/WIPF1, ANOGA/TEP10, DICDI/tlcd4b, worm/cebp-2 ×1 each. Warn-only or skipped via conf/local_quote_baseline.yaml (file: prefixes) and the unanchored literal_bracket_patterns: "[^a-zA-Z\\s]" (GO_REF:, where any digit/hyphen/period makes a placeholder "literal").

Whether this is actually outstanding depends on what is now in #4954 — I could not read the issue (the gh issue view call was declined in this runner). If the inventory and the "not covered by the new check" note are already recorded there, consider this closed; if not, it is the one thing left from my last round besides perf.

2. The new positive control's fixture document is schema-invalid, which makes it depend on LRV not enforcing required slots. test_reference_cache_behavior.py:234 writes {"references": [{"id": "PMID:1", "title": TITLE}]} and passes --target-class GeneReview, but gene_symbol (gene_review.yaml:41) and taxon (:124) are required: true. If LRV loads the data through the LinkML/Pydantic loader before extracting references, the run aborts before any fetch, attempted is never written, and assert attempted.exists() at :249 fails for a reason that has nothing to do with the guard. The sibling test two functions up builds a complete document (id/gene_symbol/taxon, :116-120) — reusing that shape with an uncached PMID costs three lines and removes the coupling.

The failure direction is safe (loud, not silent), and the "Build and test" run for this push will settle whether it passes today — but "passes because upstream happens not to validate required slots" is a dependency on unspecified behaviour in the one test whose job is to be trustworthy. Fix this →


🔵 SUGGESTIONS

3. The loosened except Exception is load-bearing on a pytest implementation detail — worth a comment. At :101-102, except Exception: pass is only safe because the in-file forbid_network (:93-94) calls pytest.fail, which raises _pytest.outcomes.Failed — a BaseException subclass — so a network attempt still propagates rather than being swallowed into the pass. The subprocess guard in tests/conftest.py:137 raises a plain RuntimeError. If anyone ever harmonizes the two on RuntimeError, this test silently stops checking "no fetch" while still passing its cache-bytes assertion. One comment on the except line, or narrowing it to exclude the guard's exception, makes that durable.

4. UV_OFFLINE=1 in the new test is doing less than it looks. Same point as my first review, now applying to the positive control too: it gates uv's package resolution, not LRV's HTTP. The audit hook is the real guard — which is fine and is the design, but the UV_OFFLINE in env.update(...) at :236 may read to a future maintainer as the network protection.


What I could not verify

Same runner limitations as both prior passes: no uv, no .venv, no network, and gh issue view was declined. So no just test, no just validate-all, no reference regression suite, and no inspection of LRV 0.3.0's ReferenceValidationConfig — findings 🟡 2 and 🔵 3 hinge on runtime behaviour I can only reason about from the schema and from pytest's documented exception hierarchy. The corpus inventory in 🟡 1 is grep over the checked-out tree; the full_text_unavailable explanation for CHL1 is inferred from the wrapper's strip pass at run_reference_validator.sh:76-80, not observed from a validator run. CI for this push: "Build and test" in_progress at the time of writing.
· branch ci/upgrade-lrv-030

@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 of 8a233e021. All three remaining suggestions from my last pass are resolved, cleanly:

  • The network-guard positive control now traverses the path it protects — test_subprocess_network_guard_is_active_through_wrapper (tests/test_reference_cache_behavior.py:230-251) runs scripts/run_reference_validator.sh -> uv run python -m ...reference_cli with an uncached PMID and an empty cache dir, asserting the guard trips and nothing is written. If uv run ever sanitizes PYTHONPATH so sitecustomize never loads, this goes red instead of the negative at line 156 going vacuous. That was the point.
  • pytest.raises(AttributeError) is replaced by "raises or returns is_valid is False" (lines 98-105), with the cache-bytes assertion unconditional — the invariant, not the upstream implementation detail.
  • The cache params now carry the disclaimer that they check cache preservation, not metadata precedence (lines 36-37).

I also confirmed the dependency claim: pyproject.toml:51 is >=0.3.0,<0.4, uv.lock:2655 resolves 0.3.0 from the PyPI registry, and [tool.uv.sources] holds only the workspace self-reference. No source checkout snuck in.

Requesting changes on the self-declared blocker plus two smaller items.

CRITICAL (unchanged, correctly self-declared) — released 0.3.0 still carries the slowdown, and the refreshed numbers are worse than my earlier estimate: 8.78s -> 21.98s median (+150%) on the same 100-gene sample, across ~6,700 reviews in one process. Upstream linkml/linkml-reference-validator#106 brings it to 7.90s in an isolated checkout, i.e. faster than 0.2.1, confirming the str.translate/normalize_text diagnosis (ligature table applied per quote rather than per fetched record). Reporting that the cache-only comparison produced identical diagnostics in every round is the right control. Nothing to change here: merge/release #106, raise the floor, re-lock, rerun full validation.

IMPORTANT 1 — residual placeholder excerpts are unchanged (expected; my ask was for #4954 bookkeeping, not code on this branch), but I could not read #4954 in this runner (gh issue view declined), so I cannot confirm it was recorded. Current tree holds 23: 1 empty at genes/ARATH/CHL1/CHL1-ai-review.yaml:175 (escapes the new check because run_reference_validator.sh:76-80 strips supporting_text from full_text_unavailable entries; per the wording this PR adds, the key should simply be deleted), plus 22 bracket-only across 9 files (mouse/Notch1 x4, human/ABL1 x7, mouse/App x3, mouse/Sox2 x3, mouse/Ifi204 x2, SCHPO/atg2 x3, and one each in human/WIPF1, ANOGA/TEP10, DICDI/tlcd4b, worm/cebp-2) that are warn-only via conf/local_quote_baseline.yaml or skipped via the unanchored literal_bracket_patterns. If the inventory is already in #4954, consider this closed.

IMPORTANT 2 — the new positive control's fixture document is schema-invalid, which couples it to unspecified upstream behaviour. Line 234 writes {"references": [...]} only, but gene_symbol (gene_review.yaml:41) and taxon (:124) are required: true. If LRV loads data through the LinkML loader before extracting references, the run aborts before any fetch and assert attempted.exists() at line 249 fails for a reason unrelated to the guard. The sibling test two functions up already builds a complete document (lines 116-120); reusing that shape with an uncached PMID costs three lines. The failure direction is safe (loud, not silent) and CI for this push will settle whether it passes today, but "passes because upstream happens not to enforce required slots" is a weak footing for the one test whose job is to be trustworthy.

Suggestions (the loosened except Exception at line 101 is safe only because pytest.fail raises a BaseException subclass while the conftest guard raises RuntimeError — worth a comment so a future harmonization doesn't silently neuter it; and UV_OFFLINE in the new test gates uv's resolution, not LRV's HTTP) with full detail in the review comment: #4947 (comment)

Not verified: no uv, no .venv, no network, and gh issue view declined, so no test suite, no validate-all, and no inspection of LRV 0.3.0's ReferenceValidationConfig. Corpus claims are grep over the checked-out tree. "Build and test" was still in progress.

@cmungall cmungall changed the title Upgrade LRV to 0.3.0 and remove cache-loader monkeypatch Upgrade LRV to 0.3.1rc1 and remove cache-loader monkeypatch Oct 12, 2026
@ai4c-reviewer

ai4c-reviewer Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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


Re-review: Upgrade LRV to 0.3.0 and remove cache-loader monkeypatch

  • Diff the new push (32d8fbf35) against 8a233e021
  • Check the perf blocker status and the dependency pin
  • Re-check the two outstanding findings (CHL1 empty excerpt, positive-control fixture)
  • Post updated review

Curation checklist (infrastructure PR — no gene-review or GOA content changed on this branch):

  • Schema validation passes — cannot run (no uv, no .venv, no network in this runner; "Build and test" for this push is in_progress)
  • All PMIDs verified as real — n/a, no references added
  • Supporting text matches publication content — n/a here; residual corpus state unchanged (see 🟡 3)
  • GO terms correct and specific — n/a
  • Review actions well-justified — n/a
  • Core functions accurately identified — n/a
  • No over-annotation issues missed — n/a

Verdict: request changes — the push is a two-line dependency bump, and it is genuine progress: the upstream perf fix is now published and consumed rather than living in a source checkout. But it is published as a release candidate, and the control experiment that established "identical diagnostics" was run against a different artifact than the one now pinned. The PR is correctly still a draft.


What changed in 32d8fbf35

pyproject.toml:51 >=0.3.0,<0.4 → >=0.3.1rc1,<0.4, and uv.lock resolves 0.3.1rc1 from PyPI (uploaded 2026-10-12T18:11:24Z, ~9 minutes before the push). Nothing else. The floor is correct in the one way that matters most: 0.3.0 does not satisfy >=0.3.1rc1, so the slow build can no longer be resolved, and 0.3.1 final will satisfy it when released. [tool.uv.sources] still holds only the workspace self-reference — no source checkout snuck in.


🔴 CRITICAL

1. The pin is a prerelease, which is not the gate the PR set for itself. The body's own exit criteria read "merge/release upstream #106, raise the minimum LRV version and lock that release here" — an rc is not that release. Two consequences:

  • Prerelease resolution is now enabled for this package. Under PEP 440/uv, a specifier containing a prerelease opts that package into prerelease candidates, so a future 0.3.2rc1 becomes resolvable for anyone installing without the lockfile. The <0.4 cap is not affected (PEP 440's exclusive ordered comparison forbids <0.4 from matching 0.4.0rc1), so the exposure is bounded to 0.3.x prereleases — but it is still a standing change to the published floor that outlives this PR's testing purpose.
  • The floor should become >=0.3.1 (or >=0.3.1,<0.4) and be re-locked before ready. Keeping >=0.3.1rc1 is fine for exactly what the commit message says it is — testing the published artifact — and should not survive into the merge.

2. There is no measurement, and no diagnostics control, for the artifact that is now pinned. The table in the body has four rows — released 0.2.1 (8.78s), released 0.3.0 (21.98s), 0.3.0 + the cache change in an isolated source checkout (7.90s), upstream main (6.70s). 0.3.1rc1 is none of them, and the body still states "the dependency remains on released 0.3.0; this PR does not yet contain the measured performance improvement."

This matters more than bookkeeping, because the body is explicit that the cache-only comparison was constructed to isolate the optimization from newer unreleased matching changes — and the published rc is very unlikely to be that isolated patch. The wheel grew 175,413 → 198,993 bytes (+13.4%) and the sdist 1,294,426 → 1,342,037, which is far more than a per-validator memoization adds. If the rc also carries the matching changes, then:

  • the "identical diagnostics in every round" control does not cover what is pinned, and
  • matching-behaviour changes are precisely the class of change that can flip quote validation across 6,773 reviews and shift what conf/local_quote_baseline.yaml needs to cover.

Concretely, before ready: (a) add a 0.3.1rc1 timing row measured the same way (same 100 genes, three rounds); (b) re-run the full-corpus reference validation against 0.3.1rc1 and diff diagnostics against released 0.3.0, rather than carrying forward the cache-only control. The body already promises full-corpus results — that run should now be against the rc, not 0.3.0. I could not inspect the rc's contents to confirm what else it contains (no network in this runner); the size delta is an inference, and upstream's changelog between 0.3.0 and 0.3.1rc1 would settle it quickly. Fix this →


🟡 IMPORTANT

3. Both items from my last pass are unchanged, as expected for one and not for the other.

  • The positive control's fixture is still schema-invalid (tests/test_reference_cache_behavior.py:234): {"references": [{"id": "PMID:1", "title": TITLE}]} with --target-class GeneReview, while gene_symbol (gene_review.yaml:41) and taxon (:124) are required: true. The sibling at :116-120 already builds the complete shape; reusing it with an uncached PMID costs three lines and removes the dependency on LRV not enforcing required slots before reference extraction. This is the one test whose entire job is to be trustworthy, so "passes because upstream happens not to validate" is weak footing. Failure direction is safe (loud), and "Build and test" was still in_progress when I finished, so I still cannot say whether it passes today. Fix this →
  • The residual placeholders are untouched — expected, since my ask was Audit remaining editorial-only evidence snippets and clarify quotation guidance #4954 bookkeeping rather than code here. Still 23 in the tree: 1 empty at genes/ARATH/CHL1/CHL1-ai-review.yaml:175 (supporting_text: '' with full_text_unavailable: true, which escapes the new check because scripts/run_reference_validator.sh:76-80 strips the field from full_text_unavailable entries before LRV sees it — per the wording this PR adds at gene_review.yaml:93-95, the key should simply be deleted), plus 22 bracket-only across 9 files that are warn-only via the baseline or skipped via the unanchored literal_bracket_patterns. I again could not read Audit remaining editorial-only evidence snippets and clarify quotation guidance #4954 in this runner, so I cannot confirm the inventory was recorded there.

🔵 SUGGESTIONS

4. The four version floors you just corrected now read >= 0.3.0 against a >= 0.3.1rc1 pin (scripts/run_reference_validator.sh:14, docs/publication_fulltext_warming.md:5, src/ai_gene_review/etl/publication_warm.py:3, project.justfile:1249). These are defensible as feature floors — trust_cached_entries and the provider chain really did arrive in 0.3.0, and 0.3.1 is performance — so I would leave them rather than re-churn, but it is worth being deliberate about that reading instead of having it be accidental.

5. uv lock --check with a prerelease floor is the one mechanical thing I cannot verify here. The specifier form should be sufficient for uv to admit the rc without a [tool.uv] prerelease setting, and the lock already contains the resolved rc, so CI is the arbiter — just worth confirming the lock-consistency check in the body's validation list was re-run after this bump rather than carried over from the 0.3.0 state.


What I could not verify

Same runner limitations as all three prior passes: no uv, no .venv, no network, and gh issue view / gh run list declined. So no just test, no just validate-all, no reference regression suite, no inspection of 0.3.1rc1's contents or changelog, and no read of #4954. The wheel/sdist size deltas in 🔴 2 are from uv.lock metadata in the diff; the inference that the rc carries more than the cache change follows from those sizes and from the body's own note about unreleased matching changes, and should be checked against upstream's changelog. "Build and test" for 32d8fbf35 was in_progress at the time of writing.
· branch ci/upgrade-lrv-030

@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 of 32d8fbf35. The push is a two-line dependency bump and it is genuine progress: the upstream perf fix is now published and consumed (pyproject.toml:51 >=0.3.1rc1,<0.4, uv.lock resolving 0.3.1rc1 from PyPI, uploaded ~9 minutes before the push). The floor is correct in the way that matters most — 0.3.0 no longer satisfies it, so the slow build cannot be resolved, and 0.3.1 final will. No source checkout snuck in; [tool.uv.sources] still holds only the workspace self-reference.

Requesting changes on two items, plus the two carryovers.

CRITICAL 1 — the pin is a prerelease, which is not the gate this PR set for itself ("raise the minimum LRV version and lock that release here"). A specifier containing a prerelease opts the package into prerelease resolution, so a future 0.3.2rc1 becomes resolvable for anyone installing without the lockfile. The <0.4 cap is unaffected (PEP 440 forbids <0.4 from matching 0.4.0rc1), so exposure is bounded to 0.3.x prereleases, but it is a standing change to the published floor that outlives the testing purpose. Fine for testing the published artifact, as the commit message says; the floor should become >=0.3.1 and be re-locked before ready.

CRITICAL 2 — there is no measurement, and no diagnostics control, for the artifact now pinned. The body's table covers 0.2.1 (8.78s), 0.3.0 (21.98s), 0.3.0+cache in an isolated checkout (7.90s) and upstream main (6.70s); 0.3.1rc1 is none of them, and the body still states "the dependency remains on released 0.3.0; this PR does not yet contain the measured performance improvement." This is more than bookkeeping because the body is explicit that the cache-only comparison was built to isolate the optimization from newer unreleased matching changes — and the rc is unlikely to be that isolated patch: the wheel grew 175,413 to 198,993 bytes (+13.4%) and the sdist 1,294,426 to 1,342,037, far more than a per-validator memoization. If the rc also carries the matching changes, the "identical diagnostics in every round" control does not cover what is pinned, and matching-behaviour changes are exactly the class that can flip quote validation across 6,773 reviews and shift what conf/local_quote_baseline.yaml must cover. Before ready: add a 0.3.1rc1 timing row measured the same way, and re-run full-corpus reference validation against the rc with a diagnostics diff versus 0.3.0 rather than carrying the cache-only control forward. The size delta is an inference — upstream's changelog between 0.3.0 and 0.3.1rc1 would settle it.

IMPORTANT 3 (carryover) — the positive control's fixture is still schema-invalid at tests/test_reference_cache_behavior.py:234 ({"references": [...]} only, while gene_symbol and taxon are required: true). The sibling at :116-120 already builds the complete shape; reusing it with an uncached PMID costs three lines and removes the dependency on LRV not enforcing required slots before reference extraction. Failure direction is safe, but this is the one test whose job is to be trustworthy. Also unchanged: 23 residual placeholder excerpts (1 empty at genes/ARATH/CHL1/CHL1-ai-review.yaml:175, 22 bracket-only across 9 files) — expected, since my ask was #4954 bookkeeping, which I again could not read in this runner.

Suggestions (the four version floors corrected last push now read >= 0.3.0 against a >= 0.3.1rc1 pin — defensible as feature floors, worth being deliberate about; and confirm uv lock --check was re-run after this bump) with full detail in the review comment: #4947 (comment)

Not verified: no uv, no .venv, no network, gh issue view declined, so no test suite, no validate-all, no inspection of 0.3.1rc1's contents or changelog. "Build and test" for this push was still in progress.

@ai4c-reviewer

ai4c-reviewer Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 4m 47s —— View job


Re-review: Upgrade LRV to 0.3.1rc1 and remove cache-loader monkeypatch

  • Diff the new push (e8c6df0b4) against 32dfb35
  • Verify the offline-guard fixture fix against the schema's required slots
  • Re-check the dependency pin, the lock, and the RC measurement claims
  • Re-audit the residual placeholder corpus
  • Post updated review

Curation checklist (infrastructure PR — no gene-review or GOA content changed on this branch):

  • Schema validation passes — cannot run (no uv, no .venv, no network in this runner; both runs for this push were in_progress)
  • All PMIDs verified as real — n/a, no references added
  • Supporting text matches publication content — n/a here; residual corpus state in 🟡 3
  • GO terms correct and specific — n/a
  • Review actions well-justified — n/a
  • Core functions accurately identified — n/a
  • No over-annotation issues missed — n/a

Verdict: request changes — for exactly one reason now, and it is the one the PR declares itself: the pin is still a release candidate. e8c6df0b4 closes my last IMPORTANT, and the PR body closes the other CRITICAL from that pass properly rather than by assertion. One new item below, which is about what the refreshed table no longer shows.


✅ Resolved by e8c6df0b4

The positive control's fixture is no longer schema-invalid. tests/test_reference_cache_behavior.py:234-239 now carries id, gene_symbol and taxon{id,label} — which are the three required: true slots reachable from GeneReview (gene_review.yaml:331-348, with gene_symbol at :38 and taxon at :121; references/existing_annotations are not required). The uncached PMID:1 and the empty cache dir are untouched, so the guard assertion at :254 can no longer fail for a reason unrelated to the guard. Three lines, exactly as scoped.

✅ Resolved in the body since 32dfb35 (my prior 🔴 2)

  • There is now a measurement and a diagnostics control for the pinned artifact. Alternating three runs each on the same 100-gene manifest: 0.3.0 median 43.47s vs 0.3.1rc1 median 25.46s, −41%, with byte-identical diagnostics in all three pairs. Both medians check out against the listed runs.
  • The full-corpus run is against the rc, not carried forward from 0.3.0 — 6,773 reviews, 171,220 snippets checked, zero errors, 49 advisory warnings across 28 files, and output identical to released 0.3.0 after normalizing worktree roots, .lrv temp suffixes and the timing footer. That is the right control and it is strictly better than what I asked for: it covers whatever else the rc carries beyond the normalized-reference cache, which was the actual worry behind the wheel-size delta, instead of arguing from the changelog.
  • Lock verified here: uv.lock:2655 resolves 0.3.1rc1 from the PyPI registry with wheel sha256 88ba0eea05d041c30ce5af15b801072685e6fa3886b8816cd973190253568cca, matching the body exactly; sdist cbf458ca…, both uploaded 2026-10-12T18:11Z. [tool.uv.sources] still holds only the workspace self-reference — no source checkout, as stated.

🔴 CRITICAL (self-declared, still blocking)

1. The pin is a prerelease. pyproject.toml:51 is >=0.3.1rc1,<0.4. The body commits to replacing it with >=0.3.1,<0.4 and refreshing the lock once the final release ships, which is the right plan and needs nothing further on this branch — it is simply why the PR cannot go ready. Worth keeping in view: a specifier containing a prerelease opts this package into prerelease resolution for anyone installing without the lockfile. The exposure is bounded to 0.3.x (PEP 440 forbids <0.4 from matching 0.4.0rc1), but it is a standing change to the published floor that would outlive the testing purpose.


🟡 IMPORTANT

2. The refreshed table dropped the 0.2.1 row, so "no net regression against the version being replaced" is no longer demonstrated anywhere in the body. What is now shown is rc1 vs 0.3.0 — rc1 beating the artifact nobody is running. The version this PR upgrades from is 0.2.1, previously measured at 8.78s median on the same 100-gene sample, against rc1's 25.46s here.

I think the busy-machine caveat explains the whole gap and that the upgrade is fine: the common 0.3.0 arm moved 21.98s → 43.47s between rounds, so this round is running ~2× slow across the board, and 25.46/2 lands near the isolated-checkout 7.90s. But that reconciliation is mine, not the body's, and the only direct evidence for parity-or-better vs 0.2.1 is still the isolated source-checkout pair (0.3.0+cache 7.90s vs 0.2.1 8.78s) — not the published artifact. One additional alternating arm with 0.2.1 installed, in the same round as the other two, puts the actual before/after of this PR on one row set and costs little next to the full-corpus runs already done. Fix this →

3. Residual placeholder excerpts unchanged — expected; my ask was #4954 bookkeeping, not code here. For the record the current tree holds 27, slightly more than the 23 I reported last pass (my earlier pattern missed quoted-scalar forms):

  • 1 empty — genes/ARATH/CHL1/CHL1-ai-review.yaml:175, supporting_text: '' under PMID:31431511 with a real reason at :171-172. Per the wording this PR adds (gene_review.yaml:91-94, "Omit this optional field when no source quotation is being asserted") the key should simply be deleted; it survives today only because scripts/run_reference_validator.sh:76-80 strips supporting_text from full_text_unavailable entries before LRV sees them.
  • 26 bracket-only across 10 files — human/ABL1 ×7 (:466, :532, :547, :688, :859, :1666, :1728), mouse/Notch1 ×4, mouse/Sox2 ×3, SCHPO/atg2 ×3, mouse/App ×3, mouse/Ifi204 ×2, and one each in human/WIPF1:51, ANOGA/TEP10:122, DICDI/tlcd4b:151, worm/cebp-2:423. Warn-only via conf/local_quote_baseline.yaml (file: prefixes) or skipped via the unanchored literal_bracket_patterns (GO_REF:).

The body says #4954 now carries a YAML-node inventory of 37 candidates including multiline values, plus the wrapper/baseline/literal-pattern exemptions — a superset of the above and exactly the bookkeeping I asked for. gh issue view was declined in this runner, so I am taking that on the body's word rather than confirming it.


🔵 SUGGESTIONS

4. The guard records the event name but not the target, so the positive control cannot attribute the attempt it catches. tests/conftest.py:141-145 writes only event to the sentinel, and the new control asserts attempted.read_text() in {"socket.connect", "socket.getaddrinfo"} (:255). Any network attempt anywhere in that subprocess tree satisfies it — including the wrapper's own uv run python -c preprocessing pass (run_reference_validator.sh:65-93), which inherits the same hook. UV_NO_SYNC=1/UV_OFFLINE=1 make a uv-side trip unlikely and the negative assertion at :156 is the one that carries weight, so this is cosmetic. But writing f"{event} {args!r}" would make the control report which fetch it caught, which is the entire reason it exists.

5. Relatedly, the fixture's new taxon.id: NCBITaxon:9606 is a prefix absent from skip_prefixes (conf/reference_validator_config.yaml:24-48). LRV should extract references only from the references slot and supported_by[].reference_id, not from a Term-ranged slot, so I expect it to be inert — but it is a second unskipped CURIE inside the one document whose whole assertion is "something tried to fetch". Fixing 4 makes the question moot either way.

6. The four version floors still read >= 0.3.0 against a >=0.3.1rc1 pin (scripts/run_reference_validator.sh:14, docs/publication_fulltext_warming.md:5, src/ai_gene_review/etl/publication_warm.py:3, project.justfile:1249). Still defensible as feature floors — multi-file validate data, trust_cached_entries and the provider chain all arrived in 0.3.0, and 0.3.1 is performance only. I would leave them rather than re-churn; just keep that reading deliberate.


What I could not verify

Same runner limitations as all four prior passes: no uv, no .venv, no network, and gh issue view declined. So no just test, no just validate-all, no reference regression suite, no inspection of the rc's contents or changelog, and no read of #4954. Corpus counts in 🟡 3 are grep over the checked-out tree; the required-slot check in the ✅ section is read from gene_review.yaml, not from a validator run. Both workflow runs for e8c6df0b4 ("Build and test" 38292308680 and this review job) were in_progress when I finished.

One housekeeping note that is not a PR finding: this runner's checkout carries an uncommitted reversal of the 6-line CLAUDE.md quotation paragraph (git status shows M CLAUDE.md; git diff removes exactly the lines the PR adds). The committed branch content is correct and I left the working tree alone — flagging it only so it is not mistaken for a missing change.
· branch ci/upgrade-lrv-030

@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 of e8c6df0b4. The push closes my last IMPORTANT, and the PR body closes the other CRITICAL from that pass properly rather than by assertion. Requesting changes for one reason, the one the PR declares itself: the pin is still a release candidate.

Resolved by e8c6df0 — the positive control's fixture is no longer schema-invalid. tests/test_reference_cache_behavior.py:234-239 now carries id, gene_symbol and taxon{id,label}, the three required: true slots reachable from GeneReview (gene_review.yaml:331-348, with gene_symbol at :38 and taxon at :121). The uncached PMID:1 and the empty cache dir are untouched, so the guard assertion at :254 can no longer fail for a reason unrelated to the guard.

Resolved in the body since 32dfb35 (my prior CRITICAL 2) — there is now a measurement and a diagnostics control for the pinned artifact: alternating three runs each on the same 100-gene manifest, 0.3.0 median 43.47s vs 0.3.1rc1 median 25.46s (-41%), byte-identical diagnostics in all three pairs; both medians check out against the listed runs. And the full-corpus run is against the rc rather than carried forward — 6,773 reviews, zero errors, 49 advisory warnings in 28 files, output identical to released 0.3.0 after normalizing worktree roots, .lrv temp suffixes and the timing footer. That is strictly better than what I asked for: it covers whatever else the rc carries beyond the cache change, which was the real worry behind the wheel-size delta, instead of arguing from the changelog. I verified the lock here: uv.lock:2655 resolves 0.3.1rc1 from PyPI with wheel sha256 88ba0eea... matching the body, and [tool.uv.sources] still holds only the workspace self-reference.

CRITICAL (self-declared, still blocking) — pyproject.toml:51 is >=0.3.1rc1,<0.4. The body commits to replacing it with >=0.3.1,<0.4 and refreshing the lock once the final release ships, which is the right plan and needs nothing further here; it is simply why the PR cannot go ready. Keep in view that a specifier containing a prerelease opts this package into prerelease resolution for anyone installing without the lockfile — bounded to 0.3.x by <0.4, but a standing change to the published floor that would outlive the testing purpose.

IMPORTANT — the refreshed table dropped the 0.2.1 row, so 'no net regression against the version being replaced' is no longer demonstrated anywhere in the body. What is shown is rc1 beating the artifact nobody is running. The version this PR upgrades from is 0.2.1, previously 8.78s median on the same sample, against rc1's 25.46s here. I think the busy-machine caveat explains the whole gap and the upgrade is fine — the common 0.3.0 arm moved 21.98s to 43.47s between rounds, so this round runs ~2x slow across the board and 25.46/2 lands near the isolated-checkout 7.90s — but that reconciliation is mine, not the body's, and the only direct evidence for parity-or-better vs 0.2.1 is still the isolated source checkout, not the published artifact. One additional alternating arm with 0.2.1 in the same round puts the actual before/after on one row set, cheaply.

IMPORTANT (carryover, expected) — residual placeholder excerpts unchanged; my ask was #4954 bookkeeping, not code here. The current tree holds 27, slightly more than the 23 I reported last pass (my earlier pattern missed quoted-scalar forms): 1 empty at genes/ARATH/CHL1/CHL1-ai-review.yaml:175, plus 26 bracket-only across 10 files (ABL1 x7, Notch1 x4, Sox2 x3, atg2 x3, App x3, Ifi204 x2, one each in WIPF1:51, TEP10:122, tlcd4b:151, cebp-2:423). The body says #4954 now carries a 37-candidate YAML-node inventory including multiline values plus the wrapper/baseline/literal-pattern exemptions — a superset of that list and exactly the bookkeeping I asked for; gh issue view was declined in this runner, so I take it on the body's word.

Suggestions (the guard records the event name but not the target, so the positive control cannot attribute the attempt it catches — writing f'{event} {args!r}' in tests/conftest.py:141-145 would fix that; relatedly the fixture's new NCBITaxon prefix is absent from skip_prefixes, which should be inert but is a second unskipped CURIE in the one document whose assertion is 'something tried to fetch'; and the four version floors still read >= 0.3.0, defensible as feature floors) with full detail in the review comment: #4947 (comment)

Not verified: no uv, no .venv, no network, gh issue view declined, so no test suite, no validate-all, no inspection of the rc's contents. Corpus counts are grep over the checked-out tree; the required-slot check is read from the schema, not from a validator run. Both runs for this push were in_progress.

@cmungall
cmungall marked this pull request as ready for review October 13, 2026 09:03
@ai4c-reviewer

ai4c-reviewer Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 4m 55s —— View job


Re-review: Upgrade LRV to 0.3.1rc1 and remove cache-loader monkeypatch

  • Check whether anything changed since e8c6df0b4
  • Confirm CI outcome for this push
  • Check whether upstream v0.3.1 final exists
  • Audit what 0.3.1rc1 actually contains, and this corpus's exposure to it
  • Re-check carryover findings
  • Post updated review

Curation checklist (infrastructure PR — no gene-review or GOA content changed on this branch):

  • Schema validation passes — "Build and test" for e8c6df0b4 is green (38292308680, conclusion success). First complete run across my five passes; this retires the "could not verify the suite" caveat I have been carrying.
  • All PMIDs verified as real — n/a, no references added
  • Supporting text matches publication content — n/a here; residual corpus state in 🟡 3
  • GO terms correct and specific — n/a
  • Review actions well-justified — n/a
  • Core functions accurately identified — n/a
  • No over-annotation issues missed — n/a

Verdict: request changes. No new commits since e8c6df0b4 — what changed is the draft → ready-for-review transition, and that is the problem: the PR body's own merge gate cannot be satisfied today, because upstream v0.3.1 final does not exist. I also finally had network and gh in this runner, so I could audit what the rc actually ships — and it is five upstream PRs, not one. The full-corpus control does cover it, but the body should say what it is shipping.


🔴 CRITICAL

1. The PR went ready-for-review while its own gate is unsatisfiable: upstream v0.3.1 final has not been released. The body says "keep draft until the final 0.3.1 pin replaces the prerelease" and "Before merge, replace the RC floor with the final >=0.3.1,<0.4 release and refresh the lock once that release is published." Verified against the upstream releases API — the latest release is still the prerelease:

v0.3.1rc1  2026-10-12T18:10:51Z  prerelease=true
v0.3.0     2026-10-04T01:30:07Z  prerelease=false

And the pin is unchanged: pyproject.toml:51 is linkml-reference-validator>=0.3.1rc1,<0.4, uv.lock:2655 resolves 0.3.1rc1, uv.lock:121 records the rc specifier. So nothing is wrong with the branch — it is exactly the state the body describes — but ready-for-review asserts a gate the ecosystem cannot satisfy yet. Either go back to draft until upstream cuts 0.3.1, or state explicitly in the body that merging on the rc is now the accepted decision and drop the "replace before merge" commitment. The current combination reads as the gate having been met.

Worth restating the one standing consequence: a specifier containing a prerelease opts this package into prerelease resolution for anyone installing without the lockfile. Bounded to 0.3.x by <0.4 (PEP 440 forbids <0.4 from matching 0.4.0rc1), but it outlives the testing purpose.


🟡 IMPORTANT

2. The body materially understates what 0.3.1rc1 contains — and two of the five upstream PRs in it touch cache format and quote matching. The body says the release "now includes both the delimiter fix and the normalized-reference cache from LRV #106." The actual range v0.3.0...v0.3.1rc1 is 57 commits, 28 files, +4055/-208:

Upstream PR What it does Footprint
#101 A new reference-cache format contract cache.py +251 (new), reference_fetcher.py +232/-142, docs/reference/cache-format.md (new), tests/test_cache_validation.py +512
#103 url: HTML pages cached as readable text instead of markup, with a cache-version bump etl/sources/url.py, etl/extract/html.py +185/-9, test_url_source_cache_version.py
#104 New SVGExtractor for file: SVG references etl/extract/svg.py +897 (new), etl/sources/file.py +35/-3
#105 Fuzzy matching / repair changes fuzzy_text_utils.py +103/-2, matching.py, repairer.py, supporting_text_validator.py +59/-9
#106 The normalized-reference cache (the stated reason for the bump) cache.py, benchmarks/repeated_quotes.py

#105 is exactly the class of change I flagged two passes ago as able to flip quote validation across the corpus — commits like "Never offer a fragment of a quote as its fuzzy correction", "Count stopwords when deciding a fuzzy match drops part of the quote", "Keep a dropped negation from passing as a near spelling". #101 concerns the format of this repo's ~6,800 committed publications/*.md.

This is not a blocking correctness objection, because the full-corpus identical-diagnostics run is the right control and it empirically covers all of it — that remains the strongest evidence in this PR. The ask is bookkeeping with teeth: a reviewer deciding whether that control is sufficient needs to know what it is covering. Describing a 57-commit range as "the delimiter fix and the normalized-reference cache" invites the reader to think the control only has to cover a memoization. Please list the five PRs, and note that the identical-diagnostics result is what clears the cache-format and matching changes. Fix this →

3. Residual placeholder excerpts unchanged — expected, since my ask was #4954 bookkeeping rather than code here. Still 1 empty at genes/ARATH/CHL1/CHL1-ai-review.yaml:175 (supporting_text: '' with full_text_unavailable: true, which survives only because scripts/run_reference_validator.sh:76-80 strips the field from full_text_unavailable entries before LRV sees it — per the wording this PR adds at gene_review.yaml:91-94, the key should simply be deleted), plus 26 bracket-only across 10 files that are warn-only via conf/local_quote_baseline.yaml or skipped via the unanchored literal_bracket_patterns.


🔵 SUGGESTIONS

4. I could finally run the exposure analysis for #103/#104, and it is reassuring — but one cache entry is now frozen in a superseded format. Recording it so it isn't rediscovered later:

5. The body omits a real argument in its own favour. #101's "Preserve consumer cache extensions across refreshes" is upstream formalizing precisely what this repo depends on — full_text_available as a consumer extension that survives a cache refresh, which until now was an unspecified behaviour the deleted reference_cache_compat.py was partly defending against. That is a durability win for the removal of the monkeypatch, and it is a better reason to take 0.3.1 than the performance number.

6. The guard records the event name but not the target (carryover). tests/conftest.py:141-145 writes only event to the sentinel, so the positive control asserts that something tried to connect, not what. Any attempt anywhere in the subprocess tree satisfies it, including the wrapper's own uv run python -c preprocessing pass. f"{event} {args!r}" would let the control report which fetch it caught, which is the reason it exists. Cosmetic — the negative assertion is the one carrying weight.

7. The four version floors still read >= 0.3.0 against a >=0.3.1rc1 pin (scripts/run_reference_validator.sh:14, docs/publication_fulltext_warming.md:5, src/ai_gene_review/etl/publication_warm.py:3, project.justfile:1249). Still defensible as feature floors — trust_cached_entries and the provider chain arrived in 0.3.0. Leave them; just keep that reading deliberate.


What I verified this pass, and what I did not

Better than previous passes: this runner had gh and network, so the upstream release list, the v0.3.0...v0.3.1rc1 commit/file range, and the CI conclusion are observed, not inferred — which settles the wheel-size inference from my fourth pass (the rc does carry more than the cache change, and the full-corpus control is what covers it). The lock and pin are read from the diff. Corpus counts in 🟡 3 and the url:/SVG exposure in 🔵 4 are grep plus reading the cache entry directly. Still no uv and no .venv, so I did not run just test or just validate-all myself — I am relying on the green "Build and test" run for e8c6df0b4. gh issue view was declined again, so #4954's inventory is still taken on the body's word.
· branch ci/upgrade-lrv-030

@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 the draft -> ready-for-review transition. No new commits since e8c6df0b4; what changed is the readiness assertion, and that is the problem. This runner finally had gh and network, so several things I had been inferring are now observed.

Good news first: "Build and test" for e8c6df0b4 is green (run 38292308680, conclusion success). That is the first complete run across my five passes and it retires the "could not verify the suite" caveat I had been carrying.

CRITICAL 1 - the PR went ready-for-review while its own merge gate is unsatisfiable. The body says "keep draft until the final 0.3.1 pin replaces the prerelease" and commits to replacing the floor "once that release is published". Verified against the upstream releases API: the latest release is still v0.3.1rc1 (2026-10-12T18:10:51Z, prerelease=true); v0.3.0 (2026-10-04) is the most recent final. The pin is unchanged - pyproject.toml:51 is >=0.3.1rc1,<0.4, uv.lock:2655 resolves the rc, uv.lock:121 records the rc specifier. Nothing is wrong with the branch; it is exactly the state the body describes. But ready-for-review asserts a gate the ecosystem cannot satisfy yet. Either return to draft until upstream cuts 0.3.1, or state explicitly that merging on the rc is now the accepted decision and drop the "replace before merge" commitment - the current combination reads as the gate having been met. Standing consequence either way: a specifier containing a prerelease opts this package into prerelease resolution for anyone installing without the lockfile, bounded to 0.3.x by <0.4.

IMPORTANT 2 - the body materially understates what 0.3.1rc1 contains, and two of the five upstream PRs in it touch cache format and quote matching. The body says the release "includes both the delimiter fix and the normalized-reference cache from LRV #106". The actual range v0.3.0...v0.3.1rc1 is 57 commits, 28 files, +4055/-208, spanning: #101 a new reference-cache format contract (cache.py +251 new, reference_fetcher.py +232/-142, new docs/reference/cache-format.md, tests/test_cache_validation.py +512); #103 url: HTML pages cached as readable text instead of markup, with a cache-version bump; #104 a new SVGExtractor (+897) for file: SVG references; #105 fuzzy matching and repair changes (fuzzy_text_utils.py +103/-2, matching.py, repairer.py, supporting_text_validator.py +59/-9); and #106 the normalized-reference cache. #105 is exactly the class of change I flagged two passes ago as able to flip quote validation across the corpus - commits include "Never offer a fragment of a quote as its fuzzy correction", "Count stopwords when deciding a fuzzy match drops part of the quote", "Keep a dropped negation from passing as a near spelling". #101 concerns the format of this repo's ~6,800 committed publications/*.md.

This is not a blocking correctness objection: the full-corpus identical-diagnostics run against the rc is the right control and it empirically covers all of it, and it remains the strongest evidence in this PR. The ask is bookkeeping with teeth - a reviewer deciding whether that control is sufficient needs to know what it is covering, and describing a 57-commit range as "the delimiter fix and the normalized-reference cache" invites the reader to think the control only has to cover a memoization. Please list the five PRs and note that the identical-diagnostics result is what clears the cache-format and matching changes.

IMPORTANT 3 (carryover, expected) - residual placeholder excerpts unchanged; my ask was #4954 bookkeeping, not code here. Still 1 empty at genes/ARATH/CHL1/CHL1-ai-review.yaml:175 and 26 bracket-only across 10 files, warn-only via the baseline or skipped via the unanchored literal_bracket_patterns.

Suggestions, including the #103/#104 exposure analysis I could finally run: #104 is inert here (file is in skip_prefixes at conf/reference_validator_config.yaml:36, and there are zero .svg file: references); #103 touches exactly one reference, url:https://www.nature.com/articles/ncb2557 in PIP5K1B, whose cache entry is still pre-#103 raw markup and whose single quote resolves inside a

so it survives either representation - but trust_cached_entries: true means that entry is now permanently frozen in a superseded format, which one just warm-references or one doc sentence closes. Also: #101's "Preserve consumer cache extensions across refreshes" is upstream formalizing exactly what this repo depends on for full_text_available, which is a better argument for taking 0.3.1 than the performance number and the body does not make it. Plus the guard recording event but not target, and the four >= 0.3.0 feature floors. Full detail: #4947 (comment)

Verified this pass: upstream release list, the v0.3.0...v0.3.1rc1 range, and the CI conclusion are observed rather than inferred - which settles the wheel-size inference from my fourth pass. Not verified: no uv and no .venv, so I did not run just test or just validate-all myself and am relying on the green Build and test run; gh issue view was declined again, so #4954's inventory is still taken on the body's word.

@ai4c-reviewer

ai4c-reviewer Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 4m 59s —— View job


Re-review: Upgrade LRV to 0.3.1rc1 and remove cache-loader monkeypatch

Curation checklist (infrastructure PR — no gene-review or GOA content changed on this branch):

  • Schema validation passes — green on e8c6df0b4 (38292308680); 8ed05dd3b is docs + two test files and its test (3.12) run was in_progress when I finished
  • All PMIDs verified as real — n/a, no references added
  • Supporting text matches publication content — n/a here; residual corpus state now tracked in Audit remaining editorial-only evidence snippets and clarify quotation guidance #4954 (verified, see below)
  • GO terms correct and specific — n/a
  • Review actions well-justified — n/a
  • Core functions accurately identified — n/a
  • No over-annotation issues missed — n/a

Verdict: approve. Every CRITICAL and IMPORTANT from my six prior passes is now closed, two of them by correcting my framing rather than conceding it. gh api worked this pass, so #4954 is read rather than taken on the body's word — and it is a better artifact than what I asked for. Three suggestions below, none blocking.


✅ Resolved since e8c6df0b4

The ready-for-review gate (my prior 🔴 1) is closed the right way. I verified upstream again — latest release is still v0.3.1rc1 (2026-10-12T18:10:51Z, prerelease=true); v0.3.0 (2026-10-04) is the newest final — so the "wait for 0.3.1" option remains unsatisfiable. The body now takes the other option explicitly: "release-candidate dependencies are accepted by the maintainer. Waiting for final 0.3.1 is not a merge requirement", with the prerelease-resolution consequence stated ("deliberately permits 0.3.x prereleases for installations without the lockfile") and the final release deferred to a later dependency update. That is a maintainer decision on a disclosed trade, not an unmet gate. The pin is unchanged and verified: pyproject.toml:51 >=0.3.1rc1,<0.4, uv.lock:121 records that specifier, uv.lock:2655 resolves 0.3.1rc1 from PyPI, [tool.uv.sources] still only the workspace self-reference.

The upstream-scope disclosure (my prior 🟡 2) is in, and it corrects my table. The new "Upstream changes covered by this validation" section lists #101, #103, #105, #106 with the cache-format and matching changes named, and states that the full-corpus identical-diagnostics run is what clears them. It also fixes an error in my last review: #104 is the tracking issue, not a PR — confirmed via the API (104 ISSUE "Extract rendered text from SVG (and drawio)…" state=open; 105 PR "Read SVG figures as the text they render (#104, phase 1)" state=closed). My five-PR table should have been four PRs plus one issue. The body's version is correct.

The #4954 bookkeeping (my 🟡 carryover, three passes running) is verified and better than my ask. The issue carries the YAML-node inventory — 37 candidates: 28 file:, 8 GO_REF:, 1 empty PMID — as a per-location table with the cited source and candidate value for each, plus all three exemption mechanisms (wrapper strip for full_text_unavailable, local-quote baseline for file:, unanchored literal_bracket_patterns + GO_REF skip), and the explicit framing that this is a source-content inventory, not an LRV error list. It also rejects my own suggestion, correctly: anchoring [^a-zA-Z\s] to the first character "would stop preserving legitimate notation such as [Ca2+]". That is right and I had it wrong — [Ca2+] opens with an alpha char, so ^[^a-zA-Z\s] would miss it, and only ^[A-Z]{2,5}$ would be left, which Ca2+ also fails. Deferring config hardening to a separate PR with notation regression tests is the better plan. genes/ARATH/CHL1/CHL1-ai-review.yaml:175 is still supporting_text: '', correctly out of scope here.

The url: cache note (my 🔵 4) is documented, and the escape hatch actually works. docs/publication_fulltext_warming.md:35-41 states the markup→text change, that trust preserves older committed markup, and that just warm-references opts out. I checked the mechanism rather than the prose: url is not in skip_prefixes (conf/reference_validator_config.yaml:28-48), scripts/warm_reference_cache.py:46-49 sets trust_cached_entries = False, and its glob genes/*/*/*-ai-review.yaml covers PIP5K1B, whose cache entry is still the pre-#103 form (content_type: url, body opening <!DOCTYPE html>). So the one affected entry is reachable by the documented command. just warm-references exists at project.justfile:1015.

Also closed: the #101 consumer-extension argument is now made in the body ("preservation of consumer metadata across refreshes… supports our use of full_text_available without a local cache-loader patch") — the durability argument for deleting the monkeypatch, which is the better reason to take 0.3.1 than the timing table. The except Exception hazard is documented at tests/test_reference_cache_behavior.py:101. And the dropped 0.2.1 arm is handled by disclosure rather than a new measurement — "not a same-round comparison against the original 0.2.1 dependency, so it does not establish a net speedup over 0.2.1" — which scopes the claim accurately; the isolated-checkout pair remains the only parity evidence against the version being replaced, and the body no longer implies otherwise.


🔵 SUGGESTIONS

1. The guard now records the target but doesn't discriminate on it, so the control is still satisfiable by the wrong fetch. tests/conftest.py:143 writes f'{event} {args!r}' — good, the repr lands in the assertion message. But the check is assert target.startswith("(") and target != "()" (test_reference_cache_behavior.py:257), and args is a non-empty tuple for both events by construction (sys.audit("socket.connect", sock, addr) → 2 items; sys.audit("socket.getaddrinfo", host, port, family, type, proto) → 5), so both halves hold for any recorded attempt. The attribution concern was that the wrapper's own uv run python -c preprocessing pass (run_reference_validator.sh:65-93) inherits the same hook, so a package-index trip would satisfy the positive control. One negative discriminator — assert "pypi.org" not in target and "astral.sh" not in target — turns the recorded target into a check; the positive form ("nih.gov" in target) would couple the test to LRV's provider chain, so the negative is the safer shape. Separately, write_text overwrites, so only the last attempt survives; opening in append mode would record the whole sequence and make attribution complete. Still cosmetic — the negative assertion at :259 plus not (cache_dir / "PMID_1.md").exists() is what carries the weight. [Fix this →](https://claude.ai/code?q=On%20branch%20ci%2Fupgrade-lrv-030%2C%20strengthen%20the%20network-guard%20positive%20control.%20In%20tests%2Fconftest.py%20the%20sitecustomize%20hook%20uses%20Path(...).write_text%2C%20so%20only%20the%20last%20attempt%20is%20recorded%3B%20append%20instead%20so%20every%20attempt%20is%20kept.%20In%20tests%2Ftest_reference_cache_behavior.py%20line%20257%2C%20the%20assertion%20target.startswith('(')%20and%20target%20!%3D%20'()'%20holds%20for%20any%20socket.connect%2Fgetaddrinfo%20args%20tuple%20and%20so%20checks%20nothing%3B%20replace%20it%20with%20a%20discriminator%20that%20excludes%20the%20wrapper's%20own%20uv%20package-index%20traffic%2C%20e.g.%20asserting%20pypi.org%20and%20astral.sh%20do%20not%20appear%20in%20the%20recorded%20target.&repo=ai4curation/ai-gene-review)

2. Nothing in pyproject.toml records that the prerelease specifier is deliberate. The one comment near the pin (:49-50) is about _materialize/#2789. The decision and its bounded consequence are documented in the PR body, which is not where someone running uv lock --upgrade in six months will look — and the body also says the final release should be adopted in a later update, which is exactly the thing a file comment would prompt. One line above :51 ("prerelease floor is deliberate — RC accepted in #4947; replace with >=0.3.1 when upstream cuts the final release") makes it durable where it is actionable. Fix this →

3. The four >= 0.3.0 floors stay, now with a readable rationale in-file. scripts/run_reference_validator.sh:14, docs/publication_fulltext_warming.md:5, src/ai_gene_review/etl/publication_warm.py:3, project.justfile:1249. These are feature floors (trust_cached_entries, multi-file validate data, the provider chain all arrived in 0.3.0) and the new docs paragraph names 0.3.1rc1 specifically for the url:-text change, so the same file now distinguishes the two versions by what each introduced. That reads deliberate rather than stale. Leave them.


What I verified this pass, and what I did not

Observed, not inferred: the upstream release list and the issue/PR types for #104/#105 (API), #4954's full body and inventory table (API — first pass where gh api was permitted), the CI conclusion for e8c6df0b4, the pin in pyproject.toml/uv.lock, skip_prefixes and the trust_cached_entries = False path in scripts/warm_reference_cache.py, the PIP5K1B cache entry's pre-#103 form, and CHL1:175. Reasoned, not run: the audit-event args shapes in 🔵 1 are from CPython's documented audit events, not from executing the hook (python3 - was declined here). Still no uv and no .venv, so I did not run just test or just validate-all — for 8ed05dd3b I am relying on the green run for the parent plus the fact that this push touches only docs and two test files; its own test (3.12) was in_progress when I finished.

One housekeeping note that is not a PR finding, repeated from last pass: this runner's checkout again carries an uncommitted reversal of the 6-line CLAUDE.md quotation paragraph (git diff removes exactly the lines the PR adds). The committed branch content is correct; I left the working tree alone.
· branch ci/upgrade-lrv-030

@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 of 8ed05dd3b plus the updated body. Approving — every CRITICAL and IMPORTANT from my six prior passes is closed, two of them by correcting my framing rather than conceding it. gh api was permitted this pass, so several things I had been taking on the body's word are now observed.

Resolved since e8c6df0:

  • The ready-for-review gate (prior CRITICAL) is closed the right way. Upstream re-verified: latest release is still v0.3.1rc1 (2026-10-12T18:10:51Z, prerelease=true), v0.3.0 (2026-10-04) the newest final — so "wait for 0.3.1" remains unsatisfiable. The body now takes the other option explicitly: RC dependencies accepted by the maintainer, waiting for 0.3.1 is not a merge requirement, prerelease-resolution consequence stated and bounded to 0.3.x, final release deferred to a later dependency update. That is a maintainer decision on a disclosed trade, not an unmet gate. Pin verified unchanged: pyproject.toml:51 >=0.3.1rc1,<0.4, uv.lock:121 the specifier, uv.lock:2655 resolving 0.3.1rc1 from PyPI, [tool.uv.sources] still only the workspace self-reference.
  • The upstream-scope disclosure (prior IMPORTANT) is in, and it corrects my table. #101/#103/#105/#106 are listed with the cache-format and matching changes named, and the full-corpus identical-diagnostics run is identified as what clears them. It also fixes an error in my last review: #104 is the tracking issue, not a PR — confirmed via the API (104 ISSUE, open; 105 PR "Read SVG figures as the text they render (#104, phase 1)", closed). My five-PR table should have been four PRs plus one issue; the body's version is correct.
  • The #4954 bookkeeping is verified and better than my ask. The issue carries the 37-candidate YAML-node inventory (28 file:, 8 GO_REF:, 1 empty PMID) as a per-location table with cited source and candidate value, all three exemption mechanisms, and the explicit framing that it is a source-content inventory rather than an LRV error list. It also rejects my own suggestion, correctly: anchoring [^a-zA-Z\s] to the first character would stop preserving [Ca2+]. That is right and I had it wrong — [Ca2+] opens with an alpha char, so ^[^a-zA-Z\s] would miss it and only ^[A-Z]{2,5}$ would remain, which Ca2+ also fails. Deferring config hardening to a separate PR with notation regression tests is the better plan.
  • The url: cache note is documented and the escape hatch actually works — I checked the mechanism, not the prose: url is not in skip_prefixes (conf/reference_validator_config.yaml:28-48), warm_reference_cache.py:46-49 sets trust_cached_entries = False, and its glob covers PIP5K1B, whose entry is still the pre-#103 form. just warm-references exists at project.justfile:1015.
  • Also closed: #101's consumer-extension durability argument is now made in the body (the better reason to take 0.3.1 than the timing table); the except Exception hazard is documented at test_reference_cache_behavior.py:101; and the dropped 0.2.1 arm is handled by honest disclosure ("not a same-round comparison … does not establish a net speedup over 0.2.1") rather than overclaim.

Three suggestions, none blocking:

  1. The guard now records the target but does not discriminate on it. conftest.py:143 writes f'{event} {args!r}' — good — but the check at :257 (target.startswith("(") and target != "()") holds for any recorded attempt, since args is a non-empty tuple for both events by construction. The attribution concern was that the wrapper's own uv run python -c preprocessing pass inherits the same hook, so a package-index trip satisfies the positive control. A negative discriminator (pypi.org / astral.sh not in target) turns the record into a check; the positive form would couple to LRV's provider chain. Also write_text overwrites, so only the last attempt survives — append mode would record the sequence. Cosmetic; the negative assertion plus the no-cache-file assertion carry the weight.
  2. Nothing in pyproject.toml records that the prerelease specifier is deliberate (the nearby comment is about _materialize/#2789). One line above :51 makes the decision durable where uv lock --upgrade will encounter it.
  3. The four >= 0.3.0 feature floors should stay — and now read deliberate rather than stale, since the new docs paragraph names 0.3.1rc1 specifically for the url:-text change, distinguishing the two versions by what each introduced.

Verification: observed this pass — upstream release list, #104/#105 types, #4954's full inventory, the CI conclusion for e8c6df0, the pin and lock, skip_prefixes and the trust-off path in warm_reference_cache.py, the PIP5K1B cache entry's format, and CHL1:175. Reasoned, not run — the audit-event args shapes in suggestion 1 are from CPython's documented audit events. Still no uv and no .venv, so I did not run just test or just validate-all; for 8ed05dd I rely on the green run for its parent plus the fact that this push touches only docs and two test files. Its own test (3.12) run was in_progress when I finished.

Full detail: #4947 (comment)

@cmungall
cmungall added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit e2057e8 Oct 14, 2026
3 checks passed
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