Skip to content

Commit 12c5ea3

Browse files
committed
docs(identity): Phase B grounded mint seam — frugal north-star, four moves
Grounded the live registry surfaces before proposing Phase B: - contract/ontology.rs:85 entity_type_id() is a 1-based POSITIONAL index into Ontology.schemas (mutable: insert/reorder renumbers everything) -- the legacy anti-pattern in our own code. - lance-graph-ontology/registry.rs OntologyRegistry is APPEND-ONLY (RegistryState::append, 'no rebuild per append') -- the correct immutable home, and already frugal: enumerate_first_with_entity_type_id shows N MappingRows -> 1 entity_type (one template reused across namespaces) is already legal. Four frugal moves recorded in the plan: (1) mint in the append-only registry, deduped by template (domains reuse via namespace, not a fresh entity_type); (2) pair entity_type <-> NiblePath at mint; (3) build-time round-trip test makes eineindeutigkeit CI-falsifiable; (4) feature-gate the legacy positional helper per I-LEGACY-API-FEATURE-GATED. https://claude.ai/code/session_014A4JuRCqKP2yNENrQ9Ha7H
1 parent 09484b3 commit 12c5ea3

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,38 @@ content), never VSA-bundled.
186186
**Critical path:** A → (B, C) → D → E → F. G hangs off A (parallel). H is gated.
187187
**Smallest unblocked first brick:** Phase A (the `NodeGuid` composition, zero-dep contract) OR Phase C (the `SoaEnvelope` impl) — both leaf, both needed by D.
188188

189+
### Phase B — grounded mint seam (2026-06-09, frugal north-star)
190+
191+
Reading the live surfaces confirmed the frugal model *finishes what's there*, not a rewrite:
192+
193+
- **Two `entity_type` worlds today.** `contract/ontology.rs:85 entity_type_id()` is a
194+
**1-based positional index** into `Ontology.schemas` (`Customer→1, Invoice→2 …`; test
195+
`entity_type_id_returns_1_based_index`) — **mutable**: insert/reorder a schema and every
196+
id renumbers. The legacy anti-pattern, in our own code. The **`OntologyRegistry`**
197+
(`lance-graph-ontology/registry.rs`) is **append-only** (`RegistryState::append`,
198+
"no rebuild per append") — the correct immutable home and the OGAR-mirror foundation.
199+
- **The registry already leans frugal.** `enumerate_first_with_entity_type_id(u16)` returns
200+
the *first* row with that id ⇒ **N `MappingRow`s → 1 `entity_type`** is already legal:
201+
one template, reused across namespaces/URIs. North-star is half-built.
202+
203+
**Four frugal moves (each a landable brick):**
204+
1. **Mint in the append-only registry, deduped by template.** `entity_type` is assigned by
205+
append order (immutable; OGAR seeds it one-way from OGIT → ids frozen, protobuf-field-
206+
number discipline), and a shape mints ONCE — domains reuse it by appending a row with a
207+
new `namespace`, same `entity_type`. That IS the frugality (one shape codebook, 256-way
208+
`namespace` reuse; cross-domain alignment is a u16 compare).
209+
2. **Pair `entity_type ↔ NiblePath` at mint.** The registry mints the bijective pair;
210+
`niblepath_of(entity_type)` stable.
211+
3. **Build-time round-trip test.** `entity_type_of(niblepath_of(et)) == et` both ways over
212+
the seeded spine ⇒ eineindeutigkeit becomes CI-falsifiable (closes DECISION-2 enforcement
213+
(a)+(b)).
214+
4. **Feature-gate the legacy positional `ontology.rs::entity_type_id`** per
215+
I-LEGACY-API-FEATURE-GATED — route through the registry or gate to a documented
216+
non-canonical path; no-renumber / field-isolation test mandatory.
217+
218+
**First brick:** moves 1+2+3 together (mint + pairing + round-trip); the legacy-gate (4)
219+
follows once nothing canonical reads the positional helper.
220+
189221
## Honest ledger
190222

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

0 commit comments

Comments
 (0)