Skip to content

Commit 5363f43

Browse files
authored
Merge pull request #484 from AdaWorldAPI/claude/nice-edison-g4rhhl
D-IDENTITY-2: frugal north-star mint (dedup-by-URI + entity_type↔NiblePath bijection)
2 parents 7053c32 + f3a0e99 commit 5363f43

10 files changed

Lines changed: 596 additions & 46 deletions

File tree

.claude/board/AGENT_LOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
## 2026-06-09 — plan addendum: left-prefix parsing confirmed + D-PG-7 deterministic foveated tree-builder
2+
3+
**Main thread (Fable).** User direction validated against identity.rs octets: GUID left half (class+tree) is order-preserving plain bytes ⇒ Cypher label/subtree patterns = byte-prefix predicates on FixedSizeBinary(16) via Lance zone-maps; similarity leg (RaBitQ/CAM-PQ/Binary16K) rides the same row. Two caveats recorded (namespace-first ordering; ≤4-nibble GUID prefix). New M6 + D-PG-7: NiblePath assignment computable by deterministic hierarchical partition ("deterministic Louvain" → concretely ndarray CLAM pole-split, 16-way, capacity-bounded ⇒ foveation), with the iron requirement APPEND-STABLE (bootstrap once; minted paths never move; layout_version gates changes). Query-time twin noted (cascade / bgz-tensor HHTL cache). Plan §8 + STATUS_BOARD row. Commit: this.
4+
5+
## 2026-06-09 — polyglot query-membrane research: 2 sweeps + spot-verification → plan v1 (D-PG-1..6)
6+
7+
**Main thread (Fable 5 1M) + 2 Explore sweeps (Sonnet).** Researched "parse mailboxes via SurrealDB's AST adapter as a normal cold path; ontology = Christmas tree, decorations materialize at HHTL addresses" + user-added scope (Node Container answers DataFusion UDF + SurrealQL DDL AST + Neo4j/Cypher). Verified at file:line: fork keys storekey-encoded ORDER-PRESERVING (arrays incl.), record-ranges lower to `stream_keys_vals(beg..end)` (pipeline.rs:223) → HHTL subtree = one native range scan under `addr64 = path << 4·(16−depth)`; kv-lance FULLY in-tree (get :646 / keys :824 / scan :848, MVCC+timeline, ~6k test lines) — `surreal_container` BLOCKED(C/D) stale; typed `surrealdb-ast` crate + C16b DDL builders (`new_for_ddl`→`ToSql`, DB-free; consumer op-surreal-ast/nexgen) = the AST-adapter surface; frontend slot = ArenaIR strategy registry (mod.rs:57-60). **Agent-claim correction:** sweep claimed `MailboxSoA<N>` impls `SoaEnvelope` — spot-grep disproved (only TestEnvelope; identity N3 LIVE → D-PG-2). Ruling respected (LanceDB leads; SurrealDB = view). Deliverable: `.claude/plans/polyglot-container-query-membrane-v1.md` + INTEGRATION_PLANS prepend + STATUS_BOARD D-PG-1..6 (all Queued). No code. No epiphany entries (council gate available on request). Commit: this.
8+
9+
## 2026-06-09 — D-IDENTITY-2 Phase B first brick: frugal north-star mint (dedup + bijection) landed
10+
11+
**Main thread (Fable).** Implemented moves 1+2+3 of the identity plan's Phase B seam in `lance-graph-ontology` (registry.rs +242, namespace.rs, bridge.rs): (1) dedup-by-URI mint — a canonical class URI already in the dictionary REUSES its global `entity_type` (new row, new bridge/namespace, same template id); fresh mints stay monotone append-order with gaps, u16-overflow-guarded. (2) `entity_type↔NiblePath` bijection pair table + `register_class_path` (both-way conflict-rejecting, EMPTY-sentinel guard, idempotent same-pair) + `niblepath_of`/`entity_type_of`/`rows_with_entity_type`. (3) round-trip tests. +5 tests (dedup-shares-id, monotone-with-gaps, checksum-reappend-keeps-id, bijection-round-trips, bijection-conflicts-rejected); 14 registry tests green; crate suites green. 3 stale-doc fixes (namespace.rs "dense within the namespace" → GLOBAL; bridge.rs "dense index" → compare-only). My 3 files clippy/fmt-clean; pre-existing crate-wide `-D warnings` (oxrdf/doc-overindent in untouched files) + fmt drift (54 files) left as-is per surgical-diff discipline. Board: STATUS_BOARD identity section (D-IDENTITY-1..4), TD-PAIRTABLE-1, plan LANDED note. Deferred: move 4 (gate positional helper, D-IDENTITY-3).
12+
113
## 2026-06-09 — D-IDENTITY Phase B: global entity_type ratified + mint trace correction
214

3-
**Main thread (Opus→Fable mid-session).** Decision-gate ratified `entity_type` = GLOBAL shared template id (DECISION-3). Pre-change trace overturned two beliefs: (a) `namespace.rs:12` "dense within the namespace" is STALE — live mint `registry.rs:476` is already global append-order; (b) registry is NOT template-deduped (own claim, corrected in-place in the plan). Blast radius of global/sparse ids traced benign (~16 readers, none dense-index). Synthesis: bijection IS the dedup — one `NiblePath ↔ entity_type` pair table = template registry + dedup index + bijection witness. Plan: DECISION-3 + CORRECTION + refinement. Epiphany: E-MINT-TRACE-1; E-OGAR-NORTHSTAR-1 Status updated. Rides in #481. Next: implement first brick (pair-table mint + round-trip test) in lance-graph-ontology.
15+
**Main thread (Opus→Fable mid-session).** Decision-gate ratified `entity_type` = GLOBAL shared template id (DECISION-3). Pre-change trace overturned two beliefs: (a) `namespace.rs:12` "dense within the namespace" is STALE — live mint `registry.rs:476` is already global append-order; (b) registry is NOT template-deduped (own claim, corrected in-place in the plan). Blast radius of global/sparse ids traced benign (~16 readers, none dense-index). Synthesis: bijection IS the dedup — one `NiblePath ↔ entity_type` pair table = template registry + dedup index + bijection witness. Plan: DECISION-3 + CORRECTION + refinement. Epiphany: E-OGAR-NORTHSTAR-1 Status updated. Rides in #481. Next: implement first brick (pair-table mint + round-trip test) in lance-graph-ontology.
416

517
## 2026-06-09 — D-IDENTITY decisions: OGAR mirror (ratified) + north-star template model
618

.claude/board/EPIPHANIES.md

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,7 @@
1-
## 2026-06-09 — E-MINT-TRACE-1 — the live mint is already global (registry.rs:476); the "namespace-local" doc is stale; dedup is net-new; the bijection IS the dedup
2-
3-
**Status:** FINDING (traced, ratified: `entity_type` = global shared template id)
4-
**Confidence:** High (read the mint, not the doc comment)
5-
6-
**Trace before change paid twice.** (1) `namespace.rs:12` documents `entity_type_id` as "dense **within the namespace**" — but the actual mint is `registry.rs:476 entity_type_id = (rows.len()+1)`: **global append-order across all namespaces**. The doc comment is stale; the GLOBAL semantics DECISION-2/3 want are already the live behavior. (2) It corrected this session's own claim, minutes old: the registry is **not** template-deduped — every append mints a fresh id (`enumerate_first_with_entity_type_id` is defensive, not reuse evidence). Frugal dedup + the `entity_type↔NiblePath` pairing are net-new.
7-
8-
**Blast radius traced benign:** ~16 `entity_type_id()` readers store-as-column-value or compare; none dense-index an array BY entity_type. Global/sparse ids break nothing. Dedup consequence: per-id row lookup becomes namespace-ambiguous ⇒ resolve by `(namespace, entity_type)`.
9-
10-
**The synthesis that shrinks Phase B:** the bijection IS the dedup. One pair table `NiblePath ↔ entity_type` in the registry: path present ⇒ reuse the template id (new row, new namespace); absent ⇒ mint fresh (monotone, never reused) + record the pair. The pair table is simultaneously the template registry, the dedup index, and the bijection witness the round-trip test proves. Moves 1+2 of the Phase B seam are one mechanism.
11-
12-
**Process lesson (generalizes):** doc comments describe intent at write-time; the mint line is the contract. For any "is this id local or global / dense or sparse" question, read the assignment site and grep for dense-indexing consumers before believing prose.
13-
14-
**Cross-ref:** identity-architecture plan DECISION-3 + Phase B grounded seam (CORRECTION block); E-OGAR-NORTHSTAR-1 (Status updated); I-LEGACY-API-FEATURE-GATED (the positional `contract/ontology.rs:85` helper is the v1 path to gate).
15-
16-
## 2026-06-09 — E-ANCESTRY-TRINITY-1 — NiblePath::is_ancestor_of is ONE bit-shift read three ways: subClassOf = supervision-edge = north-star template specialization
17-
18-
**Status:** FINDING (cross-session convergence — OGAR/SurrealDB session + identity-contract session, independently)
19-
**Confidence:** High
20-
21-
**The convergence.** A parallel CCA2A session (OGAR / nexgen op-surreal-ast / SurrealDB RecordId) pulled #480 and independently re-derived the OGAR↔lance-graph membrane as **"the registry mint of `(entity_type, NiblePath)` per class"** — exactly DECISION-2 (OGAR mirror) committed from this side in #481. Two sessions, opposite directions, same membrane.
22-
23-
**The new synthesis it surfaces:** `NiblePath::is_ancestor_of` (a single HHTL bit-shift on the GUID routing prefix) is simultaneously THREE relations:
24-
- **OWL `subClassOf`** (ontology inheritance) — OGAR-AST-CONTRACT §1.
25-
- **OTP supervision edge** (ractor parent-routing / delegation through `OrchestrationBridge`) — the other session's "supervisor-edge is now [G] mechanical" finding.
26-
- **North-star template specialization** (a domain class descends from its shared template) — E-OGAR-NORTHSTAR-1.
27-
28-
They are the SAME relation: the north-star template hierarchy IS the routing/supervision hierarchy IS the subClass hierarchy — one bit-shift, three names. Consequence: reusing a template (inherit + switch namespace), being-supervised-by, and being-a-subclass-of are the same arithmetic; there is no separate routing structure to maintain.
29-
30-
**Coordination:** the OGAR session is on #480 (Phase A); #481 carries the OGAR-side answer it needs — OGAR = OGIT mirror, immutable ClassIds, north-star spine, `namespace`=domain. Its proposed `D-IDENT` paired-note + `D-IDENTITY-PIN` should absorb the `namespace`=domain + north-star framing on next pull.
31-
32-
**Cross-ref:** E-OGAR-NORTHSTAR-1; E-IDENTITY-WHITEBOX-1; identity-architecture DECISION-2 + north-star guard; `hhtl.rs::is_ancestor_of`.
33-
341
## 2026-06-09 — E-OGAR-NORTHSTAR-1 — ontology cache = OGAR mirror with a reusable north-star template spine (namespace specializes, entity_type is shared)
352

36-
**Status:** DECISION (OGAR mirror RATIFIED via decision-gate; north-star template model RATIFIED 2026-06-09 "frugal it is"; `entity_type` = GLOBAL shared template id RATIFIED via decision-gate — see E-MINT-TRACE-1)
37-
**Confidence:** High (both halves ratified; mint trace confirms global append-order is already the live mint)
3+
**Status:** DECISION (OGAR mirror RATIFIED via decision-gate; north-star template model RATIFIED 2026-06-09 "frugal it is"; `entity_type` = GLOBAL shared template id RATIFIED via decision-gate)
4+
**Confidence:** High (both halves ratified; the live mint is global append-order across namespaces)
385

396
**Two decisions, one architecture.**
407

.claude/board/INTEGRATION_PLANS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 2026-06-09 — polyglot-container-query-membrane-v1 (Node Container answers Cypher + SurrealQL AST + DataFusion UDF over one HHTL address space; mailbox = a normal cold path)
2+
3+
**Status:** RESEARCH MAP + PLAN. Grounded by two parallel sweeps (lance-graph + surrealdb fork) with main-thread spot-verification; one agent claim caught false (SoaEnvelope has ZERO real impls — identity N3 stands live). **Plan file:** `.claude/plans/polyglot-container-query-membrane-v1.md`.
4+
**Owns:** 6 deliverables D-PG-1..6.
5+
- D-PG-1: `addr64 = path << 4·(16−depth)` codec + order-preservation property test (subtree ⇔ contiguous range ⇔ `is_ancestor_of`) — the falsifiable first brick
6+
- D-PG-2: `SoaEnvelope` impl for `MailboxSoA<N>` (= identity-plan N3) + LE parity test
7+
- D-PG-3: read-only mailbox `Transactable` adapter (get/keys/keysr/scan/scanr over phase-pinned snapshot) + hot==cold differential test
8+
- D-PG-4: `SurrealqlParse` strategy → ArenaIR (frontend #5, same slot as sparql_parse)
9+
- D-PG-5: DDL ⇄ registry bridge (DEFINE TABLE/FIELD ⇄ dedup-by-URI mint + MappingRow/FieldMask; C16b builders as exchange format)
10+
- D-PG-6 (optional): `surreal_container` unblock → Rubicon kanban VIEW over leading LanceDB (ruling-compliant; off critical path)
11+
**Key findings:** surrealdb fork keys are storekey-encoded (order-preserving, arrays included) and record-ranges lower to native KV byte-range scans (`stream_keys_vals`, pipeline.rs:223); kv-lance is FULLY implemented in-tree (18/19 Transactable methods + MVCC/timeline) — `surreal_container` BLOCKED(C/D) is stale; the fork's typed `surrealdb-ast` crate + C16b DDL builders (`new_for_ddl``ToSql`, database-free) are the AST-adapter surface.
12+
**Ruling respected:** LanceDB leads; SurrealDB is a view/dialect (handover 2026-05-28 §2, E-RUBICON-RACTOR).
13+
**Companion plans:** `identity-architecture-exists-vs-needs-v1` (addresses), `bindspace-singleton-to-mailbox-soa-v1` (mailbox, #418).
14+
15+
---
16+
117
## 2026-06-07 — singleton-to-snapshot-nudge-v1 (workspace-wide audit: every shared-mutable singleton → per-owner MailboxSoA + Arc-swap COW snapshot; read-only codebooks explicitly left as-is)
218

319
**Status:** PROPOSAL. Design-spec + audit only, no code beyond the AttentionMatrix correctness fix. **Plan file:** `.claude/plans/singleton-to-snapshot-nudge-v1.md`.

.claude/board/STATUS_BOARD.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,3 +799,32 @@ When a deliverable is abandoned:
799799
|---|---|---|---|
800800
| D-EW64-3 | `EpisodicEdges64::{coldest, contains}` — MRU cold-tier read surface | In PR | contract lib 545 green; clippy clean |
801801
| D-EW64-4 | `DemotionSink` trait + `promote_into` — hot→cold exit seam (impls gated OQ-11.6) | In PR | contract lib 545 green; clippy clean |
802+
803+
---
804+
805+
## identity-architecture-exists-vs-needs-v1 — structured NodeGuid + frugal north-star OGAR mint
806+
807+
Plan path: `.claude/plans/identity-architecture-exists-vs-needs-v1.md`. Epiphanies: E-IDENTITY-WHITEBOX-1, E-OGAR-NORTHSTAR-1. Rides in the open identity PR on `claude/nice-edison-g4rhhl`.
808+
809+
| D-id | Title | Crate(s) / repo | ~LOC | Risk | Status | PR / Evidence |
810+
|---|---|---|---|---|---|---|
811+
| D-IDENTITY-1 | `identity::NodeGuid` (UUIDv8) + `NiblePath::from_packed` — byte layout, version/variant gates, field-isolation matrix | `lance-graph-contract` | ~250 | LOW | **Shipped** | Phase A; +15 contract tests, clippy-D clean |
812+
| D-IDENTITY-2 | Frugal north-star mint: dedup-by-URI global template id + `entity_type↔NiblePath` bijection pair table + round-trip tests (moves 1+2+3) | `lance-graph-ontology` | ~250 | LOW | **In PR** | dedup + `register_class_path`/`niblepath_of`/`entity_type_of`/`rows_with_entity_type`; +5 tests, 14 registry green |
813+
| D-IDENTITY-3 | Gate legacy positional `contract/ontology.rs:85 entity_type_id` per I-LEGACY-API-FEATURE-GATED (move 4) | `lance-graph-contract` / -ontology | ~80 | MED | **Queued** | needs consumer audit first |
814+
| D-IDENTITY-4 | Pair-table Lance persistence (re-register-on-hydration → persisted) | `lance-graph-ontology` | ~60 | LOW | **Queued** | TECH_DEBT TD-PAIRTABLE-1 |
815+
816+
---
817+
818+
## polyglot-container-query-membrane-v1 — three dialects, one HHTL address space, mailbox as cold path
819+
820+
Plan path: `.claude/plans/polyglot-container-query-membrane-v1.md`. Research grounded 2026-06-09; rides on `claude/nice-edison-g4rhhl`.
821+
822+
| D-id | Title | Crate(s) / repo | ~LOC | Risk | Status | PR / Evidence |
823+
|---|---|---|---|---|---|---|
824+
| D-PG-1 | `addr64` left-aligned HHTL codec + order-preservation property test (subtree ⇔ contiguous range) | `lance-graph-contract` | ~120 | LOW | **Queued** | first brick; everything stands on it |
825+
| D-PG-2 | `SoaEnvelope` impl for `MailboxSoA<N>` (= identity N3, confirmed live) + LE parity test | `cognitive-shader-driver` | ~150 | LOW | **Queued** | gap re-verified 2026-06-09 (§2.4 of plan) |
826+
| D-PG-3 | Read-only mailbox `Transactable` adapter (5 methods, phase-pinned) + hot==cold differential test | shader-driver + fork contract | ~250 | MED | **Queued** | gated on D-PG-1,2 |
827+
| D-PG-4 | `SurrealqlParse` strategy → ArenaIR (SELECT point/range) + selector rule | `lance-graph-planner` | ~300 | MED | **Queued** | slot proven by sparql_parse |
828+
| D-PG-5 | DDL ⇄ registry bridge (DEFINE walker → mint; reverse via C16b `ToSql`) | `lance-graph-ontology` | ~250 | MED | **Queued** | gated on fork C16c |
829+
| D-PG-6 | (optional) `surreal_container` unblock → kanban view over LanceDB | `surreal_container` | ~200 | LOW | **Queued** | ruling-compliant; OQ-PG1 open |
830+
| D-PG-7 | Deterministic foveated tree-builder (CLAM-style 16-way bootstrap + append-stable insertion → `register_class_path`) | `lance-graph-ontology` + ndarray CLAM | ~300 | MED | **Queued** | plan §8 addendum; gated on D-PG-1; determinism + append-stability property tests mandatory |

.claude/board/TECH_DEBT.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,3 +2649,16 @@ files; 217 tests green. Fixes are hand-applied (NOT `clippy --fix`, which mangle
26492649
`reader_state.rs` into stranded-comment match guards). The CI clippy step for
26502650
deepnsm was promoted Tier-B advisory → Tier-A gating in
26512651
`.github/workflows/style.yml`.
2652+
2653+
## TD-PAIRTABLE-1 — entity_type↔NiblePath pair table is in-memory only
2654+
**Status:** Open (2026-06-09, D-IDENTITY-2)
2655+
2656+
The `path_by_type` / `type_by_path` bijection tables on `RegistryState`
2657+
(registry.rs) are NOT persisted to the Lance cache. `absorb_row` (the
2658+
`OntologyRegistry::open` replay path) reconstructs `rows` + the by-name/by-uri
2659+
indices but leaves the pair tables empty; callers must re-`register_class_path`
2660+
after hydration (the OGAR/hydrator seed step does this). Persisting the pairs
2661+
(two extra Lance columns, or derive from a NiblePath column on MappingRow) is
2662+
the Paid state. Low risk: dedup itself survives replay (the deduped
2663+
`entity_type` is baked into each persisted `schema_ptr`); only the path
2664+
bijection needs re-seeding. Pair: D-IDENTITY-4.

.claude/plans/identity-architecture-exists-vs-needs-v1.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,24 @@ test proves.
244244
**First brick:** moves 1+2+3 together (mint + pairing + round-trip); the legacy-gate (4)
245245
follows once nothing canonical reads the positional helper.
246246

247+
> **LANDED (2026-06-09, D-IDENTITY-2).** Moves 1+2+3 shipped in
248+
> `lance-graph-ontology` (registry.rs + namespace.rs + bridge.rs):
249+
> dedup-by-URI mint (one global template id, reused across bridges /
250+
> namespaces; monotone-with-gaps, never renumbered), the
251+
> `entity_type ↔ NiblePath` bijection pair table (`register_class_path` /
252+
> `niblepath_of` / `entity_type_of`, both-way conflict-rejecting +
253+
> EMPTY-sentinel guard), `rows_with_entity_type` for the multi-row
254+
> reading, and the three stale-doc corrections. 5 new tests
255+
> (`same_uri_…_shares_one_template_id`, `fresh_mint_is_monotone_with_gaps`,
256+
> `changed_checksum_reappend_keeps_the_template_id`,
257+
> `class_path_bijection_round_trips_both_ways`,
258+
> `class_path_bijection_conflicts_are_rejected`); 14 registry tests green,
259+
> crate suites green, my 3 files clippy/fmt-clean (pre-existing crate-wide
260+
> `-D warnings` + fmt drift in untouched files left as-is). **Deferred:**
261+
> move 4 (gate `contract/ontology.rs:85` positional helper — needs the
262+
> consumer audit first); pair-table Lance persistence (TECH_DEBT — in-memory
263+
> only, re-registered on hydration).
264+
247265
## Honest ledger
248266

249267
- **[G] (exists, reuse):** all 6 layers above — `NiblePath`, `SchemaPtr`, `ClassId`,

0 commit comments

Comments
 (0)