diff --git a/.claude/board/AGENT_LOG.md b/.claude/board/AGENT_LOG.md index d83335c8..238cd8a1 100644 --- a/.claude/board/AGENT_LOG.md +++ b/.claude/board/AGENT_LOG.md @@ -1,3 +1,7 @@ +## 2026-06-13 — SoA migration diff resolution doc (catch-up audit + post-#490 supersession map) + +**bardioc cross-session.** Operator directive: *"the biggest goal would be to catch up on all SoA bindspace migration plans and resolve the diff."* Surveyed the SoA / BindSpace / identity plan family (9 plans + 4 board files + 5 code files + canon doc-locks) and produced a single resolution doc at `.claude/plans/soa-migration-diff-resolution-2026-06-13.md` that names every plan-vs-shipped diff post-#487/#489/#490. **Headline drifts named:** (1) `identity-architecture-exists-vs-needs-v1.md §N1`'s UUIDv8 layout fully superseded by OGAR/CLAUDE.md P0 canon — the namespace/entity_type/kind/niblepath_prefix/shape_hash/RFC ceremony framing did NOT ship; canon's classid·HEEL·HIP·TWIG·family·identity (no ceremony) won (PR #489/#490). (2) `bindspace-singleton-to-mailbox-soa-v1.md`'s `CollapseGateEmission` / `MailboxSoA::emit()` / Baton-as-type was retired in PR #487 tombstone; `last_emission_cycle → last_active_cycle` rename per #477 supersession. (3) `unified-soa-convergence-v1.md §4.2` stack pins drifted (`lance =7.0.0` / `lancedb =0.30.0`); 2026-05-29 addendum partially addressed. (4) `polyglot-container-query-membrane-v1.md` ratified research-only — self-describing-key convergence dissolved the membrane question. **D-MBX-A2 status:** still queued, still the gating gap; MailboxSoA has no Hamming columns. **S2-S4 status:** unshipped; `driver.rs:56` still has `pub(crate) bindspace: Arc`, both `bin/serve.rs:29` + `bin/grpc.rs:29` still call `BindSpace::zeros(4096)`. **SoaEnvelope status:** trait shipped (#477), zero real implementors — only `TestEnvelope` in tests; MailboxSoA does NOT impl it. **Staunen/Wisdom-as-entropy×energy-substrate-state correction with §6.1 alternative framings (Bugwelle / aerodynamics / event horizon / Friston FEP)** — added per operator relay 2026-06-13: (a) Staunen as the entropy *Bugwelle* (bow wave) of thinking-in-progress — Staunen is not static, it's the leading-edge entropy disturbance GENERATED by cognitive motion; (b) Aerodynamic / shock-wave analogy — as cognitive velocity through the substrate increases, the Bugwelle steepens, "sonic boom" = the *aha* breakthrough where entropy collapses abruptly; (c) Event-horizon / inertia — Wisdom's (low entropy × high energy) corner has gravitational properties, novelty needs escape velocity to break out of the well, the canon's "reserve don't reclaim" at classid==0/family==0 keeps the bootstrap basin always-escapable; (d) Friston Free Energy Principle as the scientific anchor — high FE = Staunen, FE-minimisation in progress = Confusion/Chaos quadrant, minimised FE = Wisdom; `consume_firing(row)` IS active inference (energy ≥ threshold ⇒ fire, in-place mark, integrate prediction error). The four framings stack: Bugwelle = shape; aerodynamics = velocity scaling; event-horizon = inertia/why Wisdom resists; FEP = drive function. Same underlying substrate dynamics, four vocabularies for reach. (handover §8 + operator image relays + operator framing relay 2026-06-13). Canonical DIKW = Data → Information → Knowledge → Wisdom, bridged by Processing → Cognition → Judgment; Wisdom IS the canonical DIKW apex rung. The operator's precise framing: **Staunen = high entropy × low energy** = "needs entropy work" marker = cognitive pressure + emerging insight (not yet crystallised). **Wisdom = low entropy × high energy** = crystalline knowledge with supporting plasticity + integrated insights, the substrate has invested heavily and locked it in. Diagonal opposites on the entropy×energy plane, NOT two ends of one axis. The other two quadrants: **Confusion / Chaos** (high entropy × high energy = in-progress climb state, substrate has invested energy but entropy hasn't yet collapsed) and **Boredom / Inert** (low entropy × low energy = ordered but not energised). Substrate column map: Energy = `MailboxSoA.energy: [f32; N]` (signed spatio-temporal accumulator); Plasticity = `MailboxSoA.plasticity_counter: [u8; N]` (saturating Hebbian counter = long-term investment); Entropy proxy = classid-prefix-resolved codebook hit-rate × local edge-neighbourhood density. Two-algebra rule maps onto the plane: entropy axis = signed side (`vsa_bind`), energy axis = magnitude side (`vsa_bundle`). The canon's 3×4 uniform cascade (HEEL · HIP · TWIG = three u16 tiers) shape-matches DIKW's three transitions + four layers — not coincidentally. NOT YET corrected in lance-graph CLAUDE.md (line ~120 still says "Magnitude = Contradiction depth from Staunen × Wisdom qualia") — flagged as `TD-CLAUDE-MD-STAUNEN-MISNAME` for a separate maintenance pass with three specific edits identified (line ~120 rewrite citing entropy×energy markers, §11.5 rephrasing, new DIKW-anchor sub-section under "The Click" mapping cascade tiers onto DIKW transitions + the entropy×energy quadrant diagram). **LE-contract violations still on the books:** `engine_bridge.rs` f32→i4 qualia re-encode, `Vsa16kF32` persisted as cross-boundary in singleton, DTO-as-owned-Vec sites — all dissolve at S2/S4. Errata stubs prepended to 4 affected plans (bindspace-singleton-to-mailbox-soa, identity-architecture-exists-vs-needs, unified-soa-convergence, polyglot-container-query-membrane) pointing at the resolution doc. Resolved punchlist §7 lists 9 follow-up PRs in priority order. Docs-only PR; no code touched. + ## 2026-06-13 — #489 canonicalised: wire-in + self-describing Display + retire Phase-A wrapper **bardioc cross-session.** Operator pin: *"#489 is canonical."* Audited OGAR/CLAUDE.md P0 against `canonical_node.rs` group-by-group. Key (classid·HEEL·HIP·TWIG·family·identity = 8·4·4·4·6·6 hex) matches exactly; RFC-WAIVED matches ("No UUID ceremony"); 3×4 uniform tiers match (each u16; tier-of-level = `level >> 2`); 16-byte EdgeBlock at fixed offset = row-layout analogue of the zero-fallback ladder (default class's default ClassView reserves it, registry-resolved opt-out for non-default classes, "reserve-don't-reclaim" at row level). **One gap closed:** canon mandates *"every printed GUID is self-describing at sight"* via the dash-groups, wrapper had no `Display`. Added `impl Display for NodeGuid` emitting canonical `{classid:08x}-{heel:04x}-{hip:04x}-{twig:04x}-{family:06x}{identity:06x}` (LE in-memory bytes folded through the accessors so hex print is canon-ordered regardless). +2 Display tests. **Phase-A wrapper retired in the same PR** (operator: *"delete #480 from your mind"*): `identity.rs` deleted (UUIDv8 NodeGuid + RFC ceremony bits + IDENTITY_LAYOUT_VERSION + SHAPE_HASH_BITS/LOCAL_BITS — all canon-incompatible per *"wrappers adapt to the canon, never the reverse"*); `pub use identity::{NodeGuid, IDENTITY_LAYOUT_VERSION}` → `pub use canonical_node::{EdgeBlock, NodeGuid, NodeRow}`; `pub mod identity;` removed. Two stale doc references reworded: `hhtl.rs:192` (`from_packed` now a general HHTL utility, not identity::NodeGuid-specific), `lance-graph-ontology/src/registry.rs:405` (`niblepath_of` now points at the canon's `classid·HEEL·HIP·TWIG` resolution). `cargo test -p lance-graph-contract --lib`: **594/594 green** (−10 retired UUIDv8 tests, +2 Display, +8 wire-in canonical_node tests now visible); `cargo check -p lance-graph-ontology`: clean (5 pre-existing `oxrdf::Subject` deprecation warnings, untouched files); `cargo clippy -p lance-graph-contract --all-targets -- -D warnings`: clean. Anchored on #482 (GUID canon) + #489 (canonical_node) + OGAR/CLAUDE.md P0 (the canon itself, *"wrappers audited against this canon group-by-group — never the reverse"*). diff --git a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md index d34d547c..c42447d7 100644 --- a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md +++ b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md @@ -1,5 +1,7 @@ # bindspace-singleton-to-mailbox-soa-v1 — dissolve the shared `Arc` into per-mailbox `MailboxSoA` thoughtspace +> **ERRATA (2026-06-13, post-#490):** D-MBX-A1 columns are shipped (PR #386, mailbox_soa.rs); `last_emission_cycle` is renamed to `last_active_cycle` (PR #477); `CollapseGateEmission` + `MailboxSoA::emit()` are deleted (PR #487); §2.6 DTO inventory predates the TD-RESONANCEDTO-DUP-1 deferral. §5 sequencing (D-MBX-A2 → S1 → S2 → S3 → S4) is still directionally correct; D-MBX-A2 is the current gating gap. Full diff resolution: `soa-migration-diff-resolution-2026-06-13.md`. + > **Status:** CONJECTURE / design (migration spec). NOT yet implemented. > **Date:** 2026-05-27. > **Owns the answer to:** *"make MailboxSoA the individual, mailbox-owned, ephemeral diff --git a/.claude/plans/identity-architecture-exists-vs-needs-v1.md b/.claude/plans/identity-architecture-exists-vs-needs-v1.md index dc0469a8..02f0a644 100644 --- a/.claude/plans/identity-architecture-exists-vs-needs-v1.md +++ b/.claude/plans/identity-architecture-exists-vs-needs-v1.md @@ -1,5 +1,7 @@ # Identity Architecture — What Exists vs What Needs Building (v1) +> **ERRATA (2026-06-13, post-#490):** §N1's proposed UUIDv8 layout (`namespace + entity_type + kind + niblepath_prefix + shape_hash + local + RFC version/variant + layout_version`) is **fully superseded by the operator-pinned canon** (OGAR/CLAUDE.md P0). Canon's `classid · HEEL · HIP · TWIG · family · identity` (8·4·4·4·6·6 hex; 3×4 uniform; RFC-WAIVED; no shape_hash, no layout_version) shipped in `canonical_node.rs` (PR #489) and was canonicalised via lib.rs re-export switch in PR #490; the Phase-A wrapper `identity.rs` was deleted in the same PR (zero in-tree consumers per #480's own body). §N5 `entity_type ↔ NiblePath` bijection: **shipped** in PR #484 (`lance-graph-ontology::registry`). §N3 `SoaEnvelope` impls: still queued. Full diff resolution: `soa-migration-diff-resolution-2026-06-13.md`. + > **Status:** INTEGRATION MAP + PLAN. Grounded by first-hand reads + two parallel > cross-repo sweeps (2026-06-09). Companion to > `cognitive-write-roundtrip-substrate-v1.md` (the round-trip mechanism). diff --git a/.claude/plans/polyglot-container-query-membrane-v1.md b/.claude/plans/polyglot-container-query-membrane-v1.md index aa756b40..8f1c6931 100644 --- a/.claude/plans/polyglot-container-query-membrane-v1.md +++ b/.claude/plans/polyglot-container-query-membrane-v1.md @@ -1,5 +1,7 @@ # Polyglot Container Query Membrane — SurrealQL AST + DataFusion UDF + Cypher over one HHTL address space (v1) +> **ERRATA (2026-06-13, post-#490):** Ratified as **research-only / superseded in spirit**. The "membrane / strategy-registry" framing was superseded in discussion by the self-describing-key convergence (class-in-key makes the cold path already a graph; no membrane needed) and by the GUID-canon PR #482 that crystallised the operator's canon. The verified file:line surface of lance-graph + the surrealdb fork's AST/RecordId/kv-lance remains useful as a grounded inventory but is not a committed direction. Full diff resolution: `soa-migration-diff-resolution-2026-06-13.md`. + > **Status:** RESEARCH MAP + INTEGRATION PLAN. Grounded 2026-06-09 by two parallel > repo sweeps (lance-graph + the surrealdb fork) with main-thread spot-verification > of every load-bearing claim (one agent claim caught false and corrected, §2.4). diff --git a/.claude/plans/soa-migration-diff-resolution-2026-06-13.md b/.claude/plans/soa-migration-diff-resolution-2026-06-13.md new file mode 100644 index 00000000..4c9fa439 --- /dev/null +++ b/.claude/plans/soa-migration-diff-resolution-2026-06-13.md @@ -0,0 +1,276 @@ +# SoA migration diff resolution — 2026-06-13 + +> **Type:** meta-resolution (audit + supersession map), not a new plan. +> **Audience:** any session touching the BindSpace dissolution, the SoA envelope ABI, the identity architecture, or the cycle-coherent snapshot work after PR #490. +> **Scope:** harmonises the SoA / BindSpace / identity plan family against the shipped reality post-#487/#489/#490 + the operator-pinned canon (OGAR/CLAUDE.md P0). Names every drift, pins the supersession, and lists the open work that survives. Does not declare new deliverables; does not retroactively rewrite plan bodies. +> **Trigger:** the bardioc cross-session driver opened PR #490 ("#489 is canonical"), which retired the Phase-A UUIDv8 wrapper. With the canonical NodeGuid layout now live, multiple plans hold framing that no longer matches code or canon. Resolution doc lands the diff in one place. + +--- + +## 1. Canon anchors (the truth all plans must match) + +| Anchor | Where | Says | +|---|---|---| +| Operator GUID canon | `OGAR/CLAUDE.md` P0 | 16-byte key = `classid · HEEL · HIP · TWIG · family · identity` (8·4·4·4·6·6 hex); RFC-WAIVED ("the GUID is NOT RFC-stamped"); 3×4 uniform tiers; tier-of-level = `level >> 2`; codebook scoping = classid prefix; *"wrappers adapt to the canon, never the reverse."* | +| Doc-lock | `lance-graph/CLAUDE.md` (4ea6ac92, #488 line-of-commits) | Same layout; reserve-don't-reclaim discipline for the zero-fallback ladder; canon does not pre-pay RFC ceremony in every key. | +| Code form | `crates/lance-graph-contract/src/canonical_node.rs` (#489 + #490) | Locked layout matches canon group-by-group; `Display` impl renders self-describing 8-4-4-4-12 hex; size-asserts at 16/16/512; 12+4 `EdgeBlock`; 480-byte `value` slab on `NodeRow`. | +| Three-tier model | `docs/architecture/soa-three-tier-model.md` (#477) | **No emission, no inter-mailbox handoff type.** SoA is zero-copy from creation to Lance tombstone. `MailboxSoaOwner` mutates; `MailboxSoaView` reads. Lance's columnar I/O writes LE bytes from the in-place store. | +| Tombstone commit | #487 | `CollapseGateEmission` + `MailboxSoA::emit()` deleted from source; `last_emission_cycle → last_active_cycle`; `consume_firing(row) -> bool` is the in-place successor. | +| Phase-A retirement | #490 | `identity::NodeGuid` (UUIDv8 wrapper) deleted; `IDENTITY_LAYOUT_VERSION` removed; `lance_graph_contract::NodeGuid` now re-exported from `canonical_node`. | + +--- + +## 2. Plan inventory and status + +The SoA / BindSpace / identity plan family, post-#490. + +| Plan file | Intent (one line) | Status after #490 | Land-PRs | +|---|---|---|---| +| `bindspace-singleton-to-mailbox-soa-v1.md` (2026-05-27) | Dissolve `Arc` singleton → per-mailbox `MailboxSoA` | **Partially-superseded.** §3 column-by-column map authoritative; D-MBX-A1 columns shipped in #386; §2.6 DTO inventory and §5 sequencing predate the #477 emission tombstone (which made some §5 details moot). | #386 (D-MBX-A1 columns), #477 (rename + tombstone), #487 (emit() removed) | +| `unified-soa-convergence-v1.md` + addendum (2026-05-29) | "Five layered rulings" for SoA end-to-end, never re-encoded | **Authoritative as doctrine, stale on stack pins.** §1 rulings unchanged (anchor for E-SOA-IS-THE-ONLY). §4.2 stack table predates lance→7.0.0 / lancedb→0.30.0 bumps. Addendum (#486) partially addresses; this doc names the residual. | #434 (landed), #486 (addendum), #487/#488/#489/#490 (incremental impl) | +| `identity-architecture-exists-vs-needs-v1.md` (2026-06-09) | Compose `NodeGuid` from existing scalars (UUIDv8) | **§N1 layout fully-superseded by canon.** The proposed `namespace + entity_type + kind + niblepath_prefix + shape_hash + local + RFC version/variant + layout_version` layout did NOT ship. Canon's `classid + HEEL + HIP + TWIG + family + identity` (no ceremony, no shape_hash, no layout_version) won. §N5 entity_type↔NiblePath bijection: **shipped** in #484. §N3 SoaEnvelope impls: **still queued** (only `TestEnvelope` implements). | #480 (Phase-A, retired), #484 (bijection), #489 (canon code form), #490 (canon wired + Phase-A retired) | +| `cognitive-write-roundtrip-substrate-v1.md` (2026-06-11) | Cold-path write as `TripletProjection` + roundtrip_eq gate | **Still-authoritative.** Doctrine intact; blocked on `SoaEnvelope` impls for the canonical row layout. | None yet shipped | +| `cycle-coherent-soa-snapshot-v1.md` | Arc-swap COW snapshot at column granularity | **Still-authoritative.** Trait shape (`SnapshotProvider::Column`, generic `MailboxSoaSnapshot`) ratified by #487 CodeRabbit-Critical fix. No implementor yet. | None yet shipped | +| `singleton-to-snapshot-nudge-v1.md` (PR #478) | Every shared-mutable singleton → per-owner SoA + Arc-swap | **Still-authoritative.** Codebook-vs-runtime-state rule unchanged. D-SNGL-3 (AttentionMatrix `unbundle_from`) still queued. | #478 (plan, no code) | +| `polyglot-container-query-membrane-v1.md` (PR #484) | SurrealQL + DataFusion + Cypher membrane over HHTL | **Research-only / superseded in spirit.** Author self-flagged in #484 body: *"superseded in discussion by the self-describing-key convergence (the class-in-key makes the cold path already a graph; no membrane needed)."* | None | +| `causaledge64-mailbox-rename-soa-v1.md` | `MailboxSoA` shape + cycle-stamp rename | **Mostly shipped.** D-CSV-1/2/5a/7 done; the rename is in #477. | #383/#384/#386/#477 | +| `bindspace-columns-v1.md` | Original column-map prior to dissolution | **Superseded by `bindspace-singleton-to-mailbox-soa-v1.md`.** Kept for history. | (historical) | + +--- + +## 3. Concept-level diff (shipped vs planned) + +### 3.1 Retired (planned, but never shipped or deleted post-ship) + +| Concept | Plan reference | Disposition | +|---|---|---| +| `CollapseGateEmission` | bindspace-singleton-to-mailbox-soa-v1 §5; causaledge64-mailbox-rename §3 | **Deleted #487.** Replaced by in-place `MailboxSoA::consume_firing(row)`. | +| `MailboxSoA::emit()` | bindspace-singleton-to-mailbox-soa-v1 §3 | **Deleted #487.** Same successor. | +| "Baton" as a `(u16 target, CausalEdge64)` carrier type | bardioc handover §5; CLAUDE.md 2026-05-26 block | **Never materialised.** Three-tier model (#477) ratifies "no inter-mailbox handoff type at all." `MailboxId`/`MergeMode`/`GateDecision` survive as concepts in `collapse_gate.rs`. | +| `wire_cost_bytes() = 13 + 10·baton_count` | CLAUDE.md 2026-05-26 block | **Gone with the carrier (#477).** | +| `Vsa16kF32` as a *carrier* | unified-soa-convergence-v1 §2.2; bardioc handover §1 | **Deprecated as carrier; still allocated as `BindSpace.fingerprints.cycle`.** Plan §0 says "deprecated"; code at `bindspace.rs` still holds the 64KB plane. Dissolution lands at S4. | +| `identity::NodeGuid` (UUIDv8 wrapper) | identity-architecture-exists-vs-needs-v1 §N1 | **Deleted #490.** Pre-production with zero in-tree consumers per #480's own body; canon-incompatible per "wrappers adapt to the canon, never the reverse." | +| `IDENTITY_LAYOUT_VERSION` | identity-architecture-exists-vs-needs-v1 §N1 | **Deleted #490.** Canon does not pre-pay an in-band layout version in every key. | +| `SHAPE_HASH_BITS` / `LOCAL_BITS` consts | identity-architecture-exists-vs-needs-v1 §N1 | **Deleted #490.** Canon real-estate reclaimed: HIP+TWIG occupy the bytes the wrapper had spent on `shape_hash`. | +| `niblepath_prefix` slot in NodeGuid | identity-architecture-exists-vs-needs-v1 §N1 | **Not in canon.** Canon's HEEL is 4 nibbles uniform (not a truncated prefix of a `NiblePath`); HIP+TWIG are 4 more nibbles each (uniform 3×4). | +| RFC 9562 version=8 / variant=0b10 bits | identity-architecture-exists-vs-needs-v1 §N1 | **Not in canon.** Canon: *"RFC 9562 is a WRAPPER format, and wrappers adapt to the canon, never the reverse — any boundary that genuinely requires RFC-valid UUIDs owns that adaptation at its membrane and pays it explicitly."* | + +### 3.2 Renamed (plan vs code label drift) + +| Plan label | Code label | Where | +|---|---|---| +| `last_emission_cycle` | `last_active_cycle` | mailbox_soa.rs (PR #477 rationale: "there is no emission; the stamp marks in-place consumption") | +| `MailboxSoA::emit()` | `MailboxSoA::consume_firing(row)` | mailbox_soa.rs (PR #487 successor; zero-copy in-place stamp + energy reset) | +| `advance_phase` | `try_advance_phase` (Result-returning) | soa_view.rs (PR #487, returns `Result`) | +| `identity::NodeGuid` | `canonical_node::NodeGuid` (re-exported as `lance_graph_contract::NodeGuid`) | #490 | + +### 3.3 Shipped but never planned (genuinely new in code) + +| Concept | Code site | Notes | +|---|---|---| +| Zero-fallback ladder on `NodeGuid` | canonical_node.rs:11-18 | classid==0 ⇒ default class (dormant); family==0 ⇒ default basin (dormant); identity alone discriminates in the bootstrap state. "Reserve, don't reclaim" — same discipline that `EdgeBlock` extends to row-layout level. | +| `EdgeBlock` (12 in-family + 4 out-of-family) | canonical_node.rs:120-127 | Canonical, not mandatory: 16 bytes always reserved (zeroed when unused). Opt-out is registry-resolved via `classid → ClassView`, never by changing the row stride. The row-layout analogue of the key-side zero-fallback ladder. | +| `NodeRow { key:16, edges:16, value:480 } = 512 byte` | canonical_node.rs:129-140 | The Lance row the `MailboxSoaOwner` owns and the `MailboxSoaView` reads. Value slab is class-resolved; energy/meta/qualia/entity_type/materialised CausalEdge64/helix residue/fingerprint/class extensions all land here when the class's ClassView declares them. | +| `impl Display for NodeGuid` | canonical_node.rs:135-150 (#490) | Self-describing `{classid:08x}-{heel:04x}-{hip:04x}-{twig:04x}-{family:06x}{identity:06x}` per canon's *"every printed GUID is self-describing at sight."* LE in-memory bytes fold through the accessors so hex print is canon-ordered regardless. | +| Three-tier model formal split | docs/architecture/soa-three-tier-model.md (#477) | Tier 1 = MailboxSoA (hot, zero-copy creation→tombstone); Tier 2 = KanbanColumn / Rubicon (sole secondary, sole-mutator via `try_advance_phase`); Tier 3 = OGIT ontology + OGAR classes (inherited, O(1) via HHTL/`NiblePath` prefix). | +| `SoaEnvelope` trait (envelope-level LE contract) | soa_envelope.rs (#477) | Stable column ordering, fixed row stride, cycle stamp, `ENVELOPE_LAYOUT_VERSION = 1`, `verify_layout()` gate (catches stride mismatch, column overlap, column-past-stride, packet size mismatch, version skew). | + +### 3.4 Status discrepancies (plan says X, code says Y) + +| Item | Plan says | Code says | +|---|---|---| +| **D-MBX-A1 columns** (edges/qualia/meta/entity_type on MailboxSoA) | "Ship S1" | **Shipped** (PR #386, mailbox_soa.rs:73-94 with named setters/getters) | +| **D-MBX-A2** (Hamming planes + temporal/expert) | Gating gap | **Still queued** — MailboxSoA has no Hamming columns yet (mailbox_soa.rs:51-108) | +| **S2** (G4 dissolve / engine_bridge ~600→~150 LOC) | Queued behind A2+S1 | **Not shipped** — engine_bridge.rs ~34KB unchanged | +| **S4** (delete `Arc`) | Final step | **Not shipped** — driver.rs:56 still has `pub(crate) bindspace: Arc`; both `bin/serve.rs:29` and `bin/grpc.rs:29` still call `BindSpace::zeros(4096)` | +| **`SoaEnvelope` impl for MailboxSoA** | Implied substrate | **No real implementor exists.** Only `TestEnvelope` in `soa_envelope.rs` tests (lines 254-310). MailboxSoA does not impl `SoaEnvelope`. | +| **`MailboxSoaOwner` / `MailboxSoaView` for MailboxSoA** | Ratified trait split (three-tier doc) | **No real implementor exists.** Traits defined; MailboxSoA does not implement them. | + +--- + +## 4. BindSpace dissolution sequence status (post-#490) + +The bardioc handover named `D-MBX-A2 → S1 → S2 → S3 → S4` sequencing. Status as of 2026-06-13 19:54Z (post-#490): + +| Step | Deliverable | Status | Blocker / next move | +|---|---|---|---| +| **D-MBX-A2** | Hamming planes (`content`/`topic`/`angle: [[u64; 256]; N]`) + temporal/expert decisions on `MailboxSoA` | ✗ Queued | Type work; OQ-11.2 default W=16 implies ~6 KB/thought addition | +| **S1** | G5 + G6 retargets (qualia I/O + `persist_cycle` minus cycle plane) | ✗ Queued, partially-trivial | A2 not strictly required for qualia/edges/meta retargets; engine_bridge still routes through BindSpace | +| **S2** | G4 dissolve (BusDto → row-view, `dispatch_busdto`/`unbind_busdto`/`busdto_to_binary16k` deleted; engine_bridge ~600 → ~150 LOC) | ✗ Queued | A2 + S1 — content-plane writes need Hamming columns | +| **S3** | G1 reshape (`ingest_codebook_indices` → thin sensor adapter; StreamDto becomes a true membrane-edge type) | ✗ Queued | S2 | +| **S4** | Delete `Arc` field on `ShaderDriver` + the two `BindSpace::zeros(4096)` allocations + `bindspace.rs:234` type itself | ✗ Queued | S3 | + +**Honest assessment:** the canonical row layout is now live in `canonical_node.rs` (#489/#490), but **MailboxSoA has not yet been migrated to use `NodeRow` row-strided storage**. The plan's S2 ~600→~150 LOC engine_bridge shrink is the next high-leverage move, and it needs A2 first. + +--- + +## 5. LE-contract violations still on the books + +Per bardioc handover §9 zero-copy audit, "bytes don't translate at any boundary." Sites that still violate: + +| Violation | Location | Status | +|---|---|---| +| f32 → `from_f32_17d` → i4 re-encode at the qualia sensor membrane | `engine_bridge.rs` (handover named line 262-267; verify exact range post-rebases) | ✗ Still present. Canonical bad pattern: the f32 should die at the sensor membrane; everything past it should already be i4 bytes. | +| `Vsa16kF32` as cross-boundary persistent state | `bindspace.rs` `FingerprintColumns.cycle` (the 64 KB plane) | ✗ Still allocated. Plan says "ephemeral local compute only" (E-BATON-1 carve-out); code persists it at singleton level. Dissolves at S4. | +| DTO-as-owned-`Vec` where the DTO could be a `&[T]` view over a SoA column | engine_bridge.rs BusDto/StreamDto/ResonanceDto payloads | ✗ Still present. G4 dissolve (S2) addresses this. | +| Two same-name `CausalEdge64` types | causal-edge / thinking-engine | ✗ Disambiguation PR called out in #487 body as "not in scope — needs its own PR." | +| `OntologyRegistry` linear-scan vs the doc claim of "O(1) index" | `ontology` crate | ✗ Called out in #477 docs/probes/particle-soa-envelope-audit.md. Replace with HHTL radix-trie lookup; evaluate `entity_type` redundancy. | + +**Not violated** (audit checked): +- Cognitive-shader-driver does not do Arrow translation on the hot path. Arrow lives only in the ontology cold path (legit per handover §9's "calcified cold knowledge" carve-out). +- The new `NodeGuid::Display` impl (#490) is LE-clean: bytes are folded through field accessors that read LE, so hex print is canon-ordered regardless of in-memory byte order. + +--- + +## 6. The Staunen/Wisdom-as-DIKW-climb-position correction + +**Source:** bardioc handover §8 (2026-06-05) + operator image relays (2026-06-13: the 8-rung extended pyramid and the KM Cognitive Pyramid) + the [DIKW pyramid](https://en.wikipedia.org/wiki/DIKW_pyramid) canonical lineage. + +**Canonical DIKW (the lineage to anchor against):** four vertically-stacked layers — `Data → Information → Knowledge → Wisdom` — bridged by three integration arrows: + +| Arrow | Lifts | Operation | +|---|---|---| +| **Processing** | Data → Information | organize, label, transform | +| **Cognition** | Information → Knowledge | interpret, contextualise, find relevance | +| **Judgment** | Knowledge → Wisdom | visualise, analyse, apply, anticipate | + +The KM Cognitive Pyramid variant adds rung-specific markers (PIRs at Knowledge, CCIRs at Wisdom, EEI/EEFI at Information) and two orthogonal axes that run *along* the climb: **Reactionary↑Anticipatory** (decision behaviour — Data-level reactions are reactionary, Wisdom-level decisions are anticipatory) and **high↓low decision risk** (raw data drives risky decisions, wisdom drives safer ones). Extensions above Wisdom — `Self-Actualization → Universal Knowledge → Transcendence` (8-rung extended) or `Shared Understanding` (KM variant) — are post-DIKW; classical DIKW tops out at Wisdom. + +**The substrate markers (operator framing, 2026-06-13):** + +| State | Entropy | Energy | The marker signals | +|---|---|---|---| +| **Staunen** | high | low | *"needs entropy work"* — cognitive pressure, an insight is emerging but not yet crystallised. The substrate detects raw stimulus that hasn't yet been integrated and flags the work still owed. | +| **Wisdom** | low | high | *"crystalline knowledge"* — plasticity has saturated, supporting insights are locked in, the substrate has invested heavily and that investment is integrated and stable. | + +Staunen and Wisdom are **diagonal opposites on the entropy × energy plane** — two complementary dimensions, not a single axis. The DIKW climb is the trajectory `(high entropy, low energy) → (low entropy, high energy)`: + +``` + high energy + │ + Confusion / Chaos │ Wisdom (crystalline) + (the in-progress │ the integrated apex + climb state) │ + ───────────────────┼─────────────────── + Staunen │ Boredom / Inert + (cognitive │ (ordered but + pressure) │ not energised) + │ + low energy + + high entropy ←──────────→ low entropy +``` + +So: +- **Wisdom IS a DIKW rung** (the canonical apex of the four-layer pyramid) AND a substrate marker (low entropy × high energy). Both readings are correct — the rung is where Wisdom-marked firings cluster. +- **Staunen is not a DIKW rung** — it's the substrate marker (high entropy × low energy) for firings at or below Data, where stimulus overflows current frameworks and Processing hasn't yet been done. The phenomenological "wonder" *is* this marker. +- They are *not* two qualia archetypes (which is what `lance-graph/CLAUDE.md` line ~120 currently treats them as) and *not* two ends of one axis. They are diagonal corners of the entropy × energy plane; the DIKW climb traverses the plane from the Staunen corner to the Wisdom corner. + +**Substrate mapping** (the canon-aligned implementation): + +The two markers map cleanly onto columns the substrate already owns: + +| Marker dimension | Substrate column | Sign convention | +|---|---|---| +| **Energy** | `MailboxSoA.energy: [f32; N]` (the spatio-temporal accumulator) | high `|energy[row]|` = high energy; near-zero = low energy | +| **Plasticity / accumulated investment** | `MailboxSoA.plasticity_counter: [u8; N]` (saturating Hebbian counter) | high saturation = long-term investment locked in = supporting Wisdom; low + cold `last_active_cycle` = no investment yet = Staunen side | +| **Entropy proxy** | classid-prefix-resolved codebook hit-rate over a window + local edge-neighbourhood density (derived from the `edges: [CausalEdge64; N]` column) | high miss-rate + sparse neighbourhood = high entropy = Staunen-side; low miss-rate + dense neighbourhood = low entropy = Wisdom-side | + +- **Staunen marker fires** when: high entropy proxy AND low `energy[row]` AND low `plasticity_counter[row]`. The substrate is detecting incoming cognitive pressure with no investment yet. +- **Wisdom marker fires** when: low entropy proxy AND high `energy[row]` AND high `plasticity_counter[row]`. The substrate is detecting integrated, well-supported, energetically-maintained knowledge. + +Both markers are **derivatives** over the SoA's lifecycle columns; neither is its own column. The substrate computes them on demand. They are **orthogonal** to the qualia codebook (which names the *archetype* the firing snaps to — what the affective state IS, independent of where on the DIKW climb the firing sits). A Wisdom-marked firing can have any qualia archetype; a Staunen-marked firing can too. The layers correlate on genuinely-novel input (Staunen + codebook trie-miss tend to co-occur, because trie-miss IS one of the high-entropy proxy signals) but neither implies the other. + +**Bipolar / two-algebra connection:** the canon's **TWO-ALGEBRA RULE** — *"sign = XOR (`vsa_bind`); magnitude = `vsa_bundle`, NEVER raw-XOR-on-magnitudes"* (OGAR/CLAUDE.md P0) — maps cleanly onto the entropy × energy plane. The **entropy axis is the signed side** (Staunen → Wisdom is the direction of entropy-reducing work; one bit per rung-transition, XOR-composed across rungs via `vsa_bind` to give the cumulative direction of the climb). The **energy axis is the magnitude side** (`vsa_bundle`, Markov-respecting — energy bundles in place, never raw-XORs across boundaries). The Walsh-Hadamard cascade pyramid on the address tree IS the substrate that carries this — top-gaussian preserved rung-to-rung per Parseval, anti-moiré via the helix `CurveRuler` stride-4-over-17 walk. The **Confusion / Chaos** quadrant (high entropy × high energy) is the *in-progress* climb state: the substrate has invested energy but the entropy hasn't yet collapsed into Wisdom — analogous to the WH cascade mid-traversal before Parseval-preservation locks the top-gaussian in. + +**Cascade-tier connection:** the canon's three tiers (HEEL · HIP · TWIG, each u16 = 4 nibbles = 4 climb steps) match the three DIKW transitions (Processing / Cognition / Judgment). The classid prefix (8 hex = 32 bits) carries the codebook scope; the HEEL/HIP/TWIG tiers carry the rung-position; family/identity carry the basin-local content. This is a clean substrate decomposition of the DIKW climb — *not coincidentally,* the canon's 3×4 uniform tiers are the same shape as DIKW's 3 transitions + 4 layers. + +**Status in lance-graph:** **NOT YET CORRECTED.** + +- `lance-graph/CLAUDE.md` line ~120 still reads: *"Magnitude = Contradiction depth from Staunen × Wisdom qualia."* Treats them as qualia archetypes; misses the DIKW-climb framing entirely. +- The §11.5 *"high Staunen × Wisdom spreads plasticity to adjacent rows"* mechanism reads correctly only when those markers come from the climb-position lifecycle layer (derived from `plasticity_counter` + `last_active_cycle` + codebook hit-rate), not the qualia codebook. +- No PR has landed to fix the framing. + +**Action:** flagged here as `TD-CLAUDE-MD-STAUNEN-MISNAME`; pending CLAUDE.md maintenance pass. Three specific edits: + +1. *"Magnitude = Contradiction depth from Staunen × Wisdom qualia"* → *"Magnitude = Contradiction depth across the entropy × energy substrate-state plane (Staunen = high entropy × low energy = cognitive pressure / emerging insight; Wisdom = low entropy × high energy = crystalline knowledge with supporting plasticity). Both are derivatives over `MailboxSoA.energy` + `plasticity_counter` + `last_active_cycle` + classid-prefix codebook hit-rate, NOT qualia archetypes."* +2. §11.5 rephrasing of "Staunen × Wisdom" → "entropy×energy substrate-state markers" or equivalent, with the column-derivation table made explicit. +3. Add a short DIKW-anchor sub-section to "The Click" that names the canonical four-layer lineage + the three bridging operations (Processing / Cognition / Judgment) and maps them onto the cascade tiers (HEEL → Processing-class, HIP → Cognition-class, TWIG → Judgment-class) so the cascade's purpose is self-describing. Include the entropy×energy quadrant diagram so the Confusion / Chaos quadrant (in-progress climb) is named explicitly alongside Staunen and Wisdom. + +Not in scope of this resolution doc (which is plan-side, not CLAUDE.md-side); flagged on the punchlist. + +### 6.1 Alternative framings (cross-references for the same dynamics) + +The entropy × energy substrate-state plane has four useful aliases. Each illuminates a different facet; all four describe the same underlying substrate dynamics. Recorded here so future sessions can reach the canon via the framing they already know. + +**(a) Staunen as the entropy *Bugwelle* (bow wave) of thinking-in-progress.** Staunen is not a static state — it is the leading-edge entropy disturbance that a thinking process *generates* as it advances through the substrate. As cognitive motion pushes into un-integrated territory, the entropy field piles up at the front: the wave of "this is new" cresting just ahead of where Processing / Cognition / Judgment have already done their work. The Bugwelle vocabulary captures what the static `(high entropy, low energy)` corner of the plane misses — that Staunen is *generated by motion* and dissipates when motion stops (the bow wave flattens when the boat stops moving; the cognitive wave flattens when thinking quiesces). + +**(b) Aerodynamic / shock-wave analogy.** Extending (a): as cognitive *velocity* through the substrate increases (rate of new edge accumulation per cycle, fan-out of `apply_edges` deliveries), the Staunen Bugwelle steepens — analogous to how a pressure wave in front of an accelerating aircraft compresses into a shock wave at trans-sonic speeds. A "sonic boom" in the substrate is the moment of breakthrough where entropy reduces abruptly (the wave collapses into a discrete crystallisation) — phenomenologically, the *aha* moment. The Mach-cone framing predicts that thinking too fast for the substrate's plasticity-counter integration rate produces wake-turbulence (transient Confusion / Chaos quadrant occupation before the entropy resolves). + +**(c) Event-horizon / inertia framing.** Wisdom's `(low entropy, high energy)` corner has *gravitational* properties. Crystallised knowledge has inertia — supporting insights are densely bound, edge-neighbourhoods are saturated, classid-prefix codebook hits at high rate, plasticity_counter is at saturation. Novelty that arrives near Wisdom must reach an *escape velocity* to break out of the gravitational well; insufficient cognitive velocity gets pulled in and assimilated into the existing crystal (lateral plasticity spread, no new arc). The event-horizon analogy: at the boundary of well-rehearsed knowledge, the substrate's predictive grip on incoming input is so strong that nothing escapes without enough Staunen Bugwelle pressure to overcome the inertia. *"You can't teach an old dog new tricks"* names this; the canon's "reserve, don't reclaim" discipline at classid==0 / family==0 is what keeps escape velocity addressable (the bootstrap basin always has a path out). + +**(d) Friston Free Energy Principle (FEP) — the scientific anchor.** Karl Friston's framework casts cognition as **variational free energy minimisation**: the substrate maintains generative models that predict its inputs, and acts to minimise the divergence between predictions and observations. Free energy = `surprise + complexity` (or more precisely, an upper bound on surprise via the variational inequality). The substrate has two ways to reduce free energy: **(i) update beliefs** to better predict observations (perceptual inference — moves the model toward the input), or **(ii) act on the world** to make observations match predictions (active inference — moves the input toward the model). + +Mapping FEP onto the entropy × energy plane: + +| FEP quantity | Substrate marker | Plane corner | +|---|---|---| +| **High free energy** (high prediction error, high surprise) | Staunen | high entropy × low energy | +| **Free energy minimisation in progress** (model updating + action) | Confusion / Chaos (the climb) | high entropy × high energy | +| **Minimised free energy** (predictions match observations) | Wisdom | low entropy × high energy | +| **Free-energy minimum with zero activity** (predictions match and nothing is happening) | Boredom / Inert | low entropy × low energy | + +The substrate's `consume_firing(row)` lifecycle IS active inference: when `energy[row].abs() >= threshold` (sufficient prediction-error signal accumulated), the substrate fires — taking the in-place mark, advancing `last_active_cycle`, resetting `energy[row]` (the prediction error has been integrated; the model has updated). Rows below threshold are absorbed into the existing crystal (passive update). The Staunen → Wisdom trajectory IS the free-energy-minimisation trajectory; the trajectory's *velocity* is the rate of free-energy reduction, which is what FEP says brains are organised to maximise (within metabolic constraints). + +**The four framings stack:** Bugwelle says *what shape* Staunen has (a leading-edge wave generated by motion). Aerodynamics says *how Staunen scales with velocity* (steepens to a shock at high cognitive velocity). Event-horizon says *why Wisdom resists novelty* (gravitational inertia of crystalline knowledge). FEP says *why the substrate moves at all* (free-energy minimisation drives the entire trajectory). The canon's entropy × energy plane + 3×4 cascade tiers + `MailboxSoA.energy/plasticity_counter` substrate columns are the implementation. + +--- + +## 7. Resolved punchlist (post-#490) + +Prioritised; each item names the smallest follow-up PR that closes it. + +1. **Errata stubs on affected plans** (this PR) — append a 1-2 line errata block on: + - `bindspace-singleton-to-mailbox-soa-v1.md` (pointing here for D-MBX-A1 shipped status + rename + emission-tombstone) + - `identity-architecture-exists-vs-needs-v1.md` (pointing here for §N1 canon-supersession + §N5 bijection-shipped) + - `unified-soa-convergence-v1.md` (pointing here for §4.2 stack-pin drift) + - `polyglot-container-query-membrane-v1.md` (ratify research-only) + +2. **NodeRow speaking accessors + LE round-trip + SoaEnvelope binding** (next PR, lance-graph) — `NodeRow::key_bytes()` / `edges_bytes()` / `value_bytes()` / `as_le_bytes()` / `from_le_bytes()`; const `ColumnDescriptor` table for the three top-level slots; `impl SoaEnvelope for NodeRowPacket<'a>` (borrowed slice wrapper, zero-copy). The bridge between the canonical row layout and the envelope ABI. + +3. **MailboxSoA speaking setters** (same next PR) — `set_energy(row, value)`, `add_energy(row, delta)`, `set_plasticity(row, value)`, `set_threshold(value)`, `set_current_cycle(value)`, `set_last_active_cycle(row, value)`. Currently only the D-MBX-A1 column setters exist (`set_edge` / `set_qualia` / `set_meta` / `set_entity_type`); the original energy/plasticity columns are written by direct field access. Names should match the migration map's vocabulary so call sites self-describe. + +4. **D-MBX-A2** (separate PR, gating) — Hamming planes + temporal/expert decisions on `MailboxSoA`. The unblock for S1-S4. + +5. **CLAUDE.md Staunen × Wisdom misnaming fix** (CLAUDE.md maintenance pass, separate) — rewrite the §"The Click" `Magnitude` line + §11.5 to read the markers from the plasticity-lifecycle layer. + +6. **engine_bridge re-encode audit** (after D-MBX-A2 lands) — Close `engine_bridge.rs` qualia f32→i4 re-encode + the DTO-as-owned-Vec sites flagged in handover §9. + +7. **bardioc handover sync** (separate bardioc PR) — `BINDSPACE_DISSOLUTION_HANDOVER.md` adds a post-2026-06-05 appendix reflecting #477/#487/#489/#490 shipped, this resolution doc's diff results. + +8. **OntologyRegistry linear-scan → HHTL radix-trie** (separate PR, lance-graph) — Called out in #477 audit; classid-prefix-scoped lookup per canon's *"codebook scoping = the class routing prefix."* + +9. **Two `CausalEdge64` types disambiguation** (separate PR, lance-graph) — Called out in #487 body. + +--- + +## 8. What this doc does NOT do + +- Does not create new plans or deliverables (every item in §7 lands in its own PR). +- Does not declare new architectural decisions. The canon (OGAR/CLAUDE.md P0) is the canon. The three-tier model (#477) is the three-tier model. This doc only reports what the diff IS. +- Does not retroactively rewrite plan bodies. Each affected plan gets a brief errata note pointing here (item §7.1). +- Does not edit `lance-graph/CLAUDE.md` (item §7.5 is a separate maintenance pass). +- Does not touch any code (item §7.2/§7.3 are the next PR). + +--- + +## 9. Cross-references + +- OGAR/CLAUDE.md P0 — the canon (operator-pinned). +- `lance-graph/CLAUDE.md` — doc-lock; `4ea6ac92` made it canonical. +- `bardioc/BINDSPACE_DISSOLUTION_HANDOVER.md` — the 2026-06-05 handover this doc extends. +- `docs/architecture/soa-three-tier-model.md` — #477 ratified model. +- `crates/lance-graph-contract/src/canonical_node.rs` — code form of the canon. +- `crates/lance-graph-contract/src/soa_envelope.rs` — envelope-level LE contract. +- `crates/cognitive-shader-driver/src/mailbox_soa.rs` — the D-MBX-A1 MailboxSoA. +- PR #470 (handover propagation), #477 (three-tier), #478 (singleton nudge), #480 (Phase-A NodeGuid, retired), #482 (GUID canon), #484 (bijection + D-IDENTITY-2), #487 (emission tombstone), #489 (canonical_node code form), #490 (wire-in + Display + Phase-A retirement). diff --git a/.claude/plans/unified-soa-convergence-v1.md b/.claude/plans/unified-soa-convergence-v1.md index d92fdfc6..947fac64 100644 --- a/.claude/plans/unified-soa-convergence-v1.md +++ b/.claude/plans/unified-soa-convergence-v1.md @@ -1,5 +1,7 @@ # unified-soa-convergence-v1 — THE single little-endian SoA, end-to-end across the workspace +> **ERRATA (2026-06-13, post-#490):** §1 "five layered rulings" remain authoritative (anchor for `E-SOA-IS-THE-ONLY`). §4.2 stack-pin table is stale — `lance` bumped to `=7.0.0` and `lancedb` to `=0.30.0` since this plan; the 2026-05-29 review addendum partially addressed but its own pins drifted too. The three-tier model in PR #477 (`docs/architecture/soa-three-tier-model.md`) ratifies "no emission, no inter-mailbox handoff" — supersedes any plan language implying a Baton carrier type. Full diff resolution: `soa-migration-diff-resolution-2026-06-13.md`. + > **Status:** PROPOSAL / integration plan. Design-spec only; **no code in this plan**. > **Authored:** 2026-05-29 (session `017GFLBn`, branch `claude/splat3d-cpu-simd-renderer-MAOO0`). > **Supersedes nothing; integrates / sequences:**