diff --git a/.claude/board/INTEGRATION_PLANS.md b/.claude/board/INTEGRATION_PLANS.md index 38f2a57c..4d01f1c2 100644 --- a/.claude/board/INTEGRATION_PLANS.md +++ b/.claude/board/INTEGRATION_PLANS.md @@ -35,6 +35,23 @@ - **Confidence** — **mutable**: Working / Partial / Broken — see PR #N +--- + +## palantir-parity-cascade-v2 — Foundry/Gotham parity capstone + DTO ladder (authored 2026-05-07) + +- **Plan:** `.claude/plans/palantir-parity-cascade-v2.md` +- **Companion knowledge:** `.claude/knowledge/soa-dto-dependency-ledger.md` (the SoA DTO entropy ledger; ships with this plan). +- **Author + date:** main thread (Opus 4.7 1M), 2026-05-07 (immediately after PR #352 merge). +- **Status:** Active. +- **Scope:** Integration capstone over 4 prior Foundry parity docs (`q2-foundry-integration-v1`, `lf-integration-mapping-v1`, `foundry-consumer-parity-v1`, `medcare-foundry-vision`) and v1 cascade Pillar 0. **Pillar 0 carry-forward**: Foundry parity IS SoA-as-canon parity — Column H (`EntityTypeId: u16`, PR #272 SHIPPED) is already the Foundry Object Type bridge; v2 just makes the SoA carry the Foundry-equivalent shape, NOT duplicate the table set. **DTO ladder finding (2026-05-07 audit)**: `StreamDto`, `ResonanceDto`, `BusDto` all live in `thinking-engine::dto.rs` (Tiers 0/1/2), upstream of contract. 22 DTOs classified across 3 buckets: 9 bare-metal, 7 SoA-glue, 6 bridge-projection (3 OPEN re-classifications). **Business Logic ↔ Thinking-style ↔ OGIT triangle**: each business operation has 3 faces (`thinking_style: ThinkingStyle` dispatch, `ogit_verb: TTL`, `ogit_entities[]: TTL`); v2 D-PARITY-V2-2 ships the routing table. +- **Originating context:** main-thread requests 2026-05-07: (a) updated roadmap with Foundry/Gotham parity; (b) SoA DTO dependency-graph / entropy ledger to classify bare-metal vs SoA-glue (StreamDto, BusDto, ResonanceDto); (c) cognitive-shader-driver internal vs lance-graph-callcenter external O(1) mapping; (d) Business Logic Thinking-style OGIT mapping later. +- **Resolves ledger rows:** none directly. **Hardens** v1 D-CASCADE-V1-7 (codec cascade column population) via the explicit ledger entry tracking the "OPEN" status of each cascade column. +- **Branch:** `claude/create-graph-ontology-crate-gkuJG`. PR target: `AdaWorldAPI/lance-graph` base=`main`. +- **Confidence (2026-05-07):** Pre-execution. Pillar 0 carry-forward is right per existing PR #272 (Column H is the bridge already). Top-3 ranked: D-PARITY-V2-1 (DTO ledger — ships with this plan), D-PARITY-V2-2 (triangle ledger — ships with this plan), D-PARITY-V2-3 (BusDto bridge into engine_bridge.rs). +- **Cross-plan deps:** v1 D-CASCADE-V1-2 (`SchemaPtr.context_id`) → v2 D-PARITY-V2-4 (`Schema::ObjectView`); v1 D-CASCADE-V1-7 (codec cascade columns) → v2 D-PARITY-V2-12 (`SchemaPtr.thinking_style`); v5 D-9 (`MulThresholdProfile`) → v2 D-PARITY-V2-12 (column extension). +- **Foundry parity status snapshot:** SHIPPED — Column H (PR #272), audit trail, RBAC/RLS, PostgREST. IN PROGRESS — Q2 cockpit. QUEUED — LF-12 Pipeline DAG, LF-20 FunctionSpec, LF-22/23 ObjectView/Notification, LF-50 ModelRegistry. +- **Out of v2 scope:** CRDT scenario branching (Column F already exists; UI affordance is v3), Foundry Marketplace/Compass, Foundry Code Repositories, Vertex/Workshop UX (covered by `q2-foundry-integration-v1`), Foundry-export-format ingest. + --- ## ogit-cascade-supabase-callcenter-v1 — OGIT SPO-G + Supabase realtime + Zone 1/2/3 (authored 2026-05-07) diff --git a/.claude/board/LATEST_STATE.md b/.claude/board/LATEST_STATE.md index 927cd04b..07582b9a 100644 --- a/.claude/board/LATEST_STATE.md +++ b/.claude/board/LATEST_STATE.md @@ -2,7 +2,7 @@ > **Auto-injected at session start via SessionStart hook.** > Updated after every merged PR. -> **Last updated:** 2026-05-06 (splat-osint-ingestion-v1 PR 1+2 of 6 in flight: contract::splat module + EWA OSINT example). Prior: 2026-04-21 post PR #243. +> **Last updated:** 2026-05-07 (PR #352 merged: lance-graph-ontology v5 + ogit-cascade v1 plans). Prior: 2026-05-06 (splat-osint-ingestion-v1 PR 1+2 of 6 in flight). Prior: 2026-04-21 post PR #243. > > Purpose: prevent new sessions from hallucinating structure that > already exists or proposing features already shipped. Read this @@ -14,6 +14,7 @@ | PR | Merged | Title | What it added | |---|---|---|---| +| **#352** | 2026-05-07 | plan: lance-graph-ontology v5 + ogit-cascade v1 | Two-plan PR. **v5** (177 lines): 15 deliverables for ontology crate post-merge follow-on (D-1 dcterms:source, D-2 SpoBridge::promote_to_spo, D-9 ontology-aware MUL thresholds). 4 ratifications (smb-ontology export-only, D-9 above D-2, MulThresholdProfile in lance-graph-contract, OGIT-fork upstream non-PR). **v1 cascade** (209 lines): 15 D-CASCADE deliverables for SoA-as-canon + Zone 1/2/3 + BioPortal arsenal + bridge collapse. **Pillar 0**: OntologyRegistry IS the SoA, schema IS the DTO + name→row index. **Codec cascade per row** (target state, NOT YET WIRED — D-CASCADE-V1-7): identity Vsa16kF32 → CAM-PQ 6 B → Base17 34 B → palette key 4 B → Scent 1 B + qualia 18×f32 + meta 8 B + edge 8 B, every step O(1). | | **#243** | *(open)* | D5+D7 categorical-algebraic inference | `thinking_styles.rs` (490 LOC, 12 tests), `free_energy.rs` (347 LOC, 7 tests), `role_keys.rs` bind/unbind/recovery (295 LOC, 14 tests), `content_fp.rs` (98 LOC, 5 tests), `markov_bundle.rs` (250 LOC, 8 tests), `trajectory.rs` (298 LOC, 4 tests). Plans: `categorical-algebraic-inference-v1.md` (496 lines). Knowledge: `paper-landscape-grammar-parsing.md`, `session-2026-04-21-categorical-click.md`. CLAUDE.md § The Click (P-1). 12 epiphanies. | | **#225** | *(open)* | Codec-sweep plan + D0.6/D0.7 CodecParams | 9-commit plan (`codec-sweep-via-lab-infra-v1.md`, Rules A-F, 9 starter YAMLs, CODING_PRACTICES audit) + `lance-graph-contract::cam` CodecParams/Builder/precision-ladder validation (14 tests). 147/147 contract suite | | **#224** | 2026-04-20 | lab = API+Planner+JIT, thinking harvest, I11 measurability | `lab-vs-canonical-surface.md` extended: three-part lab stack (API + Planner + JIT), thinking-harvest subsection (REST/Cypher → `{rows, thinking_trace}` = the AGI magic bullet), I11 invariant (every layer L0→L4 emits harvest-ready trace; no black-box short-circuits) | diff --git a/.claude/board/PR_ARC_INVENTORY.md b/.claude/board/PR_ARC_INVENTORY.md index 82be9a54..09b569c3 100644 --- a/.claude/board/PR_ARC_INVENTORY.md +++ b/.claude/board/PR_ARC_INVENTORY.md @@ -35,6 +35,38 @@ --- +## #352 — plan: lance-graph-ontology v5 + ogit-cascade v1 (merged 2026-05-07) + +**Confidence (2026-05-07):** plan-only, pre-execution. Pillar 0 (SoA-as-canon) is the architectural anchor; Pillars 1-4 are mechanical consequences. Top-3 deliverables locked for both v5 and v1 cascade. Foundry/Gotham parity prior art confirmed extensive (Q2 = Gotham UI equivalent per `q2-foundry-integration-v1.md`; Column H EntityTypeId = Foundry Object Type bridge per PR #272 SHIPPED; LF-12/20/22/23/50 already mapped in `lf-integration-mapping-v1.md`). v2 roadmap will integrate, not duplicate. **Status:** Merged to `main` as `8e2f088`. + +**Added:** +- `.claude/plans/lance-graph-ontology-v5.md` (177 lines) — 15 deliverables ranked by leverage/cost, picking up where v4 (OGIT#1 merged) left off. +- `.claude/plans/ogit-cascade-supabase-callcenter-v1.md` (209 lines) — Pillar 0 (SoA-as-canon) + Pillar 1 (OGIT SPO-G lingua franca) + Pillar 2 (Zone 1/2/3 BBB tightening) + Pillar 3 (smb/medcare bridge collapse to 2-line projections) + Pillar 4 (BioPortal arsenal stubs); 15 D-CASCADE deliverables. +- `.claude/board/INTEGRATION_PLANS.md` — prepended with both v5 and v1 cascade entries (append-only governance honored). + +**Locked:** +- **v5 ratifications (4):** smb-ontology export-only forever; D-ONTO-V5-9 above D-ONTO-V5-2 (registry has zero behavioral consumer until V5-9 lands); `MulThresholdProfile` lives in `lance-graph-contract`; `AdaWorldAPI/OGIT` is extension-fork-only — never PR back to `almatoai/OGIT`. +- **v1 Pillar 0 (the holy-grail click):** `OntologyRegistry` IS the SoA; per-domain schema IS the DTO + name→row index. Bridges hold `LazyLock<&OntologyRegistry>`, project columns through scoped views. +- **v1 Pillar 2 (Zone 1/2/3 BBB tightening):** Zone 3 is the only outbound emission point. `serde::Serialize` is **denied on Zone 1 / Zone 2 types** via `cert-officer` static check (D-CASCADE-V1-1). +- **v1 codec cascade per row** (target state — NOT YET WIRED, see Deferred): identity `Vsa16kF32` (64 KB) → CAM-PQ `[u8; 6]` → Base17 `[u8; 34]` → palette key `u32` → Scent `u8` + qualia `[f32; 18]` + meta `MetaWord` + edge `CausalEdge64`. Every step `O(1)`. +- **v1 `ontology_context_id: u32` per named graph** (D-CASCADE-V1-2; consistent with `lance-graph-rdf-fma-snomed-v1` §Core). +- **v1 BioPortal arsenal scope:** 10 namespace stubs under `OGIT/NTO/Medical/{ICD10CM, RxNorm, LOINC, FMA, RadLex, SNOMED, MONDO, HPO, DRON, CHEBI}/`. Full ingestion gated on `lance-graph-rdf-fma-snomed-v1`. + +**Deferred (immutable parks):** +- All 30 D-* code implementations across both plans (D-ONTO-V5-1..15 + D-CASCADE-V1-1..15). +- **Codec cascade column population in `OntologyRegistry`** — current state has NO `cam_pq_code`/`base17`/`palette_key`/`scent` columns; uses `(bridge_id, public_name)` tuples + `ogit_uri` hashing for indexing (per agent audit, `registry.rs:33-86`). D-CASCADE-V1-7 is the wiring deliverable. +- Full SNOMED CT, DRON, CHEBI imports (license / size-payoff gated). +- bgz-tensor attention layer integration with codec cascade (orthogonal). +- n8n-rs / crewai-rust consumption of new SoA columns (separate plan). +- **Thinking-style OGIT mapping** — user request 2026-05-07; queued as v2 follow-on. +- TRUST-1 / FLOW-1 / COMPASS-1 / PARSER-1 ledger rows — explicit deferrals. + +**Docs:** +- `.claude/plans/lance-graph-ontology-v5.md` — v5 plan with §7 self-bootstrapping prompt. +- `.claude/plans/ogit-cascade-supabase-callcenter-v1.md` — v1 cascade plan with §"Self-bootstrapping prompt" + cross-reference table. + +--- + ## splat-osint-ingestion: SPLAT-1 stage 0->1 + EWA OSINT bridge (2026-05-06) **Confidence (2026-05-06):** high (math certified by Pillar 6 — PR #289 EWA-Sandwich PSD-preserving 10 000/10 000 hops; PR #286 Koestenberger-Stark 1.467x tightness; PR #287 Dueker-Zoubouloglou Hilbert-CLT). **Status:** In PR (branch `claude/splat-osint-ingestion`). diff --git a/.claude/knowledge/soa-dto-dependency-ledger.md b/.claude/knowledge/soa-dto-dependency-ledger.md new file mode 100644 index 00000000..d577856c --- /dev/null +++ b/.claude/knowledge/soa-dto-dependency-ledger.md @@ -0,0 +1,234 @@ +# SoA DTO Dependency Ledger — entropy table + +> **READ BY:** integration-lead, truth-architect, bus-compiler, host-glove-designer, palette-engineer, cert-officer, family-codec-smith, callcenter-specialist. +> **APPEND-ONLY.** Newest entries prepend. Status (CONJECTURE / FINDING / OPEN) per row IS updatable; everything else is immutable history. +> **First authored:** 2026-05-07 (immediately after PR #352 merge, paired with `palantir-parity-cascade-v2.md`). +> **Maintenance contract:** every PR that adds a `*Dto` / `*Row` / `*Intent` / `*Event` / `*Filter` / `*Step` / `*Slot` type prepends a row here. CI gate `tools/dto-class-check` (planned D-PARITY-V2-10) enforces. + +## Why this ledger exists + +The 2026-05-07 audit found 22+ DTO types across the workspace that admit three orthogonal classifications: + +1. **Tier** (where in the data ladder): sensor → engine → contract → callcenter (0 → 4). +2. **Classification** (structural shape): bare-metal vs SoA-glue vs bridge-projection. +3. **Zone** (BBB membrane position): Zone 1 (BindSpace SoA, no Serialize) / Zone 2 (Arrow scalar membrane) / Zone 3 (outbound serialization). + +These three axes determine **whether a type may carry `serde::Serialize`**, **which crate it belongs in**, and **whether it composes through the codec cascade or routes around it**. Classifying every DTO once prevents the recurring "should this be a struct, an enum, or a column projection" rediscovery tax. + +## Definitions + +- **Bare-metal DTO** — single-row scalar payload, no batch column structure. May serialize. Examples: `CognitiveEventRow`, `ExternalIntent`, `BusDto`. +- **SoA-glue DTO** — projects column slices over many rows; used for batch operations, compose chains, semiring composition. MUST NOT serialize. Examples: `UnifiedStep`, `ResonanceDto`, `TekamoloSlots`. +- **Bridge-projection DTO** — `LazyLock<&Registry>` or trait-bounded scoped view over a canonical store. Owns no data; only references. Examples: `MedcareBridge`, `OntologyDto`. +- **Tier 0** = sensor / lens (raw input, codebook indices). +- **Tier 1** = engine compute (ripple field, energy distribution). +- **Tier 2** = engine commit (single resolved thought). +- **Tier 3** = lance-graph-contract (canonical zero-dep DTOs consumed by all crates). +- **Tier 4** = lance-graph-callcenter (membrane DTOs and Zone 3 transcode). +- **Zone 1** = inside BBB; only `cognitive-shader-driver` BindSpace + `thinking-engine` ResonanceDto. +- **Zone 2** = `lance-graph-callcenter::lance_membrane`, BBB-scalar-only Arrow projection. +- **Zone 3** = `lance-graph-callcenter::transcode/`, `phoenix`, `postgrest`, `drain`, `supabase` — Serialize allowed. + +## The ladder (canonical flow) + +``` +Tier 0 StreamDto (codebook_indices: Vec, timestamp: u64) + thinking-engine::dto.rs:40 bare-metal · Zone 1 + │ + ▼ engine.compute(stream) +Tier 1 ResonanceDto (energy: Vec, top_k: [(u16, f32); 8]) + thinking-engine::dto.rs:59 SoA-glue · Zone 1 + │ (this IS the SoA — not a glue layer; the substrate) + ▼ engine.commit(resonance) +Tier 2 BusDto (codebook_index: u16, energy: f32, top_k: [(u16, f32); 8]) + thinking-engine::dto.rs:115 bare-metal · Zone 1 + │ + ▼ ShaderDispatch.encode(BusDto) — see engine_bridge.rs:6,37,80,121 +Tier 3 ShaderDispatch / ShaderResonance / ShaderBus / ShaderCrystal + lance-graph-contract::cognitive_shader bare-metal · Zone 1 + UnifiedStep (depends_on: Vec, status, …) SoA-glue · Zone 1 + TekamoloSlots (4 role-slice pairs) SoA-glue · Zone 1 + SlotPrior (5×f32 axes) SoA-glue · Zone 1 + WorldModelDto (qualia + axes + proprioception + cycle) SoA-glue · Zone 1 + ShaderEvent (cycle, free_energy, resolution, style) bare-metal · Zone 1 + StepResult (style, mode, reason, free_will, step) bare-metal · Zone 1 + MetaFilter (thinking_mask, awareness_min, 3×u8) bare-metal · Zone 1 + CommitFilter (actor_id, max_free_energy, …) bare-metal · Zone 2 + WorldMapDto (state_vector[11], anchor, distance) bridge-projection · Zone 1 + │ + ▼ LanceMembrane.project() +Tier 4 CognitiveEventRow (15 scalar fields, repr(C)-style) bare-metal · Zone 2 + ← BBB invariant: scalar-only enforced + ExternalIntent (role, dn, body, routing, kind) bare-metal · Zone 2 + OntologyDto (entity_types + link_types + action_types) + bridge-projection · Zone 3 + EntityTypeDto / PropertyDto / LinkTypeDto / ActionTypeDto bridge-projection · Zone 3 + Filter (postgrest) (5+ predicate terms) SoA-glue · Zone 3 + FilterTerm (spo_filter) SoA-glue · Zone 3 + DriftEvent (parallelbetrieb event) bridge-projection · Zone 3 + RowEncryptionPolicy / RowEncryptionRegistry bare-metal · Zone 3 + │ + ▼ Zone 3 transcode (phoenix WS / postgrest / supabase REST) +External payload JSON-LD / Arrow RecordBatch / Phoenix channel msg +``` + +## Per-DTO entropy table + +> Schema: `Tier · Crate · File · Line · Type · Classification · Zone · Has Serialize? · Has repr(C)? · Status`. Status is the only mutable column. + +| Tier | Crate | File | Line | Type | Class | Zone | Serialize | repr(C) | Status (2026-05-07) | +|---|---|---|---|---|---|---|---|---|---| +| 0 | thinking-engine | dto.rs | 40 | `StreamDto` | bare-metal | 1 | No | No | FINDING | +| 1 | thinking-engine | dto.rs | 59 | `ResonanceDto` | SoA-glue | 1 | No | No | FINDING (this IS the SoA) | +| 2 | thinking-engine | dto.rs | 115 | `BusDto` | bare-metal | 1 | No | No | FINDING | +| 3 | lance-graph-contract | cognitive_shader.rs | * | `ShaderDispatch` | bare-metal | 1 | No | No | FINDING | +| 3 | lance-graph-contract | cognitive_shader.rs | * | `ShaderResonance` | bare-metal | 1 | No | No | FINDING | +| 3 | lance-graph-contract | cognitive_shader.rs | * | `ShaderBus` | bare-metal | 1 | No | No | FINDING | +| 3 | lance-graph-contract | cognitive_shader.rs | * | `ShaderCrystal` | bare-metal | 1 | No | No | FINDING | +| 3 | lance-graph-contract | cognitive_shader.rs | 81 | `MetaFilter` | bare-metal | 1 | No | No | FINDING | +| 3 | lance-graph-contract | orchestration.rs | 333 | `UnifiedStep` | SoA-glue | 1 | No | No | FINDING | +| 3 | lance-graph-contract | sensorium.rs | 145 | `StepResult` | bare-metal | 1 | No | No | FINDING | +| 3 | lance-graph-contract | world_model.rs | 165 | `WorldModelDto` | SoA-glue | 1 | No | No | FINDING | +| 3 | lance-graph-contract | world_map.rs | 43 | `WorldMapDto` | bridge-projection | 1 | No | No | OPEN — classification needs explicit confirmation in registry projection layer | +| 3 | lance-graph-contract | graph_render.rs | 248 | `ShaderEvent` | bare-metal | 1 | No | No | FINDING | +| 3 | lance-graph-contract | grammar/tekamolo.rs | 18 | `TekamoloSlots` | SoA-glue | 1 | No | No | FINDING | +| 3 | lance-graph-contract | grammar/verb_table.rs | 83 | `SlotPrior` | SoA-glue | 1 | No | No | FINDING | +| 3 | lance-graph-contract | grammar/verb_table.rs | 123 | `SlotPriorDelta` | SoA-glue | 1 | No | No | FINDING | +| 3 | lance-graph-contract | external_membrane.rs | 75 | `CommitFilter` | bare-metal | 2 | No | No | FINDING — Zone 2 boundary type | +| 4 | lance-graph-callcenter | external_intent.rs | 33 | `ExternalIntent` | bare-metal | 2 | No | No | FINDING | +| 4 | lance-graph-callcenter | external_intent.rs | 111 | `CognitiveEventRow` | bare-metal | 2 | No | No | FINDING — `bbb_scalar_only_compile_check` enforces | +| 4 | lance-graph-callcenter | ontology_dto.rs | 19 | `OntologyDto` | bridge-projection | 3 | No | No | OPEN — Pillar 3 of v1 cascade collapses this to a 2-line projection over `OntologyRegistry::enumerate(ns)` | +| 4 | lance-graph-callcenter | ontology_dto.rs | 29 | `EntityTypeDto` | bridge-projection | 3 | No | No | FINDING | +| 4 | lance-graph-callcenter | ontology_dto.rs | 38 | `PropertyDto` | bridge-projection | 3 | No | No | FINDING | +| 4 | lance-graph-callcenter | ontology_dto.rs | 46 | `LinkTypeDto` | bridge-projection | 3 | No | No | FINDING | +| 4 | lance-graph-callcenter | ontology_dto.rs | 54 | `ActionTypeDto` | bridge-projection | 3 | No | No | FINDING | +| 4 | lance-graph-callcenter | postgrest.rs | 138 | `Filter` | SoA-glue | 3 | No | No | FINDING | +| 4 | lance-graph-callcenter | transcode/spo_filter.rs | 34 | `FilterTerm` | SoA-glue | 3 | No | No | FINDING | +| 4 | lance-graph-callcenter | transcode/parallelbetrieb.rs | 109 | `DriftEvent` | bridge-projection | 3 | No | No | OPEN — borderline; could be re-classified bare-metal | +| 4 | lance-graph-callcenter | policy.rs | 353 | `RowEncryptionPolicy` | bare-metal | 3 | No | No | FINDING | +| 4 | lance-graph-callcenter | policy.rs | 365 | `RowEncryptionRegistry` | bare-metal | 3 | No | No | FINDING | + +**Counts** (FINDING-grade as of 2026-05-07): 22 classified, 3 OPEN (`WorldMapDto` projection-layer confirmation, `OntologyDto` collapse target, `DriftEvent` ambiguity), 0 CONJECTURE. + +## Internal vs external O(1) mapping (per the user's framing) + +### Internal O(1) — cognitive-shader-driver, no Serialize, in-memory + +``` +ThinkingEngine.commit() returns BusDto (bare-metal, Tier 2, Zone 1) + │ + │ ShaderDispatch.encode(BusDto): + │ ├── BindSpace.write_cycle_fingerprint([u64; 256]) + │ │ converts to Vsa16kF32 internally + │ ├── CollapseGate.merge(MergeMode::Bundle | Xor) + │ ├── CAM-PQ encode → cam_pq_code: [u8; 6] (column read O(1)) + │ ├── bgz17 encode → base17: [u8; 34] (column read O(1)) + │ ├── PaletteSemiring → palette_key: u32 (column read O(1)) + │ └── Scent compute → scent: u8 (column read O(1)) + ▼ +TripletGraph (AriGraph) write + │ SpoBridge::promote_to_spo (v5 D-2, queued) + ▼ +CausalEdge64 column update (Pearl 2³ mask, per-row) +``` + +**Every step is a method on the carrier.** Zero DTO indirection. The codec cascade columns live in the SAME `BindSpace` SoA address space as Columns A..H (per `EPIPHANIES.md` 2026-04-26). A SIMD sweep can read all of them without indirection, which is why the Pillar 0 click works. + +### External O(1) — lance-graph-callcenter, Zone 3, Serialize allowed + +``` +LanceVersionWatcher.bump(CognitiveEventRow) (bare-metal, Zone 2) + │ + ▼ LanceMembrane.subscribe(CommitFilter) → watch::Receiver + │ + ▼ Zone 2 → Zone 3 fan-out + │ + ├── transcode/phoenix.rs → JSON-LD over WebSocket + ├── transcode/postgrest.rs → Arrow RecordBatch over HTTP + └── transcode/supabase.rs → Cypher → SPARQL CONSTRUCT → JSON-LD over Realtime + (D-CASCADE-V1-10) +``` + +**The path is one-way; an inbound message reverses it**: Supabase → SemanticQuad → SPO → CollapseGate → BindSpace (D-CASCADE-V1-9 wires this). + +## Encoding cascade column status (FINDING from 2026-05-07 audit) + +`OntologyRegistry` (`registry.rs:33-86`, `proposal.rs:81-96 MappingRow`) carries: + +| Column | Status | +|---|---| +| `bridge_id`, `public_name`, `ogit_uri` | FINDING — used as primary key tuple | +| `namespace_id: NamespaceId` | FINDING | +| `schema_ptr: SchemaPtr` | FINDING | +| `kind: SchemaKind` | FINDING | +| `semantic_type: SemanticType` | FINDING | +| `marking: Marking` | FINDING | +| `confidence: f32` | FINDING | +| `created_at_us: i64` + `created_by: String` | FINDING | +| `source_uri: String` | FINDING (carries v5 D-1 dcterms:source target) | +| `active: bool` | FINDING | +| `checksum: String` | FINDING | +| `identity_fp: Vsa16kF32` | OPEN — D-CASCADE-V1-7 wires | +| `cam_pq_code: [u8; 6]` | OPEN — D-CASCADE-V1-7 wires | +| `base17: [u8; 34]` | OPEN — D-CASCADE-V1-7 wires | +| `palette_key: u32` | OPEN — D-CASCADE-V1-7 wires | +| `scent: u8` | OPEN — D-CASCADE-V1-7 wires | +| `qualia: [f32; 18]` | OPEN — D-CASCADE-V1-7 wires | +| `meta: MetaWord` | OPEN — D-CASCADE-V1-7 wires | +| `edge: CausalEdge64` | OPEN — D-CASCADE-V1-7 wires | +| `thinking_style: Option` | OPEN — D-PARITY-V2-12 wires | +| `ontology_context_id: u32` | OPEN — D-CASCADE-V1-2 wires | + +**Today the registry uses `(bridge_id, public_name)` tuples + `ogit_uri` hashing** for indexing (per agent audit, no codec cascade columns). The codec cascade is target state, NOT current state. This ledger row is the canonical place to track that gap. + +## Bare-metal vs SoA-glue decision matrix + +When designing a new DTO, ask in order: + +1. **Does it project column slices over many rows?** → SoA-glue. MUST NOT carry `serde::Serialize`. Examples: `UnifiedStep.depends_on: Vec`, `ResonanceDto.energy: Vec`, `TekamoloSlots` (4 role-slice pairs). +2. **Is it a single-row scalar payload that may exit the BBB?** → bare-metal. May carry `serde::Serialize` IF and only IF it lives in Zone 3. Examples: `CognitiveEventRow` (Zone 2 — no Serialize), `OntologyDto`'s leaf types (Zone 3 — Serialize allowed when wire emit is added). +3. **Is it a `LazyLock<&Registry>` reference + a name→row map?** → bridge-projection. MUST own no data. Examples: `MedcareBridge`, `WoaBridge`, `OntologyDto` (after Pillar 3 collapse). +4. **None of the above?** → AMBIGUOUS — flag for explicit classification in a new ledger row before merging. + +## Probe queue (CONJECTURE-grade until probed) + +| Probe | What to measure | Pass criterion | Status | +|---|---|---|---| +| O(1) lookup latency | `name → cam_pq_code` p99 vs raw oxigraph SPARQL p99 | ≥ 100× speedup | OPEN — D-CASCADE-V1-11 | +| `Serialize` static check | `cert-officer` parses every Zone 1 / Zone 2 type and asserts no `#[derive(Serialize)]` | zero Zone 1 / Zone 2 types with Serialize | OPEN — D-CASCADE-V1-1 | +| DTO classification CI | `tools/dto-class-check` parses every `*Dto` / `*Row` / `*Filter` and asserts a `// classification:` doc comment | 100% coverage | OPEN — D-PARITY-V2-10 | +| BusDto round-trip | `BusDto → ShaderDispatch.encode → BindSpace → ShaderResonance.unbind → BusDto` is identity | bit-exact identity | OPEN — D-PARITY-V2-3 | +| Codec cascade column SoA layout | `cargo asm` confirms a SIMD sweep over `OntologyRegistry` rows reads `cam_pq_code` + `base17` + `palette_key` from contiguous memory | one cache line per row group | OPEN — D-CASCADE-V1-7 | + +## Open questions + +1. **`WorldMapDto` re-classification**: currently bridge-projection because its state vector is computed from a classifier-backed lookup. Should it be SoA-glue (state vector IS a column) or bare-metal (single-row classifier output)? **Probe**: read its construction site (`world_map.rs:43-` + classifier wire-up). +2. **`DriftEvent` re-classification**: parallelbetrieb event, structurally a single-row payload but emitted by a bridge. Probe its consumers. +3. **`OntologyDto` collapse target**: after Pillar 3 of v1 cascade lands, `OntologyDto` becomes a 2-line projection. The leaf types (`EntityTypeDto`, `PropertyDto`, `LinkTypeDto`, `ActionTypeDto`) stay as bridge-projections. Is that the right split, or should the leaves disappear too? **Recommend keep leaves** for type safety at the wire boundary. +4. **Should `MetaFilter` and `CommitFilter` merge?** Both are predicate gates; one is Zone 1 (cognitive_shader.rs:81), the other is Zone 2 (external_membrane.rs:75). The Zone boundary justifies the split today; revisit if a Zone 2 type ever needs the cognitive filter shape. +5. **How do `CrystalFingerprint` variants (`Binary16K`, `Vsa16kF32`, `Vsa16kBF16`, `Vsa16kF16`, `Vsa16kI8`) relate to this ledger?** Strictly speaking they're carriers, not DTOs — but they appear in `CognitiveEventRow` as `cycle_fp_hi` / `cycle_fp_lo` `u64` fields. **Recommend: carriers do NOT appear in the ledger; only types ending in Dto/Row/Intent/Event/Filter/Step/Slot do**. + +## Cross-references + +- `.claude/plans/palantir-parity-cascade-v2.md` — the v2 capstone plan; this ledger ships with it. +- `.claude/plans/ogit-cascade-supabase-callcenter-v1.md` — Pillar 0 SoA-as-canon; codec cascade columns (D-CASCADE-V1-7). +- `.claude/plans/lance-graph-ontology-v5.md` — D-9 thresholds, D-2 SpoBridge. +- `.claude/plans/callcenter-membrane-v1.md` § 10.9 — Membrane Role Place Translation iron rule (parent doctrine). +- `crates/thinking-engine/src/dto.rs` — `StreamDto`, `ResonanceDto`, `BusDto` definitions. +- `crates/cognitive-shader-driver/src/engine_bridge.rs` — `BusDto` consumption point (Tier 2 → Tier 3). +- `crates/lance-graph-contract/src/orchestration.rs` — `UnifiedStep` (Tier 3 SoA-glue). +- `crates/lance-graph-callcenter/src/external_intent.rs` — `CognitiveEventRow` (Tier 4 BBB-scalar). +- `crates/lance-graph-callcenter/src/ontology_dto.rs` — `OntologyDto` family (Tier 4 bridge-projection). +- `crates/lance-graph-ontology/src/registry.rs` — `OntologyRegistry` SoA target (Pillar 0 anchor). +- `.claude/board/EPIPHANIES.md` 2026-04-26 — BindSpace 8-column extension for Foundry parity. +- `.claude/board/SINGLE_BINARY_TOPOLOGY.md` — Layer 2 ecosystem ontology. + +## Maintenance protocol + +1. **PR adds a new `*Dto`/`*Row`/`*Intent`/`*Event`/`*Filter`/`*Step`/`*Slot` type** → prepend a row to "Per-DTO entropy table" with the exact file:line + classification + zone + Status (CONJECTURE if unverified, FINDING if probed). +2. **PR re-classifies an existing type** → append a `**Reclassified (YYYY-MM-DD from PR #N):**` line under the existing row; do not edit the original Status. +3. **PR closes an OPEN status** → flip the Status column to FINDING and append a one-line note with the closing PR. +4. **PR introduces a new probe** → add a row to "Probe queue" with pass criterion; do not delete probe rows (keep the queue auditable). +5. **CI gate `tools/dto-class-check`** (D-PARITY-V2-10) parses every classified type and confirms its `// classification:` doc comment matches the ledger row. + +This ledger is the single source of truth for DTO classification across the workspace. Disagreements between code, plan, and ledger are resolved by **updating the ledger AND the code in the same PR**. diff --git a/.claude/plans/palantir-parity-cascade-v2.md b/.claude/plans/palantir-parity-cascade-v2.md new file mode 100644 index 00000000..6b3682a1 --- /dev/null +++ b/.claude/plans/palantir-parity-cascade-v2.md @@ -0,0 +1,307 @@ +# Palantir Parity · Cascade · DTO Ladder — v2 + +> **Status:** plan, not implementation. +> **Authored:** 2026-05-07 (immediately after PR #352 merge). +> **Owner crates:** `lance-graph`, `lance-graph-contract`, `lance-graph-callcenter`, `lance-graph-ontology`, `cognitive-shader-driver`, `thinking-engine`, `q2`, `crewai-rust`. +> **Depends on:** `ogit-cascade-supabase-callcenter-v1` (Pillar 0 SoA-as-canon), `lance-graph-ontology-v5` (D-9 thresholds, D-2 SpoBridge), `q2-foundry-integration-v1`, `lf-integration-mapping-v1`, `foundry-consumer-parity-v1`, `medcare-foundry-vision.md`. +> **Carry-over:** prior 4 Foundry parity docs are NOT superseded. v2 is the **integration capstone** that ties them together with v1 cascade's SoA pillar and the newly-located DTO ladder (`StreamDto`, `ResonanceDto`, `BusDto` — all in `thinking-engine::dto.rs`, upstream of contract). + +## Why v2 exists + +The Foundry/Gotham parity surface is already extensively mapped — 5+ documents, 41 LF + 4 W chunks, PR #272 already shipped Column H (`EntityTypeId = u16` per-row Foundry Object Type bridge). What's missing is **a single capstone** that: + +1. Reconciles the prior 4 parity docs (Q2 cockpit + LF integration mapping + foundry consumer parity + MedCare Foundry vision) with v1 cascade's SoA-as-canon click. +2. Maps the **DTO ladder** — `StreamDto` → `ResonanceDto` → `BusDto` → contract DTOs → callcenter DTOs — onto Foundry primitives (Object, Pipeline, Function, ObjectView, Notification). +3. Surfaces the **Business Logic ↔ Thinking-style ↔ OGIT** triangle the user named: each Foundry "Function" maps to a `ThinkingStyle` dispatch + an OGIT verb. +4. Lists the deliverables that close gaps the prior docs left open (LF-12 Pipeline DAG, LF-20 FunctionSpec, LF-22/23 ObjectView, LF-50 ModelRegistry). + +## Pillar 0 carry-forward — Foundry parity IS SoA-as-canon parity + +The v1 cascade's Pillar 0 (`OntologyRegistry` IS the SoA; schema IS the DTO + index) already provides every Foundry primitive the parity docs targeted, **without a separate object/pipeline/function table per primitive**: + +| Foundry primitive | Our equivalent | Where it lives | +|---|---|---| +| **Object** (per-row entity with type) | SoA row + Column H `EntityTypeId: u16` | `cognitive-shader-driver::BindSpace.entity_type` (PR #272 SHIPPED) | +| **Object Type** (schema for a class) | OGIT TTL entity declaration | `OGIT/NTO//entities/*.ttl` (v4 + v5 work) | +| **Pipeline Builder** (DAG of transforms) | `UnifiedStep.depends_on: Vec` | `lance-graph-contract::orchestration::UnifiedStep` (LF-12 QUEUED) | +| **Function** (named transform) | `ThinkingStyle` dispatch + `FunctionSpec` row | `lance-graph-contract::thinking` (36 styles) + LF-20 (QUEUED) | +| **Object Explorer** (UI property scrolling) | Q2 Object Explorer with PrefetchDepth L0→L3 | `q2-foundry-integration-v1.md` Q2-1.2 (QUEUED) | +| **Cypher / Workshop console** | Q2 Cypher Console (polyglot) | Q2-2.x (QUEUED) | +| **ObjectView** (card / detail / summary) | `Schema::ObjectView` + `NotificationSpec` | LF-22/23 (QUEUED) | +| **Model Registry** (ML deployment surface) | `lance-graph-models` crate (planned) | LF-50/52 (QUEUED) | +| **Helix** (time-series histogram) | NARS `(frequency, confidence)` per triple + `CausalEdge64` Pearl 2³ mask | NOT replicated — architecturally novel; Vertex has zero causal typing | +| **Code Workbook** (notebook surface) | `lance-graph-python` + Jupyter (existing) | `crates/lance-graph-python/` | +| **Action** (state-mutating call) | `ExternalIntent` → `UnifiedStep` → BindSpace write | `lance-graph-callcenter::external_intent` | +| **Foundry Function (Compute Module)** | `crewai-rust` agent + `n8n-rs` workflow | sibling repos via `lance-graph-contract` | + +**Click**: there is no separate "Foundry Object table" — there is a `BindSpace` SoA row whose Column H gives it a Foundry-equivalent type tag. The whole architectural distance between Foundry and our stack is *which primitive owns the row*. Foundry says "an Object row in the Ontology table". We say "a row in the canonical SoA, with its EntityTypeId column = ontology link". Same outcome, our structure is one-fewer-layer-deep. + +## The 8 column map (extended with codec cascade) + +Per `EPIPHANIES.md` 2026-04-26 (Foundry parity discussion) the BindSpace already carries 8 columns A–H. v1 cascade's codec cascade extends **inside** Column H's per-row state, not as new columns: + +| Col | Name | Type | Foundry primitive | Codec cascade row state | +|---|---|---|---|---| +| A | Entity | row id | Object | (this row's address) | +| B | Content | `Box<[u64; 256]>` | Property values | shadow of inner content | +| C | Cycle | `Box<[f32]>` (Vsa16kF32, 64 KB) | — | identity fingerprint | +| D | Topic | `Box<[u64]>` | Object discussion topic | bundled context | +| E | Angle | `Box<[u64]>` | Object viewing-angle / persona | dispatched perspective | +| F | OntologyDelta | per-row CRDT | Branch / scenario diff | Foundry Scenario equivalent | +| G | Awareness | per-row pressure | Object access metadata | DK + flow + compass | +| **H** | **EntityType** | `EntityTypeId: u16` | **Foundry Object Type** | **opaque link to OGIT row** | + +**v2 extension** — the codec cascade per H-row (one per OntologyRegistry entry): + +| Sub-column | Type | Bytes | Foundry analog | +|---|---|---|---| +| `identity_fp` | `Vsa16kF32` | 64 KB | Object embedding | +| `cam_pq_code` | `[u8; 6]` | 6 | k-NN search index | +| `base17` | `[u8; 34]` | 34 | bgz17 archetype | +| `palette_key` | `u32` | 4 | PaletteSemiring composition handle | +| `scent` | `u8` | 1 | final scent tier | +| `qualia` | `[f32; 18]` | 72 | NARS truth + DK + flow + compass | +| `meta` | `MetaWord` | 8 | dispatch bits + dcterms:source pointer | +| `edge` | `CausalEdge64` | 8 | Pearl 2³ causal mask (Foundry has none) | + +**Foundry parity differentiator**: every row's Pearl 2³ mask is a **causal type tag** Foundry/Vertex don't have. Our `Helix`-equivalent isn't a histogram of *time*; it's a histogram of *causal masks across time* — strictly more expressive. + +## DTO ladder — the bare-metal vs SoA-glue split + +The DTO inventory (per the 2026-05-07 audit) found `StreamDto` / `ResonanceDto` / `BusDto` in `thinking-engine::dto.rs` (NOT in lance-graph-contract). The ladder runs across four tiers: + +``` +Tier 0 sensor / lens StreamDto (codebook indices, bare-metal) + │ + ▼ +Tier 1 thinking-engine compute ResonanceDto (4096 ripple energies, SoA-glue) + │ ← this is where the SoA actually is + ▼ +Tier 2 thinking-engine commit BusDto (single committed thought, bare-metal) + │ + ▼ +Tier 3 lance-graph-contract UnifiedStep (DAG vector, SoA-glue) + ShaderEvent (single render output, bare-metal) + StepResult (single decision, bare-metal) + TekamoloSlots (4 role-slice pairs, SoA-glue) + │ + ▼ +Tier 4 lance-graph-callcenter OntologyDto (entity + link + action vectors, bridge-projection) + CognitiveEventRow (15 scalar fields, bare-metal — BBB-scalar-only) + ExternalIntent (gate-crossing, bare-metal) + CommitFilter (fanout predicate, bare-metal) +``` + +**Bare-metal DTO** = single-row scalar payload, no batch column structure, eagerly serialized at Zone 3 (or never). 9 instances across crates. + +**SoA-glue DTO** = projects column slices over many rows, used for batch operations or compose chains. 7 instances. **`ResonanceDto.energy: Vec` over 4096 codebook entries IS the SoA — not a glue layer; it's the substrate.** + +**Bridge-projection DTO** = `LazyLock<&Registry>` or trait-bounded view over a canonical store. 6 instances (3 clear, 3 ambiguous — flagged in the ledger). + +**The classification matters because**: +- Bare-metal DTOs may carry `serde::Serialize` if (and only if) they live in Zone 3. +- SoA-glue DTOs MUST NOT carry `serde::Serialize` — they project columns; serializing the projection breaks the SIMD sweep. +- Bridge-projection DTOs MUST NOT own data — only `LazyLock<&Registry>` references. + +## Internal vs external O(1) mappings + +Per the user's framing — two distinct surfaces: + +### Internal (cognitive-shader-driver, in-memory, no Serialize) + +``` +ThinkingEngine.commit() → BusDto + │ + ▼ +ShaderDispatch.encode(BusDto) + │ + ├── BindSpace SoA write (Column A, B, C, D, E, F, G, H) + ├── CollapseGate.merge (MergeMode::Bundle | MergeMode::Xor) + ├── CAM-PQ encode (DistanceTableProvider) + ├── bgz17 encode (Base17) + ├── palette key compute (PaletteSemiring) + └── Scent compute (final cascade tier) + │ + ▼ +TripletGraph (AriGraph) write → SpoBridge::promote_to_spo (v5 D-2) + │ + ▼ +CausalEdge64 column update (per-row Pearl 2³ mask) +``` + +**No DTO crosses this path eagerly.** Every step is a method on the carrier. `BindSpace.write_cycle_fingerprint(&[u64; 256])` is the canonical entry point; it converts internally to `Vsa16kF32`. The codec cascade columns live in the SAME address space as `Column A..H`, so a SIMD sweep can read all of them without indirection. + +### External (lance-graph-callcenter, Zone 3, Serialize allowed) + +``` +LanceVersionWatcher.bump(CognitiveEventRow) ← Zone 2 fans out + │ + ▼ +LanceMembrane.subscribe(CommitFilter) → watch::Receiver + │ + ▼ +Zone 3 transcode/{phoenix, postgrest, supabase}.rs + ├── CognitiveEventRow → JSON-LD (Phoenix WS payload) + ├── CognitiveEventRow → Arrow RecordBatch (PostgREST) + └── CognitiveEventRow → Supabase realtime payload (Cypher → SPARQL CONSTRUCT → JSON-LD) + │ + ▼ +External consumer (browser, agent, n8n flow, crewai task) +``` + +**Every external DTO crosses Zone 2's BBB membrane as Arrow scalar columns first** (`bbb_scalar_only_compile_check`), then becomes a Serialize-derived shape ONLY in Zone 3. The path is one-way; an inbound message reverses it (Supabase → SemanticQuad → SPO → CollapseGate → BindSpace). + +## Business Logic ↔ Thinking-style ↔ OGIT (the third triangle) + +The user's ask: *"the Business Logic needs some Thinking style OGIT mapping later"*. The shape is a triangle, not a chain. Each business operation has three faces: + +``` + Thinking style + (lance-graph-contract::thinking, 36 styles) + ▲ + │ + │ dispatches + │ + Business operation ──┼── OGIT verb + (industry case) │ (OGIT/NTO//verbs/*.ttl) + │ + │ describes + │ + ▼ + OGIT entity + (OGIT/NTO//entities/*.ttl) +``` + +Example: `WorkOrder::Issue` is an operation. It dispatches `ThinkingStyle::PracticalCommit` (the cluster that commits transactional facts). It maps to the OGIT verb `Issued` (Customer→Order). Its arguments are OGIT entities (`Customer`, `Order`, `Position`). + +v2 introduces this triangle as an **append-only knowledge artifact**, not as a new schema column. Each business operation gets one row in `.claude/knowledge/business-thinking-ogit-triangle.md` (NEW, deliverable D-PARITY-V2-9 below) carrying `(operation_name, thinking_style, ogit_verb, ogit_entities[])`. + +The crewai-rust + n8n-rs consumers read this knowledge file as a routing table; the lance-graph-planner consults it when picking a strategy. + +## Deliverables (15 total, ranked by leverage / cost) + +| Rank | D-id | Scope | LOC | Owner crate / file | +|---|---|---|---|---| +| 1 | **D-PARITY-V2-1** | Knowledge doc: `soa-dto-dependency-ledger.md` (the entropy ledger; this v2 plan ships it) | ~250 | `.claude/knowledge/` | +| 2 | **D-PARITY-V2-2** | Knowledge doc: `business-thinking-ogit-triangle.md` (operation → style → verb → entities routing) | ~150 | `.claude/knowledge/` | +| 3 | **D-PARITY-V2-3** | Wire `cognitive-shader-driver::engine_bridge` to consume `BusDto` directly (close the StreamDto → ResonanceDto → BusDto → ShaderDispatch path) | ~200 | `cognitive-shader-driver::engine_bridge` | +| 4 | **D-PARITY-V2-4** | LF-22/23: `Schema::ObjectView` + `NotificationSpec` in `lance-graph-contract` | ~180 | `lance-graph-contract::ontology` | +| 5 | **D-PARITY-V2-5** | LF-20: `FunctionSpec { name, signature, body, thinking_style: ThinkingStyle }` in `lance-graph-contract` | ~150 | `lance-graph-contract::function` (new module) | +| 6 | **D-PARITY-V2-6** | LF-12: wire `UnifiedStep.depends_on` resolution into `OrchestrationBridge::route()` (Pipeline DAG hot path) | ~250 | `lance-graph-contract::orchestration` | +| 7 | **D-PARITY-V2-7** | Q2-1.2: Object Explorer property scrolling at PrefetchDepth L0→L3, consuming `OntologyDto` projection | ~400 | `q2/src/ui/explorer.rs` (cross-repo) | +| 8 | **D-PARITY-V2-8** | LF-50/52: scaffold `lance-graph-models` crate (ModelRegistry, LlmProvider trait, deployment manifest) | ~300 | `crates/lance-graph-models/` (new) | +| 9 | **D-PARITY-V2-9** | Populate first 12 rows of `business-thinking-ogit-triangle.md` (one per WorkOrder operation in v4 OGIT TTL emit) | ~12 entries × ~5 lines | `.claude/knowledge/business-thinking-ogit-triangle.md` | +| 10 | **D-PARITY-V2-10** | DTO classification CI check: `cargo metadata` + `syn` parse asserts every `*Dto`/`*Row`/`*Filter` type carries a `// classification: bare-metal | soa-glue | bridge-projection` doc comment | ~250 | `tools/dto-class-check/` (new bin) | +| 11 | **D-PARITY-V2-11** | Foundry parity test: assert that for every `Schema::ObjectView` we can render a Q2 cockpit panel without writing a single new endpoint (Wire DTOs are lab quarantine per PR #223) | ~300 | `q2/tests/parity.rs` | +| 12 | **D-PARITY-V2-12** | `OntologyRegistry::SchemaPtr` carries `thinking_style: Option` so per-entity dispatch is a column read | ~80 | `lance-graph-ontology::registry` (extends v5 D-9 surface) | +| 13 | **D-PARITY-V2-13** | bgz-tensor `AttentionSemiring` integration with codec cascade columns (composes over `palette_key`) | ~200 | `bgz-tensor::hhtl_cache` | +| 14 | **D-PARITY-V2-14** | Helix-equivalent: `CausalEdge64` time-series histogram operator in `lance-graph-planner` (Foundry-superseding causal histogram) | ~250 | `lance-graph-planner::physical` | +| 15 | **D-PARITY-V2-15** | End-to-end parity test: open a Q2 Object Explorer panel, click an entity, hit Function (`ThinkingStyle` dispatch), observe the Pipeline DAG (`UnifiedStep.depends_on`), see the result render through `Schema::ObjectView` — all without leaving the SoA | ~500 | `q2/tests/end_to_end_foundry_parity.rs` | + +## Dependencies (path graph) + +``` + v5 D-9 (MulThresholdProfile) + │ + ▼ + v1 D-CASCADE-V1-2 (SchemaPtr.context_id) + │ + ▼ + v1 D-CASCADE-V1-7 (codec cascade columns) + │ + ├──► v2 D-PARITY-V2-12 (SchemaPtr.thinking_style) + │ + ├──► v2 D-PARITY-V2-4 (Schema::ObjectView) + │ │ + │ ▼ + │ v2 D-PARITY-V2-7 (Q2 Object Explorer) + │ │ + │ ▼ + │ v2 D-PARITY-V2-11 (parity test) + │ + ├──► v2 D-PARITY-V2-5 (FunctionSpec) + │ │ + │ ▼ + │ v2 D-PARITY-V2-6 (Pipeline DAG resolver) + │ │ + │ ▼ + │ v2 D-PARITY-V2-15 (end-to-end test) + │ + └──► v2 D-PARITY-V2-13 (bgz-tensor cascade composition) + │ + ▼ + v2 D-PARITY-V2-14 (causal histogram operator) + + v2 D-PARITY-V2-1 (DTO ledger) ← independent, ships with this plan + v2 D-PARITY-V2-2 (triangle ledger) ← independent, ships with this plan + v2 D-PARITY-V2-3 (BusDto bridge) ← independent, only needs thinking-engine + v2 D-PARITY-V2-9 (12 triangle rows) ← needs V2-2 + v2 D-PARITY-V2-10 (CI class check) ← needs V2-1 + v2 D-PARITY-V2-8 (lance-graph-models) ← independent, scaffold only +``` + +## Acceptance criteria + +- [ ] `cargo test -p lance-graph-callcenter --features full` passes; `bbb_scalar_only_compile_check` still compiles. +- [ ] `tools/dto-class-check` (D-PARITY-V2-10) fails CI if any `*Dto`/`*Row`/`*Filter` type lacks a classification doc comment. +- [ ] Q2 parity panel (D-PARITY-V2-11) renders an `OntologyDto` projection without using any Wire DTO defined under `cognitive-shader-driver/src/wire.rs`. +- [ ] D-PARITY-V2-15 end-to-end test passes, asserting (via `cert-officer`) that no Zone 1 / Zone 2 type was reachable through `Serialize` during the round-trip. +- [ ] DTO ledger (D-PARITY-V2-1) classifies all 22+ DTOs found in the 2026-05-07 audit; new DTOs added by deliverables 4–8 above append rows. +- [ ] Triangle ledger (D-PARITY-V2-9) carries one row per WorkOrder operation in OGIT/NTO/WorkOrder/verbs/. +- [ ] No upstream PRs to `almatoai/OGIT` (per v5 ratification). + +## Out of v2 scope + +- **CRDT scenario branching** (Foundry's `Branch` and `MasterBranch`) — Column F already provides per-row OntologyDelta; surfacing it as a UI affordance is a v3 concern. +- **Foundry Marketplace / Compass** (data discovery surfaces) — adjacent UX; our equivalent is `OntologyRegistry::enumerate(namespace)` exposed via Q2. +- **Foundry Code Repositories** (managed git surface) — orthogonal; we use external git. +- **Vertex / Workshop** specific UI affordances — covered by the existing q2-foundry-integration-v1 plan; v2 does not extend Q2's UX scope. +- **Ontology import from Foundry export format** — speculative; the OGIT TTL surface is the canonical input. + +## Open questions + +1. **DTO ledger maintenance pattern**: append-only knowledge doc (current proposal) vs cargo-doc-generated (auto-extracted from `// classification:` doc comments)? **Recommend manual append + auto-validate via D-PARITY-V2-10**, so the ledger is human-curated but machine-verified. +2. **Triangle ledger scope**: just WorkOrder for v2 (12 rows), or also Healthcare and SMB (~50 rows)? **Recommend WorkOrder-only for v2**; expand in v3 once the pattern is proven. +3. **Q2 dependency direction**: should `q2` depend on `lance-graph-callcenter`, or only on `lance-graph-contract`? **Recommend contract-only** to preserve the lab-quarantine boundary; `q2` consumes `OntologyDto` via the contract surface. +4. **`thinking_style: Option` on `SchemaPtr`**: column on every row (D-PARITY-V2-12) vs lookup table keyed by `(namespace, public_name)`? **Recommend column** — makes the SoA sweep coherent; lookup table reintroduces indirection. +5. **bgz-tensor causal histogram** (D-PARITY-V2-14) — is this `lance-graph-planner::physical` territory or a new `lance-graph-helix` crate? **Recommend planner-physical** unless it grows past 800 LOC. + +## Self-bootstrapping prompt for next session + +``` +Read .claude/plans/palantir-parity-cascade-v2.md cover-to-cover. The Pillar 0 +carry-forward (Foundry parity IS SoA-as-canon parity) is the architectural +anchor. If you find yourself proposing a new ObjectTable / FunctionTable / +PipelineTable, stop — those are the SoA columns A-H, and v2's job is to make +the SoA carry the Foundry-equivalent shape, not duplicate the table set. + +Top-3 deliverables to start: D-PARITY-V2-1 (the DTO ledger; ships with this +plan as `.claude/knowledge/soa-dto-dependency-ledger.md`), D-PARITY-V2-2 (the +triangle ledger; ships as `.claude/knowledge/business-thinking-ogit-triangle.md`), +D-PARITY-V2-3 (BusDto bridge into engine_bridge.rs). + +Cross-plan deps: v1 D-CASCADE-V1-7 (codec cascade columns) MUST land before +V2-12 (SchemaPtr.thinking_style); v1 D-CASCADE-V1-2 (SchemaPtr.context_id) MUST +land before V2-4 (Schema::ObjectView). Confirm those before starting V2-12 / V2-4. + +Branch: claude/create-graph-ontology-crate-gkuJG (per workspace policy). +PR target: AdaWorldAPI/lance-graph base=main. +``` + +## Cross-references + +- `.claude/plans/lance-graph-ontology-v5.md` — D-9 thresholds, D-2 SpoBridge. +- `.claude/plans/ogit-cascade-supabase-callcenter-v1.md` — Pillar 0 SoA-as-canon, codec cascade columns. +- `.claude/plans/q2-foundry-integration-v1.md` — Q2 = Gotham UI equivalent (4 phases). +- `.claude/plans/lf-integration-mapping-v1.md` — 41 LF + 4 W chunks across stages 1-8. +- `.claude/plans/foundry-consumer-parity-v1.md` — SMB + MedCare shared surface. +- `.claude/medcare-foundry-vision.md` — F1-F5 phases with cost/sovereignty positioning. +- `.claude/board/SINGLE_BINARY_TOPOLOGY.md` — Layer 2 ecosystem ontology. +- `.claude/board/EPIPHANIES.md` 2026-04-26 — BindSpace 8-column extension for Foundry parity. +- `.claude/knowledge/soa-dto-fma-map.md:215-217` — Column H Foundry Object Type bridge (PR #272). +- `.claude/knowledge/soa-dto-dependency-ledger.md` (NEW, ships with this plan) — entropy ledger. +- `.claude/knowledge/business-thinking-ogit-triangle.md` (NEW, ships with this plan) — operation routing. + +## Confidence (2026-05-07) + +Pre-execution. Pillar 0 carry-forward is the only architectural commitment that admits no rollback — and it is right per the Foundry parity prior art (Column H is already the bridge; the rest is column population, not new tables). The 15 deliverables are bounded; D-PARITY-V2-1, V2-2, V2-3 land first because they have no upstream blockers and ship with this plan.