feat(ogar-dismech): mint 19 DisMech causal predicates as a Vocabulary - #275
Conversation
Adds the DisMech causal-graph predicate palette (Monarch Initiative `dismech`, `src/dismech/graph.py`) on top of the existing DISMECH_CONCEPT_ID (0x0333) reservation, mirroring ogar-ro's RelationVocabulary structure exactly: a DisMechPredicate struct, the dismech_palette! macro, 19 FnIndex consts minted contiguously at DOMAIN_FLOOR (0x90) through 0xA2, a by_index position lookup, an ogar_loco::Vocabulary impl (binary, non-branching, non-pushing leaf assertions, each declaring the DISMECH_TARGET_CODEBOOK), and a plug_into helper for VocabularyRegistry. Every CURIE uses the dismech: namespace, never RO: or BFO:. This is grounded in upstream's own behavior, not a style choice: its SEPIO exporter defines its own namespace constants (dismech:causally_upstream_of, dismech:has_pathophysiology) rather than reaching for RO terms, and the entire upstream src/ tree contains exactly one RO: literal, which is corpus data, not a graph-builder predicate name. ogar-ro's own 2026-08-10 LOCAL:/SCTID: precedent for confounds_test / has_interpretation / interprets covers exactly this situation: when no RO term carries the needed semantics, the CURIE records honest provenance instead of a bent match. Left open, not resolved: whether dismech:causes and upstream's dismech:causally_upstream_of denote the same relation. Tests: closed-set size/bounds, contiguous-slot lookup, binary/ non-pushing/codebook shape per predicate, anti-vacuity CURIE-namespace guard (dismech: required, RO:/BFO: forbidden), name/CURIE-suffix uniqueness, registry plug + duplicate-concept refusal, plus the existing collision-guard suite untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KCGhDYoQBXs3poaR7sFuqp
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_3fa6b0d8-8d34-4074-88b5-cb264ed68e06) |
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Adds the DisMech causal-graph predicate palette on top of the existing
DISMECH_CONCEPT_ID(0x0333) reservation incrates/ogar-dismech/, mirroringogar-ro'sRelationVocabularystructure exactly (DisMechPredicatestruct, adismech_palette!macro, contiguousFnIndexconsts, aby_indexposition lookup, anogar_loco::Vocabularyimpl, and aplug_intohelper forVocabularyRegistry).The 19 predicates — a measured, closed set
These are the complete predicate vocabulary emitted by the upstream DisMech causal-graph builder (
monarch-initiative/dismech,src/dismech/graph.py), minted contiguously fromDOMAIN_FLOOR(0x90):0x90causes0x97influences0x9Emeasures0x91leads_to0x98targets0x9Frescues0x92triggers0x99treats0xA0readout0x93exacerbates0x9Amodels0xA1contributes_to0x94predisposes_to0x9Bpartially_models0xA2variant_of0x95protects_against0x9Cfails_to_model0x96modulates0x9DperturbsEach is a binary, non-branching, non-pushing leaf assertion (same shape as
ogar-ro's relation calls: it asserts an edge, it does not compute a value for a caller), declaring the newDISMECH_TARGET_CODEBOOK— the basin-local operand-resolution codebook, mirroringRELATION_TARGET_CODEBOOK.Why
dismech:*, neverRO:*— the whole decisionEvery CURIE uses the
dismech:namespace. This is grounded in what upstream itself does, not a style preference:dismech:causally_upstream_of,dismech:has_pathophysiology) rather than reaching for a similar-sounding RO term.src/tree there is exactly oneRO:literal, and it names corpus data (a gene-disease association), never one of the graph-builder's own predicate names.So minting these 19 under
RO:CURIEs — even where a plausible match exists (causes→RO:0002411is the tempting one) — would assert a claim upstream deliberately declined to make.ogar-ro's own 2026-08-10 precedent covers exactly this: itsconfounds_testpredicate usesLOCAL:, andhas_interpretation/interpretsuseSCTID:, specifically because "no RO term carries the [needed] semantics… the byte is the normalized predicate either way; the CURIE records provenance, never a second dispatch key." Same reasoning, applied uniformly to all 19 rows here.Left open, not resolved: upstream's SEPIO export uses the label
causally_upstream_offor its causal family, which is not one of the 19 graph-builder predicate names minted here. Whetherdismech:causesanddismech:causally_upstream_ofdenote the same relation under two labels is undetermined — the module doc says so explicitly rather than assuming either way.Tests
13 tests in
ogar-dismech(up from 3): closed-set size (RELATIONS.len() == 19) and bounds (0x90..=0xA2), contiguous-slotby_indexlookup with refusal at both edges, per-predicate binary/non-branching/non-pushing/codebook shape, an anti-vacuity CURIE-namespace guard (every CURIE starts withdismech:, and — the silence twin — none starts withRO:/BFO:), name/CURIE-suffix uniqueness, and registryplug_into+ duplicate-concept refusal (RegistryError::ConceptTaken). The existingDISMECH_CONCEPT_IDconst and its collision-guard tests are untouched and still pass.Added an
ogar-locopath dependency (same shapeogar-rouses).Verification
cargo test -p ogar-dismech— 13/13 passcargo test -p ogar-ro -p ogar-obo— no regression (47 + 10 + 4 integration tests pass)cargo fmt -p ogar-dismech --check— cleancargo clippy -p ogar-dismech --all-targets -- -D warnings— clean except one pre-existingclippy::assertions_on_constantsfinding in the untouched collision-guard test (stays_in_the_0x03_ontology_domain_clear_of_documented_bands), confirmed present onmainbefore this PR and unrelated to this change; left untouched per the collision-guard-tests-stay-untouched instruction.🤖 Generated with Claude Code
Generated by Claude Code