Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .claude/board/AGENT_LOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 2026-06-20 (cont.¹²) — D-OVC realign LANDED: contract classids follow OGAR 0xDDCC + ogar_codebook mirror

**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.

**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.

**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.

**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.

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.

## 2026-06-20 (cont.¹¹) — ogar-vocab⇄contract codebook migration doc + canon-conflict surfaced

**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).
Expand Down
3 changes: 3 additions & 0 deletions .claude/board/ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ flip Open entry to Superseded.
**When an issue is deferred knowingly** — leave it Open here but
also append a row to `TECH_DEBT.md` with cross-ref back.

## ISS-CLASSID-OGAR-DRIFT — 2026-06-20 (cont.) — RESOLVING (operator signed off; landed)
**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.

## ISS-CLASSID-OGAR-DRIFT — 2026-06-20 — OPEN (needs operator sign-off)
**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.
**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.
Expand Down
2 changes: 2 additions & 0 deletions .claude/board/LATEST_STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

---

> **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).
>
> **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`.
>
> **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`.
Expand Down
62 changes: 41 additions & 21 deletions .claude/plans/ogar-vocab-contract-codebook-migration-v1.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Migration — OGAR `ogar-vocab` codebook ⇄ `lance-graph-contract` classid (v1)

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

Expand Down Expand Up @@ -84,23 +84,43 @@ class-identity codebook. Reconcile onto OGAR's `0xDDCC` scheme:

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

- **D-OVC-1** Move/mirror `ConceptDomain` + `canonical_concept_domain` +
`source_domain_concept` + `canonical_concept_id` + `CODEBOOK` + `LabelDTO`
into `lance-graph-contract` (e.g. `contract::ogar_codebook`); `ogar-vocab`
re-exports (or wire-compat duplicate). Round-trip test: `LabelDTO::from_alias`
parity across both crates.
- **D-OVC-2** Mint `CLASSID_PROJECT` (`0x0100`) + `CLASSID_ERP` (`0x0200`) in
`canonical_node.rs` + `ReadMode`s, registered in `BUILTIN_READ_MODES`. Add
`soa_graph::{PROJECT, ERP}` `DomainSpec`s (siblings of `OSINT_GOTHAM`/`FMA_ANATOMY`).
- **D-OVC-3** **Canon realign (SIGN-OFF):** `CLASSID_OSINT 0x0007 → 0x0700`,
`CLASSID_FMA 0x0008 → 0x09xx` (Health) or a minted anatomy domain. Field-isolation
/ version-gate per `I-LEGACY-API-FEATURE-GATED`; update `aiwar.rs`, `soa_graph.rs`,
tests, and the canon block in `lance-graph/CLAUDE.md` + OGAR `CODEBOOK`.
- **D-OVC-4** Route `classid → ReadMode` (and the domain ClassView) through
`canonical_concept_domain(classid_lo)`; q2 reads `LabelDTO`/`canonical` for
display labels (the contract→q2 leg of the triangle).

## 5 — Decisions needed (operator)
> **Update 2026-06-20:** operator signed off §5 (realign 0xDDCC / wire-compat /
> FMA = Health `0x0901`). D-OVC-1/2 SHIPPED, D-OVC-4 SHIPPED (function + tests;
> q2 display-label leg is q2-side); D-OVC-3 (cutover audit) downgraded — the
> classid realign is a const *value* change, not a bit-layout reclaim, so it is
> layout-preserving (no `ENVELOPE_LAYOUT_VERSION` bump); what remains is updating
> the `lance-graph/CLAUDE.md` canon block + OGAR `CODEBOOK` cross-doc.

- **D-OVC-1** ✅ **SHIPPED.** NEW `contract::ogar_codebook` — wire-compat mirror
(zero-dep, no OGAR↔contract dependency): `ConceptDomain`, `canonical_concept_domain`,
`classid_concept_domain` (the classid→domain route, D-OVC-4), `source_domain_concept`,
`CODEBOOK` (project `0x01XX` + commerce `0x02XX`), `canonical_concept_id`,
`LabelDTO { label, id, canonical }` + `from_canonical` + `id_le`. (Named
`from_canonical`, not `from_alias`: the contract carries the codebook-id layer,
NOT OGAR's curator-alias normalizer — that stays in `ogar-vocab`.) Drift-guard
test pins the shared `0xDDCC` ids; 6 tests.
- **D-OVC-2** ✅ **SHIPPED.** Minted `CLASSID_PROJECT` (`0x0100`) + `CLASSID_ERP`
(`0x0200`) in `canonical_node.rs` + `ReadMode::{PROJECT, ERP}` (both Cognitive /
CoarseOnly), registered in `BUILTIN_READ_MODES`. Added `soa_graph::{PROJECT, ERP}`
`DomainSpec`s (siblings of `OSINT_GOTHAM`/`FMA_ANATOMY`), re-exported from lib.rs.
- **D-OVC-3** ◐ **PARTIAL.** Canon realign LANDED: `CLASSID_OSINT 0x0007 → 0x0700`,
`CLASSID_FMA 0x0008 → 0x0901` (anatomy concept in Health). Tests updated to assert
the new values + `>>8` domain bytes. **Layout-preserving** (const value, not a bit
reclaim) → no field-isolation matrix / version-gate needed. **Remaining:** update
the `lance-graph/CLAUDE.md` canon block note + OGAR `CODEBOOK` cross-ref doc.
- **D-OVC-4** ✅ **SHIPPED (contract leg).** `classid_concept_domain(classid)` routes
on the low-u16 `0xDDCC` high byte; tests assert all five classids resolve to their
`ConceptDomain`. q2's `LabelDTO`/`canonical` display-label consumption is the q2-side
leg (this crate exports the type + ids).

## 5 — Decisions needed (operator) — ✅ RESOLVED 2026-06-20

1. **Canon realign OSINT/FMA?** → **YES, realign to `0xDDCC`** (OSINT `0x0700`,
FMA `0x0901`).
2. **Dependency direction?** → **(b) wire-compat now** — both define, the `u16` LE
wire is the only contract, drift-guard test prevents divergence. No new dep.
3. **FMA/anatomy domain?** → **Health `0x09XX`** — FMA = anatomy concept `0x0901`,
`0x0900` = Health root. (`CC = 0x00` = domain root, reserved everywhere.)

1. **Canon realign OSINT/FMA?** `CLASSID_OSINT 0x0007 → 0x0700`, `CLASSID_FMA
0x0008 → 0x09XX`. This rewrites merged canon (#557/#560) + the `lance-graph/
Expand Down
3 changes: 2 additions & 1 deletion crates/lance-graph-contract/src/aiwar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ impl AiwarClassView {
pub fn aiwar_node_rows(graph: &LiteralGraph) -> Vec<NodeRow> {
let view = AiwarClassView::from_graph(graph);
let ids = graph.all_node_ids();
let fam_of = |id: &str| -> Option<u32> { graph.node(id).and_then(|n| view.family_of(&n.label)) };
let fam_of =
|id: &str| -> Option<u32> { graph.node(id).and_then(|n| view.family_of(&n.label)) };
ids.iter()
.enumerate()
.map(|(i, id)| {
Expand Down
Loading
Loading