Skip to content

Apply #262's DIET judgement to the occurrence it missed (#295) - #465

Merged
realmarcin merged 2 commits into
mainfrom
diet-rescoping-295
Aug 7, 2026
Merged

Apply #262's DIET judgement to the occurrence it missed (#295)#465
realmarcin merged 2 commits into
mainfrom
diet-rescoping-295

Conversation

@realmarcin

Copy link
Copy Markdown
Contributor

Closes #295.

Three occurrences, not two

The record cites the same PMID:28287150 snippet three times. #262 re-scoped two to PARTIAL — the snippet is the paper's generic background about Geobacter species in prior literature, not a finding about this coculture. The third stayed SUPPORT, so the record simultaneously held that the snippet establishes nothing here and that it fully supports an interaction.

Worse than the issue recorded

That third occurrence also had no explanation and a snippet truncated mid-word:

snippet: Direct interspecies electron transfer (DIET) mechanism has been recently
  characterised with Geobacter species which couple the electron balance with
  o

#262's note on the first occurrence reads "Snippet also completed here, having previously been truncated mid-word" — the same truncation, fixed in one place and left in another.

Re-scoped to PARTIAL with the same reasoning, snippet completed, explanation added. The interaction is unaffected either way: its other two items — the metabolic-shift quantification and the electron-uptake measurement — are what carry it, exactly as #295 predicted.

A defect I introduced and the gate caught

Writing that explanation reintroduced #400's defect, in the very file I was fixing. An unquoted #262 in a plain multi-line scalar starts a YAML comment, so everything after it was swallowed and the file stopped parsing:

yaml.parser.ParserError: expected <block end>, but found '<scalar>'

just validate caught it before commit. Quoted, and swept the KB for the same shape: three continuation lines contain " #", all inside quoted scalars, and validate-scalars reports 0 truncated across 318 files. So the KB is clean and this was mine alone — but it is a live demonstration of why #400 is worth doing.

just qc green.

🤖 Generated with Claude Code

The record cites the same PMID:28287150 snippet three times, not twice as the
issue says. #262 re-scoped two to PARTIAL on the grounds that it is the paper's
generic background about Geobacter species in prior literature, not a finding
about this coculture. The third stayed SUPPORT, so the record simultaneously
held that the snippet establishes nothing here and that it fully supports an
interaction.

Worse than the issue recorded: that third occurrence also had no explanation and
a snippet truncated mid-word at "with o". #262's note on the first occurrence
says "Snippet also completed here, having previously been truncated mid-word" -
the same truncation, fixed in one place and left in another.

Re-scoped to PARTIAL with the same reasoning, snippet completed, explanation
added. The interaction is unaffected either way: its other two items, the
metabolic-shift quantification and the electron-uptake measurement, are what
carry it - which is what the issue predicted.

Writing that explanation reintroduced #400's defect, in the file I was fixing:
an unquoted "#262" in a plain multi-line scalar starts a YAML comment, so
everything after it was swallowed and the file stopped parsing. `just validate`
caught it. Quoted, and swept the KB for the same pattern - three continuation
lines contain " #", all inside quoted scalars, and validate-scalars reports 0
truncated across 318 files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Network integrity findings

Warnings only — a member with no interaction yet, or a participant matched by ontology id rather than by name, or one on a community-level interaction that resolves to no member. Reported, but does not fail the build.

Network Integrity Audit Report
================================================================================

0 error, 55 warning across 27 records with findings
Only error-severity findings fail the build.

ANME_SRB_Anaerobic_Methanotrophic_Syntrophic_Consortia
--------------------------------------------------------------------------------
  [warning] NAME_MISMATCH: Source 'ANME-1' matches no taxonomy entry by name; resolved to 'ANME-1 (anaerobic methanotrophic archaea, clade 1)' by source_id NCBITaxon:588814
  [warning] NAME_MISMATCH: Target 'Desulfofervidus' matches no taxonomy entry by name; resolved to 'Desulfofervidus (sulfate-reducing bacterial partner of ANME-1)' by target_id NCBITaxon:1902583
  [warning] NAME_MISMATCH: Source 'ANME-2a' matches no taxonomy entry by name; resolved to 'ANME-2a (anaerobic methanotrophic archaea, clade 2a)' by source_id NCBITaxon:588816
  [warning] NAME_MISMATCH: Target 'Seep-SRB1' matches no taxonomy entry by name; resolved to 'Seep-SRB1 (sulfate-reducing bacterial partner of ANME-2a)' by target_id NCBITaxon:213119
  [warning] NAME_MISMATCH: Source 'ANME-2c' matches no taxonomy entry by name; resolved to 'ANME-2c (anaerobic methanotrophic archaea, clade 2c)' by source_id NCBITaxon:3386252
  [warning] NAME_MISMATCH: Target 'Seep-SRB2' matches no taxonomy entry by name; resolved to 'Seep-SRB2 (additional sulfate-reducing bacterial partner)' by target_id NCBITaxon:213118

Total: 6 issues (0 error, 6 warning)

Aalborg_East_Full_Scale_EBPR_Community
--------------------------------------------------------------------------------
  [warning] DISCONNECTED: Taxon 'Bacteroidetes flanking community members' has no interactions
  [warning] DISCONNECTED: Taxon 'Tetrasphaera-related actinobacterial PAOs' has no interactions

Total: 2 issues (0 error, 2 warning)

Bacteroides_Methanobrevibacter_Gnotobiotic_Mouse_Mutualism
--------------------------------------------------------------------------------
  [warning] DISCONNECTED: Taxon 'Desulfovibrio piger comparator' has no interactions

Total: 1 issues (0 error, 1 warning)

BioModels_MODEL2204300001_Kefir_Community_Model
--------------------------------------------------------------------------------
  [warning] DISCONNECTED: Taxon 'Lactobacillus kefiri' has no interactions
  [warning] DISCONNECTED: Taxon 'Lactococcus lactis' has no interactions

Total: 2 issues (0 error, 2 warning)

BioModels_MODEL2405300001_Infant_Gut_HMO_SynCom
--------------------------------------------------------------------------------
  [warning] DISCONNECTED: Taxon 'Bacteroides ovatus' has no interactions
  [warning] DISCONNECTED: Taxon 'Bacteroides vulgatus' has no interactions
  [warning] DISCONNECTED: Taxon 'Bifidobacterium bifidum' has no interactions
  [warning] DISCONNECTED: Taxon 'Bifidobacterium breve' has no interactions
  [warning] DISCONNECTED: Taxon 'Blautia producta' has no interactions
  [warning] DISCONNECTED: Taxon 'Enterococcus faecalis' has no interactions
  [warning] DISCONNECTED: Taxon 'Escherichia coli K-12' has no interactions
  [warning] DISCONNECTED: Taxon 'Lacticaseibacillus rhamnosus' has no interactions
  [warning] DISCONNECTED: Taxon 'Ruminococcus gnavus' has no interactions
  [warning] DISCONNECTED: Taxon 'Streptococcus thermophilus' has no interactions

Total: 10 issues (0 error, 10 warning)

Crucian_Carp_Gut_Disease_Resistance_SynCom
--------------------------------------------------------------------------------
  [warning] UNKNOWN_TARGET: Target taxon 'Aeromonas hydrophila' not found in taxonomy section (community-level scope)

Total: 1 issues (0 error, 1 warning)

Drosophila_FiveSpecies_Gnotobiotic_Gut_Microbiota
--------------------------------------------------------------------------------
  [warning] UNKNOWN_SOURCE: Source taxon 'Drosophila five-species bacterial microbiota' not found in taxonomy section (community-level scope)

Total: 1 issues (0 error, 1 warning)

East_River_Floodplain_Core_Microbiome
--------------------------------------------------------------------------------
  [warning] UNKNOWN_SOURCE: Source taxon 'core floodplain bacteria' not found in taxonomy section (community-level scope)
  [warning] UNKNOWN_SOURCE: Source taxon 'East River floodplain bacteria' not found in taxonomy section (community-level scope)

Total: 2 issues (0 error, 2 warning)

Ensifer_YF2_Sphingobacterium_Y2_Polyethylene_Degrading_Consortium
--------------------------------------------------------------------------------
  [warning] DISCONNECTED: Taxon 'Chryseobacterium sp. MF1' has no interactions

Total: 1 issues (0 error, 1 warning)

GLBRC_UFMP_Fermentation_Community
--------------------------------------------------------------------------------
  [warning] UNKNOWN_SOURCE: Source taxon 'Olsenella (Actinobacteriota)' not found in taxonomy section (community-level scope)
  [warning] NAME_MISMATCH: Target 'Clostridium (Firmicutes)' matches no taxonomy entry by name; resolved to 'Clostridium_B sp. (MAG CLOS1)' by target_id NCBITaxon:1485

Total: 2 issues (0 error, 2 warning)

Hanford_300_Area_Unconfined_Aquifer_Community
--------------------------------------------------------------------------------
  [warning] NAME_MISMATCH: Source 'intrusion-associated Actinobacteria' matches no taxonomy entry by name; resolved to 'Actinobacteria/Actinomycetota aquifer bacteria' by source_id NCBITaxon:201174
  [warning] UNKNOWN_TARGET: Target taxon 'Hanford groundwater bacteria' not found in taxonomy section (community-level scope)
  [warning] UNKNOWN_SOURCE: Source taxon 'aquifer redox guild bacteria and archaea' not found in taxonomy section (community-level scope)

Total: 3 issues (0 error, 3 warning)

High_Solids_Switchgrass_Methanogenic_Microbiome
--------------------------------------------------------------------------------
  [warning] DISCONNECTED: Taxon 'Bacilli' has no interactions

Total: 1 issues (0 error, 1 warning)

KB1_Chlorinated_Ethene_Dechlorinating_Consortium
--------------------------------------------------------------------------------
  [warning] DISCONNECTED: Taxon 'Sporomusa spp. in KB-1' has no interactions

Total: 1 issues (0 error, 1 warning)

Legume_Rhizobia_Mars_Simulant_Symbiosis
--------------------------------------------------------------------------------
  [warning] NAME_MISMATCH: Source 'Sinorhizobium spp. (rhizobial symbionts)' matches no taxonomy entry by name; resolved to 'Sinorhizobium meliloti' by source_id NCBITaxon:382
  [warning] UNKNOWN_TARGET: Target taxon 'Medicago truncatula (host legume)' not found in taxonomy section (community-level scope)

Total: 2 issues (0 error, 2 warning)

Lunar_Martian_Simulant_PGPB_Lettuce_SynCom
--------------------------------------------------------------------------------
  [warning] UNKNOWN_TARGET: Target taxon 'Lactuca sativa (lettuce host)' not found in taxonomy section (community-level scope)
  [warning] UNKNOWN_TARGET: Target taxon 'Lactuca sativa (lettuce host)' not found in taxonomy section (community-level scope)

Total: 2 issues (0 error, 2 warning)

Lunar_Simulant_Phosphate_Solubilizing_Bacteria_Nicotiana
--------------------------------------------------------------------------------
  [warning] UNKNOWN_TARGET: Target taxon 'Nicotiana benthamiana' not found in taxonomy section (community-level scope)

Total: 1 issues (0 error, 1 warning)

Model_Lignocellulose_Formaldehyde_Crossfeeding_Community
--------------------------------------------------------------------------------
  [warning] UNKNOWN_SOURCE: Source taxon 'model lignocellulose consortium members' not found in taxonomy section (community-level scope)
  [warning] UNKNOWN_TARGET: Target taxon 'model lignocellulose consortium members' not found in taxonomy section (community-level scope)

Total: 2 issues (0 error, 2 warning)

Moss_Microbe_Complex_Regolith_Biofertilizer
--------------------------------------------------------------------------------
  [warning] UNKNOWN_SOURCE: Source taxon 'Hypnum plumaeforme (moss host)' not found in taxonomy section (community-level scope)
  [warning] UNKNOWN_TARGET: Target taxon 'Hordeum vulgare (barley model crop)' not found in taxonomy section (community-level scope)

Total: 2 issues (0 error, 2 warning)

ORNL_Clostridium_Desulfovibrio_Geobacter_Trophic_Model
--------------------------------------------------------------------------------
  [warning] UNKNOWN_TARGET: Target taxon 'Desulfovibrio vulgaris Hildenborough and Geobacter sulfurreducens' not found in taxonomy section (community-level scope)
  [warning] UNKNOWN_TARGET: Target taxon 'three-species model community' not found in taxonomy section (community-level scope)

Total: 2 issues (0 error, 2 warning)

Oak_Ridge_FRC_Uranium_Nitrate_Groundwater_Community
--------------------------------------------------------------------------------
  [warning] UNKNOWN_TARGET: Target taxon 'other groundwater bacteria' not found in taxonomy section (community-level scope)

Total: 1 issues (0 error, 1 warning)

PET_Artificial_FourSpecies_Degradation_Consortium
--------------------------------------------------------------------------------
  [warning] UNKNOWN_TARGET: Target taxon 'engineered PETase/MHETase and TPA-utilization members' not found in taxonomy section (community-level scope)

Total: 1 issues (0 error, 1 warning)

PMI_Variovorax_Thermotolerance_Collection
--------------------------------------------------------------------------------
  [warning] UNKNOWN_SOURCE: Source taxon 'Variovorax' not found in taxonomy section (community-level scope)
  [warning] UNKNOWN_TARGET: Target taxon 'Arabidopsis thaliana' not found in taxonomy section (community-level scope)

Total: 2 issues (0 error, 2 warning)

Rice_Duckweed_Bacillus_SynCom
--------------------------------------------------------------------------------
  [warning] UNKNOWN_SOURCE: Source taxon 'Bacillus SynCom' not found in taxonomy section (community-level scope)
  [warning] UNKNOWN_TARGET: Target taxon 'Rhizoctonia solani' not found in taxonomy section (community-level scope)

Total: 2 issues (0 error, 2 warning)

Saanich_Inlet_OMZ_Redox_Gradient_Community
--------------------------------------------------------------------------------
  [warning] UNKNOWN_SOURCE: Source taxon 'Saanich Inlet redox-gradient microorganisms' not found in taxonomy section (community-level scope)

Total: 1 issues (0 error, 1 warning)

Shewanella_Geobacter_Exoelectrogenic_Biofilm_Community
--------------------------------------------------------------------------------
  [warning] UNKNOWN_TARGET: Target taxon 'anode-associated biofilm community' not found in taxonomy section (community-level scope)
  [warning] UNKNOWN_TARGET: Target taxon 'anode' not found in taxonomy section (community-level scope)

Total: 2 issues (0 error, 2 warning)

Sulfide_Spring_Autotrophic_CPR_Biofilm
--------------------------------------------------------------------------------
  [warning] DISCONNECTED: Taxon 'Beggiatoa' has no interactions

Total: 1 issues (0 error, 1 warning)

Thermophilic_Lignocellulose_Composting_SynCom_Biosanitization
--------------------------------------------------------------------------------
  [warning] UNKNOWN_TARGET: Target taxon 'Pseudomonas aeruginosa' not found in taxonomy section (community-level scope)

Total: 1 issues (0 error, 1 warning)

The full report is attached to the workflow run as an artifact.

I claimed the KB was clean on the basis that validate-scalars reports 0
truncated across 318 files. That check structurally cannot see this defect - it
flags a plain scalar swallowed by a "#" comment, and these are well-formed
scalars that merely stop early. It reports 0 correctly and says nothing.

The reviewer's sweep - resolve each snippet against its cached source, flag any
that matches verbatim but is followed in the source by a letter - found seven
more, in five records:

  "...ammonia-oxidizing bac"        -> bacteria   (x2)
  "...and Stenotrop"                -> Stenotrophomonas (x5)
  "...elemental sulf"               -> sulfur
  "...were potential"               -> potentially
  "...propionate usi"               -> using protons as the electron acceptor
  "...were upregu"                  -> upregulated in D. vulgaris
  "...base of the Thermo"           -> Thermoplasmatales within the Euryarchaeota

All completed verbatim from references_cache/, and the sweep is now a test so
the class cannot recur silently. Digits following a snippet are excluded - those
are citation markers the cached markdown ran together with the preceding word -
and one letter case is allowlisted with its reason: "parvus" + "cocultivated" is
a missing space in the cache, not a cut quote.

Also stopped the new explanation vouching for a sibling item that does not do
what its own explanation claims: that snippet is the paper's study-scope
sentence and quantifies nothing, despite an explanation saying it quantifies the
shift toward 1,3-propanediol. Same defect class as this one; noted rather than
fixed, since it needs the curator's judgement.

Filed #466: just validate-references performs zero checks and passes vacuously,
which is how all eight of these survived.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@realmarcin

Copy link
Copy Markdown
Contributor Author

Review round 1 — my "the KB is clean" claim was unsupported, and wrong

I justified it with validate-scalars reporting 0 truncated across 318 files. That check structurally cannot see this defect — it flags a plain scalar swallowed by a # comment, and these are well-formed scalars that merely stop early. It reported 0 correctly, and said nothing.

The reviewer's sweep — resolve each snippet against its cached source, flag any that matches verbatim but is followed in the source by a letter — found seven more, across five records:

truncated completes to
...ammonia-oxidizing bac ×2 bacteria (AOB), and nitrite-oxidizing bacteria (NOB)
...and Stenotrop ×5 Stenotrophomonas
...elemental sulf sulfur
...were potential potentially
...propionate usi using protons as the electron acceptor
...were upregu upregulated in D. vulgaris
...base of the Thermo Thermoplasmatales within the Euryarchaeota

All completed verbatim from references_cache/, and the sweep is now a test, so the class can't recur silently.

Two refinements the sweep needed: digits following a snippet are excluded (citation markers the cached markdown ran together with the preceding word — ...glutamate4), and one letter case is allowlisted with its reason — parvus + cocultivated is a missing space in the cache, not a cut quote.

Also fixed

My new explanation vouched for a sibling item that doesn't do what its own explanation claims — that snippet is the paper's study-scope sentence and quantifies nothing, despite an explanation saying it quantifies the shift toward 1,3-propanediol. Same defect class, six lines up. Noted rather than silently fixed, since re-scoping it is the curator's judgement.

Why none of this was caught — #466

just validate-references performs zero checks and passes vacuously:

Validation Summary:
  Total checks: 0
  All validations passed!

Identical on main, identical for every record. CLAUDE.md says it does "snippet validation against abstracts"; the recipe comment says it "can verify snippets taken from a paper's Methods/Results". Neither is currently true. Filed as #466 — that's how all eight survived.

Verified clean by the review

The snippet completion is verbatim against references_cache/PMID_28287150.txt, character-for-character. PARTIAL is the right enum per the schema's own definition ("supports the mechanism but not the specific site, taxa, or quantitative figure asserted"). All three occurrences are now byte-identical. The quoted explanation round-trips, #262 and (#295) and the escaped apostrophe all surviving.

just qc green.

@realmarcin
realmarcin merged commit 9b97e88 into main Aug 7, 2026
7 checks passed
@realmarcin
realmarcin deleted the diet-rescoping-295 branch August 7, 2026 09:17
realmarcin added a commit that referenced this pull request Aug 7, 2026
…) (#475)

#466 reported the reference validator as performing zero checks, reading

    Total checks: 0
    All validations passed!

as a vacuous pass. It is not. `Total checks` is printed as `len(all_results)`
in the upstream CLI, and `all_results` holds validation *issues* — so 0 means
no problems were found. Planting a snippet that appears in no publication into
taxonomy[0].evidence[0] produces:

    [ERROR] Text part not found as substring: 'ZZQQ ...'
    Location: taxonomy[0].evidence[0].snippet
    Total checks: 1 / Issues found: 1

The justfile already said this, from #257, in four lines directly above the
recipe. Prose was not enough, so the claim is now a test that fails if the
validator ever does accept fabricated text, plus a second test asserting a real
curated snippet is still accepted - a checker that rejects everything would be
just as useless and passes the first test alone.

Diagnosing it turned up something the issue did not: **SupportingReference is
never checked at all.** It is the range of `Discussion.evidence`, and unlike
EvidenceItem its `snippet` and `reference` carry no `implements:`, so the
plugin's field detection cannot see them. 11 snippets across 8 records are
unvalidated, and the module's own description claims the opposite — that it
"carries a verbatim snippet so the same anti-hallucination
snippet-vs-cached-abstract check the Mechs already run can validate it".

Not fixed here on purpose: that lives in mech_shared.yaml, which is vendored
byte-identical and sha-pinned across the Mech repos by the vendored-sync job,
so editing this copy alone would fail CI and violate the module's own
instruction. Filed instead; the gap is pinned by a test that fails when it is
closed, so nobody closes it silently.

Also confirms what remains true about the truncation class: a snippet cut
mid-word still passes, because a cut quote is still a substring and substring
matching is what the tool promises. That is #295/#465, covered by
test_snippets_are_not_truncated.py, and it is why those eight survived - not
vacuity.

No behavioural change; tests and comments only.
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.

#262's DIET re-scoping missed one occurrence: same snippet still cited as SUPPORT

1 participant