Skip to content

Commit 36059ce

Browse files
authored
Merge pull request #595 from AdaWorldAPI/claude/sync-ogar-codebook-auth-domain
fix(contract): sync ogar_codebook to OGAR #110 (Auth 0x0B domain) — fixes lance-graph-ogar parity fuse
2 parents 42f245a + 81d08c4 commit 36059ce

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

.claude/board/LATEST_STATE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
1111
---
1212

13+
## 2026-06-23 — IN PR (`claude/sync-ogar-codebook-auth-domain`) — `contract::ogar_codebook` synced to OGAR #110 (Auth domain `0x0B`) — fixes the codebook parity drift #42's ogar-vocab bump surfaced
14+
15+
OGAR #110 minted the `0x0B` **AuthStore** class family; the contract's zero-dep mirror lagged (39 vs 43), so `lance-graph-ogar`'s compile-time `COUNT_FUSE` + runtime `assert_codebook_parity()` fired and **broke the q2 Railway build** (`cockpit-server` → `lance-graph-ogar`). Synced the mirror: **NEW** `ConceptDomain::Auth` (`0x0BXX`) + `0x0B => Auth` routing + 4 `CODEBOOK` entries (`auth_store` `0x0B01` / `auth_zitadel` `0x0B02` / `auth_zanzibar` `0x0B03` / `auth_ory_keto` `0x0B04`), and the `lance-graph-ogar::parity::domains_agree` `(O::Auth, C::Auth)` arm. Mirror is now **43** = `ogar_vocab::class_ids::ALL`. **Verified:** `cargo build --manifest-path crates/lance-graph-ogar` (COUNT_FUSE green, 36s); `cargo test --manifest-path crates/lance-graph-ogar` (`mirror_is_a_faithful_copy_of_ogar_codebook` + 53 lib tests green); `cargo test -p lance-graph-contract` (8 ogar_codebook tests green); contract clippy `-D warnings` + fmt clean. The parity guard worked as designed — the `#[non_exhaustive]`-total `domains_agree` match tripped on the new OGAR domain. Refs: q2 #41 (root `/Dockerfile`) + #42 (ogar-vocab lock bump → `302c284`); this is the contract-side completion that unblocks the live Rust deploy.
16+
17+
---
18+
1319
## 2026-06-22 — MERGED #592 (merge `48794eaf`, `claude/contract-app-prefix-mirror`) — `contract::ogar_codebook` APP-prefix (hi-u16) mirror — closes `ISS-CONTRACT-APP-PREFIX-MIRROR`
1420

1521
Membrane consumers can now pull BOTH halves of a render `classid` BBB-safely from `lance_graph_contract::ogar_codebook` — no hand-stamped `0x000N`. **NEW:** `AppPrefix` enum (the OGAR#95 §2 allocation table as typed data — `Core 0x0000` / OpenProject `0x0001` / Odoo `0x0002` / WoA `0x0003` / SMB `0x0004` / Healthcare `0x0005` / Redmine `0x0007`) with `prefix()` / `from_prefix()` / `render(concept)`; free fns `render_classid(prefix, concept)`, `render_classid_for_concept(AppPrefix, &str)`, `classid_app_prefix(classid)`, `classid_concept(classid)` — the wire-compat mirror of OGAR#97 `ogar_vocab::app` (`render_classid_for::<P>` / `app_of` / `concept_of`), **no `ogar-vocab` dependency**. Two parity tests: `app_prefixes_match_ogar_allocation_table` (pins the 6 prefixes vs OGAR `PortSpec::APP_PREFIX`) + `render_classid_composes_decomposes_and_preserves_the_concept_half` (pins the `0x0005_0901` MedCare-patient worked example, and that the render lens never perturbs the lo-u16 concept RBAC keys on). Follows the OGAR#98 `canonical_concept_name` mirror precedent. Closes the gap the #591 consumer spellbook surfaced. Contract lib **+2 tests** / +1 doctest; `cargo fmt -p lance-graph-contract --check` clean; `clippy -p lance-graph-contract --all-targets -D warnings` clean (also `--features guid-v2-tail`). (Incidental: the crate-wide `cargo fmt` pass also corrected pre-existing struct-literal/line-width drift in `content_store.rs` — same crate, no behavior change.) Refs: PR #592 (merged `48794eaf`), ISSUES `ISS-CONTRACT-APP-PREFIX-MIRROR` (RESOLVED), `.claude/knowledge/ogar-consumer-preflight.md` § Core-gap (CLOSED), OGAR#97/#98.

crates/lance-graph-contract/src/ogar_codebook.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ pub enum ConceptDomain {
5454
Ocr,
5555
/// `0x09XX` — Health (clinical / patient / care; FMA anatomy lives here).
5656
Health,
57-
/// Any high-byte slot not yet assigned a domain (`0x03XX`–`0x06XX`, `0x0AXX`+).
57+
/// `0x0BXX` — Auth (identity / authz: AuthStore, Zitadel, Zanzibar, Ory Keto).
58+
Auth,
59+
/// Any high-byte slot not yet assigned a domain (`0x03XX`–`0x06XX`, `0x0AXX`, `0x0CXX`+).
5860
Unassigned,
5961
}
6062

@@ -71,6 +73,7 @@ pub fn canonical_concept_domain(id: u16) -> ConceptDomain {
7173
0x07 => ConceptDomain::Osint,
7274
0x08 => ConceptDomain::Ocr,
7375
0x09 => ConceptDomain::Health,
76+
0x0B => ConceptDomain::Auth,
7477
_ => ConceptDomain::Unassigned,
7578
}
7679
}
@@ -292,6 +295,11 @@ pub const CODEBOOK: &[(&str, u16)] = &[
292295
("treatment", 0x0905),
293296
("visit", 0x0906),
294297
("vital_sign", 0x0907),
298+
// ── 0x0BXX — Auth domain (identity / authz; OGAR's 0x0B AuthStore family) ──
299+
("auth_store", 0x0B01),
300+
("auth_zitadel", 0x0B02),
301+
("auth_zanzibar", 0x0B03),
302+
("auth_ory_keto", 0x0B04),
295303
];
296304

297305
/// Resolve a **canonical-concept** string to its stable `u16` codebook id via
@@ -363,6 +371,7 @@ mod tests {
363371
assert_eq!(canonical_concept_domain(0x0700), ConceptDomain::Osint);
364372
assert_eq!(canonical_concept_domain(0x0801), ConceptDomain::Ocr);
365373
assert_eq!(canonical_concept_domain(0x0901), ConceptDomain::Health);
374+
assert_eq!(canonical_concept_domain(0x0B01), ConceptDomain::Auth);
366375
assert_eq!(canonical_concept_domain(0x0500), ConceptDomain::Unassigned);
367376
}
368377

@@ -417,6 +426,11 @@ mod tests {
417426
assert_eq!(canonical_concept_id("commercial_line_item"), Some(0x0201));
418427
assert_eq!(canonical_concept_id("commercial_document"), Some(0x0202));
419428
assert_eq!(canonical_concept_id("currency_policy"), Some(0x0206));
429+
// 0x09XX Health + 0x0BXX Auth (OGAR #110 minted the AuthStore family).
430+
assert_eq!(canonical_concept_id("patient"), Some(0x0901));
431+
assert_eq!(canonical_concept_id("vital_sign"), Some(0x0907));
432+
assert_eq!(canonical_concept_id("auth_store"), Some(0x0B01));
433+
assert_eq!(canonical_concept_id("auth_ory_keto"), Some(0x0B04));
420434
assert_eq!(canonical_concept_id("not_a_concept"), None);
421435
}
422436

crates/lance-graph-ogar/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ pub mod parity {
134134
| (O::Osint, C::Osint)
135135
| (O::Ocr, C::Ocr)
136136
| (O::Health, C::Health)
137+
| (O::Auth, C::Auth)
137138
| (O::Unassigned, C::Unassigned)
138139
)
139140
}

0 commit comments

Comments
 (0)