Skip to content

contract: retarget CLASSID_FMA 0x0901 → 0x0A01 (clear the FMA/patient classid collision)#603

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/medcare-bridge-lance-graph-wmx76z
Jun 24, 2026
Merged

contract: retarget CLASSID_FMA 0x0901 → 0x0A01 (clear the FMA/patient classid collision)#603
AdaWorldAPI merged 1 commit into
mainfrom
claude/medcare-bridge-lance-graph-wmx76z

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

The bug (real, in-repo)

OGAR's NodeGuid canon audit (OGAR/docs/NODEGUID-CANON-AUDIT.md F-1) surfaced a
classid collision inside this contract:

  • canonical_node.rs: NodeGuid::CLASSID_FMA = 0x0000_0901
  • ogar_codebook.rs: ("patient", 0x0901)

FMA anatomy and patient share the identical classid 0x0901, both in the
Health domain (>>8 == 0x09). A consumer can't distinguish an FMA structural
node from a patient node by classid, and the patient RBAC grants (rbac.rs,
0x0901) would gate FMA reference data too.

Root cause: anatomy was placed in the Health PHI domain. Anatomy is
public reference (the femur exists; it is part_of the lower limb) — a
clinical finding about it is PHI; the structure itself is not.

The fix

Mirrors OGAR's new 0x0A Anatomy domain (OGAR PR #117 — the Anatomy mint + the
audit that found this):

  • ogar_codebook.rs: add ConceptDomain::Anatomy, route 0x0A → Anatomy,
    add anatomical_structure / skeleton / bone / joint (0x0A01..04) to
    CODEBOOK.
  • canonical_node.rs: retarget CLASSID_FMA 0x0901 → 0x0A01
    (anatomical_structure, the FMA root). patient stays at 0x0901; the
    collision is cleared. This continues the existing ISS-CLASSID-OGAR-DRIFT
    realignment saga (FMA: 0x0008 → 0x0901 → 0x0A01).
  • Tests updated to assert 0x0A01 / Anatomy and to forbid the 0x0901
    alias
    (assert_ne!(CLASSID_FMA, 0x0901, "must not alias patient")).

Blast radius

  • Constant-following consumers inherit the fix with no change: the
    ReadMode::FMA registry (m.insert(CLASSID_FMA, ReadMode::FMA)), the
    soa_graph FMA DomainSpec, and q2 PR docs: deep audit — 8 meticulous inventory documents across lance-grap… #50's osint-bake/fma (which keys
    on CLASSID_FMA).
  • ConceptDomain is #[non_exhaustive] and matched only within this crate — no
    exhaustiveness break.
  • patient (0x0901) and all rbac.rs patient grants are untouched.

Gates

cargo test -p lance-graph-contract735 + others green; clippy-clean (the
two warnings are pre-existing, unrelated). Board hygiene: EPIPHANIES.md
E-CLASSID-FMA-PATIENT-COLLISION.

Cross-refs

🤖 Generated with Claude Code


Generated by Claude Code

…llision)

OGAR's NodeGuid canon audit (OGAR/docs/NODEGUID-CANON-AUDIT.md F-1) surfaced a
real in-repo collision: NodeGuid::CLASSID_FMA = 0x0000_0901 was identical to
ogar_codebook's ("patient", 0x0901) — FMA anatomy and patient shared one classid,
both in the Health domain. A consumer could not distinguish an FMA structural
node from a patient node by classid, and patient RBAC grants (rbac.rs, 0x0901)
would gate FMA reference data.

Root cause: anatomy was placed in the Health PHI domain. Anatomy is public
reference (the femur exists; part_of the lower limb) — a clinical finding *about*
it is PHI, the structure itself is not.

Fix (mirrors OGAR's new 0x0A Anatomy mint, OGAR PR #117):
- ogar_codebook: add ConceptDomain::Anatomy, route 0x0A -> Anatomy, add
  anatomical_structure/skeleton/bone/joint (0x0A01..04) to CODEBOOK.
- canonical_node: CLASSID_FMA 0x0901 -> 0x0A01 (anatomical_structure, the FMA
  root). patient stays at 0x0901; collision cleared.
- Tests assert 0x0A01 / Anatomy and forbid the 0x0901 alias.

Constant-following consumers (ReadMode::FMA registry, soa_graph DomainSpec, q2
#50's osint-bake/fma) inherit the fix with no change. ConceptDomain is
#[non_exhaustive] (no exhaustiveness break). 735+ contract tests green,
clippy-clean. Board: EPIPHANIES E-CLASSID-FMA-PATIENT-COLLISION.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AdaWorldAPI, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 27 minutes and 4 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b3c3506-a721-4c20-993f-190a9b362a2f

📥 Commits

Reviewing files that changed from the base of the PR and between 8bfc933 and 1c6a7db.

📒 Files selected for processing (3)
  • .claude/board/EPIPHANIES.md
  • crates/lance-graph-contract/src/canonical_node.rs
  • crates/lance-graph-contract/src/ogar_codebook.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI AdaWorldAPI merged commit b1ad1b5 into main Jun 24, 2026
5 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.

2 participants