From 52f9c2348faa8d2a35bbedc2957f762d5068af01 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 30 May 2026 20:08:39 +0000 Subject: [PATCH 1/6] =?UTF-8?q?feat(contract):=20D-MBX-A6=20Phase=201=20?= =?UTF-8?q?=E2=80=94=20planner<->ractor<->surreal=20meta-DTO=20(kanban=20+?= =?UTF-8?q?=20soa=5Fview=20+=20StepDomain::Kanban)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire lance-graph-planner, ractor (mailbox/supervisor), and surrealdb (surreal_container's transparent SoA view) through the canonical OrchestrationBridge surface — no parallel DTO family (lab-vs-canonical ruling). - kanban.rs: KanbanColumn (4-phase Rubicon + 2 terminal exits) + KanbanMove (Copy, <=16B; MailboxId + witness_chain_position pointer + Libet -550ms anchor). - soa_view.rs: MailboxSoaView (zero-dep borrow trait, &[T] columns = the transparent zero-copy SoA view, R1 'one SoA never transformed') + MailboxSoaOwner (advance_phase; read/owner split makes 'view is read-only' structural). - orchestration.rs: StepDomain::Kanban variant + 'kanban.' prefix (additive-safe). Contract stays zero-dep; consumers implement the traits (dependency inversion). 485 contract lib tests green (+6); planner/cognitive-shader-driver/supervisor cargo-check clean. Consumer impls deferred to follow-up slices. Board hygiene (same commit): LATEST_STATE inventory + STATUS_BOARD D-MBX-A6-P1 + EPIPHANIES E-SOA-VIEW-IS-A-BORROW + AGENT_LOG run. https://claude.ai/code/session_01R9AWgFa65uPnLyS2my2d2R --- .claude/board/AGENT_LOG.md | 13 ++ .claude/board/EPIPHANIES.md | 7 + .claude/board/LATEST_STATE.md | 2 + .claude/board/STATUS_BOARD.md | 1 + crates/lance-graph-contract/src/kanban.rs | 132 +++++++++++++ crates/lance-graph-contract/src/lib.rs | 4 + .../lance-graph-contract/src/orchestration.rs | 9 +- crates/lance-graph-contract/src/soa_view.rs | 179 ++++++++++++++++++ 8 files changed, 346 insertions(+), 1 deletion(-) create mode 100644 crates/lance-graph-contract/src/kanban.rs create mode 100644 crates/lance-graph-contract/src/soa_view.rs diff --git a/.claude/board/AGENT_LOG.md b/.claude/board/AGENT_LOG.md index a0150f69..2fc18f9b 100644 --- a/.claude/board/AGENT_LOG.md +++ b/.claude/board/AGENT_LOG.md @@ -106,6 +106,19 @@ **D-ids:** D-ODOO-OP-1 (**Shipped**) **Outcome:** DONE. Phase 2 of the Odoo SoA → Foundry SoC pipeline. `bucket_corpus` groups `OdooStyleRecipe` corpus by semantic `OdooMethodKind` (10-variant: Compute/Inverse/Constrain/Onchange/Action/Cron/ApiModel/ApiModelCreateMulti/Override/Helper). `emit_op_dispatch` emits deterministic compilable Rust: per-unique-recipe_id `RECIPE_: u32` consts + per-kind `Op { method_id, recipe_id }` struct + `static _OPS: &[Op]` slice. Recipe dedup: identical DAtom weight vectors collapse to one `RECIPE_*` const (many-to-one method→recipe mapping preserved in the static slice). Output is zero-dep Rust — no imports needed in the emitted file; consumers write it to `OUT_DIR` and `include!()`. Deterministic by construction: buckets in declaration order, within each bucket sorted by recipe_id then method_id. +## [Autonomous build / Opus 4.8] D-MBX-A6 Phase 1 — planner⟷ractor⟷surreal meta-DTO (contract slice) + +**Branch:** claude/sleepy-cori-aRK2x | **Files:** +- `crates/lance-graph-contract/src/kanban.rs` (NEW) — `KanbanColumn` (6) + `KanbanMove` +- `crates/lance-graph-contract/src/soa_view.rs` (NEW) — `MailboxSoaView` + `MailboxSoaOwner` borrow traits + fake-impl tests +- `crates/lance-graph-contract/src/orchestration.rs` (+`StepDomain::Kanban` + 4 arm updates + round-trip test entry) +- `crates/lance-graph-contract/src/lib.rs` (module decls + re-exports) + +**Tests:** `cargo test -p lance-graph-contract` → 485 lib pass (+6 new: 4 kanban, 2 soa_view; orchestration round-trip extended) + integration suites green. `cargo check` clean on `lance-graph-planner`, `cognitive-shader-driver`, `lance-graph-supervisor` (default + `--features supervisor`) — `StepDomain::Kanban` verified additive-safe (all downstream uses are `!=`/`matches!`/`from_step_type`; no exhaustive match without wildcard). + +**Outcome:** DONE (contract slice; consumer impls deferred). Realizes the planner⟷ractor⟷surreal wiring as an EXTENSION of the canonical `OrchestrationBridge` surface (lab-vs-canonical ruling — no parallel DTO family) + a zero-dep transparent-SoA-view borrow trait (E-SOA-VIEW-IS-A-BORROW). Honors R1 (view returns `&[T]`, never copies) + R4 (witness = `chain_position` pointer). Deferred: planner-emit (D-MBX-A6 Ph2-3, incl. the {native|JIT|SurrealQL|elixir} strategy set), `impl MailboxSoaView/Owner for MailboxSoA` (cognitive-shader-driver), ractor `ConsumerEnvelope::Kanban` arm, surreal_container read-view (BLOCKED on OQ-11.6 fork). + +**Review pattern:** `// ///`-decision-markers → `/code-review` (medium, 1 finding → REFUTED via grep + cargo check) → markers stripped → cargo verify. Design via Opus Plan agent map (LATEST_STATE + lab-vs-canonical + unified-soa-convergence-v1 + orchestration/container/surreal_container/supervisor surfaces). --- diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index 8426d570..add423e6 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -42,6 +42,13 @@ The two-paper bracket (`streaming-arm-nars-discovery-v1.md`: Aerial+ discovery u 4. **The one missing seam (the actionable finding).** `ruff_spo_triplet::Predicate` is a **closed vocabulary** (`rdf:type, has_function, emitted_by, depends_on, reads_field, raises, traverses_relation`) and `from_ndjson` **hard-rejects** anything else — and **none of them is an implication/association relation.** An `X → Y` ARM rule therefore cannot flow through that loader until `Implies`/`CoOccursWith` is added (a *deliberate* ontology change per that crate's own doc). This is D-ARM-SYN-1; it gates SYN-2 (the `CandidateRule → ModelGraph` adapter) and SYN-3 (the `ArmDiscovered` truth calibration below the codegen gate). **Determinism boundary (unchanged, reaffirmed):** Aerial+ is the only nondeterministic node in the bracket. The transcode keeps it standalone, seeded (`aerial::Rng`), behind the `aerial` feature, and emitting a `CandidateRule` *proposal* — never a committed triple. Promotion is the council's job. Full map: `.claude/knowledge/aerial-arm-ruff-spo-codegen-synergies.md`. Code: `crates/lance-graph-arm-discovery/`. Cross-ref: `E-INTERPRET-NOT-STORE-1`, `E-SOA-IS-THE-ONLY`, `I-NOISE-FLOOR-JIRAK`, Karabulut 2025 §2/§3.3, Abreu 2025 §4. +## 2026-05-30 — E-SOA-VIEW-IS-A-BORROW — the transparent SoA view surrealdb needs is a zero-dep contract *borrow trait*, not a DTO; the read/owner split makes "view is read-only" structural + +**Status:** FINDING (derived; subject to `epiphany-brainstorm-council` per PR #433). Builds on the author-stated R1 ("one SoA never transformed") + R4 (witness-as-pointer) rulings in `E-SOA-IS-THE-ONLY` — those pre-exist and are not council-gated; this is the contract-shape consequence. + +The planner⟷ractor⟷surrealdb wiring (user-requested 2026-05-30) is realized WITHOUT a new DTO family (`lab-vs-canonical-surface.md` §"Decision Procedure"): extend the canonical `OrchestrationBridge`/`UnifiedStep` surface (`StepDomain::Kanban` + `"kanban."` prefix) + add `kanban::{KanbanColumn, KanbanMove}` + a zero-dep borrow trait `soa_view::MailboxSoaView` returning `&[T]` column slices. The borrow trait is the key move: it lets the in-RAM `MailboxSoA` (ractor-owned, in cognitive-shader-driver), a surreal kv-lance view, and the planner all read the SAME bytes through one vocabulary — the dependency-inversion pattern already used by `PlannerContract`/`OrchestrationBridge`, so the contract stays zero-dep (it cannot name `MailboxSoA` from another crate without a dep). The `MailboxSoaView` (read) vs `MailboxSoaOwner` (mutate `advance_phase`) split makes "the view is read-only" a *structural* guarantee (surreal implements only the read half) — honoring R1 by type, not convention. + +**Cross-ref:** `E-SOA-IS-THE-ONLY` (R1/R4 origin); `lab-vs-canonical-surface.md` §Decision Procedure; `unified-soa-convergence-v1.md §5+§8.4` (D-MBX-A6); LATEST_STATE Contract Inventory 2026-05-30. --- diff --git a/.claude/board/LATEST_STATE.md b/.claude/board/LATEST_STATE.md index a93c9740..97fe5036 100644 --- a/.claude/board/LATEST_STATE.md +++ b/.claude/board/LATEST_STATE.md @@ -42,6 +42,8 @@ ## Current Contract Inventory (lance-graph-contract) +> **2026-05-30 — PR-in-flight addition** (D-MBX-A6 Phase 1 — planner⟷ractor⟷surreal meta-DTO): `lance_graph_contract::kanban::{KanbanColumn (6: Planning/CognitiveWork/Evaluation/Commit/Plan/Prune), KanbanMove}` — the 4-phase Rubicon kanban transition; `KanbanMove` is `Copy`, ≤16 B, carries `MailboxId` + `witness_chain_position` (R4 pointer) + `libet_offset_us` (−550 ms anchor, D-MBX-8). `lance_graph_contract::soa_view::{MailboxSoaView, MailboxSoaOwner}` — zero-dep **borrow trait** for the transparent zero-copy SoA view (R1 "one SoA never transformed"); `&[T]` column accessors (energy/edges_raw/meta_raw/entity_type) mirror `MailboxSoA::*_at`; the read/owner split makes "view is read-only" structural (surreal implements only the read half). `orchestration::StepDomain::Kanban` variant + `"kanban."` prefix. Consumed via the EXISTING `OrchestrationBridge` (planner emits, ractor owns/drives via `MailboxSoaOwner`, surreal_container projects via read-only `MailboxSoaView`) — NO parallel DTO family (lab-vs-canonical ruling). Contract `[dependencies]` still empty. 485 contract lib tests green (+6 new); `cargo check` clean on planner/cognitive-shader-driver/supervisor (StepDomain variant additive-safe). Consumer impls deferred. See E-SOA-VIEW-IS-A-BORROW; `unified-soa-convergence-v1.md §5+§8.4`. +> > **2026-05-28 — PR-in-flight addition** (bindspace→mailbox migration wave A1-A4): `lance_graph_contract::witness_table::{WitnessEntry, WitnessTable}` — column-type primitive resolving the 6-bit W-slot in `CausalEdge64 v2` into a per-cohort `(mailbox_ref: u32, spo_fact_ref: Option)` table (`mailbox_ref` carries the full canonical `MailboxId`, NOT a truncated cohort-local index — see PR #427 Codex P2 fix). Zero-dep, 3 unit tests, `WitnessTable::{new, get, set, default}`. Cross-ref: `.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md` §10 (architectural refinements landed in same wave). Also in same wave: `cognitive-shader-driver::MailboxSoA` gains four thoughtspace columns (`edges: [CausalEdge64; N]`, `qualia: [QualiaI4_16D; N]`, `meta: [MetaWord; N]`, `entity_type: [u16; N]`) + 8 row accessors; `ShaderDriver` gains transitional `mailboxes: HashMap>` + `with_mailbox()` builder + `mailbox()` read accessor (sibling-shape, additive — singleton untouched). 457 contract+driver tests pass. Types that EXIST — do NOT re-propose them: diff --git a/.claude/board/STATUS_BOARD.md b/.claude/board/STATUS_BOARD.md index 3954f13e..c69e794b 100644 --- a/.claude/board/STATUS_BOARD.md +++ b/.claude/board/STATUS_BOARD.md @@ -564,6 +564,7 @@ Plan path: `.claude/plans/unified-soa-convergence-v1.md`. Handover `.claude/hand | D-MBX-10 | SoA version byte at layout root (`MailboxSoAHeader`); refuse v(N>M) bytes on v(M) reader; field-isolation matrix tests on every column op (`I-LEGACY-API-FEATURE-GATED` discipline) | lance-graph-contract | 100 | HIGH | **Queued** | foundation — should land early in P2; gates on OQ-11.5 | | D-MBX-11 | Lance `=6.0.0 → =6.0.1` patch bump (5 Cargo.toml files identified) | workspace Cargo.toml | 10 | LOW | **Queued (mechanical)** | none — can land in parallel with par-tile prereq | | D-MBX-12 | 8-PR workspace-wide consumer alignment: 12.1 AriGraph · 12.2 Vsa16k audit · 12.4 lance-graph · 12.5 planner · 12.6 shader-driver · 12.7 callcenter · 12.8 ontology audit · 12.9 thinking-styles | per-crate | 800 | per-PR | **Queued (multi-PR)** | sequencing per OQ-11.8: 12.4 → 12.5 → 12.6 → 12.7 → 12.1 → 12.9 → 12.2 → 12.8 | +| D-MBX-A6-P1 | contract slice of D-MBX-A6: `kanban::{KanbanColumn, KanbanMove}` + `soa_view::{MailboxSoaView, MailboxSoaOwner}` + `StepDomain::Kanban` — the planner⟷ractor⟷surreal seam, zero-dep, no parallel DTO family | lance-graph-contract | 340 | HIGH | **In PR** | extends §8.4; +6 tests; downstream cargo-check clean; consumer impls (planner emit / `MailboxSoA` owner-impl / ractor arm / surreal read-view) deferred | --- diff --git a/crates/lance-graph-contract/src/kanban.rs b/crates/lance-graph-contract/src/kanban.rs new file mode 100644 index 00000000..c427c8ef --- /dev/null +++ b/crates/lance-graph-contract/src/kanban.rs @@ -0,0 +1,132 @@ +//! # `kanban` — the 4-phase Rubicon kanban contract (zero-dep). +//! +//! The seam where three subsystems meet over the ONE per-mailbox SoA: +//! - **lance-graph-planner** emits a [`KanbanMove`] (the plan's output unit), +//! - **ractor** (the mailbox owner, `lance-graph-supervisor`) drives the +//! transition — advancing a [`KanbanColumn`] *is* the mailbox lifecycle step, +//! - **surrealdb** (`surreal_container`) projects the columns as the kanban view +//! over SoA-shaped Lance rows. +//! +//! Carried across the canonical [`crate::orchestration::OrchestrationBridge`] as a +//! `UnifiedStep { step_type: "kanban.*" }` ([`crate::orchestration::StepDomain::Kanban`]). +//! +//! Spec: `.claude/plans/unified-soa-convergence-v1.md` §5 + §8.4 (D-MBX-A6 Phase 1). +//! +//! ## Invariants honoured +//! - **R1 "one SoA never transformed":** a [`KanbanMove`] is a *transition record*, +//! not SoA data — it carries only `Copy` scalars + a pointer, never the SoA. +//! - **R4 witness-as-pointer:** the witness is a `chain_position` index into the +//! source mailbox's witness arc (mirrors +//! [`crate::collapse_gate::CollapseGateEmission`]'s `chain_position`), never the +//! witnessed data. + +use crate::collapse_gate::MailboxId; + +/// The four Rubicon phases (+ two terminal exits), Libet-anchored. +/// +/// The mailbox lifecycle advances through these columns from spawn toward a +/// terminal column. The discriminants are stable (used as a kanban-column key and +/// for compact SoA storage) — **do not reorder**. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)] +#[repr(u8)] +pub enum KanbanColumn { + /// `t < -550 ms` (Libet readiness-potential window): ractor owns the SoA; + /// counterfactual pre-planning / expansion happens here. The spawn state. + #[default] + Planning = 0, + /// `t >= -550 ms`: the SoA mutates under cognitive operations; the Σ-commit + /// ratchet advances here. + CognitiveWork = 1, + /// `t > 0`: read back over the witness arc; residual free-energy assessed. + Evaluation = 2, + /// Terminal — calcify: commit to Lance SPO-G + AriGraph pointer. + Commit = 3, + /// Terminal — re-plan: re-enter [`Planning`](KanbanColumn::Planning) carrying + /// the witness (the "act differently next time" exit). + Plan = 4, + /// Terminal — veto: drop the move (Libet "free won't", post-hoc inhibition). + Prune = 5, +} + +impl KanbanColumn { + /// Is this a terminal column (no further in-cycle transition from here)? + #[inline] + pub fn is_terminal(self) -> bool { + matches!(self, Self::Commit | Self::Plan | Self::Prune) + } +} + +/// One kanban transition: the planner's output unit and the ractor's lifecycle step. +/// +/// `Copy` and small (≤ 16 B) so it rides the airgap as owned microcopy, never a +/// borrow into the SoA (R1). The witness is a *pointer* (R4). +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct KanbanMove { + /// The mailbox whose lifecycle is advancing. + pub mailbox: MailboxId, + /// Column the mailbox is leaving. + pub from: KanbanColumn, + /// Column the mailbox is entering. + pub to: KanbanColumn, + /// Witness pointer: position in the source mailbox's witness chain. Mirrors + /// [`crate::collapse_gate::CollapseGateEmission`]'s `chain_position` — + /// structural time, not a wall-clock stamp (R4). + pub witness_chain_position: u32, + /// Libet commit anchor: signed micros relative to the act. `-550_000` on the + /// `Planning → CognitiveWork` Σ-commit; `0` otherwise. Structural offset only. + pub libet_offset_us: i32, +} + +// NOTE (follow-up, D-MBX-A6 Phase 2-3): the planner execution strategy +// { lance-graph-planner (native) | JIT | SurrealQL | elixir } is intentionally NOT carried +// on KanbanMove here — the planner-emit slice reuses the planner's existing strategy enum +// rather than duplicating it. Revisit whether KanbanMove needs an exec-target tag then. + +// `KanbanMove` must stay a small owned microcopy (airgap discipline, I1): +// MailboxId(4) + 2×KanbanColumn(1) + u32(4) + i32(4) packs within 16 B. +const _: () = assert!(core::mem::size_of::() <= 16); + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn kanban_column_discriminants_are_stable() { + // Stable column key — do not reorder. + assert_eq!(KanbanColumn::Planning as u8, 0); + assert_eq!(KanbanColumn::CognitiveWork as u8, 1); + assert_eq!(KanbanColumn::Evaluation as u8, 2); + assert_eq!(KanbanColumn::Commit as u8, 3); + assert_eq!(KanbanColumn::Plan as u8, 4); + assert_eq!(KanbanColumn::Prune as u8, 5); + } + + #[test] + fn default_column_is_planning_the_spawn_state() { + assert_eq!(KanbanColumn::default(), KanbanColumn::Planning); + } + + #[test] + fn terminal_columns_are_commit_plan_prune() { + assert!(KanbanColumn::Commit.is_terminal()); + assert!(KanbanColumn::Plan.is_terminal()); + assert!(KanbanColumn::Prune.is_terminal()); + assert!(!KanbanColumn::Planning.is_terminal()); + assert!(!KanbanColumn::CognitiveWork.is_terminal()); + assert!(!KanbanColumn::Evaluation.is_terminal()); + } + + #[test] + fn kanban_move_is_copy_and_small() { + let m = KanbanMove { + mailbox: 42, + from: KanbanColumn::Planning, + to: KanbanColumn::CognitiveWork, + witness_chain_position: 7, + libet_offset_us: -550_000, + }; + let n = m; // Copy, not move + assert_eq!(m, n); + assert!(core::mem::size_of::() <= 16); + } +} diff --git a/crates/lance-graph-contract/src/lib.rs b/crates/lance-graph-contract/src/lib.rs index c39c6cd6..661ffc9a 100644 --- a/crates/lance-graph-contract/src/lib.rs +++ b/crates/lance-graph-contract/src/lib.rs @@ -58,6 +58,7 @@ pub mod graph_render; pub mod hash; pub mod high_heel; pub mod jit; +pub mod kanban; pub mod literal_graph; pub mod mail; pub mod manifest; @@ -85,6 +86,7 @@ pub mod scenario; pub mod sensorium; pub mod sigma_propagation; pub mod sla; +pub mod soa_view; pub mod splat; pub mod tax; pub mod thinking; @@ -95,3 +97,5 @@ pub mod world_model; // Re-exports for the most commonly used collapse_gate types. pub use collapse_gate::{CollapseGateEmission, GateDecision, MailboxId, MergeMode}; +pub use kanban::{KanbanColumn, KanbanMove}; +pub use soa_view::{MailboxSoaOwner, MailboxSoaView}; diff --git a/crates/lance-graph-contract/src/orchestration.rs b/crates/lance-graph-contract/src/orchestration.rs index 55531a6a..d0ef9d01 100644 --- a/crates/lance-graph-contract/src/orchestration.rs +++ b/crates/lance-graph-contract/src/orchestration.rs @@ -49,6 +49,10 @@ pub enum StepDomain { Smb, /// Medcare reality-check vertical (clinic data sovereignty). Medcare, + /// 4-phase Rubicon kanban transition over the per-mailbox SoA — the seam + /// where the planner (emits), ractor (owns/drives), and surrealdb (projects) + /// meet. `step_type` prefix `"kanban."`. See [`crate::kanban`]. + Kanban, } impl StepDomain { @@ -72,6 +76,7 @@ impl StepDomain { "nd" => Some(Self::Ndarray), "smb" => Some(Self::Smb), "medcare" => Some(Self::Medcare), + "kanban" => Some(Self::Kanban), _ => None, } } @@ -106,7 +111,7 @@ impl StepDomain { // Generic defaults for infrastructure / orchestration domains. // These are NOT vertical-facing; they execute the cycle, not // the policy. Starter values — tune empirically. - Self::Crew | Self::Ladybug | Self::N8n | Self::LanceGraph | Self::Ndarray => { + Self::Crew | Self::Ladybug | Self::N8n | Self::LanceGraph | Self::Ndarray | Self::Kanban => { DomainProfile { audit_retention_days: 30, auto_action_confidence: 0.70, @@ -131,6 +136,7 @@ impl core::fmt::Display for StepDomain { Self::Ndarray => "nd", Self::Smb => "smb", Self::Medcare => "medcare", + Self::Kanban => "kanban", }; f.write_str(s) } @@ -236,6 +242,7 @@ mod tests { StepDomain::Ndarray, StepDomain::Smb, StepDomain::Medcare, + StepDomain::Kanban, ]; for domain in all { let s = domain.to_string(); diff --git a/crates/lance-graph-contract/src/soa_view.rs b/crates/lance-graph-contract/src/soa_view.rs new file mode 100644 index 00000000..122a6038 --- /dev/null +++ b/crates/lance-graph-contract/src/soa_view.rs @@ -0,0 +1,179 @@ +//! # `soa_view` — the transparent, zero-copy read view over the ONE SoA. +//! +//! **R1 "one SoA never transformed":** the per-mailbox SoA is never serialized or +//! copied; it lives from mailbox spawn to tombstone and is mutated only by +//! cognitive operations. This module is the **zero-dep borrow vocabulary** that +//! lets three holders read the SAME bytes: +//! +//! - `cognitive-shader-driver`'s `MailboxSoA` — the in-RAM hot owner (implements +//! [`MailboxSoaOwner`]; ractor drives it), +//! - `surreal_container` — the transparent kv-lance-backed VIEW (implements the +//! read-only [`MailboxSoaView`] over the same Lance columns; no Arrow re-encode), +//! - `lance-graph-planner` — a CONSUMER (plans over the columns directly). +//! +//! The contract owns **no** SoA storage — only this lens. It cannot name +//! `MailboxSoA` (another crate) without a dependency, so the lens is a trait the +//! owner/view implement — the same dependency-inversion pattern as +//! [`crate::plan::PlannerContract`] and [`crate::orchestration::OrchestrationBridge`]. + +use crate::collapse_gate::MailboxId; +use crate::kanban::{KanbanColumn, KanbanMove}; + +/// A transparent, read-only view over one mailbox's SoA columns. +/// +/// Implementors return **borrows** (`&[T]`) or `Copy` scalars — never clones of the +/// backing store. A `surreal_container` view and the in-RAM `MailboxSoA` are both +/// valid implementors over the *same* bytes; that two-implementor symmetry is what +/// "transparent view" means here (R1). +pub trait MailboxSoaView { + /// Identity of the mailbox this view reads. + fn mailbox_id(&self) -> MailboxId; + /// Number of populated rows in the SoA. + fn n_rows(&self) -> usize; + /// 6-bit witness-table slot (0..=63) the mailbox occupies. + fn w_slot(&self) -> u8; + /// Monotonic cognitive cycle stamp. + fn current_cycle(&self) -> u32; + /// The Rubicon phase the mailbox is currently in (kanban column). + fn phase(&self) -> KanbanColumn; + + // ── zero-copy column borrows (the SIMD / surreal-projection surface) ── + + /// Per-row spatial-temporal energy accumulator. + fn energy(&self) -> &[f32]; + /// Per-row packed `CausalEdge64` as raw `u64` (reconstruct via `CausalEdge64(raw)`; + /// kept raw so the contract stays zero-dep — `causal-edge` is not a contract dep). + fn edges_raw(&self) -> &[u64]; + /// Per-row packed `MetaWord` as raw `u32`. + fn meta_raw(&self) -> &[u32]; + /// Per-row entity-type id. + fn entity_type(&self) -> &[u16]; + + // NOTE (follow-up): the qualia column (`QualiaI4_16D`) accessor is intentionally omitted — + // add `fn qualia(&self) -> &[crate::qualia::QualiaI4_16D]` when the first consumer + // (planner strategy selection) needs it; keep the read surface minimal until then. + + // ── per-row scalar read (mirrors `MailboxSoA::energy_at`) ── + + /// Energy at `row`. Default indexes [`energy`](MailboxSoaView::energy); override + /// if the implementor can read a single row more cheaply. + #[inline] + fn energy_at(&self, row: usize) -> f32 { + self.energy()[row] + } +} + +/// The mutation airgap for the SoA **owner** only (the ractor-driven hot path). +/// +/// A read-only view (e.g. `surreal_container`) deliberately does **not** implement +/// this — that is what makes "the view is read-only" a structural guarantee rather +/// than a convention. Only the in-RAM `MailboxSoA` owner advances phases. +pub trait MailboxSoaOwner: MailboxSoaView { + /// Drive one Rubicon phase transition to `to`; return the emitted move. + /// + /// The only mutation surface at the contract level: cognitive operations advance + /// the lifecycle column. The SoA columns themselves are mutated by the owner's + /// own (crate-private) cognitive ops, never serialized through here (R1). + fn advance_phase(&mut self, to: KanbanColumn) -> KanbanMove; +} + +#[cfg(test)] +mod tests { + use super::*; + + /// A minimal in-memory implementor proving the trait is satisfiable and the + /// `&[T]` borrows compile + read zero-copy — without any consumer crate. + struct FakeSoa { + id: MailboxId, + phase: KanbanColumn, + energy: Vec, + edges: Vec, + meta: Vec, + etype: Vec, + cycle: u32, + } + + impl MailboxSoaView for FakeSoa { + fn mailbox_id(&self) -> MailboxId { + self.id + } + fn n_rows(&self) -> usize { + self.energy.len() + } + fn w_slot(&self) -> u8 { + (self.id & 0x3F) as u8 + } + fn current_cycle(&self) -> u32 { + self.cycle + } + fn phase(&self) -> KanbanColumn { + self.phase + } + fn energy(&self) -> &[f32] { + &self.energy + } + fn edges_raw(&self) -> &[u64] { + &self.edges + } + fn meta_raw(&self) -> &[u32] { + &self.meta + } + fn entity_type(&self) -> &[u16] { + &self.etype + } + } + + impl MailboxSoaOwner for FakeSoa { + fn advance_phase(&mut self, to: KanbanColumn) -> KanbanMove { + let from = self.phase; + self.phase = to; + KanbanMove { + mailbox: self.id, + from, + to, + witness_chain_position: 0, + libet_offset_us: if to == KanbanColumn::CognitiveWork { + -550_000 + } else { + 0 + }, + } + } + } + + fn sample() -> FakeSoa { + FakeSoa { + id: 7, + phase: KanbanColumn::Planning, + energy: vec![0.1, 0.2, 0.3], + edges: vec![0, 1, 2], + meta: vec![10, 11, 12], + etype: vec![100, 101, 102], + cycle: 1, + } + } + + #[test] + fn view_reads_columns_zero_copy() { + let soa = sample(); + // Borrow points INTO the backing store (zero-copy): identical pointer. + assert_eq!(soa.energy().as_ptr(), soa.energy.as_ptr()); + assert_eq!(soa.n_rows(), 3); + assert_eq!(soa.edges_raw(), &[0, 1, 2]); + assert_eq!(soa.meta_raw(), &[10, 11, 12]); + assert_eq!(soa.entity_type(), &[100, 101, 102]); + assert_eq!(soa.energy_at(1), 0.2); + assert_eq!(soa.phase(), KanbanColumn::Planning); + assert_eq!(soa.w_slot(), 7); + } + + #[test] + fn owner_advances_phase_and_sets_libet_anchor() { + let mut soa = sample(); + let m = soa.advance_phase(KanbanColumn::CognitiveWork); + assert_eq!(m.from, KanbanColumn::Planning); + assert_eq!(m.to, KanbanColumn::CognitiveWork); + assert_eq!(m.libet_offset_us, -550_000); + assert_eq!(soa.phase(), KanbanColumn::CognitiveWork); + } +} From a1d2ea601d4646ab8d7bf767df7c95b8e1292f6c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 30 May 2026 20:14:02 +0000 Subject: [PATCH 2/6] docs(board): capture E-EW64-IS-PREDICTIVE-PREFETCH + F-WIRE-DTO-DUP-MAP findings EW64 = CPU-style predictive prefetch co-issued with CE64 into the shader; (4x4)^4 L1-4 from cortex/hippocampus; Hebbian = CE64/EW64 SoA1:SoA2 superposition (design basis for the EpisodicWitness64 follow-up). DTO hunt: ResonanceDto duplicated (2 defs in thinking-engine = TD-RESONANCEDTO-DUP-1); StreamDto/BusDto single-def Wire DTOs; P64 = convergence crate. https://claude.ai/code/session_01R9AWgFa65uPnLyS2my2d2R --- .claude/board/EPIPHANIES.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index add423e6..283aca65 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -42,6 +42,32 @@ The two-paper bracket (`streaming-arm-nars-discovery-v1.md`: Aerial+ discovery u 4. **The one missing seam (the actionable finding).** `ruff_spo_triplet::Predicate` is a **closed vocabulary** (`rdf:type, has_function, emitted_by, depends_on, reads_field, raises, traverses_relation`) and `from_ndjson` **hard-rejects** anything else — and **none of them is an implication/association relation.** An `X → Y` ARM rule therefore cannot flow through that loader until `Implies`/`CoOccursWith` is added (a *deliberate* ontology change per that crate's own doc). This is D-ARM-SYN-1; it gates SYN-2 (the `CandidateRule → ModelGraph` adapter) and SYN-3 (the `ArmDiscovered` truth calibration below the codegen gate). **Determinism boundary (unchanged, reaffirmed):** Aerial+ is the only nondeterministic node in the bracket. The transcode keeps it standalone, seeded (`aerial::Rng`), behind the `aerial` feature, and emitting a `CandidateRule` *proposal* — never a committed triple. Promotion is the council's job. Full map: `.claude/knowledge/aerial-arm-ruff-spo-codegen-synergies.md`. Code: `crates/lance-graph-arm-discovery/`. Cross-ref: `E-INTERPRET-NOT-STORE-1`, `E-SOA-IS-THE-ONLY`, `I-NOISE-FLOOR-JIRAK`, Karabulut 2025 §2/§3.3, Abreu 2025 §4. +## 2026-05-30 — E-EW64-IS-PREDICTIVE-PREFETCH — EpisodicWitness64 is a CPU-style predictive prefetch co-issued with CausalEdge64 into the cognitive shader; (4x4)^4 L1-4 derives from cortex/hippocampus; "fire together wire together" = CE64/EW64 SoA1:SoA2 superposition + +**Status:** CONJECTURE / design (user-stated 2026-05-30). Design basis for the queued `EpisodicWitness64` (`SpoWitness64`, pr-ce64-mb-4) follow-up. + +- **EW64 = predictive prefetch.** Like a CPU prefetcher pulls a cache line *before* the instruction needs it, `EpisodicWitness64` predictively prefetches the episodic context (the witnessed SPO arc) so that when CE64 + EW64 enter the cognitive shader *together*, the episodic prior is already resident. EW64 anticipates; CE64 is the causal "instruction"; they are co-issued. +- **"What fires together wires together" = CE64/EW64 SoA1:SoA2 superposition** (Hebbian). Superposing the two SoAs in the cognitive shader (the inside / zero-copy path) IS the wiring step — co-activation of CE64 (causal) + EW64 (episodic) over the same CAM address space strengthens the binding. Grounds the earlier "SoA1:SoA2 superposition inside cognitive-shader-driver" as Hebbian plasticity. +- **(4x4)^4 (L1-4) derives from cortex + hippocampus.** The shader's 4-level (4x4)^4 block layering (L1-4) is brain/hippocampus-derived (cortical microcircuit / hippocampal indexing), not arbitrary tiling. Ground the exact L1-4 ↔ cortical-layer / hippocampal-subfield mapping when speccing EW64. +- **Type implication:** EW64 shares CE64's low-40 SPO+NARS bits (co-addressing for superposition) + an episodic/prefetch lens (recency, salience, witness-arc pointer); prefetched ahead of the cycle; CE64+EW64 issued as a pair. + +**Cross-ref:** `E-SOA-VIEW-IS-A-BORROW`; pr-ce64-mb-4 `SpoWitness64`; `causal-edge/src/edge.rs` (CE64 layout to mirror); "The Click" (AriGraph/episodic = thinking tissue); D-MBX-A3 (witness-arc handle column). + +--- + +## 2026-05-30 — F-WIRE-DTO-DUP-MAP — ResonanceDto is the duplicated one (2 defs in thinking-engine); StreamDto/BusDto single-def cross-crate Wire DTOs; P64 = convergence crate + +**Status:** FINDING (grep audit 2026-05-30, user-requested DTO hunt). +- **ResonanceDto — DUPLICATED:** two defs, BOTH in thinking-engine — `awareness_dto.rs:21` AND `dto.rs:59` (41 uses thinking-engine + 3 cognitive-shader-driver). = existing `TD-RESONANCEDTO-DUP-1` (Deferred → fold into D-MBX-2). Per the SoA-DTO ledger "ResonanceDto IS the SoA" — dedup converges both onto the one SoA shape, not pick-a-winner. +- **StreamDto — single def** (`thinking-engine/src/dto.rs:40`; 5 + 3 uses). LAB Wire DTO (input carrier into CognitiveShader). +- **BusDto — single def** (`thinking-engine/src/dto.rs:120`; 54 + 48 + 1 uses). Heavily cross-crate bus transport DTO. +- **P64 — convergence crate** (`p64-bridge` 17, bgz-tensor 8, planner 6, shader-driver 5, osint 1); no single `P64` type — it's the convergence point (CLAUDE.md: "p64 = where both repos meet, no circular deps"). + +**Action:** ResonanceDto dedup stays `TD-RESONANCEDTO-DUP-1` (tied to D-MBX-2 SoA convergence — dedup onto the one SoA per "one SoA never transformed"). StreamDto/BusDto are NOT duplicated; cross-crate spread = expected LAB Wire surface. No new action unless dedup is prioritized now. +**Cross-ref:** `TD-RESONANCEDTO-DUP-1`; SoA-DTO entropy ledger (PR #353); `lab-vs-canonical-surface.md`. + +--- + ## 2026-05-30 — E-SOA-VIEW-IS-A-BORROW — the transparent SoA view surrealdb needs is a zero-dep contract *borrow trait*, not a DTO; the read/owner split makes "view is read-only" structural **Status:** FINDING (derived; subject to `epiphany-brainstorm-council` per PR #433). Builds on the author-stated R1 ("one SoA never transformed") + R4 (witness-as-pointer) rulings in `E-SOA-IS-THE-ONLY` — those pre-exist and are not council-gated; this is the contract-shape consequence. From c5a319bdef8b55f2aa782d0a7f3dbde9d02d7bba Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 30 May 2026 20:19:04 +0000 Subject: [PATCH 3/6] style(contract): rustfmt the profile() Kanban match arm (Codex P2 on #437) Split the over-width StepDomain catch-all pattern multi-line + drop redundant block braces, matching pinned-toolchain (1.95.0) rustfmt. Scoped to the one arm/ file I modified; the crate's pre-existing fmt deviations (14 other files) untouched. https://claude.ai/code/session_01R9AWgFa65uPnLyS2my2d2R --- .../lance-graph-contract/src/orchestration.rs | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/crates/lance-graph-contract/src/orchestration.rs b/crates/lance-graph-contract/src/orchestration.rs index d0ef9d01..74abb12a 100644 --- a/crates/lance-graph-contract/src/orchestration.rs +++ b/crates/lance-graph-contract/src/orchestration.rs @@ -111,15 +111,18 @@ impl StepDomain { // Generic defaults for infrastructure / orchestration domains. // These are NOT vertical-facing; they execute the cycle, not // the policy. Starter values — tune empirically. - Self::Crew | Self::Ladybug | Self::N8n | Self::LanceGraph | Self::Ndarray | Self::Kanban => { - DomainProfile { - audit_retention_days: 30, - auto_action_confidence: 0.70, - escalation: Escalation::Llm, - requires_fail_closed: false, - verb_taxonomy: VerbTaxonomyId::Generic, - } - } + Self::Crew + | Self::Ladybug + | Self::N8n + | Self::LanceGraph + | Self::Ndarray + | Self::Kanban => DomainProfile { + audit_retention_days: 30, + auto_action_confidence: 0.70, + escalation: Escalation::Llm, + requires_fail_closed: false, + verb_taxonomy: VerbTaxonomyId::Generic, + }, } } } From 7d8a27f1dac1aeaf1635ed71699e17acdcb65b8c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 30 May 2026 20:34:04 +0000 Subject: [PATCH 4/6] =?UTF-8?q?feat(contract):=20MailboxSoaView::class=5Fi?= =?UTF-8?q?d=20=E2=80=94=20the=20ontology-class=20SoA=20hook=20(Cognitive-?= =?UTF-8?q?RISC=20N1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expose the per-row class/shape discriminator on the SoA view: class_id()/class_id_at() alias the existing entity_type u16 slot (= OGIT EntityTypeId), so the class hook lands with ZERO new column (R1 'one SoA never transformed') and zero new dep. Class machinery (labels/projection/jinja templates) resolves one layer up via lance-graph-ontology, never in the SoA/kv-lance columns. This is the freeze-time N1 hook; aerial+ (#436) is the discovery engine that populates it. Board: EPIPHANIES E-ARIGRAPH-IS-AN-ISLAND (dead-wiring audit, machete-corroborated) + E-AERIAL-IS-THE-DISCOVERY-PROPOSER (synergy synthesis). 485 contract tests green; soa_view.rs rustfmt-clean. https://claude.ai/code/session_01R9AWgFa65uPnLyS2my2d2R --- .claude/board/EPIPHANIES.md | 31 +++++++++++++++++++++ crates/lance-graph-contract/src/soa_view.rs | 22 +++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index 283aca65..69f2563b 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -1,3 +1,34 @@ +## 2026-05-30 — E-ARIGRAPH-IS-AN-ISLAND — AriGraph's cross-crate wirings are nominal/orphaned; the hot→cold bridge is dead; machete corroborates + +**Status:** FINDING (read-only audit 2026-05-30, file:line-cited, Opus agent). Pre-existing, NOT introduced by PR #437. + +AriGraph (`crates/lance-graph/src/graph/arigraph/`) is almost entirely standalone: +- **Nominal wirings (zero impls):** contract `graph_render`/`sensorium`/`persona` declare provider traits AriGraph is "the producer" for — but those traits have NO impl anywhere; AriGraph's own `GraphSensorium` doesn't implement the contract trait. +- **Dead hot→cold bridge:** `graph/witness_tombstone.rs` (calcify→Tombstone→WitnessLink, the D-ATOM-5 hot→cold snapshot machinery) is ALL `todo!()` AND not declared in `graph/mod.rs` (orphaned/uncompiled). `planner/src/cache/convergence.rs:22-27` p64 drift CONFIRMED dead (`CausalEdge64`/`SpoBase17`/`DistanceMatrix` `#[allow(unused_imports)]`; per-head edge-emission never built; nothing calls `run_convergence`/`update_planes` on a real path). `planner/src/serve.rs` orphaned (`mod serve;` declared nowhere). Contract `counterfactual.rs`/`quorum.rs`/`recipe.rs` exist on disk but NOT in `lib.rs` (the causal-edge→AriGraph `EpisodicEdge` bridge lives in counterfactual.rs, `todo!()` + BLOCKED). +- **Parallel/bypassed:** `lance-graph-osint` has its `lance-graph`(AriGraph) dep COMMENTED OUT — feeds convergence from its own `extractor::Triplet`, never AriGraph. +- **machete corroborates:** `lance-graph` flags `lancedb` (cold-path Lance persistence unwired — matches dead witness_tombstone), `bgz17`/`bgz-tensor` (codec cascade unconnected) unused; `cognitive-shader-driver` flags `prost` (gRPC/serve unwired — matches orphaned serve.rs). +- **Design sound where built:** `spo_bridge::promote_to_spo` is the one LIVE load/store gate; HotWitness/WitnessCorpus/EpisodicMemory snapshot-by-value (no arena pointers) — honor hot→cold-copy by design, just unbuilt. NO live-code violation (bridge is dead, not wrong). +- **Two parallel witness vocabularies:** AriGraph `WitnessEntry`/`WitnessLink` (u64 mailbox_id placeholder) vs PR #437 R4 `witness_chain_position` (contract `MailboxId`) — not unified. + +**Action:** record as tech-debt; reconnection (D-ATOM-5 witness_tombstone, p64 convergence terminus, witness-vocab unification) is large + separate. Do NOT strip the machete-flagged deps blindly — cold/codec/serve wiring is intended-but-unbuilt, not truly dead deps. +**Cross-ref:** `F-WIRE-DTO-DUP-MAP`; `E-SOA-IS-THE-ONLY`; cognitive-risc-core invariants 4/5. + +--- + +## 2026-05-30 — E-AERIAL-IS-THE-DISCOVERY-PROPOSER — #436 aerial+ is the runtime-data + class-discovery proposer feeding the ONE SPO/class substrate through the ratification firewall; class_id is its SoA landing + +**Status:** FINDING (synergy synthesis, post-#436 rebase, 2026-05-30). + +#436 shipped `crates/lance-graph-arm-discovery` (Aerial+ ARM transcode). Synergies with this arc + Cognitive-RISC: +- **Aerial+ = a PROPOSER** in the RISC `discovery_origin` ISA (`ArmDiscovered` tier): a mined association, an AST-walk step, an LLM conjecture = the SAME candidate object differing only by `discovery_origin` (core invariant 9; proposers dumb, Rubicon arbitrates). Aerial is nondeterministic (seeded) → stays UPSTREAM of the ratification council (determinism firewall). +- **Emits SPO+NARS `Triple{s,p,o,f,c}`** into `ruff_spo_triplet` (mirrors `odoo_ontology::OntologyTriple`). Gap: closed predicate vocab rejects `Implies`/`CoOccursWith` (D-ARM-SYN-1, council-gated). Same SPO substrate the cognitive SoA packs (CausalEdge64 SPO palette + f/c) ⇒ aerial candidates → council → CausalEdge64/SPO → kanban (D-MBX-A6) → shader. +- **Aerial ALSO discovers CLASSES** (shape-families): cognitive-risc-classes — taxonomy DISCOVERED "via group-by-on-structural-hash or Aerial+"; splat→aerial→Wikidata discovers OWL/DOLCE+ HHTL classes+basins. ⇒ aerial is the discovery engine behind the `class_id` the SoA needs (the "ontology classes wired into the SoA" ask). Float lives OFFLINE in `jc` (Jirak-Cartan certified 256-codebook); aerial addresses it ONLINE with integer codes (CAM-PQ doctrine). +- **SPO-vocabulary debt (extends F-WIRE-DTO-DUP-MAP):** ≥4 parallel SPO-triple types (AriGraph `TripletGraph`, `ruff_spo_triplet::Triple`, `odoo_ontology::OntologyTriple`, aerial `CandidateTriple`, osint `extractor::Triplet`) — "one SoA never transformed" wants ONE; unification is the convergence work. +- **class_id landing (shipping now):** the SoA's class discriminator IS the existing `entity_type: [u16; N]` (= OGIT `EntityTypeId`); expose it as `MailboxSoaView::class_id()` (N1 freeze hook). Metadata resolves one layer up via `lance-graph-ontology::OntologyRegistry` (perf gap: add O(1) `by_entity_type_id` index; today O(n) `enumerate_first_with_entity_type_id`). +**Cross-ref:** `aerial-arm-ruff-spo-codegen-synergies.md`; `splat-codebook-aerial-wikidata-compression.md`; cognitive-risc-{core,classes,faiss-homology}; PR #437 `MailboxSoaView`. + +--- + ## 2026-05-30 — E-ARM-JC-RESOLVES-BOTH-SEAMS — aerial's two open seams (the distance oracle AND the D-ARM-7 Jirak floor) both resolve to `crates/jc`; jc PROVES the splat codebook, aerial USES it to discover the DOLCE skeleton that compresses Wikidata **Status:** FINDING (architecture; seams concrete, end-to-end pipeline is CONJECTURE). User framing: "gaussian-splat spatial blasgraph top-k 10000×10000 … for OWL/DOLCE+ SPO HHTL classes and basin via aerial+ to deterministically compress Wikidata … adjacent to JC Jirak[-Cartan] with EWA-sandwich gaussian splat." diff --git a/crates/lance-graph-contract/src/soa_view.rs b/crates/lance-graph-contract/src/soa_view.rs index 122a6038..678aa2e3 100644 --- a/crates/lance-graph-contract/src/soa_view.rs +++ b/crates/lance-graph-contract/src/soa_view.rs @@ -49,6 +49,25 @@ pub trait MailboxSoaView { /// Per-row entity-type id. fn entity_type(&self) -> &[u16]; + /// Per-row **class discriminator** — the Cognitive-RISC `class_id` / `shape_id` + /// (a.k.a. the OGIT `EntityTypeId`). Aliases + /// [`entity_type`](MailboxSoaView::entity_type) today: the existing `u16` slot IS + /// the class hook, so no new column is added (honors R1 "one SoA never + /// transformed"). Only the `u16` discriminator lives on the SoA; the machinery it + /// keys — label inheritance, column projection, jinja templates — resolves ONE + /// LAYER UP via the OGIT ontology cache (`lance-graph-ontology`), never in the SoA + /// / kv-lance columns. This is the Cognitive-RISC N1 freeze-time hook. + #[inline] + fn class_id(&self) -> &[u16] { + self.entity_type() + } + + /// The `class_id` of a single row. + #[inline] + fn class_id_at(&self, row: usize) -> u16 { + self.entity_type()[row] + } + // NOTE (follow-up): the qualia column (`QualiaI4_16D`) accessor is intentionally omitted — // add `fn qualia(&self) -> &[crate::qualia::QualiaI4_16D]` when the first consumer // (planner strategy selection) needs it; keep the read surface minimal until then. @@ -162,6 +181,9 @@ mod tests { assert_eq!(soa.edges_raw(), &[0, 1, 2]); assert_eq!(soa.meta_raw(), &[10, 11, 12]); assert_eq!(soa.entity_type(), &[100, 101, 102]); + // class_id is the Cognitive-RISC N1 hook aliasing the entity_type slot. + assert_eq!(soa.class_id(), &[100, 101, 102]); + assert_eq!(soa.class_id_at(0), 100); assert_eq!(soa.energy_at(1), 0.2); assert_eq!(soa.phase(), KanbanColumn::Planning); assert_eq!(soa.w_slot(), 7); From 36c81d1a18985451b548d7c4723bc92e4c571705 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 30 May 2026 20:38:38 +0000 Subject: [PATCH 5/6] docs(board): ResonanceDto is layered-not-dup (reframe TD to integrate-onto-SoA) + aerial->EW64 prefetch wiring F-RESONANCEDTO-IS-LAYERED-NOT-DUP: dto.rs (raw energy field) vs awareness_dto.rs (gestalt+user-model) are two layers, a name collision masking the missing qualia/gestalt -> i4-32D thinking-style/atom/strategy(elixir/jit/JITson) integration; NARS = the think-about-thinking meta-layer. Resolution = disambiguate + integrate onto the one SoA, not delete. E-AERIAL-FEEDS-EW64-PREFETCH: aerial's mined X->Y associations are the predictive-prefetch table EW64 consumes (fire-together -> wires-together). https://claude.ai/code/session_01R9AWgFa65uPnLyS2my2d2R --- .claude/board/EPIPHANIES.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index 69f2563b..e526eec4 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -1,3 +1,32 @@ +## 2026-05-30 — F-RESONANCEDTO-IS-LAYERED-NOT-DUP — the two ResonanceDto are two abstraction layers (energy-field Ψ vs gestalt-awareness), a name collision masking a MISSING INTEGRATION, not a copy + +**Status:** FINDING (both defs read 2026-05-30; reframes `TD-RESONANCEDTO-DUP-1` from "dedup" to "disambiguate + integrate"). + +- **`thinking-engine/src/dto.rs:59`** = RAW ENERGY FIELD (Ψ interference): `energy: Vec` (codebook[4096]) + `cycle_count`/`converged`/`top_k[8]`; `from_energy`/`entropy`/`active_count`. Low-level signal in the StreamDto→ResonanceDto→BusDto→ThoughtStruct speed-zone bus. +- **`thinking-engine/src/awareness_dto.rs:21`** = GESTALT + USER MODEL: `hdr: HdrResonance` (3D S/P/O) + `gestalt_state` (Crystallizing/Contested/Dissolving/Epiphany) + `dissonance`/`n_resonant`/`total_energy` + inferred `user_style: ThinkingStyle`/engagement/valence/depth/confidence; `from_superposition`. + +⇒ **NOT a true duplicate** — same name, two layers (raw energy vs gestalt-awareness). machete/`TD-RESONANCEDTO-DUP-1` flagged a NAME COLLISION masking a layering. User's read confirmed: it's "just missing the integration." + +**Missing integration (the actionable chain):** energy-field (Ψ) → gestalt-awareness → **+ qualia** (today a SEPARATE `QualiaDto`, integrated only at `MomentDto`) → **selection of i4-32D thinking-styles / atoms / strategies**. The awareness ResonanceDto stops at a COARSE `user_style` (3 variants) and does NOT drive the full i4-32D layer (`contract::atoms::I4x32` 33-atom TSV, `contract::recipe_kernels` 34 tactics, `contract::thinking` 36 styles) nor STRATEGY selection (elixir / jit / JITson-Cranelift templates). "thinking about thinking" = NARS meta-layer (`planner::mul` Meta-Uncertainty / Dunning-Kruger + `user_model_confidence`) above the selection. + +**Resolution (reframes the TD):** NOT pick-a-winner-and-delete. (1) Disambiguate names (`ResonanceField` for Ψ energy vs `GestaltResonance` for the awareness model). (2) Wire the integration onto the ONE SoA ("ResonanceDto IS the SoA", PR #353): MailboxSoA columns ALREADY carry the substrate — `qualia:[QualiaI4_16D;N]` + `meta:[MetaWord;N]`(thinking/awareness bits) + `entity_type`(class_id) + `edges`(CausalEdge64). resonance→gestalt→qualia→i4-32D-style→strategy converges onto SoA columns + the contract atom/recipe/thinking surface, NOT a third struct. The "dedup" IS an integration onto the SoA — the "one SoA never transformed" convergence. +**Cross-ref:** `TD-RESONANCEDTO-DUP-1` (reframed); `F-WIRE-DTO-DUP-MAP`; SoA-DTO ledger (PR #353); `contract::{atoms,recipe_kernels,thinking,qualia,mul}`. + +--- + +## 2026-05-30 — E-AERIAL-FEEDS-EW64-PREFETCH — aerial+'s mined X→Y associations ARE the predictive-prefetch table EW64 consumes; aerial learns "fire together", EW64 "wires together" + +**Status:** CONJECTURE / design (user-stated 2026-05-30). Sweet-spot wiring for the EpisodicWitness64 follow-up; closes the "prefetch WHAT, from where" gap in `E-EW64-IS-PREDICTIVE-PREFETCH`. + +EW64 = CPU-style predictive prefetch co-issued with CE64 into the shader. Open question was "prefetch what." **Aerial+ (#436) discovers it:** +- **aerial (discovery / slow / nondeterministic, upstream of firewall):** mines `X→Y` association rules with data-derived `(f,c)` — the Hebbian "when antecedent X fires, consequent Y co-occurs" ("fire together"). +- **EW64 (hot / prefetch):** when CE64(X) activates in the SoA, EW64 prefetches the episodic-witness pointer for the aerial-predicted Y (its witness arc), resident BEFORE the shader needs it ("wires together"). +- aerial's `(f,c)` → EW64's prefetch confidence; un-ratified aerial rules never reach EW64 (firewall). EW64 shares CE64's low-40 SPO bits so antecedent/consequent co-address (superposition). +⇒ **EW64 type design:** payload = witness-arc pointer to the predicted consequent + confidence/recency lens; populated from the RATIFIED aerial association table; co-issued with CE64. +**Cross-ref:** `E-EW64-IS-PREDICTIVE-PREFETCH`; `E-AERIAL-IS-THE-DISCOVERY-PROPOSER`; `aerial-arm-ruff-spo-codegen-synergies.md`; pr-ce64-mb-4 `SpoWitness64`. + +--- + ## 2026-05-30 — E-ARIGRAPH-IS-AN-ISLAND — AriGraph's cross-crate wirings are nominal/orphaned; the hot→cold bridge is dead; machete corroborates **Status:** FINDING (read-only audit 2026-05-30, file:line-cited, Opus agent). Pre-existing, NOT introduced by PR #437. From 0fb055aa6a0a4ae14261de7b472a64f40f42794b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 30 May 2026 20:42:20 +0000 Subject: [PATCH 6/6] docs(board): AriGraph paper (arXiv 2407.04363v3) grounds CE64/EW64 = its semantic/episodic edge duality E-ARIGRAPH-PAPER-GROUNDS-CE64-EW64: Es semantic edges = CE64; Ee episodic edges ('happened at the same time') = EW64 = the witness arc. aerial+ generalizes the co-occurrence; retrieval = semantic(Contriever, discovery-only float)+episodic search; Ariadne loop = the 5-layer stack; HHTL/CAM = Wikidata-scale semantic substrate. The lance-graph arigraph/ port is a faithful island to wire into the hot SoA + cold store. https://claude.ai/code/session_01R9AWgFa65uPnLyS2my2d2R --- .claude/board/EPIPHANIES.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index e526eec4..9c817934 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -1,3 +1,22 @@ +## 2026-05-30 — E-ARIGRAPH-PAPER-GROUNDS-CE64-EW64 — AriGraph (arXiv 2407.04363v3) IS the source: its semantic-edge/episodic-edge duality grounds CE64/EW64; the episodic edge ("happened at the same time") IS the witness arc + +**Status:** FINDING (read the AriGraph paper, Anokhin et al. AIRI, 2026-05-30). User's "first is AriGraph!!!" — this is the canonical design source for the semantic+episodic arc. + +AriGraph world model G = (Vs, Es, Ve, Ee): +- **Es = semantic edges = SPO triplets** `(v, rel, u)` (semantic memory) ⇒ **CE64 = an AriGraph semantic edge** (SPO palette + NARS f/c, 64-bit packed). +- **Ee = episodic edges = `(observation-vertex v_e^t, all SPO triplets E_s^t extracted at t)`** — "connect all triplets that happened at the same time" ⇒ **EW64 = an AriGraph episodic edge = the witness arc.** The board's `witness_chain_position` / belief-state arc IS AriGraph's episodic edge. The CE64/EW64 pairing = AriGraph's semantic/episodic duality, EXACTLY. Grounded, not ad-hoc. +- **"happened at the same time" = Hebbian "fire together".** aerial+ (PR `#436`) GENERALIZES it: offline ARM mines co-occurrence `X→Y` across many observations; AriGraph records per-observation co-occurrence online. Both feed EW64's predictive prefetch (`E-AERIAL-FEEDS-EW64-PREFETCH`). +- **Retrieval = semantic search (Contriever embedding similarity, depth d/width w BFS, Alg 2) + episodic search (relevance-weighted top-k episodic vertices; rel = n_i/max(N_i,1)·log(max(N_i,1))).** Per iron rules: Contriever FLOAT similarity is discovery-layer-only; CAM exact + HHTL facet-AND are the addressing layer. Episodic search = retrieving witness arcs. +- **Ariadne loop = cognitive-RISC 5-layer stack:** AriGraph (semantic+episodic content) = Substrate; retrieval→working-memory + planning (sub-goals) = Compilation; the plan = Schedule (kanban); ReAct decision = Execution (shader); goal/agent = Producer. + +**lance-graph impl vs paper:** faithful PORT — `arigraph/triplet_graph.rs` (Es semantic), `witness_corpus.rs`/`episodic.rs` (Ee/Ve episodic), `orchestrator.rs` (Ariadne loop), `retrieval.rs` (semantic search), `sensorium.rs`. But it is an ISLAND (`E-ARIGRAPH-IS-AN-ISLAND`): semantic/episodic edges NOT wired to the hot SoA (CE64/EW64 cols) or cold Lance store. **Wiring task = Es→CE64(hot)+TripletGraph/SpoStore(cold); Ee→EW64(hot prefetch)+WitnessCorpus(cold); under load/store + witness-materialization discipline.** + +**Wikidata scale (wikidata-hhtl-load.md):** AriGraph semantic memory at 115M-entity scale = HHTL/CAM — P279 subClassOf DAG = the ONE 16^n tree axis; OWL/DOLCE closed ranges = facet bitmasks (SIMD batch-AND over the SoA facet column = the semantic-search accelerator); CAM shape-dedup; en+de cols; Derived reasoning store (transitive closures) orthogonal+CAM-indexed. 120GB→~38GB structural. = how AriGraph's Vs/Es scale to a world KG. + +**Cross-ref:** arXiv 2407.04363v3; `E-EW64-IS-PREDICTIVE-PREFETCH`; `E-AERIAL-FEEDS-EW64-PREFETCH`; `E-ARIGRAPH-IS-AN-ISLAND`; wikidata-hhtl-load + faiss-homology-cam-pq + cognitive-risc-{core,classes}; `arigraph/{triplet_graph,witness_corpus,episodic,orchestrator,retrieval}.rs`. + +--- + ## 2026-05-30 — F-RESONANCEDTO-IS-LAYERED-NOT-DUP — the two ResonanceDto are two abstraction layers (energy-field Ψ vs gestalt-awareness), a name collision masking a MISSING INTEGRATION, not a copy **Status:** FINDING (both defs read 2026-05-30; reframes `TD-RESONANCEDTO-DUP-1` from "dedup" to "disambiguate + integrate").