Extend CausalNodeTypeEnum with STATE/QUALITY/CAPACITY (+26 retyped)#81
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Extends the TraitMech schema’s CausalNodeTypeEnum to represent three previously-missing semantics (STATE, QUALITY, CAPACITY) and updates the corpus + grounding mappings so affected causal-graph nodes are correctly typed going forward.
Changes:
- Add
STATE/QUALITY/CAPACITYtoCausalNodeTypeEnum(schema extension). - Extend
scripts/retype_causal_nodes.pyto migrate the remaining mis-typed labels and mark the deferred list resolved. - Retype affected causal-graph nodes across the corpus and update
mappings/node_grounding.tsv+ proposal artifacts to match the newnode_typekeys.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/traitmech/schema/traitmech.yaml | Adds STATE, QUALITY, CAPACITY permissible values to CausalNodeTypeEnum. |
| scripts/retype_causal_nodes.py | Extends RETYPES to include the three newly-supported node types and clears DEFERRED. |
| proposals/metpo_traitmech_v3/proposal.md | Updates the “Node-typing notes” section to reflect post-merge resolution. |
| proposals/metpo_traitmech_v1/metpo_proposal_classes_robot.tsv | Adds three new leaf rows for the v1 cohort’s enum lift (STATE/QUALITY/CAPACITY). |
| mappings/node_grounding.tsv | Updates the (label, node_type) keys for the three affected mappings to use the new enum values. |
| data/traits/environment/facultative_psychrophilic.yaml | Retypes membrane fluidity node to QUALITY and appends curation event. |
| data/traits/environment/mesophilic.yaml | Retypes membrane fluidity node to QUALITY and appends curation event. |
| data/traits/environment/neutrophilic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/environment/obligately_aerobic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/environment/ph_optimum.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/environment/psychrophilic.yaml | Retypes membrane fluidity node to QUALITY and appends curation event. |
| data/traits/environment/psychrotolerant.yaml | Retypes membrane fluidity node to QUALITY and appends curation event. |
| data/traits/environment/temperature_optimum.yaml | Retypes membrane fluidity node to QUALITY and appends curation event. |
| data/traits/environment/temperature_preference.yaml | Retypes membrane fluidity node to QUALITY and appends curation event. |
| data/traits/metabolism/aerobic_respiration.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/metabolism/oxidative_phosphorylation.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/metabolism/respiration.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/morphology/gliding.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/physiology/carboxydotrophic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/physiology/chemolithoautotrophic.yaml | Retypes proton motive force→STATE and reducing power→CAPACITY; appends curation event. |
| data/traits/physiology/chemolithoheterotrophic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/physiology/chemoorganotrophic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/physiology/chemotrophic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/physiology/hydrogenotrophic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/physiology/lithoautotrophic.yaml | Retypes reducing power node to CAPACITY and appends curation event. |
| data/traits/physiology/lithotrophic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/physiology/organotrophic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/physiology/photolithoautotrophic.yaml | Retypes reducing power node to CAPACITY and appends curation event. |
| data/traits/physiology/photoorganoheterotrophic.yaml | Retypes proton motive force node to STATE and appends curation event. |
| data/traits/physiology/phototrophic.yaml | Retypes reducing power node to CAPACITY and appends curation event. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
realmarcin
added a commit
that referenced
this pull request
May 26, 2026
All six Copilot inline comments were the same finding: the inline
references to "PR_D" are placeholders, not real PR identifiers, so
they'll be meaningless once the PR is merged.
Replaced across all four affected files:
- scripts/retype_causal_nodes.py (5 occurrences)
- mappings/node_grounding.tsv (3 occurrences in notes)
- proposals/metpo_traitmech_v1/metpo_proposal_classes_robot.tsv
(3 occurrences in row obs)
- proposals/metpo_traitmech_v3/proposal.md (3 occurrences)
Replacement phrasing depends on context:
- "extended in PR_D"
→ "extended via the STATE/QUALITY/CAPACITY enum extension"
- "added to the enum in PR_D"
→ "added to the enum in the same batch"
- "PR_D for the other three"
→ "the STATE/QUALITY/CAPACITY batch for the other three"
- "STATE in PR_D after CausalNodeTypeEnum"
→ "STATE after CausalNodeTypeEnum"
- "PR_D, after the enum was"
→ "after the enum was"
- "(PR_D)" → "(same enum-extension batch)"
The references to PR #72 (biomass retype, already merged) are
kept verbatim — that PR number is stable.
Verified:
- just verify-proposal metpo_traitmech_v1 → PASS
- just verify-proposal metpo_traitmech_v3 → PASS
- just validate-strict → 0 ERROR rows
- grep -r "PR_D" scripts mappings proposals → 0 hits
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ped) Closes the v3 cohort's "Node-typing notes" follow-up. When v3 landed, four labels were mis-typed because the enum couldn't represent their actual semantics: proton motive force → BIOLOGICAL_PROCESS (semantically a STATE) membrane fluidity → BIOLOGICAL_PROCESS (semantically a QUALITY) microbial biomass → BIOLOGICAL_PROCESS (closest fit: CHEMICAL) reducing power → CHEMICAL (semantically a CAPACITY) PR #72 retyped biomass → CHEMICAL (the closest existing fit at that time). This PR adds the three missing enum values (STATE / QUALITY / CAPACITY) and retypes the remaining three labels covering 26 nodes: proton motive force BIOLOGICAL_PROCESS → STATE 16 nodes membrane fluidity BIOLOGICAL_PROCESS → QUALITY 6 nodes reducing power CHEMICAL → CAPACITY 4 nodes Schema (src/traitmech/schema/traitmech.yaml): CausalNodeTypeEnum gains STATE, QUALITY, CAPACITY permissible values with prose descriptions distinguishing each from the closest existing value (STATE vs BIOLOGICAL_PROCESS, QUALITY vs MOLECULAR_FUNCTION, CAPACITY vs CHEMICAL). Migration (scripts/retype_causal_nodes.py): RETYPES dict extended from 1 to 4 entries; DEFERRED list now empty. Re-run produces 26 retypes across 25 files. Mapping TSV (mappings/node_grounding.tsv): Three rows updated to use the new node_type keys so future seeded nodes ground correctly: proton motive force BIOLOGICAL_PROCESS → STATE reducing power CHEMICAL → CAPACITY membrane fluidity BIOLOGICAL_PROCESS → QUALITY All three still ground to their METPO:1007500/1007503/1007505 cohort-v3 CURIEs. v1 cohort (proposals/metpo_traitmech_v1/, Path B extend-in-place): Three new leaf rows under METPO:1007410 (trait causal node type): METPO:1007421 causal-graph state node METPO:1007422 causal-graph quality node (xref PATO:0000001) METPO:1007423 causal-graph capacity node Subset tag unchanged (metpo_traitmech_2026_05). verify-proposal: all 13 CausalNodeTypeEnum values lifted, 0 failures. robot-validate-proposal: ELK +6, no UNSAT. v3 cohort (proposals/metpo_traitmech_v3/proposal.md): "Node-typing notes" section rewritten to document the post-merge resolution (all four labels now correctly typed, pointing at PR #72 and PR_D). Verified locally: - just validate-strict → 0 ERROR rows / 357 files - just verify-proposal v1 → PASS (13 leaves lifted) - just verify-proposal v3 → PASS - just robot-validate-proposal v1 → PASS, ELK +6 - retype-causal-nodes --apply (second pass) → 0 retypes (idempotent) - uv run pytest tests/ → 56 passed Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
All six Copilot inline comments were the same finding: the inline
references to "PR_D" are placeholders, not real PR identifiers, so
they'll be meaningless once the PR is merged.
Replaced across all four affected files:
- scripts/retype_causal_nodes.py (5 occurrences)
- mappings/node_grounding.tsv (3 occurrences in notes)
- proposals/metpo_traitmech_v1/metpo_proposal_classes_robot.tsv
(3 occurrences in row obs)
- proposals/metpo_traitmech_v3/proposal.md (3 occurrences)
Replacement phrasing depends on context:
- "extended in PR_D"
→ "extended via the STATE/QUALITY/CAPACITY enum extension"
- "added to the enum in PR_D"
→ "added to the enum in the same batch"
- "PR_D for the other three"
→ "the STATE/QUALITY/CAPACITY batch for the other three"
- "STATE in PR_D after CausalNodeTypeEnum"
→ "STATE after CausalNodeTypeEnum"
- "PR_D, after the enum was"
→ "after the enum was"
- "(PR_D)" → "(same enum-extension batch)"
The references to PR #72 (biomass retype, already merged) are
kept verbatim — that PR number is stable.
Verified:
- just verify-proposal metpo_traitmech_v1 → PASS
- just verify-proposal metpo_traitmech_v3 → PASS
- just validate-strict → 0 ERROR rows
- grep -r "PR_D" scripts mappings proposals → 0 hits
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2ee00ac to
959e1a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the v3 cohort's "Node-typing notes" follow-up. When v3 landed, four labels were mis-typed because the enum couldn't represent their actual semantics. PR #72 partially resolved this (biomass → CHEMICAL); this PR adds the three missing enum values and finishes the cleanup.
microbial biomassproton motive forcemembrane fluidityreducing powerSchema (
src/traitmech/schema/traitmech.yaml)CausalNodeTypeEnumgains three permissible values:STATE— a bioenergetic or molecular state of the cell (e.g. proton motive force, redox state of the quinone pool). Distinct from a process: the state is the gradient/steady-value, not its establishment.QUALITY— a quality or measurable attribute of a cellular component (e.g. membrane fluidity, GC content, motility speed). A PATO-style axis attached to a microbial entity.CAPACITY— a metabolic or functional capacity — an electron-donating pool, ATP charge, or other reservoir-of-X notion that is neither a single chemical species nor a process.Migration (
scripts/retype_causal_nodes.py)RETYPESextended from 1 → 4 entries;DEFERREDlist now empty. Re-run produces 26 retypes across 25 files.v1 cohort: Path B extend-in-place
Three new leaf rows under
METPO:1007410(trait causal node type), keeping subset tagmetpo_traitmech_2026_05:METPO:1007421— causal-graph state nodeMETPO:1007422— causal-graph quality node (xrefPATO:0000001)METPO:1007423— causal-graph capacity nodeverify-proposalreports all 13 CausalNodeTypeEnum values lifted.v3 cohort
proposals/metpo_traitmech_v3/proposal.md"Node-typing notes" section rewritten to document the post-merge resolution.Mapping TSV
Three rows in
mappings/node_grounding.tsvupdated to use the newnode_typekeys so future seeded nodes ground correctly. All three still ground to their cohort-v3 METPO CURIEs (METPO:1007500/1007503/1007505).Verified locally
Test plan
🤖 Generated with Claude Code