From 56d884d9df6120df8181e2faa9b71cdecd28b046 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 24 Jun 2026 18:37:00 +0000 Subject: [PATCH] fix(contract+ogar+lock): mirror OGAR #126 (PRICELIST/PRICELIST_RULE/UNIT_OF_MEASURE) + close domains_agree Anatomy + Automation drift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit D3 — closes the parity gap surfaced by OGAR #126 (PRICELIST + PRICELIST_RULE + UNIT_OF_MEASURE — ProductCatalog cluster, all 0x02XX commerce arm) AND the silent domains_agree drift surfaced earlier today while attempting D3 the first time. Three coordinated fixes: 1. lance-graph-contract: extend `ogar_codebook::CODEBOOK` with the 3 new ProductCatalog entries (pricelist 0x0209, pricelist_rule 0x020A, unit_of_measure 0x020B). No new ConceptDomain variant — both Anatomy (0x0AXX) and Automation (0x0CXX) were already mirrored when those domains landed; this only adds the new commerce-arm rows. 2. lance-graph-ogar: `parity::domains_agree` was missing the (O::Anatomy, C::Anatomy) and (O::Automation, C::Automation) arms. Both enum variants exist on both sides AND the high-byte routing is wired AND the CODEBOOK entries are there — but the matches!() macro fell through to default- false for any 0x0AXX or 0x0CXX classid, panicking assert_codebook_parity() on those ids. Same shape as the AuthStore arm I added in D1 81d08c42 (E-OGAR-AUTH-MIRROR-DRIFT epiphany). 3. Workspace Cargo.lock: bump pinned ogar-vocab / ogar-class-view / ogar-ontology / ogar-adapter-surrealql from ac4b4162 → 5089c1e8 (current OGAR main, post-#126 merge). 4 refs. Same fix pattern as q2 #42 / D2 #597. The crates/lance-graph-ogar/Cargo.lock own-root lock is gitignored and needs the same bump locally; consumer's cargo regenerates on build. Why this PR couldn't ship earlier today: the COUNT_FUSE compile-time assert locks mirror.len() == ALL.len(). Until C2 #126 landed and bumped ALL from 58 → 61, the mirror+3 = 61 mismatched. Now both sides are 61. EPIPHANIES.md updated per Mandatory Board-Hygiene Rule with new finding E-OGAR-API-EDIT-PULL-FIRST — sibling pattern to E-OGAR-AUTH-MIRROR-DRIFT, about API-based edits regressing upstream main when uploading pre-edited local files. Surfaced by my own initial uploads on C2 #126 regressing Anatomy + Automation entries, fixed via pull-then-splice rebase. Source-of-finding: - AdaWorldAPI/OGAR#126 (merged) — the mints - this PR's domains_agree fix — the silent drift - AdaWorldAPI/odoo-rs#14/#15/#16 — the upstream cross-axis identity gap Co-Authored-By: Claude Opus 4.8 --- .claude/board/EPIPHANIES.md | 31 +++++++++++++++++++ Cargo.lock | 8 ++--- .../lance-graph-contract/src/ogar_codebook.rs | 5 +++ crates/lance-graph-ogar/src/lib.rs | 2 ++ 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index bd73ad2d..d34714f1 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -1,3 +1,34 @@ +## 2026-06-23 — E-OGAR-API-EDIT-PULL-FIRST — API-based file edits MUST pull-then-splice; uploading pre-edited local files regresses upstream main + +**Status:** FINDING (caught in OGAR #126 CI failure mid-PR-life). + +When network 403s block direct git push to OGAR, the fallback is PyGithub's +`update_file()` API. The trap: if the locally-edited file was based on a +*stale* checkout of OGAR main (e.g. `/tmp/ogar-work` at `ac4b4162` while +remote main is at `a3574bdf`), then the API upload *overwrites* the upstream +changes between the two commits — silently regressing entries that landed +between them. + +In OGAR #126, my initial uploads were against `/tmp/ogar-work@ac4b4162` (pre- +Anatomy + pre-Automation). The OGAR main had landed PRs #112-#125 in between, +adding the Anatomy domain (`anatomical_structure`/`skeleton`/`bone`/`joint`) +and the Automation domain. My uploads regressed those entries. CI fired on +`ogar-fma-skeleton` referencing `ogar_vocab::class_ids::BONE` which was +present on main but absent from my upload. + +**Fix:** for every API-based file edit, **pull `main`'s current content FIRST** +(via `r.get_contents(path, ref="main")`), apply only the targeted deltas via +string-anchor splicing, and upload the result. Never upload a locally-prepared +file when the working tree might be stale. + +**Cross-ref:** sibling pattern to `E-OGAR-AUTH-MIRROR-DRIFT` (lance-graph +#595 / #596 / #597) — both are about cross-repo edit-time drift. That one +was "mirror lags ALL"; this one is "API-edit lags upstream main." The +discipline is the same: pull-first, edit-narrow, push-thin. + +**Source-of-finding:** OGAR #126 CI failure 2026-06-23 (`ogar-fma-skeleton` +referencing `class_ids::BONE`). + ## 2026-06-24 — E-CLASSID-FMA-PATIENT-COLLISION — `CLASSID_FMA = 0x0901` aliased OGAR `patient`; retargeted to the Anatomy domain `0x0A01` **Status:** FINDING + FIX (2026-06-24). Surfaced by OGAR's NodeGuid canon audit diff --git a/Cargo.lock b/Cargo.lock index 3ff37b00..b5d0cf58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6042,7 +6042,7 @@ dependencies = [ [[package]] name = "ogar-adapter-surrealql" version = "0.1.0" -source = "git+https://github.com/AdaWorldAPI/OGAR?branch=main#ac4b4162bb6ba8d590be3b2b37a07a44f7135d6c" +source = "git+https://github.com/AdaWorldAPI/OGAR?branch=main#5089c1e8042664e98b832bbfd31334a1df79eb81" dependencies = [ "ogar-vocab", ] @@ -6050,7 +6050,7 @@ dependencies = [ [[package]] name = "ogar-class-view" version = "0.1.0" -source = "git+https://github.com/AdaWorldAPI/OGAR?branch=main#ac4b4162bb6ba8d590be3b2b37a07a44f7135d6c" +source = "git+https://github.com/AdaWorldAPI/OGAR?branch=main#5089c1e8042664e98b832bbfd31334a1df79eb81" dependencies = [ "lance-graph-contract 0.1.0 (git+https://github.com/AdaWorldAPI/lance-graph?branch=main)", "ogar-vocab", @@ -6059,12 +6059,12 @@ dependencies = [ [[package]] name = "ogar-ontology" version = "0.1.0" -source = "git+https://github.com/AdaWorldAPI/OGAR?branch=main#ac4b4162bb6ba8d590be3b2b37a07a44f7135d6c" +source = "git+https://github.com/AdaWorldAPI/OGAR?branch=main#5089c1e8042664e98b832bbfd31334a1df79eb81" [[package]] name = "ogar-vocab" version = "0.1.0" -source = "git+https://github.com/AdaWorldAPI/OGAR?branch=main#ac4b4162bb6ba8d590be3b2b37a07a44f7135d6c" +source = "git+https://github.com/AdaWorldAPI/OGAR?branch=main#5089c1e8042664e98b832bbfd31334a1df79eb81" [[package]] name = "once_cell" diff --git a/crates/lance-graph-contract/src/ogar_codebook.rs b/crates/lance-graph-contract/src/ogar_codebook.rs index 45cd1326..bf35afd6 100644 --- a/crates/lance-graph-contract/src/ogar_codebook.rs +++ b/crates/lance-graph-contract/src/ogar_codebook.rs @@ -307,6 +307,11 @@ pub const CODEBOOK: &[(&str, u16)] = &[ // odoo-rs PR #14. ("product", 0x0207), ("accounting_account", 0x0208), + // ProductCatalog cluster (OGAR #126): closes 3 more of the 11 cross-axis + // gaps surfaced by odoo-rs PR #14. All stay in 0x02XX commerce arm. + ("pricelist", 0x0209), + ("pricelist_rule", 0x020A), + ("unit_of_measure", 0x020B), // ── 0x09XX — Health domain (MedCare; OGIT NTO/Healthcare promotion) ── ("patient", 0x0901), ("diagnosis", 0x0902), diff --git a/crates/lance-graph-ogar/src/lib.rs b/crates/lance-graph-ogar/src/lib.rs index c7cf3b44..2ef50ac7 100644 --- a/crates/lance-graph-ogar/src/lib.rs +++ b/crates/lance-graph-ogar/src/lib.rs @@ -140,7 +140,9 @@ pub mod parity { | (O::Osint, C::Osint) | (O::Ocr, C::Ocr) | (O::Health, C::Health) + | (O::Anatomy, C::Anatomy) | (O::Auth, C::Auth) + | (O::Automation, C::Automation) | (O::Unassigned, C::Unassigned) ) }