From 5e157bfaedb67f401ce0deff0207ff9b4f02b640 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 27 May 2026 20:29:07 +0000 Subject: [PATCH 1/4] =?UTF-8?q?docs(mailbox):=20MailboxSoA=20becomes=20per?= =?UTF-8?q?-mailbox=20thoughtspace;=20BindSpace-singleton=E2=86=92SoA=20mi?= =?UTF-8?q?gration=20spec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document the dissolution of the shared Arc singleton into per-mailbox MailboxSoA ephemeral thoughtspace (the BindSpace surrogate, NOT a per-mailbox copy of a singleton): - plan: bindspace-singleton-to-mailbox-soa-v1 — singleton inventory (driver.rs:56 / serve.rs:29 / engine_bridge.rs), column-by-column migration map (drop the 64 KB Vsa16kF32 cycle plane; own edges/qualia/meta/entity_type; reference content via CAM-PQ; keep ontology a shared Arc), cradle-to-grave lifecycle, 5 gated steps, preserved invariants (E-CE64-MB-4 ownership=compile-time no-alias, E-BATON-1, I-VSA-IDENTITIES, I-LEGACY-API-FEATURE-GATED), 4 open questions - EPIPHANIES: E-MAILBOX-IS-BINDSPACE design ruling - INTEGRATION_PLANS + STATUS_BOARD: D-MBX-1..5 deliverables (Queued, gated on D-CE64-MB-1-impl + PR-NDARRAY-MIRI-COMPLETE) - mailbox_soa.rs: module doc-note pointing to the migration plan Design/spec only; no behavioral code change. https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41 --- .claude/board/EPIPHANIES.md | 18 ++ .claude/board/INTEGRATION_PLANS.md | 9 + .claude/board/STATUS_BOARD.md | 14 + .../bindspace-singleton-to-mailbox-soa-v1.md | 240 ++++++++++++++++++ .../src/mailbox_soa.rs | 9 + 5 files changed, 290 insertions(+) create mode 100644 .claude/plans/bindspace-singleton-to-mailbox-soa-v1.md diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index e22cbfd0..4213ee75 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -1,3 +1,21 @@ +## 2026-05-27 — E-MAILBOX-IS-BINDSPACE — the singleton `Arc` dissolves *onto* mailboxes: `MailboxSoA` *becomes* the per-mailbox ephemeral thoughtspace (BindSpace surrogate), it is NOT copied per mailbox + +**Status:** CONJECTURE / design-ruling (migration spec authored this session; NOT yet implemented). Extends `E-BATON-1` + `E-CE64-MB-4` downward into the column layout. Plan: `.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md`. + +**The correction:** the ask began as *"MailboxSoA has an individual **copy** of the BindSpace."* That is still a singleton (N synchronized copies = the aliasing problem `E-CE64-MB-4` kills). The ruling: **there is no global address space to copy.** `MailboxSoA` *is* the BindSpace for the life of one think-arc — each mailbox **owns** its per-row SoA columns (born in the mailbox, die with it), and the shared singleton `Arc` is **dissolved**, not sharded. + +**Current singleton (to migrate):** `crates/cognitive-shader-driver` — `ShaderDriver.bindspace: Arc` (`driver.rs:56`); one `Arc::new(BindSpace::zeros(4096))` in `bin/serve.rs:29`; per-row read/write surface in `engine_bridge.rs`. `BindSpace` (`bindspace.rs:234`) carries a **64 KB/row `Vsa16kF32` `cycle` plane** (`FLOATS_PER_VSA=16384`) — 256 MB across the 4096-row singleton. + +**Column migration (full map in the plan §3):** `cycle` `Vsa16kF32` plane → **DROP** (ephemeral local compute, never a column — `E-BATON-1`); `content/topic/angle` dense planes → **reference** (CAM-PQ code ≤6 B), not own (`I-VSA-IDENTITIES`); `edges`(`CausalEdge64`)/`qualia`(i4-16D)/`meta`(u32)/`entity_type`(u16) → **own** in `MailboxSoA`; `temporal`/`expert` → fold into `CausalEdge64`/mailbox identity (OQ-2); **`ontology: Arc` STAYS shared** (cold Zone-2, read-only). Per-row hot footprint drops ~71.6 KB → ~24–30 B. + +**Why it's safe:** mailbox *moves* batons in (`apply_edges`) and *moves* emissions out (`CollapseGateEmission`), so the borrow checker proves no shared-mutable aliasing of the thoughtspace — the guarantee the `Arc`+`CollapseGate` "read-only by convention" only enforced by discipline becomes a **compile error** (`E-CE64-MB-4`). + +**Gated staging (plan §6):** S1 add columns behind `mailbox-thoughtspace` feature → S2 move `engine_bridge` surface onto mailbox rows → S3 driver holds a sea-star of mailboxes (kill the 4096 singleton in `serve.rs`) → S4 death→SPO+Lance tombstone-witness → S5 delete `BindSpace`+`cycle` plane. Gated on `D-CE64-MB-1-impl` (par-tile) + `PR-NDARRAY-MIRI-COMPLETE`; S5 blocked on the CLAUDE.md "The Click" / `Vsa16kF32` doctrinal update (OQ-4, already flagged in `surreal/RECONCILIATION`). + +**Cross-ref:** `E-BATON-1`, `E-CE64-MB-4`, `E-LADDER-SERVES-MAILBOX` (§6 tombstone-witness), `I-VSA-IDENTITIES`, `I-LEGACY-API-FEATURE-GATED` (feature-gate the v1 accessors during S1–S4), `causaledge64-mailbox-rename-soa-v1` (§5 MailboxSoA), `cognitive-substrate-convergence-v1` (D-CSV-7 shipped accumulator). + +--- + ## 2026-05-27 — E-CONTRACT-NO-SERIALIZE-2 — correction to E-CONTRACT-NO-SERIALIZE (below): the audit event never leaves the inside; "serialize at the membrane" was the wrong half — audit is not membrane traffic at all **Status:** FINDING (sharpens the entry directly below; user correction via the question "why should the audit event go outside?"). The §1 half of the prior entry — *contracts compile types, never serialize; build-time serde codegen is fine* — stands. This entry replaces its "outer membrane's job" framing (board is append-only, so the prior entry is left intact and corrected here). diff --git a/.claude/board/INTEGRATION_PLANS.md b/.claude/board/INTEGRATION_PLANS.md index fb9c8fe6..10227b4f 100644 --- a/.claude/board/INTEGRATION_PLANS.md +++ b/.claude/board/INTEGRATION_PLANS.md @@ -1,3 +1,12 @@ +## 2026-05-27 — bindspace-singleton-to-mailbox-soa-v1 (dissolve the shared `Arc` into per-mailbox `MailboxSoA` ephemeral thoughtspace) + +**Status:** PROPOSAL / design (migration spec; NOT yet implemented). **Plan file:** `.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md`. **Epiphany:** `E-MAILBOX-IS-BINDSPACE`. +**Scope:** `MailboxSoA` *becomes* the per-mailbox, mailbox-owned, ephemeral "thoughtspace" — the BindSpace surrogate. The singleton `ShaderDriver.bindspace: Arc` (`cognitive-shader-driver/src/driver.rs:56`; one `BindSpace::zeros(4096)` in `bin/serve.rs:29`) is **dissolved**, not copied. Column map: drop the 64 KB `Vsa16kF32` `cycle` plane; own `edges`/`qualia`/`meta`/`entity_type` in the mailbox; reference content via CAM-PQ; keep `ontology` a shared `Arc`. +**Deliverables:** D-MBX-1 add migrated columns to `MailboxSoA` (feature-gated) · D-MBX-2 move `engine_bridge` per-row surface onto mailbox rows · D-MBX-3 driver holds sea-star of mailboxes (kill the singleton) · D-MBX-4 death→SPO+Lance tombstone-witness · D-MBX-5 delete `BindSpace`+`cycle` plane. +**Gates:** `D-CE64-MB-1-impl` (par-tile) + `PR-NDARRAY-MIRI-COMPLETE` first; D-MBX-5 blocked on the CLAUDE.md "The Click"/`Vsa16kF32` doctrinal update (OQ-4). +**Invariants:** `E-CE64-MB-4` (ownership = compile-time no-alias) · `E-BATON-1` (LE baton is the only cross-boundary state) · `I-VSA-IDENTITIES` (reference content, don't copy planes) · `I-LEGACY-API-FEATURE-GATED` (feature-gate v1 `BindSpace` accessors during S1–S4) · no double-mailbox (sync inner / ractor outer). + +--- ## 2026-05-27 — odoo-savant-reasoners-v1 (lance-graph side of the Odoo richness harvest: 2 new OGIT families + Layer-2 axioms + StyleCluster wiring + 5 Reasoner impls) **Status:** PROPOSAL (picks up the cross-repo handover boundary in `.claude/odoo/SAVANTS.md` §"lance-graph handover boundary"). woa-rs defined the 25-Savant roster + delegation tuples; lance-graph implements (a) Reasoner impls, (b) 2 new families + Layer-2 alignment axioms for the `None` classes, (c) StyleCluster wiring. diff --git a/.claude/board/STATUS_BOARD.md b/.claude/board/STATUS_BOARD.md index d95d4141..e786d0ef 100644 --- a/.claude/board/STATUS_BOARD.md +++ b/.claude/board/STATUS_BOARD.md @@ -514,6 +514,20 @@ hot/cold/feedback loop onto our contract types + SoA floor --- +## bindspace-singleton-to-mailbox-soa-v1 — dissolve `Arc` into per-mailbox `MailboxSoA` + +Plan path: `.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md`. Epiphany `E-MAILBOX-IS-BINDSPACE`. Migration of the shared singleton address space into mailbox-owned ephemeral thoughtspace (LE-contract SoA columns); drops the 64 KB `Vsa16kF32` `cycle` plane. + +| D-id | Title | Crate(s) | ~LOC | Risk | Status | PR / Evidence | +|---|---|---|---|---|---|---| +| D-MBX-1 | add migrated columns (`edges`/`qualia`/`meta`/`entity_type`) to `MailboxSoA` behind `mailbox-thoughtspace` feature | cognitive-shader-driver | 120 | MED | **Queued** | gated on D-CE64-MB-1-impl + PR-NDARRAY-MIRI-COMPLETE | +| D-MBX-2 | move `engine_bridge` per-row read/write surface onto mailbox rows; `cycle` plane becomes a transient local | cognitive-shader-driver | 180 | MED | **Queued** | blocked on D-MBX-1 + OQ-1 (content-ref shape) | +| D-MBX-3 | `ShaderDriver` holds a sea-star of mailboxes; kill the `BindSpace::zeros(4096)` singleton in `serve.rs` | cognitive-shader-driver | 160 | HIGH | **Queued** | blocked on D-MBX-2 + OQ-2 (temporal/expert fold) | +| D-MBX-4 | death → SPO-G quad + Lance tombstone-witness (link-integrity back-pointer) | cognitive-shader-driver + Lance | 200 | HIGH | **Queued** | blocked on D-MBX-3 + Zone-2 persistence | +| D-MBX-5 | delete `BindSpace` singleton + `Vsa16kF32` `cycle` plane; remove feature gate | cognitive-shader-driver | 80 | MED | **Queued** | blocked on D-MBX-4 + OQ-4 (CLAUDE.md "The Click" doctrinal update) | + +--- + ## Update protocol When a deliverable ships: diff --git a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md new file mode 100644 index 00000000..17f11520 --- /dev/null +++ b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md @@ -0,0 +1,240 @@ +# bindspace-singleton-to-mailbox-soa-v1 — dissolve the shared `Arc` into per-mailbox `MailboxSoA` thoughtspace + +> **Status:** CONJECTURE / design (migration spec). NOT yet implemented. +> **Date:** 2026-05-27. +> **Owns the answer to:** *"make MailboxSoA the individual, mailbox-owned, ephemeral +> 'thoughtspace' carrier — the BindSpace surrogate — and document where + how the +> BindSpace singleton migrates onto it."* +> **Anchored to (FINDING-grade):** `E-BATON-1` (no persisted singleton BindSpace; Baton = +> LE `(u16, CausalEdge64)`), `E-CE64-MB-4` (mailbox-as-owner ⇒ Rust move/ownership proves +> no-alias / no-race / no-UAF at compile time; UB = compile error), `E-LADDER-SERVES-MAILBOX` +> (mailbox is the owned unit; hot ephemeral → cold SPO + Lance tombstone-witness), +> `I-VSA-IDENTITIES` (bundle identities, not content), the "restore the contract, never port +> the carrier" iron rule (deprecated `Vsa16kF32`). +> **Subsumed under:** `causaledge64-mailbox-rename-soa-v1` (§5 `MailboxSoA`, §1 ownership, +> §0 zones). This doc is the *column-level migration map* that plan deferred to impl. + +--- + +## 0. The correction this doc encodes + +The request was first phrased as *"MailboxSoA has an individual **copy** of the BindSpace."* +That is **not** the model. A per-mailbox *copy* of a global singleton is still a singleton +(N copies of one shared shape, kept in sync = the aliasing problem `E-CE64-MB-4` exists to +kill). The correct model: + +> **`MailboxSoA` *becomes* the BindSpace.** There is no global address space that a +> mailbox copies from. Each mailbox **owns its own ephemeral "thoughtspace"** — the per-row +> SoA columns are *born in the mailbox, live only as long as the mailbox, and die with it* +> (sea-star spawn → think → emit → die → tombstone). The singleton `Arc` is +> **dissolved**, not sharded. + +`Vsa16kF32` is deprecated as a carrier (`E-BATON-1`); cumulative state lives in +**CausalEdge64 emissions + AriGraph SPO-G quads + the per-mailbox SoA columns**. The mailbox +*is* the BindSpace surrogate for the duration of one think-arc. + +--- + +## 1. Current state — the singleton inventory (what migrates) + +The address space exists today as **one shared `Arc`** in +`crates/cognitive-shader-driver`: + +| Site | What it is | +|---|---| +| `src/driver.rs:55` `pub struct ShaderDriver` | the holder | +| `src/driver.rs:56` `pub(crate) bindspace: Arc` | the singleton handle | +| `src/driver.rs:80` (ctor arg) / `:594` (builder field) / `:612` (builder setter) | how it's injected | +| `src/driver.rs:116` `fn bindspace(&self) -> &BindSpace` | read accessor | +| `src/bin/serve.rs:29` `Arc::new(BindSpace::zeros(4096))` | **the one instance** — 4096 rows, shared across all thinking | +| `src/engine_bridge.rs` (`bind_busdto`/`unbind_busdto`/`read_qualia_*`/`write_qualia_*`, `&mut BindSpace`) | the per-row read/write surface | +| `src/bindspace.rs:234` `pub struct BindSpace` / `:280` `BindSpace::zeros` | the type + allocator | + +`BindSpace` is "read-only universal address space; mutations go through `CollapseGate`" +(`bindspace.rs:225`). That is the singleton contract: **one space, all rows, shared.** + +### `BindSpace` columns today (per row), from `bindspace.rs` + +| Column | Type / width | Bytes/row | Role | +|---|---|---|---| +| `fingerprints.content` | `[u64; 256]` | 2 048 | identity fp — "what" (topic) | +| `fingerprints.topic` | `[u64; 256]` | 2 048 | identity fp — topic plane | +| `fingerprints.angle` | `[u64; 256]` | 2 048 | identity fp — angle plane | +| `fingerprints.cycle` | `f32 × 16 384` (`FLOATS_PER_VSA`) | **65 536** | **`Vsa16kF32` carrier — DEPRECATED** | +| `edges` | `EdgeColumn` (`CausalEdge64`) | 8 | the LE contract / baton edge | +| `qualia` | `QualiaI4Column` (i4-16D) | 8 | affective role (already LE i4) | +| `meta` | `MetaColumn` (`MetaWord` u32) | 4 | thinking·awareness·nars_f·nars_c·free_e | +| `temporal` | `u64` | 8 | temporal stamp | +| `expert` | `u16` | 2 | expert id | +| `entity_type` | `u16` (column H) | 2 | OGIT type binding (1-based into ontology) | +| `ontology` | `Option>` | (shared) | **read-only cold ontology** | + +The `cycle` plane alone is **64 KB/row** — at 4096 rows that's 256 MB of `Vsa16kF32` the +singleton carries. This is exactly the "empty cathedral" carrier the deprecation kills. + +--- + +## 2. Target — `MailboxSoA` as the LE-contract thoughtspace + +`MailboxSoA` today (`src/mailbox_soa.rs:32`) is only a **spatial-temporal accumulator**: +`energy: [f32; N]`, `plasticity_counter: [u8; N]`, `last_emission_cycle: [u32; N]`, +`current_cycle`, `w_slot`, `threshold`, `mailbox_id`. It has no thoughtspace columns. + +**Target shape** — the same per-row SoA, *owned by the mailbox*, in little-endian contract +types (i4 / u8 / u16 / u32 / u64 + `CausalEdge64`), **minus the `Vsa16kF32` plane**: + +```rust +pub struct MailboxSoA { + // ── identity / ownership (unchanged) ── + pub mailbox_id: MailboxId, + pub w_slot: u8, + pub current_cycle: u32, + pub threshold: f32, + + // ── accumulator (already present, D-CSV-7) ── + pub energy: [f32; N], + pub plasticity_counter: [u8; N], + pub last_emission_cycle: [u32; N], + + // ── NEW: the migrated thoughtspace columns (per-mailbox owned) ── + pub edges: [CausalEdge64; N], // ← BindSpace.edges (8 B/row — the LE baton edge) + pub qualia: [QualiaI4_16D; N], // ← BindSpace.qualia (8 B/row — already i4) + pub meta: [MetaWord; N], // ← BindSpace.meta (u32/row) + pub entity_type: [u16; N], // ← BindSpace.entity_type (references shared ontology) + // temporal/expert: fold into CausalEdge64 where the v2 layout already carries them, + // else keep [u64;N]/[u16;N] — see §3 note + OQ-2. + + // ── content identity: NOT the 64 KB plane — a reference, see §3 / OQ-1 ── + // pub content_ref: [ContentId; N], // CAM-PQ code / codebook id (≤ 6 B/row) +} +``` + +Shared-immutable state (the **ontology registry**) does **not** migrate into the mailbox — +it stays a shared `Arc` handed to mailboxes by reference (it is calcified +cold Zone-2, not ephemeral thinking state). See §4. + +`DefaultMailboxSoA = MailboxSoA<1024>` (already 4× the old 4096-singleton's *effective* hot +working set per mailbox; many small mailboxes replace one giant space). + +--- + +## 3. Column-by-column migration map + +| `BindSpace` column | → Destination | How | +|---|---|---| +| `fingerprints.cycle` (`Vsa16kF32`, 64 KB) | **DROP** | The bundle is *ephemeral local compute* inside one `Think`, never a stored column (`E-BATON-1`, "The Click" Baton-scoping note). Compute it transiently if a step needs it; never allocate it per row. | +| `fingerprints.content/topic/angle` (3×2 KB Hamming planes) | **Reference, not own** (OQ-1) | Per `I-VSA-IDENTITIES` (bundle *identities*, not content): the mailbox holds a small **content reference** (CAM-PQ code / codebook id, ≤ 6 B), resolving to the dense plane in the shared cold codebook only when resonance is actually needed. Dense per-row planes do **not** belong in the hot mailbox. | +| `edges` (`CausalEdge64`) | **Own** `[CausalEdge64; N]` | This *is* the LE contract / baton edge. It moves into the mailbox unchanged — it is the cumulative-state home (`E-BATON-1`). | +| `qualia` (`QualiaI4_16D`) | **Own** `[QualiaI4_16D; N]` | Already i4-16D LE; straight move. | +| `meta` (`MetaWord` u32) | **Own** `[MetaWord; N]` | Straight move (u32 packed). | +| `temporal` (u64) | **Fold or own** (OQ-2) | The v2 `CausalEdge64` layout reclaimed the old temporal bits (`I-LEGACY-API-FEATURE-GATED` items 1/3). Prefer folding temporal into the edge / the mailbox's `current_cycle`; keep a `[u64; N]` column only if a separate stamp is still required. | +| `expert` (u16) | **Subsume** | The mailbox already *is* an expert/corpus (`mailbox_id` + `w_slot`). Per-row `expert` collapses to the mailbox identity in most cases; keep a column only for multi-expert rows. | +| `entity_type` (u16) | **Own** `[u16; N]` | 1-based index into the **shared** ontology; the index is per-row mailbox state, the table it indexes is shared (next row). | +| `ontology` (`Arc`) | **Stays shared** | Read-only cold Zone-2; handed by `Arc` to the mailbox, never owned/copied. See §4. | + +**Net footprint:** per-row hot state drops from ~71.6 KB (dominated by the 64 KB `cycle` +plane) to **≈ 24–30 B/row** (edge 8 + qualia 8 + meta 4 + entity_type 2 + optional +content_ref ≤ 6). That is the whole point: the mailbox thoughtspace is L1/L2-resident +(canonical plan §5 ~1.2 KB/compartment), the singleton never was. + +--- + +## 4. What STAYS shared (does not migrate) + +- **`Arc`** — the OGIT/DOLCE/FIBO calcified ontology. Immutable at read + time, hydrated/mutated on its own owner (`OntologyRegistry::append_mapping`), shared by + `Arc` to every mailbox. This is cold Zone-2, not ephemeral thinking. Mailboxes hold + `&OntologyRegistry` (or a cloned `Arc`), never a copy of its tables. +- **Codebooks / CAM-PQ centroids** — the cleanup codebook the content references resolve + against (`I-VSA-IDENTITIES` Test 3). Shared, immutable, cold. +- **AriGraph SPO-G cold store + Lance dataset** — where the mailbox's witness calcifies on + death (`E-LADDER-SERVES-MAILBOX` §6). Shared persistence, not per-mailbox. + +Rule of thumb: **ephemeral per-think state → into the mailbox; calcified/immutable shared +knowledge → stays a shared `Arc`.** The singleton's sin was conflating the two in one +`BindSpace`. + +--- + +## 5. Lifecycle — the mailbox owns its thoughtspace cradle-to-grave + +``` +spawn MailboxSoA::new(mailbox_id, w_slot, threshold) ← owns N empty rows + │ (no global space touched) +think apply_edges(batons) → energy integrates ← receives batons (moved in) + │ rows read shared ontology/codebook by &ref +emit emit(source) → CollapseGateEmission (batons out) ← hands ownership of edges out + │ (the ONLY cross-boundary state = the LE baton) +die mailbox dropped ← Rust drop = thoughtspace freed + │ (E-CE64-MB-4: no alias survives) +witness calcify stable rows → SPO-G quad + Lance tombstone ← witness outlives the mailbox +``` + +Because the mailbox *moves* batons in and *moves* emissions out (owned `(u16, CausalEdge64)`), +the borrow checker proves there is no shared mutable aliasing of the thoughtspace — the exact +guarantee a shared `Arc` + `CollapseGate` had to enforce by *convention* +("read-only; mutate only through the gate"). Ownership makes the convention a **compile +error** when violated (`E-CE64-MB-4`). + +--- + +## 6. Migration staging (gated order) + +| Step | Change | Gate / blocker | +|---|---|---| +| **S0** | This doc + board entries (design ratified) | — (done here) | +| **S1** | Add the migrated columns to `MailboxSoA` (`edges`/`qualia`/`meta`/`entity_type`) behind a `mailbox-thoughtspace` feature; keep `Arc` alive in parallel | `D-CE64-MB-1-impl` (par-tile `Mailbox` apex) lands first; needs `PR-NDARRAY-MIRI-COMPLETE` (U16x32/U32x16/U64x8 SIMD method gaps) | +| **S2** | Move the `engine_bridge` per-row read/write surface (`bind_busdto`/`unbind_busdto`/`read/write_qualia`) onto `MailboxSoA` rows; the `cycle` Vsa16kF32 plane becomes a transient local, not a column | S1; OQ-1 (content reference shape) ratified | +| **S3** | `ShaderDriver` holds a **set of mailboxes** (sea-star) instead of one `Arc`; `serve.rs:29` stops allocating the 4096-row singleton | S2; OQ-2 (temporal/expert fold) ratified | +| **S4** | Wire death → SPO-G + Lance tombstone-witness (`E-LADDER-SERVES-MAILBOX` §6); link-integrity back-pointer | S3 + Zone-2 persistence (`surreal_container` unblock OR `lance-graph-callcenter` path) | +| **S5** | Delete `BindSpace` singleton + the `cycle` plane; remove the feature gate | S4 green; CLAUDE.md "The Click" updated off `Vsa16kF32` (see §8) | + +**Backwards-compat discipline (`I-LEGACY-API-FEATURE-GATED`):** S1–S4 run with both paths +live behind a feature; the v1 `Arc` accessors must route to the mailbox mapping or +be feature-gated to a documented no-op with a migration pointer — never silently change +semantics. Field-isolation matrix tests are mandatory when the `CausalEdge64` temporal/expert +fold (OQ-2) reclaims bits. + +--- + +## 7. Invariants the migration must preserve + +1. **`E-CE64-MB-4`** — ownership = compile-time safety. The mailbox must *own* (not borrow + `&mut` from a shared space) its columns; batons move in/out. No `Arc>` over the + thoughtspace. +2. **`E-BATON-1`** — no persisted singleton; the only cross-boundary state is the LE baton + `(u16, CausalEdge64)` (`CollapseGateEmission`). Wire cost stays `13 + 10·baton_count`. +3. **No double-mailbox** (`E-LADDER-SERVES-MAILBOX` §1) — the inner think stays sync; the + async fan-out/respawn is the ractor outer-swarm (`D-PERSONA-5`), not a second queue inside + `MailboxSoA`. +4. **`I-VSA-IDENTITIES`** — bundle identities, not content; the dense planes do not get copied + per-mailbox (that would be N× the carrier we are deleting). +5. **`I-SUBSTRATE-MARKOV`** — the bundle math is untouched; only the *carrier/ownership* is + re-homed. The transient cycle bundle still obeys Chapman-Kolmogorov when a step computes it. + +--- + +## 8. Open questions (ratify before the gated step that needs them) + +- **OQ-1 (S2):** content identity in the mailbox — CAM-PQ code, codebook id, or a slim + Hamming slice? (drives the per-row content_ref width). Default proposal: CAM-PQ code (6 B). +- **OQ-2 (S3):** fold `temporal`/`expert` into `CausalEdge64` (v2 already reclaimed the + temporal bits) vs keep separate columns. Default proposal: fold; keep only if a step needs a + standalone stamp. +- **OQ-3:** `N` per mailbox + how many mailboxes the driver holds concurrently (replaces the + single 4096). Ties to the existing `D-CE64-MB-5-impl` OQ-3 (plasticity granularity). +- **OQ-4 (S5, doctrinal):** CLAUDE.md "The Click" is still written on `Vsa16kF32`. Deleting + the `cycle` plane requires the CLAUDE.md + `EPIPHANIES.md` update the + `RECONCILIATION_with_canonical_plan.md` already flagged. Do **not** delete the plane (S5) + before that doctrinal edit lands. + +--- + +## 9. Cross-refs + +`causaledge64-mailbox-rename-soa-v1` (§0 zones, §1 ownership, §5 `MailboxSoA`, §6 crate +inventory + L-6 w_slot), `cognitive-substrate-convergence-v1` (D-CSV-7 the shipped MailboxSoA +accumulator), `EPIPHANIES.md` (`E-BATON-1`, `E-CE64-MB-4`, `E-LADDER-SERVES-MAILBOX`, +`I-VSA-IDENTITIES`, `I-LEGACY-API-FEATURE-GATED`), `.claude/surreal/RECONCILIATION_with_canonical_plan.md` +(Vsa16kF32-deprecation contradiction flag), code: `crates/cognitive-shader-driver/src/{bindspace.rs, +mailbox_soa.rs, driver.rs, engine_bridge.rs, bin/serve.rs}`. diff --git a/crates/cognitive-shader-driver/src/mailbox_soa.rs b/crates/cognitive-shader-driver/src/mailbox_soa.rs index ebedf3f9..a14a182f 100644 --- a/crates/cognitive-shader-driver/src/mailbox_soa.rs +++ b/crates/cognitive-shader-driver/src/mailbox_soa.rs @@ -9,6 +9,15 @@ //! per-row plasticity accumulator + apply_edges baton receipt. NO ractor //! wrap, NO AttentionMask/LRU, NO cross-cycle rollup — those are W6's //! orthogonal concerns / sprint-12 SigmaTierRouter integration. +//! +//! Migration target (design, NOT yet wired): this type is the per-mailbox, +//! mailbox-owned, *ephemeral* "thoughtspace" — the BindSpace surrogate. The +//! shared singleton `Arc` dissolves *onto* mailboxes (each owns its +//! own LE-contract SoA columns: edges/qualia/meta/entity_type — minus the +//! deprecated `Vsa16kF32` plane), it is NOT copied per mailbox. The only +//! cross-boundary state stays the LE baton `(u16, CausalEdge64)` (E-BATON-1); +//! ownership makes no-alias/no-race a compile error (E-CE64-MB-4). Column map + +//! gated steps: `.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md`. use causal_edge::CausalEdge64; use lance_graph_contract::collapse_gate::{CollapseGateEmission, MailboxId, MergeMode}; From 4b5ecb8b0a59375c6945302574e2a5fa564f725a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 27 May 2026 20:41:57 +0000 Subject: [PATCH 2/4] docs(mailbox): THE LE contract is one SoA end-to-end; ontology lazylock-as-is; DTO/p64 vertical audit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sharpen the migration spec per the ruling that there is ONE little-endian contract, the same SoA layout from cognitive-shader-driver down to lance-graph storage with no boundary re-encode: - plan §2.5: THE LE contract is uniform shader SoA → contract LE types (CausalEdge64/QualiaI4_16D/MetaWord/SoaColumns/entity_type) → lance storage; persisted_row is a pointer to the same SoA row, not a re-encode - plan §4: Ontology is NOT in the SoA — stays AS IS, lazylock (registry.rs:39 LazyLock) + ontology_dictionary Lance cache (lance_cache.rs, TTL-sourced, drop-and-rebuild) - plan §2.6: DTO vertical audit — p64-bridge already conforms (LE types → palette, no re-encode = the template); engine_bridge bind/unbind_busdto is the legacy re-encode seam to collapse (S2); thinking-engine StreamDto/ ResonanceDto/BusDto/ThoughtStruct survive only as ingress adapter + read projections; ResonanceDto.energy IS MailboxSoA.energy - EPIPHANIES: E-MAILBOX-IS-BINDSPACE refinement (end-to-end + ontology + DTO) - TECH_DEBT: TD-RESONANCEDTO-DUP-1 (two ResonanceDto structs, same name) Design/spec only. https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41 --- .claude/board/EPIPHANIES.md | 4 +- .claude/board/TECH_DEBT.md | 8 ++ .../bindspace-singleton-to-mailbox-soa-v1.md | 122 ++++++++++++++++-- 3 files changed, 119 insertions(+), 15 deletions(-) diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index 4213ee75..bdc0431c 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -12,7 +12,9 @@ **Gated staging (plan §6):** S1 add columns behind `mailbox-thoughtspace` feature → S2 move `engine_bridge` surface onto mailbox rows → S3 driver holds a sea-star of mailboxes (kill the 4096 singleton in `serve.rs`) → S4 death→SPO+Lance tombstone-witness → S5 delete `BindSpace`+`cycle` plane. Gated on `D-CE64-MB-1-impl` (par-tile) + `PR-NDARRAY-MIRI-COMPLETE`; S5 blocked on the CLAUDE.md "The Click" / `Vsa16kF32` doctrinal update (OQ-4, already flagged in `surreal/RECONCILIATION`). -**Cross-ref:** `E-BATON-1`, `E-CE64-MB-4`, `E-LADDER-SERVES-MAILBOX` (§6 tombstone-witness), `I-VSA-IDENTITIES`, `I-LEGACY-API-FEATURE-GATED` (feature-gate the v1 accessors during S1–S4), `causaledge64-mailbox-rename-soa-v1` (§5 MailboxSoA), `cognitive-substrate-convergence-v1` (D-CSV-7 shipped accumulator). +**Refinement (same session, 2026-05-27):** the per-mailbox SoA *is* **THE little-endian contract** — singular, and the **same SoA layout runs the whole vertical with no boundary re-encode**: cognitive-shader-driver `MailboxSoA` → `lance-graph-contract` LE types (`CausalEdge64`/`QualiaI4_16D`/`MetaWord`/`SoaColumns`/`entity_type`) → lance-graph storage (Lance columns / tombstone-witness); `ShaderCrystal.persisted_row` is a pointer to the same SoA row, not a serialized copy (plan §2.5). **The Ontology is NOT in the SoA and stays AS IS** — lazylock (`registry.rs:39 LazyLock`) + the `ontology_dictionary` Lance **cache** (`lance_cache.rs`, TTL-sourced, drop-and-rebuild; its own header already says "BindSpace … never lands here") (plan §4). **DTO audit (plan §2.6):** `p64-bridge` already conforms (maps `CausalEdge64`/`ThinkingStyle` straight to palette, no re-encode — the template); the legacy re-encode seam is `engine_bridge.rs` `bind_busdto`/`unbind_busdto`/`busdto_to_binary16k` (collapse in S2); `thinking-engine` DTOs survive only as the `StreamDto` ingress adapter + thin read-projections (`BusDto`/`ThoughtStruct`) over the mailbox SoA; `ResonanceDto.energy` *is* `MailboxSoA.energy` (the two `ResonanceDto` defs are `TD-RESONANCEDTO-DUP-1`). + +**Cross-ref:** `E-BATON-1`, `E-CE64-MB-4`, `E-LADDER-SERVES-MAILBOX` (§6 tombstone-witness), `I-VSA-IDENTITIES`, `I-LEGACY-API-FEATURE-GATED` (feature-gate the v1 accessors during S1–S4), `E-CONTRACT-NO-SERIALIZE` (compile-time handshake, no membrane serialize — same byte layout to disk), `causaledge64-mailbox-rename-soa-v1` (§5 MailboxSoA), `cognitive-substrate-convergence-v1` (D-CSV-7 shipped accumulator), `TD-RESONANCEDTO-DUP-1`. --- diff --git a/.claude/board/TECH_DEBT.md b/.claude/board/TECH_DEBT.md index bd0488d7..749301ad 100644 --- a/.claude/board/TECH_DEBT.md +++ b/.claude/board/TECH_DEBT.md @@ -13,6 +13,14 @@ --- +### TD-RESONANCEDTO-DUP-1 (bindspace-singleton-to-mailbox-soa-v1) + +- **Severity:** P3 (name collision; two distinct `ResonanceDto` structs under the same name) +- **Surfaced in:** DTO vertical audit, 2026-05-27, branch `claude/splat3d-cpu-simd-renderer-MAOO0` +- **What:** `crates/thinking-engine/src/dto.rs:59` defines `ResonanceDto { energy: Vec, top_k, cycle_count, converged }` (the Ψ ripple field); `crates/thinking-engine/src/awareness_dto.rs:21` defines a *different* `ResonanceDto { hdr: HdrResonance, dominant_perspective, gate, dissonance, total_energy, … }` (multi-perspective S/P/O). Same name, different shape, same crate. +- **Owed:** dedup under `bindspace-singleton-to-mailbox-soa-v1` — the `dto.rs` energy field unifies into `MailboxSoA.energy: [f32; N]`; the `awareness_dto.rs` scalars map to SoA `meta`/`edge` columns and `HdrResonance` becomes the S/P/O read over the SoA. Rename/merge so one canonical resonance read remains. +- **Status:** Open + ### TD-GHOST-ECHO-DUP-1 (D-PERSONA-1) - **Severity:** P3 (cosmetic type-dup; no runtime correctness risk — the two enums are not exchanged across a crate boundary today) diff --git a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md index 17f11520..5e6c6667 100644 --- a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md +++ b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md @@ -118,6 +118,84 @@ working set per mailbox; many small mailboxes replace one giant space). --- +## 2.5 — THE little-endian contract: ONE SoA, end-to-end, no boundary re-encode + +**Ruling (2026-05-27):** the per-mailbox `MailboxSoA` layout *is* **THE little-endian +contract** — singular, canonical. The **same SoA byte layout runs the whole vertical**, from +the cognitive-shader-driver hot path down to lance-graph storage, with **no re-encode / +translation at any boundary**: + +``` +cognitive-shader-driver lance-graph-contract lance-graph storage + MailboxSoA ───────────► LE byte contract types ────────► Lance columns / + (hot, owned, ephemeral) CausalEdge64 · QualiaI4_16D · SPO-G + tombstone-witness + MetaWord · SoaColumns · (cold, durable) + entity_type u16 + └──────────────── ONE little-endian SoA the whole way ──────────────┘ + persisted_row: Option is the link, not a re-encode +``` + +Consequences: + +- **No Arrow/JSON translation membrane for the thoughtspace.** The columns the mailbox owns + in RAM are the columns Lance stores. A persisted row (`ShaderCrystal.persisted_row`, + `lance-graph-contract/src/cognitive_shader.rs:382`) is a **pointer to the same SoA row** + laid down in Lance, not a serialized copy in a different shape. (Contrast the *ontology* + path, which legitimately translates `MappingRow ↔ RecordBatch` in `lance_cache.rs` — see §4 + for why the ontology is a different animal.) +- **The LE byte contract types are the shared vocabulary** (`lance-graph-contract`): + `CausalEdge64`, `QualiaI4_16D`, `MetaWord`, the `SoaColumns` floor (ndarray), `entity_type` + u16. Every layer compiles against these exact types — the contract is a *compile-time* + handshake (cf. `E-CONTRACT-NO-SERIALIZE`), and the *bytes* are identical from compute to disk. +- **Lance is append-only/versioned**, so persisting the SoA row IS the tombstone-witness + + GoBD audit trail by construction (`E-LADDER-SERVES-MAILBOX` §6) — no separate logging layer. +- This is the "restore the contract, never port the carrier" rule made vertical: one i4/u8/ + u64 SoA from shader to storage; never re-inflate to `Vsa16kF32` at any tier. + +This widens the migration scope from "cognitive-shader-driver only" to **the full vertical**: +shader-driver SoA → contract LE types → lance-graph storage must all be THAT one SoA. + +--- + +## 2.6 — DTO vertical audit: StreamDto / ResonanceDto / BusDto / p64 (what re-encodes vs what already conforms) + +The flow DTOs live in `crates/thinking-engine/src/dto.rs` (a workspace member) and stage the +cycle Φ→Ψ→B→Γ. Audited against the "one SoA, no re-encode" ruling (§2.5), **two patterns +coexist** and the migration must collapse the legacy one onto the SoA: + +### The GOOD pattern (already conforms — the reference) — `p64-bridge` + +`crates/p64-bridge/src/lib.rs` maps the **canonical LE-contract types directly** to p64 +palette storage with **no re-encode and no `p64` dependency** (compile-time bridge, joined at +the call site): `CausalEdge64 → edge_to_block` (palette row/col), `ThinkingStyle → layer_mask ++ combine + contra`, `HdrSemiring → combine/contra mode`. This **is** THE SoA reaching +storage — the i4/u8/u64 contract types address the palette directly. *Everything from the +shader SoA to lance-graph storage should look like p64-bridge.* Keep as-is; it is the +storage-ward end of the vertical. + +### The LEGACY pattern (re-encodes — collapse it) — `thinking-engine` DTOs ↔ `engine_bridge` + +These are heap `Vec`-based representations bridged into `BindSpace` rows by a **translation +membrane** in `crates/cognitive-shader-driver/src/engine_bridge.rs` +(`bind_busdto` / `unbind_busdto:310` / `busdto_to_binary16k:199`). That bind/unbind seam is +exactly the re-encode the ruling forbids for the thoughtspace. Fates: + +| DTO (`thinking-engine`) | Shape today | Fate under THE SoA | +|---|---|---| +| `StreamDto` (Φ ingress) | `source`, `codebook_indices: Vec`, `timestamp` | **Thin ingress adapter only** — a sensor-membrane boundary (like the ontology); codebook indices (identity refs, `I-VSA-IDENTITIES`-clean) hand straight into the mailbox SoA. Does NOT carry a parallel `Vec` through the hot path. | +| `ResonanceDto` (Ψ, `dto.rs`) | `energy: Vec` (the 4096 ripple field) + `top_k`/`cycle_count`/`converged` | **Already IS `MailboxSoA.energy: [f32; N]`.** The ripple field is the mailbox's energy column — unify, don't keep a separate heap `Vec` DTO. `top_k`/`converged` are derived reads. | +| `ResonanceDto` (`awareness_dto.rs`) | richer multi-perspective: `hdr: HdrResonance`, `dominant_perspective`, `gate`, `dissonance`, `total_energy`, inferred user state | **NAME-COLLISION (two `ResonanceDto`) — dedup.** Scalars (`dissonance`/`total_energy`/`gate`) → SoA `meta`/`edge` columns; `HdrResonance` = the S/P/O 3-perspective read over the SoA. Rename or merge (tech-debt entry filed). | +| `BusDto` (B consequence) | `codebook_index: u16`, `energy: f32`, `top_k`, `cycle_count`, `converged` | **Becomes a view/projection over the SoA row** (read `edges`/`qualia`/`meta` + `persisted_row`), not a bound/unbound separate struct. `unbind_busdto` collapses to a column read; `bind_busdto`/`busdto_to_binary16k` collapse (the SoA row's content-ref IS the binary16k identity). | +| `ThoughtStruct` (Γ collapse) | `bus`, lazy `text`, `sensor_contributions`, `tension_history: Vec>`, `style_trajectory` | **Γ projection of the persisted SoA row** (text stays lazy). `tension_history`/`style_trajectory` become witness columns / tombstone fields (`E-LADDER-SERVES-MAILBOX` §6), not parallel `Vec`s. | + +**Ruling:** `engine_bridge`'s `bind_busdto`/`unbind_busdto`/`busdto_to_binary16k` are the +re-encode boundary to dissolve (migration step S2). The thinking-engine DTOs survive only as +(a) the `StreamDto` ingress adapter at the sensor membrane and (b) thin *read projections* +(`BusDto`/`ThoughtStruct`) over the mailbox SoA — never as a parallel owned representation the +hot path translates to/from. p64-bridge is the conformance template for the storage-ward half. + +--- + ## 3. Column-by-column migration map | `BindSpace` column | → Destination | How | @@ -139,20 +217,36 @@ content_ref ≤ 6). That is the whole point: the mailbox thoughtspace is L1/L2-r --- -## 4. What STAYS shared (does not migrate) - -- **`Arc`** — the OGIT/DOLCE/FIBO calcified ontology. Immutable at read - time, hydrated/mutated on its own owner (`OntologyRegistry::append_mapping`), shared by - `Arc` to every mailbox. This is cold Zone-2, not ephemeral thinking. Mailboxes hold - `&OntologyRegistry` (or a cloned `Arc`), never a copy of its tables. -- **Codebooks / CAM-PQ centroids** — the cleanup codebook the content references resolve - against (`I-VSA-IDENTITIES` Test 3). Shared, immutable, cold. -- **AriGraph SPO-G cold store + Lance dataset** — where the mailbox's witness calcifies on - death (`E-LADDER-SERVES-MAILBOX` §6). Shared persistence, not per-mailbox. - -Rule of thumb: **ephemeral per-think state → into the mailbox; calcified/immutable shared -knowledge → stays a shared `Arc`.** The singleton's sin was conflating the two in one -`BindSpace`. +## 4. What STAYS shared (does not migrate) — the Ontology is lazylock-via-cache, AS IS + +The **Ontology is explicitly NOT part of THE SoA contract** and does **not** migrate. It stays +exactly as it is today — a lazily-initialised, cache-backed, read-only shared resource: + +- **`LazyLock`** — the seed registry is `static SEED_NAMESPACE_REGISTRY: + LazyLock` (`crates/lance-graph-ontology/src/registry.rs:39`), built once, + read-only thereafter. Mailboxes consult it by reference; never own or copy it. +- **The `ontology_dictionary` Lance cache** (`lance-graph-ontology/src/lance_cache.rs`, + feature `lance-cache`) — a **CACHE of hydrated TTL** keyed by `ttl_root_checksum`; the TTL + files on disk are source-of-truth; on version mismatch it **drop-and-rebuilds** (no + migration ladder). Its own header already states the boundary: *"BindSpace + (FingerprintColumns / QualiaColumn / MetaColumn / EdgeColumn) is the live runtime SoA and is + unrelated — it never lands here."* That invariant holds unchanged under this migration. +- **Why it's a different animal (and why it legitimately re-encodes):** the ontology cache + *does* translate `MappingRow ↔ RecordBatch` — but it is calcified, immutable-at-read, + shared cold knowledge, not ephemeral per-think thoughtspace. The "one SoA, no re-encode" + rule (§2.5) governs the **thoughtspace** vertical; the ontology cache is an orthogonal + TTL-projection cache and is left **as is**. + +So: a mailbox holds the ontology as `Arc` / `&OntologyRegistry` (lazylock + +cache, read-only); the per-row `entity_type: u16` (1-based index into the shared ontology) +travels in THE SoA, but the ontology tables it indexes stay shared and cached. **No ontology +work in this migration — it is `as is`.** + +Other shared-immutable state that likewise stays out of the SoA: CAM-PQ codebooks / +centroids (the cleanup codebook content references resolve against, `I-VSA-IDENTITIES` +Test 3); the AriGraph SPO-G cold store. Rule of thumb: **ephemeral per-think state → into the +mailbox SoA; calcified/immutable shared knowledge → stays shared (lazylock/cache), out of the +SoA.** --- From 749315850c8af6f3f914e31e654ca53e4eef7892 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 27 May 2026 20:54:05 +0000 Subject: [PATCH 3/4] =?UTF-8?q?docs(mailbox):=20ThoughtStruct=20=3D=20tran?= =?UTF-8?q?sparent=20hot/cold=20view=20over=20SurrealDB=20container;=2064k?= =?UTF-8?q?=E2=80=93256k=20working=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - plan §2.7: the one-SoA contract extends past RAM — ThoughtStruct is later also a transparent view into the SurrealDB-on-Lance container table(s); same SoA layout hot (mailbox) or cold (container), no RAM↔storage re-encode; persisted_row is the seam - capacity: hot ceiling ~64k–256k thoughts; 64k ≈ 300–600 MB ⇒ ~6 KB/thought, dominated by the content/topic/angle Hamming planes that STAY hot — dropping only the 64 KB Vsa16kF32 cycle plane is what makes the working set fit. Resolves OQ-1 (Hamming planes hot; CAM-PQ ref is the cold/spill form) - §3 footprint reconciled (bare columns ~24–50 B vs full hot thought ~6 KB) - STATUS_BOARD: D-MBX-6 (transparent hot/cold ThoughtStruct view); TD-RESONANCEDTO-DUP-1 -> Deferred - TECH_DEBT + EPIPHANIES updated Design/spec only. https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41 --- .claude/board/EPIPHANIES.md | 2 +- .claude/board/STATUS_BOARD.md | 2 + .claude/board/TECH_DEBT.md | 2 +- .../bindspace-singleton-to-mailbox-soa-v1.md | 69 +++++++++++++++++-- 4 files changed, 67 insertions(+), 8 deletions(-) diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index bdc0431c..f6adb434 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -12,7 +12,7 @@ **Gated staging (plan §6):** S1 add columns behind `mailbox-thoughtspace` feature → S2 move `engine_bridge` surface onto mailbox rows → S3 driver holds a sea-star of mailboxes (kill the 4096 singleton in `serve.rs`) → S4 death→SPO+Lance tombstone-witness → S5 delete `BindSpace`+`cycle` plane. Gated on `D-CE64-MB-1-impl` (par-tile) + `PR-NDARRAY-MIRI-COMPLETE`; S5 blocked on the CLAUDE.md "The Click" / `Vsa16kF32` doctrinal update (OQ-4, already flagged in `surreal/RECONCILIATION`). -**Refinement (same session, 2026-05-27):** the per-mailbox SoA *is* **THE little-endian contract** — singular, and the **same SoA layout runs the whole vertical with no boundary re-encode**: cognitive-shader-driver `MailboxSoA` → `lance-graph-contract` LE types (`CausalEdge64`/`QualiaI4_16D`/`MetaWord`/`SoaColumns`/`entity_type`) → lance-graph storage (Lance columns / tombstone-witness); `ShaderCrystal.persisted_row` is a pointer to the same SoA row, not a serialized copy (plan §2.5). **The Ontology is NOT in the SoA and stays AS IS** — lazylock (`registry.rs:39 LazyLock`) + the `ontology_dictionary` Lance **cache** (`lance_cache.rs`, TTL-sourced, drop-and-rebuild; its own header already says "BindSpace … never lands here") (plan §4). **DTO audit (plan §2.6):** `p64-bridge` already conforms (maps `CausalEdge64`/`ThinkingStyle` straight to palette, no re-encode — the template); the legacy re-encode seam is `engine_bridge.rs` `bind_busdto`/`unbind_busdto`/`busdto_to_binary16k` (collapse in S2); `thinking-engine` DTOs survive only as the `StreamDto` ingress adapter + thin read-projections (`BusDto`/`ThoughtStruct`) over the mailbox SoA; `ResonanceDto.energy` *is* `MailboxSoA.energy` (the two `ResonanceDto` defs are `TD-RESONANCEDTO-DUP-1`). +**Refinement (same session, 2026-05-27):** the per-mailbox SoA *is* **THE little-endian contract** — singular, and the **same SoA layout runs the whole vertical with no boundary re-encode**: cognitive-shader-driver `MailboxSoA` → `lance-graph-contract` LE types (`CausalEdge64`/`QualiaI4_16D`/`MetaWord`/`SoaColumns`/`entity_type`) → lance-graph storage (Lance columns / tombstone-witness); `ShaderCrystal.persisted_row` is a pointer to the same SoA row, not a serialized copy (plan §2.5). **The Ontology is NOT in the SoA and stays AS IS** — lazylock (`registry.rs:39 LazyLock`) + the `ontology_dictionary` Lance **cache** (`lance_cache.rs`, TTL-sourced, drop-and-rebuild; its own header already says "BindSpace … never lands here") (plan §4). **DTO audit (plan §2.6):** `p64-bridge` already conforms (maps `CausalEdge64`/`ThinkingStyle` straight to palette, no re-encode — the template); the legacy re-encode seam is `engine_bridge.rs` `bind_busdto`/`unbind_busdto`/`busdto_to_binary16k` (collapse in S2); `thinking-engine` DTOs survive only as the `StreamDto` ingress adapter + thin read-projections (`BusDto`/`ThoughtStruct`) over the mailbox SoA; `ResonanceDto.energy` *is* `MailboxSoA.energy` (the two `ResonanceDto` defs are `TD-RESONANCEDTO-DUP-1`, **deferred**). **Hot/cold (plan §2.7):** the SoA extends past RAM — `ThoughtStruct` is *later also a transparent view into the SurrealDB ThoughtStruct container table(s)*, same SoA layout hot (mailbox) or cold (container), no RAM↔storage re-encode. Hot ceiling **~64k–256k thoughts** (64k ≈ 300–600 MB ⇒ ~6 KB/thought, dominated by the content/topic/angle Hamming planes that stay hot — dropping only the 64 KB `Vsa16kF32` plane is what makes the working set fit; **resolves OQ-1**). New deliverable D-MBX-6. **Cross-ref:** `E-BATON-1`, `E-CE64-MB-4`, `E-LADDER-SERVES-MAILBOX` (§6 tombstone-witness), `I-VSA-IDENTITIES`, `I-LEGACY-API-FEATURE-GATED` (feature-gate the v1 accessors during S1–S4), `E-CONTRACT-NO-SERIALIZE` (compile-time handshake, no membrane serialize — same byte layout to disk), `causaledge64-mailbox-rename-soa-v1` (§5 MailboxSoA), `cognitive-substrate-convergence-v1` (D-CSV-7 shipped accumulator), `TD-RESONANCEDTO-DUP-1`. diff --git a/.claude/board/STATUS_BOARD.md b/.claude/board/STATUS_BOARD.md index e786d0ef..c97cff15 100644 --- a/.claude/board/STATUS_BOARD.md +++ b/.claude/board/STATUS_BOARD.md @@ -525,6 +525,8 @@ Plan path: `.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md`. Epiphany `E | D-MBX-3 | `ShaderDriver` holds a sea-star of mailboxes; kill the `BindSpace::zeros(4096)` singleton in `serve.rs` | cognitive-shader-driver | 160 | HIGH | **Queued** | blocked on D-MBX-2 + OQ-2 (temporal/expert fold) | | D-MBX-4 | death → SPO-G quad + Lance tombstone-witness (link-integrity back-pointer) | cognitive-shader-driver + Lance | 200 | HIGH | **Queued** | blocked on D-MBX-3 + Zone-2 persistence | | D-MBX-5 | delete `BindSpace` singleton + `Vsa16kF32` `cycle` plane; remove feature gate | cognitive-shader-driver | 80 | MED | **Queued** | blocked on D-MBX-4 + OQ-4 (CLAUDE.md "The Click" doctrinal update) | +| D-MBX-6 | `ThoughtStruct` = transparent hot/cold view over SurrealDB container table(s) (same SoA both tiers; ~64k–256k hot ceiling, ~6 KB/thought) | cognitive-shader-driver + surreal_container | 220 | HIGH | **Queued** | blocked on D-MBX-3 + surreal_container unblock (BLOCKED A/B/C/D) or callcenter Zone-2 | +| TD-RESONANCEDTO-DUP-1 | dedup the two `ResonanceDto` (thinking-engine) | thinking-engine | 60 | LOW | **Deferred** | user 2026-05-27 — fold into D-MBX-2 | --- diff --git a/.claude/board/TECH_DEBT.md b/.claude/board/TECH_DEBT.md index 749301ad..cf222ac0 100644 --- a/.claude/board/TECH_DEBT.md +++ b/.claude/board/TECH_DEBT.md @@ -19,7 +19,7 @@ - **Surfaced in:** DTO vertical audit, 2026-05-27, branch `claude/splat3d-cpu-simd-renderer-MAOO0` - **What:** `crates/thinking-engine/src/dto.rs:59` defines `ResonanceDto { energy: Vec, top_k, cycle_count, converged }` (the Ψ ripple field); `crates/thinking-engine/src/awareness_dto.rs:21` defines a *different* `ResonanceDto { hdr: HdrResonance, dominant_perspective, gate, dissonance, total_energy, … }` (multi-perspective S/P/O). Same name, different shape, same crate. - **Owed:** dedup under `bindspace-singleton-to-mailbox-soa-v1` — the `dto.rs` energy field unifies into `MailboxSoA.energy: [f32; N]`; the `awareness_dto.rs` scalars map to SoA `meta`/`edge` columns and `HdrResonance` becomes the S/P/O read over the SoA. Rename/merge so one canonical resonance read remains. -- **Status:** Open +- **Status:** Open — **Deferred** (user, 2026-05-27): not now; revisit folded into D-MBX-2 (the `engine_bridge` re-encode-seam collapse). ### TD-GHOST-ECHO-DUP-1 (D-PERSONA-1) diff --git a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md index 5e6c6667..78dee371 100644 --- a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md +++ b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md @@ -196,6 +196,57 @@ hot path translates to/from. p64-bridge is the conformance template for the stor --- +## 2.7 — Hot/cold: `ThoughtStruct` is a transparent view over the SurrealDB container table(s) + +The same "one SoA, no re-encode" rule (§2.5) extends **past RAM into persistence**. The hot +path can hold **only ~64k–256k thoughts**; beyond that, thoughts live in the **SurrealDB-on-Lance +container table(s)** (`crates/surreal_container`, the Zone-2 cold tier — currently a BLOCKED +skeleton, see `surreal/RECONCILIATION`). The ruling: + +> `ThoughtStruct` (the Γ-collapse thought) is **later also a transparent view into the +> ThoughtStruct container table(s)** — reading a thought resolves over the **same SoA layout** +> whether it is hot (in a mailbox) or cold (in the SurrealDB container). No re-encode at the +> RAM↔storage boundary: the container columns are the mailbox columns. `persisted_row` is the +> seam; the view spans hot+cold transparently. + +### Capacity (the working-set bound) + +- **Hot ceiling: ~64k–256k thoughts.** At **64k ≈ 300–600 MB RAM** ⇒ **~4.5–9 KB/thought** hot. + 256k ⇒ ~1.2–2.4 GB. +- **Why ~6 KB/thought (not the ~24–30 B of bare SoA columns):** the dominant cost is the + **content/topic/angle Hamming identity planes** = 3 × 256 × 8 B = **6 KB/thought**. The bare + migrated columns (edge 8 + qualia 8 + meta 4 + entity_type 2 + accumulator ~9 B) add only + ~30–50 B. **6 KB × 64k ≈ 400 MB** — squarely in the stated 300–600 MB range. (This is *with* + the 64 KB `Vsa16kF32` `cycle` plane dropped; keeping it would make 64k thoughts ≈ 4.7 GB, so + dropping it is what makes the 64k–256k hot working set fit at all.) +- **Resolves OQ-1 (content reference shape):** the 300–600 MB-for-64k budget implies the + **Hamming identity planes stay hot per thought** (≈ 6 KB) — they are *not* reduced to a 6 B + CAM-PQ ref in the hot path. The only thing dropped is the 64 KB f32 `cycle` carrier. A + CAM-PQ/codebook ref is the *cold/storage* form (and the spill key), not the hot form. + +### The spill / transparent-read model + +``` + hot (mailbox SoA, ≤ 64k–256k thoughts, ~300–600 MB) + │ energy decays / mailbox dies / working set full + ▼ spill — SAME SoA columns, no re-encode (persisted_row) + cold (SurrealDB-on-Lance container table(s), append-only/versioned) + ▲ + │ ThoughtStruct view reads hot OR cold transparently (same layout) +``` + +- The SurrealDB container is the **same SoA columns** persisted (edge/qualia/meta/entity_type + + content identity), append-only/versioned — so the cold store *is* the tombstone-witness + + GoBD trail (`E-LADDER-SERVES-MAILBOX` §6) by construction. +- `ThoughtStruct` (`thinking-engine`) becomes the **transparent view** over `(hot mailbox row | + cold container row)`; text stays lazy. This makes the §2.6 ruling literal at the storage tier: + `ThoughtStruct` is a read-projection, identical whether the row is in RAM or in SurrealDB. +- **Gating:** the cold tier needs `surreal_container` unblocked (BLOCKED(A/B/C/D) — fork dep + + Lance 6 pin) **or** the `lance-graph-callcenter` Zone-2 path; the transparent-view wiring is + migration step **S4** (plan §6) and new deliverable **D-MBX-6**. + +--- + ## 3. Column-by-column migration map | `BindSpace` column | → Destination | How | @@ -210,10 +261,14 @@ hot path translates to/from. p64-bridge is the conformance template for the stor | `entity_type` (u16) | **Own** `[u16; N]` | 1-based index into the **shared** ontology; the index is per-row mailbox state, the table it indexes is shared (next row). | | `ontology` (`Arc`) | **Stays shared** | Read-only cold Zone-2; handed by `Arc` to the mailbox, never owned/copied. See §4. | -**Net footprint:** per-row hot state drops from ~71.6 KB (dominated by the 64 KB `cycle` -plane) to **≈ 24–30 B/row** (edge 8 + qualia 8 + meta 4 + entity_type 2 + optional -content_ref ≤ 6). That is the whole point: the mailbox thoughtspace is L1/L2-resident -(canonical plan §5 ~1.2 KB/compartment), the singleton never was. +**Net footprint (two figures — don't conflate):** +- *Bare migrated SoA columns* ≈ **24–50 B/row** (edge 8 + qualia 8 + meta 4 + entity_type 2 + + accumulator energy/plasticity/last_emit ~21). +- *Full hot thought* ≈ **~6 KB** — because the **content/topic/angle Hamming identity planes + (3 × 2 KB) stay hot** (see §2.7; this is what sets the 64k ≈ 300–600 MB budget). The win is + dropping the **64 KB `Vsa16kF32` `cycle` plane**: per-thought ~71.6 KB → ~6 KB, which is what + makes the 64k–256k hot working set fit. The bare columns are L1/L2-resident; the Hamming + planes are the bulk and bound the working-set ceiling. --- @@ -310,8 +365,10 @@ fold (OQ-2) reclaims bits. ## 8. Open questions (ratify before the gated step that needs them) -- **OQ-1 (S2):** content identity in the mailbox — CAM-PQ code, codebook id, or a slim - Hamming slice? (drives the per-row content_ref width). Default proposal: CAM-PQ code (6 B). +- **OQ-1 (S2): RESOLVED by §2.7 capacity.** The 64k ≈ 300–600 MB budget implies the + content/topic/angle **Hamming identity planes stay hot (~6 KB/thought)**; only the 64 KB + `Vsa16kF32` `cycle` plane is dropped. CAM-PQ/codebook ref is the *cold/storage + spill-key* + form, not the hot form. - **OQ-2 (S3):** fold `temporal`/`expert` into `CausalEdge64` (v2 already reclaimed the temporal bits) vs keep separate columns. Default proposal: fold; keep only if a step needs a standalone stamp. From 44f60f1e3ad3d88d826e32d75b654998027c0a6d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 27 May 2026 20:58:51 +0000 Subject: [PATCH 4/4] =?UTF-8?q?docs(rubicon):=20ground=20=CE=A310=20Rubico?= =?UTF-8?q?n=20in=20Heckhausen=20action-phases=20+=20Libet=20veto;=20Surre?= =?UTF-8?q?alDB=20is=20a=20VIEW=20over=20leading=20LanceDB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - EPIPHANIES E-RUBICON-RACTOR: the shipped Σ10 Rubicon-resonance commit (SigmaTierRouter, D-CSV-10 #388, E21) grounded in Heckhausen's Rubicon model of action phases — ractor START = crossing the Rubicon (Σ10 commit, irreversible), Libet "free won't" = CollapseGate pre-commit veto (ghost preempt), ractor STOP = post-actional evaluation → tombstone. Provenance note: Libet/Heckhausen were NOT previously in the board (recorded now). - correction: SurrealDB is a VIEW over LanceDB, NOT a separate store; LanceDB is the leading cold storage (source of truth). The Rubicon kanban is a SurrealDB view projecting LanceDB rows. - plan §2.7 updated: cold = LanceDB (leading); SurrealDB = optional kanban view; ThoughtStruct transparent view reads hot mailbox OR cold LanceDB. Design/spec only. https://claude.ai/code/session_017GFLBnDy23AWBqvkbHHC41 --- .claude/board/EPIPHANIES.md | 18 ++++++++++ .../bindspace-singleton-to-mailbox-soa-v1.md | 35 +++++++++++-------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index f6adb434..56088745 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -1,3 +1,21 @@ +## 2026-05-27 — E-RUBICON-RACTOR — the Σ10 Rubicon commit IS the Heckhausen action-phase crossing; ractor start/stop = crossing/closing the Rubicon; Libet "free won't" = the pre-commit veto; the kanban is a SurrealDB VIEW over leading LanceDB storage + +**Status:** CONJECTURE / design-grounding. Names the psychological origin of the *already-shipped* Σ10 Rubicon doctrine. **Provenance note:** "Σ10 Rubicon" is canonical and implemented (`SigmaTierRouter` Rubicon-resonance dispatch, `D-CSV-10` shipped PR #388; origin `linguistic-epiphanies-2026-04-19.md` E21), but **"Libet" and "Heckhausen" appear nowhere in the board/code/transcripts** — that grounding was a different session or verbal, recorded here now. + +**The model.** Heckhausen/Gollwitzer's **Rubicon model of action phases**: pre-decisional *deliberation* (motivational, reversible) → **crossing the Rubicon** (intention formed = volitional, *irreversible* commitment) → pre-actional → *actional* → post-actional *evaluation*. **Libet**: the readiness potential precedes conscious decision; conscious will's role is the **veto** ("free won't") — abort before the act. + +**The mapping (orchestration = ractor start/stop):** +- **Deliberation (pre-decisional)** = a mailbox accumulating energy, **no commit** — reversible; the `MailboxSoA.energy` integrates baton receipts (`apply_edges`) below threshold. +- **Crossing the Rubicon** = the **Σ10 commit**: `ΔF < threshold AND resonance > Rubicon-bar` (`SigmaTierRouter`, D-CSV-10) → **ractor START of the actional phase** — irreversible: the baton emits (`CollapseGateEmission`), the row's contents flow through L3 to AriGraph/SPO (calcify). "Opinions are committed contradictions preserved" = post-Rubicon irreversibility. +- **Libet veto ("free won't")** = the CollapseGate **pre-commit abort window**: a mailbox can be preempted/vetoed *before* crossing (ghost-tier preemptible to zero — `E-LADDER-SERVES-MAILBOX` §5). The veto is the only "free will" lever; the readiness potential (energy ramp) is mechanical. +- **Post-actional evaluation → ractor STOP / die** → tombstone-witness persists (`E-LADDER-SERVES-MAILBOX` §6). Start=spawn-at-crossing, stop=evaluate-and-die is the ractor outer-swarm lifecycle (`D-PERSONA-5`, async at the boundary; inner Click stays sync). + +**The kanban = a SurrealDB VIEW over leading LanceDB.** The Rubicon action-phase board (deliberation | crossed/intention | actional | evaluated) is a **SurrealDB view projecting LanceDB rows** — moving a thought across columns = ractor start/stop transitions. **LanceDB is the leading storage (source of truth, append-only/versioned); SurrealDB-on-`kv-lance` is a view/query surface over it, never a separate store** (corrects any "SurrealDB-on-Lance is the cold tier" framing — the cold tier is LanceDB; SurrealDB is one view over it). See `bindspace-singleton-to-mailbox-soa-v1` §2.7. + +**Cross-ref:** `linguistic-epiphanies-2026-04-19.md` E21 (Σ10 Rubicon tier doctrine), `causaledge64-mailbox-rename-soa-v1` §10 + E-CE64-MB-8 (SigmaTierRouter = substrate-tier router), `cognitive-substrate-convergence-v*` (D-CSV-10 Rubicon-resonance, #388), `E-LADDER-SERVES-MAILBOX` (§1 ractor outer-swarm sync/async, §5 ghost preempt = veto, §6 tombstone), `E-MAILBOX-IS-BINDSPACE` + `bindspace-singleton-to-mailbox-soa-v1` §2.7 (LanceDB-leading / SurrealDB-view), `D-PERSONA-5` (ractor outer-swarm runtime). **Open:** whether to add a `linguistic-epiphanies` entry naming the Heckhausen/Libet origin alongside E21 (awaits go). + +--- + ## 2026-05-27 — E-MAILBOX-IS-BINDSPACE — the singleton `Arc` dissolves *onto* mailboxes: `MailboxSoA` *becomes* the per-mailbox ephemeral thoughtspace (BindSpace surrogate), it is NOT copied per mailbox **Status:** CONJECTURE / design-ruling (migration spec authored this session; NOT yet implemented). Extends `E-BATON-1` + `E-CE64-MB-4` downward into the column layout. Plan: `.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md`. diff --git a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md index 78dee371..fe260c1e 100644 --- a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md +++ b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md @@ -199,9 +199,10 @@ hot path translates to/from. p64-bridge is the conformance template for the stor ## 2.7 — Hot/cold: `ThoughtStruct` is a transparent view over the SurrealDB container table(s) The same "one SoA, no re-encode" rule (§2.5) extends **past RAM into persistence**. The hot -path can hold **only ~64k–256k thoughts**; beyond that, thoughts live in the **SurrealDB-on-Lance -container table(s)** (`crates/surreal_container`, the Zone-2 cold tier — currently a BLOCKED -skeleton, see `surreal/RECONCILIATION`). The ruling: +path can hold **only ~64k–256k thoughts**; beyond that, thoughts live in **LanceDB — the +*leading* cold storage** (append-only/versioned, source of truth). **SurrealDB is a *view* +over LanceDB, NOT a separate store** (`crates/surreal_container` = SurrealDB-on-`kv-lance` = +a query/kanban surface projecting the LanceDB rows; LanceDB stays leading). The ruling: > `ThoughtStruct` (the Γ-collapse thought) is **later also a transparent view into the > ThoughtStruct container table(s)** — reading a thought resolves over the **same SoA layout** @@ -230,20 +231,26 @@ skeleton, see `surreal/RECONCILIATION`). The ruling: hot (mailbox SoA, ≤ 64k–256k thoughts, ~300–600 MB) │ energy decays / mailbox dies / working set full ▼ spill — SAME SoA columns, no re-encode (persisted_row) - cold (SurrealDB-on-Lance container table(s), append-only/versioned) + cold = LanceDB (LEADING storage: append-only/versioned, source of truth) + ├──────────────► SurrealDB (a VIEW over LanceDB — the Rubicon kanban) ▲ - │ ThoughtStruct view reads hot OR cold transparently (same layout) + │ ThoughtStruct view reads hot mailbox OR cold LanceDB transparently (same layout) ``` -- The SurrealDB container is the **same SoA columns** persisted (edge/qualia/meta/entity_type - + content identity), append-only/versioned — so the cold store *is* the tombstone-witness + - GoBD trail (`E-LADDER-SERVES-MAILBOX` §6) by construction. -- `ThoughtStruct` (`thinking-engine`) becomes the **transparent view** over `(hot mailbox row | - cold container row)`; text stays lazy. This makes the §2.6 ruling literal at the storage tier: - `ThoughtStruct` is a read-projection, identical whether the row is in RAM or in SurrealDB. -- **Gating:** the cold tier needs `surreal_container` unblocked (BLOCKED(A/B/C/D) — fork dep + - Lance 6 pin) **or** the `lance-graph-callcenter` Zone-2 path; the transparent-view wiring is - migration step **S4** (plan §6) and new deliverable **D-MBX-6**. +- **LanceDB is the leading store.** The cold rows are the **same SoA columns** persisted + (edge/qualia/meta/entity_type + content identity), append-only/versioned — so LanceDB *is* + the tombstone-witness + GoBD trail (`E-LADDER-SERVES-MAILBOX` §6) by construction. +- **SurrealDB is a view, not a store.** `surreal_container` (SurrealDB-on-`kv-lance`) projects + the LanceDB rows into query surfaces — notably the **Rubicon-model kanban** (action-phase + board; see the `E-RUBICON-RACTOR` epiphany). It never owns the data; LanceDB does. +- `ThoughtStruct` (`thinking-engine`) is the **transparent view** over `(hot mailbox row | + cold LanceDB row)`; text stays lazy. The §2.6 ruling holds at the storage tier: + `ThoughtStruct` is a read-projection, identical whether the row is in RAM or LanceDB; the + SurrealDB kanban is a *second* view over the same LanceDB rows, not a re-encode. +- **Gating:** the cold tier is LanceDB (already the workspace storage); the SurrealDB *view* + needs `surreal_container` unblocked (BLOCKED(A/B/C/D) — fork dep + Lance 6 pin) but is + **optional** (a kanban surface, not the source of truth). Transparent-view wiring is + migration step **S4** (plan §6) and deliverable **D-MBX-6**. ---