Skip to content

Fix four slots whose documented meaning the corpus never honoured (#748, #749, #751, #752) - #755

Open
realmarcin wants to merge 1 commit into
mainfrom
fix/enum-semantics-and-term-grounding
Open

Fix four slots whose documented meaning the corpus never honoured (#748, #749, #751, #752)#755
realmarcin wants to merge 1 commit into
mainfrom
fix/enum-semantics-and-term-grounding

Conversation

@realmarcin

Copy link
Copy Markdown
Contributor

Four review issues from #747, resolved together because they share one cause:
a slot whose documented meaning drifted from its actual use, with no gate able
to see the difference.

issue slot resolution
#748 abundance_level redefined as ordinal; no record sweep needed
#751 biological_processes 17 terms regrounded, 12 removed, 13 duplicates cleared
#752 InteractionTypeEnum.SYNTROPHY no longer asserts obligacy
#749 InteractionTypeEnum gaps 8 METPO classes proposed

#748abundance_level is a rank, not a percentage

The values named bands: DOMINANT >1%, ABUNDANT 0.1-1%, COMMON 0.01-0.1%, RARE
<0.01%. In community_origin: SYNTHETIC records of at most four members — where
every member necessarily exceeds 1% — 76 of 91 assignments claimed the member
was below it.

The fact that decided the fix: the numeric slots already exist and are empty.
relative_abundance and absolute_abundance landed in #161 and are used by
0 of 1068 taxa. The enum was carrying a job it was never checked on while the
slot built for that job sat unused.

So AbundanceEnum is now an ordinal rank within a record, pointing at
relative_abundance for a measured share. Every existing assignment becomes
correct under that reading — both members of a coculture marked ABUNDANT means
"co-equal partners", which is a useful thing to record and evidently what the
words were being used for. No 392-taxon sweep.

Two records from #747 were re-ranked, since they had been curated against the
threshold: C. ljungdahlii DOMINANT→ABUNDANT (the 25% minority partner) and the
Methanoregula endosymbiont DOMINANT→COMMON (2%, smallest of three bins).

tests/test_abundance_level_is_ordinal.py pins it with four checks, including a
consistency check between the ordinal and numeric slots that is vacuous today and
says so — a companion test fails the moment anyone populates a number, so the
vacuity cannot go unnoticed.

#751biological_processes now holds biological processes

17 entries swapped to genuine process terms, each verified by ancestry
against GO:0008150 rather than by label — "electron transfer activity" reads
like a process to anyone not looking it up:

was is
GO:0008810 cellulase activity GO:0030245 cellulose catabolic process
GO:0097599 xylanase activity GO:0045493 xylan catabolic process
GO:0004568 chitinase activity GO:0006032 chitin catabolic process
GO:0009039 urease activity GO:0043419 urea catabolic process
GO:0018597 ammonia monooxygenase activity GO:0019329 ammonia oxidation
GO:0016661 oxidoreductase, nitrogenous donors GO:0019332 aerobic respiration, using nitrite as electron donor
GO:0008509 anion transporter activity GO:0015703 chromate transport
GO:0140487 metal ion sequestering activity GO:0061687 detoxification of inorganic compound
GO:0046872 metal ion binding GO:0061687 detoxification of inorganic compound
GO:0005576 extracellular region GO:0009306 protein secretion

12 uses of GO:0009055 were removed, not substituted. EBI OLS returns
nothing for extracellular electron transport or interspecies electron
transfer
, and every GO electron-transport-chain term denotes an intracellular
series of complexes — wrong for DIET through conductive pili. Substituting one
would repeat exactly the error being fixed. GO:0070812 organohalide respiration
is untouched: it resolves to nothing in the pinned build and is already an
exception in conf/id_label_targets.yaml, so it is a resolution failure, not an
aspect error.

Regrounding two activities onto one process term collided in 11 interactions;
2 more duplicates predated the sweep. All 13 removed.

#752 — SYNTROPHY stops asserting obligacy

It read "Obligate metabolic cooperation", which its own worked case
disproves: PMID:40298437 grows both members of CommunityMech:000336 as
monocultures in the same experiment. Obligacy is rarely establishable from one
record, and demanding it in the type pushes curators to assert it silently.
The value now describes the exchange and says obligacy is not implied.

#749 + #752 — eight METPO classes proposed

proposals/metpo_communitymech_interaction_semantics_v1/.

Checked before proposing anything, per the "METPO-maximizing, not
METPO-forcing" rule: METPO's 255 terms have Syntrophy and Electron transfer
but no cell fusion, HGT or conjugation; TraitMech and CellStructureMech have
none of the six concepts; GO has no inter-organism relation for any of them.

  • obligate syntrophy interaction / facultative syntrophy interaction
    mirroring METPO's own obligately anaerobic / facultatively anaerobic under
    oxygen preference. This requires amending METPO:1007127's definition to
    drop "obligate", or a facultative child contradicts its parent; that amendment
    is part of the proposal, not a side effect.
  • A material transfer interaction branch — cell fusion, cytoplasmic material
    exchange, HGT, interspecies and direct interspecies electron transfer —
    deliberately a sibling of the sign-based types, not a subtype. An
    interaction can be both a fusion and a mutualism; those answer different
    questions, and forcing one slot to carry both is what ran the enum out of room.

A mistake worth recording

My first pass at the #751 sweep cleared emptied biological_processes: keys with
a regex over the whole file. It silently merged non-empty lists into the
preceding one across 204 records
. I caught it by reading the diff before
running any validator, reverted, and redid it with a local structural check that
only drops a key when the very next line is not one of its items. The rerun
touches 17 files.

Validation

validate-strict 332 files / 0 ERROR · validate-terms-all 332 passed ·
validate-gtdb-all 0 incoherent · lint (ruff + mypy) clean ·
check-docs-current matches · pytest 2963 passed.

Both new gate tests were mutation-tested with a control arm: reintroducing a
percentage band and planting a molecular function each turned the right test red
by name, the restores took, and unmutated copies through the identical harness
were green.

The one local failure, test_no_snippet_stops_mid_word, is the pre-existing one
caused by an untracked references_cache/PMID_38150661.md in the working
tree. Not in this diff; CI cannot see it.

Separately filed while investigating: #754, on committed reference-cache text
and its licence.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Crb17nwErCwBJrkSCp37Ua

Resolves #748 and #751; adds the METPO proposal #749 and #752 need, and the
in-repo half of #752.

**#748 — abundance_level is ordinal, not a percentage.** The values named bands
(DOMINANT >1%, ABUNDANT 0.1-1%, COMMON 0.01-0.1%, RARE <0.01%) that the corpus
never meant: in SYNTHETIC records of at most four members, where every member
necessarily exceeds 1%, 76 of 91 assignments claimed the member was below it.
The decisive fact is that the numeric slots already exist and are empty —
`relative_abundance` and `absolute_abundance` landed in #161 and are used by 0
of 1068 taxa. So the enum now defines an ordinal rank within a record and points
at `relative_abundance` for a measured share, which makes every existing
assignment correct instead of requiring a 392-taxon sweep. Two records from #747
were re-ranked, having been curated against the old threshold.

**#751 — biological_processes now holds biological processes.** 17 entries were
swapped to genuine process terms, each verified by ancestor against GO:0008150
rather than by label; 12 uses of `GO:0009055` electron transfer activity were
removed rather than substituted, because OLS returns nothing for interspecies or
extracellular electron transfer and every GO electron-transport-chain term means
an intracellular series of complexes. Substituting one would repeat the error.
13 duplicates created or exposed by the swap were removed.

**#752 — SYNTROPHY no longer asserts obligacy.** It read "Obligate metabolic
cooperation", which its own worked case disproves: PMID:40298437 grows both
members of CommunityMech:000336 as monocultures in the same experiment.

**#749/#752 — eight METPO classes proposed** in
`proposals/metpo_communitymech_interaction_semantics_v1/`: obligate and
facultative syntrophy, and a `material transfer interaction` branch — cell
fusion, cytoplasmic exchange, HGT, interspecies and direct interspecies electron
transfer — deliberately a *sibling* of the sign-based types rather than a
subtype, since an interaction can be both a fusion and a mutualism. METPO,
TraitMech and CellStructureMech were all checked first; none has these concepts,
and METPO already models obligate/facultative this way for oxygen preference.

Both new gate tests were mutation-tested with a control arm.

An earlier attempt at the #751 sweep cleared emptied keys with a regex and
silently merged non-empty lists into the preceding one across 204 records. It
was caught by reading the diff, reverted before any validation ran, and redone
with a local structural check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Crb17nwErCwBJrkSCp37Ua
Copilot AI lite review requested due to automatic review settings September 10, 2026 04:01

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

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, 56 warning across 28 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)

Caragana_Korshinskii_CrossKingdom_Forage_SynCom
--------------------------------------------------------------------------------
  [warning] UNKNOWN_TARGET: Target taxon 'Staphylococcus' not found in taxonomy section (community-level scope)

Total: 1 issues (0 error, 1 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.

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.

2 participants