Skip to content

Commit ff1a345

Browse files
authored
Merge pull request #563 from AdaWorldAPI/claude/jirak-math-theorems-harvest-rfii13
feat(contract): D-OVC — realign classids to OGAR 0xDDCC + ogar_codebook wire-compat mirror
2 parents 6075d00 + 0c2f2d8 commit ff1a345

12 files changed

Lines changed: 484 additions & 47 deletions

File tree

.claude/board/AGENT_LOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 2026-06-20 (cont.¹²) — D-OVC realign LANDED: contract classids follow OGAR 0xDDCC + ogar_codebook mirror
2+
3+
**Main thread (Opus), autoattended.** Operator "562 merged, Rebase" + earlier `AskUserQuestion` greenlight (realign 0xDDCC / wire-compat / FMA=Health 0x0901). Rebased the jirak branch onto new main (6075d007, post #561+#562; #562 = bridge-codebook-convergence, different files — no conflict) and executed the migration plan's D-OVC deliverables, resolving ISS-CLASSID-OGAR-DRIFT.
4+
5+
**D-OVC-2 + D-OVC-3 (realign, canonical_node.rs):** `CLASSID_OSINT 0x0007 → 0x0700` (OSINT domain root; `>>8 == 0x07`), `CLASSID_FMA 0x0008 → 0x0901` (anatomy concept in the Health domain; `0x0900` = Health root). Minted `CLASSID_PROJECT = 0x0100` + `CLASSID_ERP = 0x0200`. Added `ReadMode::{PROJECT, ERP}` (both Cognitive/CoarseOnly hot business graphs), registered in `BUILTIN_READ_MODES`. Updated the value-asserting tests (old 0x0007/0x0008 → new values + `>>8` domain-byte asserts) and added `project_and_erp_classids_resolve_to_their_read_modes`. `soa_graph::{PROJECT, ERP}` DomainSpecs (siblings of OSINT_GOTHAM/FMA_ANATOMY), re-exported from lib.rs. Realign is **layout-preserving** (a const value change, not a bit reclaim) → no `ENVELOPE_LAYOUT_VERSION` bump, no field-isolation matrix needed.
6+
7+
**D-OVC-1 + D-OVC-4 (NEW `contract::ogar_codebook`):** wire-compat mirror of OGAR `ogar-vocab`'s codebook layer — **zero-dep, no OGAR↔contract dependency** (operator chose wire-compat). `ConceptDomain` (Reserved/ProjectMgmt/Commerce/Osint/Ocr/Health/Unassigned, non_exhaustive), `canonical_concept_domain(id>>8)`, `classid_concept_domain(classid)` (D-OVC-4 route), `source_domain_concept("project"|"erp"|"german-erp")`, `CODEBOOK` (26 project `0x01XX` + 6 commerce `0x02XX` concepts mirrored from OGAR `lib.rs:1073`), `canonical_concept_id`, `LabelDTO {label,id,canonical}` + `from_canonical` + `id_le`. Named `from_canonical` (not OGAR's `from_alias`) on purpose: the contract carries the codebook-id layer, NOT OGAR's curator-alias normalizer (`canonical_concept`) — that stays in ogar-vocab. **Drift guard:** `codebook_ids_match_ogar_vocab` pins the shared `0xDDCC` ids; if OGAR moves one, both sides update together. 6 tests.
8+
9+
**Verified BOTH configs:** `cargo test -p lance-graph-contract --lib` = **710** (was 703; +7: ogar_codebook ×6, project/erp read-mode ×1), `--features guid-v2-tail` = **716**; clippy `-D warnings --all-targets` clean on both; `cargo fmt` clean. Downstream unbroken: lance-graph-callcenter `--features query` = **211** (graph_table builds OSINT nodes via the symbolic const — value-agnostic). All OSINT/FMA references are symbolic; only symbiont's opaque test-classid literals (`0x0007/8`, HHTL-path tests, not OSINT/FMA assertions) use the bare values, unaffected.
10+
11+
Plan `ogar-vocab-contract-codebook-migration-v1.md` D-OVC-1/2/4 → SHIPPED, D-OVC-3 → PARTIAL (canon-doc cross-ref pending). ISSUES `ISS-CLASSID-OGAR-DRIFT` → RESOLVING. Branch reset to main + new work; PR to follow (NOT pushed to main — classifier-gated). Operator note: "might need cherry pick on New PR" — the jirak branch is fully merged into main via #561, so this is fresh work atop main, landing as a new PR.
12+
113
## 2026-06-20 (cont.¹¹) — ogar-vocab⇄contract codebook migration doc + canon-conflict surfaced
214

315
**Main thread (Opus), autoattended.** Operator: "point [to migration docs] as in DO it" + diagnosed the ontology/contract/q2 triangle seams. Grounded in OGAR `crates/ogar-vocab/src/lib.rs` (read, not guessed): it already defines `CODEBOOK` (domain-encoded `0xDDCC`, :1073), `ConceptDomain` + `canonical_concept_domain` (:1141/:1163), `source_domain_concept("project"|"erp")` (:1186), `canonical_concept_id` (:1214), `LabelDTO` (:1476) — and its own note (:1208) says `LabelDTO` "long-term belongs in lance-graph-contract; codebook id == NodeGuid.classid low u16." **Found a real canon conflict:** merged `CLASSID_OSINT=0x0007` is OGAR's *Reserved* domain (OSINT=`0x07XX`); `CLASSID_FMA=0x0008` is OGAR's *OCR* block (FMA/anatomy≈Health `0x09XX`). Wrote `.claude/plans/ogar-vocab-contract-codebook-migration-v1.md` (D-OVC-1..4): host codebook/ConceptDomain/LabelDTO in contract, classids follow `0xDDCC` (mint project `0x01XX`+ERP `0x02XX`; realign OSINT→`0x0700`, FMA→Health). INTEGRATION_PLANS prepended; ISSUES `ISS-CLASSID-OGAR-DRIFT` filed. **Did NOT mint/rewrite code:** the OSINT/FMA realign rewrites merged canon + the CLAUDE.md canon block → operator sign-off required (plan §5). Surfaced 3 decisions: (1) realign OSINT/FMA? (2) OGAR↔contract dependency direction (move vs wire-compat)? (3) FMA → Health 0x09XX or new anatomy domain? Doc committed to the jirak branch (PR #561 arc).

.claude/board/ISSUES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ flip Open entry to Superseded.
264264
**When an issue is deferred knowingly** — leave it Open here but
265265
also append a row to `TECH_DEBT.md` with cross-ref back.
266266

267+
## ISS-CLASSID-OGAR-DRIFT — 2026-06-20 (cont.) — RESOLVING (operator signed off; landed)
268+
**Status:** RESOLVING — operator greenlit the realign (`AskUserQuestion`: "Realign to 0xDDCC", "Wire-compat now", "FMA = Health 0x09XX"). Landed D-OVC-1/2/4 on the jirak branch: `CLASSID_OSINT 0x0007 → 0x0700` (OSINT domain root), `CLASSID_FMA 0x0008 → 0x0901` (anatomy concept in Health, `0x0900` = Health root); minted `CLASSID_PROJECT = 0x0100` + `CLASSID_ERP = 0x0200` with `ReadMode::{PROJECT,ERP}` registered; NEW `contract::ogar_codebook` (wire-compat mirror, zero-dep — `ConceptDomain` / `canonical_concept_domain` / `classid_concept_domain` / `source_domain_concept` / `CODEBOOK` / `canonical_concept_id` / `LabelDTO::from_canonical`); `soa_graph::{PROJECT,ERP}` DomainSpecs. Drift guard test pins the shared `0xDDCC` ids; contract 710 default / 716 v2 green, clippy clean. **Dependency direction = (b) wire-compat (no OGAR↔contract dep);** the `u16` LE wire is the only contract. D-OVC-3 (cutover/version-gate audit of the *value* realign per `I-LEGACY-API-FEATURE-GATED`) remains; the classids are layout-preserving (a const value change, not a bit-layout reclaim), so no `ENVELOPE_LAYOUT_VERSION` bump. Closes when the PR merges.
269+
267270
## ISS-CLASSID-OGAR-DRIFT — 2026-06-20 — OPEN (needs operator sign-off)
268271
**What:** merged `lance-graph-contract` classids drifted from OGAR `ogar-vocab`'s domain-encoded codebook (`0xDDCC`, `crates/ogar-vocab/src/lib.rs:1073` CODEBOOK + `:1163` `canonical_concept_domain`). `CLASSID_OSINT=0x0007``0x00` = OGAR *Reserved* domain (OSINT is `0x07XX`); `CLASSID_FMA=0x0008` → OGAR *OCR* block (FMA/anatomy is clinical → Health `0x09XX`). OGAR's own note (`lib.rs:1204-1212`): codebook id == `NodeGuid.classid` low u16, and `LabelDTO` "long-term belongs in lance-graph-contract." So contract + OGAR currently disagree on what `0x07`/`0x08` mean.
269272
**Impact:** the contract↔OGAR↔q2 triangle has an inconsistent classid space; `canonical_concept_domain(id>>8)` mis-routes contract's OSINT/FMA; project/ERP un-minted.

.claude/board/LATEST_STATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
---
1818

19+
> **2026-06-20 — IN PR (`claude/jirak-math-theorems-harvest-rfii13`)** — **D-OVC: contract classids realigned to OGAR `0xDDCC` + `contract::ogar_codebook` wire-compat mirror.** Resolved ISS-CLASSID-OGAR-DRIFT (operator-signed). **Realigned (layout-preserving const values, no `ENVELOPE_LAYOUT_VERSION` bump):** `CLASSID_OSINT 0x0007 → 0x0700` (OSINT domain root, `>>8 == 0x07`), `CLASSID_FMA 0x0008 → 0x0901` (anatomy concept in Health domain, `0x0900` = root). **Minted:** `CLASSID_PROJECT = 0x0100` + `CLASSID_ERP = 0x0200` with `ReadMode::{PROJECT, ERP}` (Cognitive/CoarseOnly) registered in `BUILTIN_READ_MODES`; `soa_graph::{PROJECT, ERP}` DomainSpecs. **NEW `contract::ogar_codebook`** (zero-dep, **wire-compat — NO OGAR↔contract dependency**): `ConceptDomain` (7 domains, `id>>8` route), `canonical_concept_domain`, `classid_concept_domain` (D-OVC-4 classid→domain), `source_domain_concept`, `CODEBOOK` (26 project `0x01XX` + 6 commerce `0x02XX`, mirrored from OGAR `ogar-vocab` `lib.rs:1073`), `canonical_concept_id`, `LabelDTO::from_canonical` + `id_le`. Drift-guard test pins the shared `0xDDCC` ids. Contract **710** lib (default) / **716** (`guid-v2-tail`), callcenter `--features query` **211** green; clippy `-D warnings` + fmt clean both configs. Refs: AGENT_LOG 2026-06-20 (cont.¹²), plan `ogar-vocab-contract-codebook-migration-v1.md` (D-OVC-1/2/4 SHIPPED, D-OVC-3 PARTIAL), ISSUES `ISS-CLASSID-OGAR-DRIFT` (RESOLVING).
20+
>
1921
> **2026-06-20 — IN PR (`claude/jirak-math-theorems-harvest-rfii13`)** — **codex roll-up + 16-family-adapter edges + Callcenter DataFusion/Gremlin + aiwar POC.** Follow-up to merged #557. (1) Both codex P1 fixes rolled in: classid filter (`project_snapshot`/`nearest_anchor` only project `classid == domain.classid` rows) + the operator's **16×8-bit family-node adapter** edge model — the `EdgeBlock` reads as 16 family adapters (each byte → a FAMILY by `family & 0xFF`, collision-aware skip), dissolving the >255-member aliasing; member-by-identity resolution removed (`E-FAMILY-ADAPTER-EDGES-ARE-RENDER-STABLE`). (2) `lance-graph-callcenter`: NEW `graph_table` (`query-lite`, `GraphSnapshot` → `nodes`/`edges` arrow MemTable `TableProvider`s + `register_graph(SessionContext)`) + NEW `graph_gremlin` (always-on Gremlin/SurrealQL traversal kernel). (3) `contract::aiwar` + example: `AiwarClassView` (category ⇒ family) + `aiwar_node_rows` ingest the real `aiwar-neo4j-harvest/data/aiwar_graph.json` (221 entities → 281 nodes / 60 family hubs / 481 edges). Contract 703 lib + callcenter 10 graph tests green; contract clippy `--all-targets -D warnings` clean. q2 wires the GraphSnapshot → Quadro-2 visual. Refs: AGENT_LOG 2026-06-20 (cont.⁷), EPIPHANIES `E-FAMILY-ADAPTER-EDGES-ARE-RENDER-STABLE`, TECH_DEBT `TD-CALLCENTER-QUERY-CLIPPY`.
2022
>
2123
> **2026-06-20 — branch work (`claude/jirak-math-theorems-harvest-rfii13`)** — **SoA-as-graph domain foundation for the OSINT/Gotham + FMA consumers (q2 renders the pixels).** New zero-dep `contract::soa_graph`: `project_snapshot(&[NodeRow], &DomainSpec) -> graph_render::GraphSnapshot` projects the canonical 32-byte head (NodeGuid + EdgeBlock) into the EXISTING Gotham/neo4j surface (`graph_render` — reused, not duplicated) — family nodes (by u24 `family`), member/in-family/out-of-family edges, all **zero value decode**. `nearest_anchor` ranks nodes to their nearest stability-anchor family by the new `NiblePath::family_hop_count` (CLAM tree distance). Two domains registered: `OSINT_GOTHAM` (classid **`0x0007`**) + `FMA_ANATOMY` (**`0x0008`**, bones = anchor families) in `BUILTIN_READ_MODES` (`ReadMode::OSINT` Cognitive/CoarseOnly hot; `ReadMode::FMA` Compressed/CoarseOnly cold). Anchor-ness is a HEAD field (`family`), never a value type — so "FMA bones as stability anchor" stays head-only (`E-ANCHOR-IS-A-HEAD-FIELD-NOT-A-VALUE-TYPE`). De-duped the GUID→NiblePath lowering: symbiont's `hhtl_path_of` now delegates to canonical `from_guid_prefix` (third copy collapsed). 698 contract + 12 symbiont tests green, clippy clean. **Deferred (named):** q2 rendering (q2 session), Callcenter DataFusion/gremlin POC, OntologyRegistry ClassView labels. Refs: AGENT_LOG 2026-06-20 (cont.⁶), EPIPHANIES `E-ANCHOR-IS-A-HEAD-FIELD-NOT-A-VALUE-TYPE`.

.claude/plans/ogar-vocab-contract-codebook-migration-v1.md

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Migration — OGAR `ogar-vocab` codebook ⇄ `lance-graph-contract` classid (v1)
22

3-
> **Status:** PROPOSED (2026-06-20). Surfaces a **canon conflict** between merged
4-
> `lance-graph-contract` classids and OGAR's `ogar-vocab` codebook; the
5-
> reconciliation rewrites merged canon (`CLASSID_OSINT`/`CLASSID_FMA`) and so is
6-
> gated on operator sign-off.
3+
> **Status:** SHIPPING (2026-06-20). Operator signed off §5; D-OVC-1/2/4 landed
4+
> on the jirak branch + D-OVC-3 realign landed (canon-doc cross-ref pending).
5+
> Originally surfaced a **canon conflict** between merged `lance-graph-contract`
6+
> classids and OGAR's `ogar-vocab` codebook.
77
> **The triangle:** ontology (OGAR `ogar-vocab`) → contract (`NodeGuid`/`ClassId`)
88
> → q2 (Quadro-2 cockpit consuming `GraphSnapshot`).
99
@@ -84,23 +84,43 @@ class-identity codebook. Reconcile onto OGAR's `0xDDCC` scheme:
8484

8585
## 4 — Deliverables (gated on §5 decisions)
8686

87-
- **D-OVC-1** Move/mirror `ConceptDomain` + `canonical_concept_domain` +
88-
`source_domain_concept` + `canonical_concept_id` + `CODEBOOK` + `LabelDTO`
89-
into `lance-graph-contract` (e.g. `contract::ogar_codebook`); `ogar-vocab`
90-
re-exports (or wire-compat duplicate). Round-trip test: `LabelDTO::from_alias`
91-
parity across both crates.
92-
- **D-OVC-2** Mint `CLASSID_PROJECT` (`0x0100`) + `CLASSID_ERP` (`0x0200`) in
93-
`canonical_node.rs` + `ReadMode`s, registered in `BUILTIN_READ_MODES`. Add
94-
`soa_graph::{PROJECT, ERP}` `DomainSpec`s (siblings of `OSINT_GOTHAM`/`FMA_ANATOMY`).
95-
- **D-OVC-3** **Canon realign (SIGN-OFF):** `CLASSID_OSINT 0x0007 → 0x0700`,
96-
`CLASSID_FMA 0x0008 → 0x09xx` (Health) or a minted anatomy domain. Field-isolation
97-
/ version-gate per `I-LEGACY-API-FEATURE-GATED`; update `aiwar.rs`, `soa_graph.rs`,
98-
tests, and the canon block in `lance-graph/CLAUDE.md` + OGAR `CODEBOOK`.
99-
- **D-OVC-4** Route `classid → ReadMode` (and the domain ClassView) through
100-
`canonical_concept_domain(classid_lo)`; q2 reads `LabelDTO`/`canonical` for
101-
display labels (the contract→q2 leg of the triangle).
102-
103-
## 5 — Decisions needed (operator)
87+
> **Update 2026-06-20:** operator signed off §5 (realign 0xDDCC / wire-compat /
88+
> FMA = Health `0x0901`). D-OVC-1/2 SHIPPED, D-OVC-4 SHIPPED (function + tests;
89+
> q2 display-label leg is q2-side); D-OVC-3 (cutover audit) downgraded — the
90+
> classid realign is a const *value* change, not a bit-layout reclaim, so it is
91+
> layout-preserving (no `ENVELOPE_LAYOUT_VERSION` bump); what remains is updating
92+
> the `lance-graph/CLAUDE.md` canon block + OGAR `CODEBOOK` cross-doc.
93+
94+
- **D-OVC-1****SHIPPED.** NEW `contract::ogar_codebook` — wire-compat mirror
95+
(zero-dep, no OGAR↔contract dependency): `ConceptDomain`, `canonical_concept_domain`,
96+
`classid_concept_domain` (the classid→domain route, D-OVC-4), `source_domain_concept`,
97+
`CODEBOOK` (project `0x01XX` + commerce `0x02XX`), `canonical_concept_id`,
98+
`LabelDTO { label, id, canonical }` + `from_canonical` + `id_le`. (Named
99+
`from_canonical`, not `from_alias`: the contract carries the codebook-id layer,
100+
NOT OGAR's curator-alias normalizer — that stays in `ogar-vocab`.) Drift-guard
101+
test pins the shared `0xDDCC` ids; 6 tests.
102+
- **D-OVC-2****SHIPPED.** Minted `CLASSID_PROJECT` (`0x0100`) + `CLASSID_ERP`
103+
(`0x0200`) in `canonical_node.rs` + `ReadMode::{PROJECT, ERP}` (both Cognitive /
104+
CoarseOnly), registered in `BUILTIN_READ_MODES`. Added `soa_graph::{PROJECT, ERP}`
105+
`DomainSpec`s (siblings of `OSINT_GOTHAM`/`FMA_ANATOMY`), re-exported from lib.rs.
106+
- **D-OVC-3****PARTIAL.** Canon realign LANDED: `CLASSID_OSINT 0x0007 → 0x0700`,
107+
`CLASSID_FMA 0x0008 → 0x0901` (anatomy concept in Health). Tests updated to assert
108+
the new values + `>>8` domain bytes. **Layout-preserving** (const value, not a bit
109+
reclaim) → no field-isolation matrix / version-gate needed. **Remaining:** update
110+
the `lance-graph/CLAUDE.md` canon block note + OGAR `CODEBOOK` cross-ref doc.
111+
- **D-OVC-4****SHIPPED (contract leg).** `classid_concept_domain(classid)` routes
112+
on the low-u16 `0xDDCC` high byte; tests assert all five classids resolve to their
113+
`ConceptDomain`. q2's `LabelDTO`/`canonical` display-label consumption is the q2-side
114+
leg (this crate exports the type + ids).
115+
116+
## 5 — Decisions needed (operator) — ✅ RESOLVED 2026-06-20
117+
118+
1. **Canon realign OSINT/FMA?****YES, realign to `0xDDCC`** (OSINT `0x0700`,
119+
FMA `0x0901`).
120+
2. **Dependency direction?****(b) wire-compat now** — both define, the `u16` LE
121+
wire is the only contract, drift-guard test prevents divergence. No new dep.
122+
3. **FMA/anatomy domain?****Health `0x09XX`** — FMA = anatomy concept `0x0901`,
123+
`0x0900` = Health root. (`CC = 0x00` = domain root, reserved everywhere.)
104124

105125
1. **Canon realign OSINT/FMA?** `CLASSID_OSINT 0x0007 → 0x0700`, `CLASSID_FMA
106126
0x0008 → 0x09XX`. This rewrites merged canon (#557/#560) + the `lance-graph/

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ impl AiwarClassView {
7474
pub fn aiwar_node_rows(graph: &LiteralGraph) -> Vec<NodeRow> {
7575
let view = AiwarClassView::from_graph(graph);
7676
let ids = graph.all_node_ids();
77-
let fam_of = |id: &str| -> Option<u32> { graph.node(id).and_then(|n| view.family_of(&n.label)) };
77+
let fam_of =
78+
|id: &str| -> Option<u32> { graph.node(id).and_then(|n| view.family_of(&n.label)) };
7879
ids.iter()
7980
.enumerate()
8081
.map(|(i, id)| {

0 commit comments

Comments
 (0)