Skip to content

Commit ed6cfea

Browse files
committed
docs(plan): reconcile unified-soa-rubikon with prior D-MBX arc + ground SurrealQL superpowers
Cross-read the existing Rubikon/kanban integration plans and tied the new unified-soa-rubikon-integration-v1 plan to its canonical homes so the two arcs cannot drift. Plan §7 (Reconciliation): maps every clause to its prior D-id — - planner ↔ SoA + the four superpowers are D-MBX-A6 (A6-P3 is the NEXT node: the missing Outcome→KanbanMove emit edge), NOT a new layer; - the -550ms Libet anchor is unchanged (R3 / D-MBX-8, shipped); - the -200ms veto REFINES unified-soa-convergence-v1 §5 R3(a) (gives the already-named pre-commit veto its anchor: RP -550ms, conscious intention ~-200ms, "free won't" window) — one new stamp on Planning→Prune, not a new type; - the SurrealQL membrane is D-MBX-9 + surreal_container::view's read_via_kv_lance stub (OQ-11.6); - the subscriber fan-out already exists as callcenter LanceVersionWatcher. Names the "do NOT mint a new PlannerDTO" drift guard (canonical = Candidate + KanbanMove). Plan §8 (SurrealQL superpowers): grounded in the AdaWorldAPI surrealdb fork, NOT generic hearsay — verified present this session: - kv-lance engine (core/src/kvs/lance/{mod,schema,tx_buffer,timeline}.rs) => SurrealDB stores into the SAME Lance bytes the SoA writes => the transparent view (D-MBX-7) is zero-copy by construction; - time-series via kvs/lance/timeline.rs + record-id ranges => the temporal Markov / witness arc; - LIVE SELECT + CHANGEFEED (expr/statements/live.rs, CHANGEFEED on DEFINE TABLE) => the version-subscription IN-direction (drive_once / LanceVersionWatcher); writer still fires kanban synchronously; - RELATE (expr/statements/relate.rs) => the EdgeBlock / key-only render. EPIPHANIES: prepend E-SURREALQL-IS-A-LENS-NOT-A-SINK — because kv-lance makes SurrealDB's store the SoA's own Lance dataset, SurrealQL is a second native runtime over one substrate, not an egress dialect; "ship it to SurrealDB" is a category error. No serialization path; only the kv-lance scan body is a stub. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi
1 parent 3e826f8 commit ed6cfea

2 files changed

Lines changed: 130 additions & 3 deletions

File tree

.claude/board/EPIPHANIES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 2026-06-20 — E-SURREALQL-IS-A-LENS-NOT-A-SINK — because SurrealDB's kv-lance engine stores into the SAME Lance bytes the SoA writes, SurrealQL is a second NATIVE runtime over the one substrate, not an egress dialect we export to; "ship it to SurrealDB" is a category error the way "ship it to a different view of the same table" is
2+
3+
**Status:** FINDING (perennial; grounded in `surrealdb/core/src/kvs/lance/` — the fork, verified 2026-06-20).
4+
5+
The reflex is to treat SurrealQL as the *egress* side — the place a result lands AFTER the cognitive substrate is done (the "send it to Splunk" shape medcare-rs's audit-sink rule already warns against). That reflex is wrong here, and the reason is the **kv-lance engine** (`surrealdb/core/src/kvs/lance/{mod,schema,tx_buffer,timeline}.rs`): SurrealDB is a `Transactable` over the Lance versioned columnar format, so its store *is* the SoA's own `nodes.lance` dataset. There is no second copy to export to — there is one set of bytes with two native runtimes pointed at it (the cognitive SoA writer, and SurrealQL).
6+
7+
Four consequences, each a superpower over the IDENTICAL bytes, not a feature of a downstream system:
8+
1. **Time-series is free** — `kvs/lance/timeline.rs` + record-id ranges read the Lance version axis directly; the version log = the witness arc (`CausalEdge64` series), no event store.
9+
2. **LIVE SELECT / CHANGEFEED = the version-subscription IN-direction** — the SurrealQL spelling of `LanceVersionScheduler::drive_once` + `callcenter::LanceVersionWatcher`. CDC for the *subscriber* half only; the writer still fires kanban synchronously.
10+
3. **RELATE = the `EdgeBlock`** — `->edge->` traversal IS the prefix-route + slot-deref of `E-GUID-IS-THE-GRAPH`, in SurrealQL syntax instead of Cypher: one AST, the egress side (`E-CYPHER-IS-THE-KANBAN-AST`).
11+
4. **Column SELECT = tenant projection** — the §2 superpowers (meta-query, project-any-tenant) each have a SurrealQL spelling over the same SoA columns.
12+
13+
The load-bearing correction: do NOT design a SoA→SurrealDB *serialization* path. The membrane (`surreal_container::view`) borrows zero-copy because the bytes are already in Lance; the only stub is the kv-lance scan body (`read_via_kv_lance`, `OQ-11.6`), not a transport. SurrealQL is a lens, gated on uncommenting a fork dep — never an export.
14+
15+
Cross-ref: `.claude/plans/unified-soa-rubikon-integration-v1.md` §8; `unified-soa-convergence-v1.md` §2.7 (SurrealDB-is-a-view-not-a-store) + D-MBX-7/9; `surreal_container/src/view.rs`; medcare-rs CLAUDE.md "the audit event does not go outside" (same anti-egress reflex, different subsystem); `E-CYPHER-IS-THE-KANBAN-AST`; `E-GUID-IS-THE-GRAPH`; `E-SUBSTRATE-IS-THE-SCHEDULER`.
16+
17+
---
18+
119
## 2026-06-20 — E-SCENT-IS-NOT-READING — head/tail (and summaries/breadcrumbs) are a positional SCENT for routing, never a substitute for the read; mistaking the scent for comprehension is the student who skimmed the first and last chapter and wrote the essay anyway
220

321
**Status:** FINDING (perennial).

.claude/plans/unified-soa-rubikon-integration-v1.md

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,117 @@ to drive the SoA.
158158
`lance-graph-callcenter`, OGAR i4-32D / `ClassView`), but the wiring is the
159159
work — none of §2–§5 is claimed running.
160160

161+
---
162+
163+
## 7. Reconciliation with prior plans — this is NOT a new arc
164+
165+
This plan **complements, does not duplicate**, the existing Rubikon/kanban
166+
convergence work. Cross-read this session (`unified-soa-convergence-v1.md` +
167+
`D-MBX-COMPLETION-MAP.md` + the kanban EPIPHANIES). The mapping, so the two
168+
plans cannot drift:
169+
170+
| This plan (§) | Canonical home (prior plan / D-id) | Status there | Relationship |
171+
|---|---|---|---|
172+
| §1 golden image SoA | — (new harness this session) | ✅ shipped | NEW — the proof-of-composition the prior arc lacked |
173+
| §2.1–.4 four superpowers | `D-MBX-A6` (planner DTO overhaul) + §2 "one SoA, never transformed" | ☐ A6-P3 NEXT | the superpowers ARE planner ops over the SoA — land **under A6**, not a new layer |
174+
| §3 Rubikon + Libet −550 ms | `unified-soa-convergence-v1` §5 R3 + `D-MBX-8` | ✅ −550 ms shipped | SAME anchor; no divergence |
175+
| §3 Libet −200 ms veto | `unified-soa-convergence-v1` §5 R3**(a)** "pre-commit veto, card never leaves Planning" | ☐ unbuilt | **REFINES, not invents:** R3(a) named the *veto*; this plan gives it the *anchor* — RP at −550 ms, conscious intention ≈ −200 ms, "free won't" window between −200 ms and the act → stamp **−200 000 µs on `Planning → Prune`**. R3(b) post-eval Prune is the *other* veto expression and already exists. |
176+
| §4 planner ↔ SoA | `D-MBX-A6` / `D-MBX-12.5` (planner sub-PR) | ☐ A6-P3 NEXT | identical target; **do NOT mint a new "PlannerDTO"** (E-2026-05-30 COUNCIL: that name is drift — canonical = `Candidate` + `KanbanMove`) |
177+
| §4 thinking-style ↔ Rubikon | `style_strategy.rs` (#439 D-MBX-A6-P3a) + OGAR i4-32D CAM |#439 passthrough | the missing edge is `Outcome → KanbanMove` emit = **A6-P3**, gated by the planner-output overhaul |
178+
| §4 SurrealQL membrane | `D-MBX-9` (Rubicon kanban VIEW) + `surreal_container::view::read_via_kv_lance` | ☐ stub, `OQ-11.6` | identical stub; gated on the surrealdb-fork dep being uncommented |
179+
| §4 callcenter boundary | `callcenter-membrane-v1` DM-4 (`LanceVersionWatcher`) | ✅ shipped (std-sync) | the *subscriber* fan-out already exists — §4's "version watcher" = this |
180+
| §2.4 key-only render | `E-GUID-IS-THE-GRAPH` + `E-CYPHER-IS-THE-KANBAN-AST` | ✅ FINDING | the zero-value-decode graph view is the doctrine; §2.4 is its planner op |
181+
182+
**Loose ends tied (the reconciliation deltas):**
183+
184+
1. **§4 is `D-MBX-A6-P3`, full stop.** The planner integration is not a parallel
185+
effort — it is the NEXT node of the shipped A6 chain (P1 #437 + P2 #439 land
186+
2 of 3 edges; the missing edge is `Outcome → KanbanMove`). This plan's §4
187+
should be read as the **capstone narrative** for A6-P3, not a competing spec.
188+
2. **The −200 ms veto is the one genuinely-new contract enrichment** here, and it
189+
is small: a single `libet_offset_us = -200_000` stamp on the `Planning → Prune`
190+
edge in `advance_phase` (today it stamps 0), mirroring the −550 000 already on
191+
`Planning → CognitiveWork`. It refines `unified-soa-convergence-v1` R3(a); it
192+
does not contradict R3(b).
193+
3. **No new kanban/SoA/scheduler type.** Everything routes through shipped
194+
`contract::{kanban, soa_view, scheduler}` + `surreal_container::view` +
195+
`callcenter::version_watcher`. Per CLAUDE.md "AGI IS the struct-of-arrays" and
196+
`E-CYPHER-IS-THE-KANBAN-AST`: board-ops + ontology-traversal + thinking-style
197+
dispatch + SurrealQL egress are **one AST seen from four sides**, not four
198+
subsystems to bridge.
199+
4. **`D-MBX-7` is the hard prerequisite for the transparent view** (lance-graph
200+
containers ≡ `MailboxSoA` layout) and `D-MBX-11`/`OQ-11.6` (Lance-7 pin +
201+
surrealdb-fork URL) gate the kv-lance re-read. The golden image already pins
202+
lance-7 lockstep, so the `D-MBX-11` blocker is *retired in the harness* — the
203+
surrealdb fork's `claude/kvs-lance-timeline` branch bumped to `lance =7.0.0 /
204+
lancedb =0.30.0` to match (verified this session). What remains is `OQ-11.6`
205+
(uncomment the fork dep, fill `read_via_kv_lance`).
206+
207+
---
208+
209+
## 8. The SurrealQL superpowers (grounded in the AdaWorldAPI fork)
210+
211+
The operator's note — *"I think we didn't understand properly the superpowers
212+
that SurrealQL grants us, time series etc"* — is correct: SurrealQL is not just
213+
an egress dialect, it is a **second native runtime over the SAME Lance bytes**.
214+
All four below are VERIFIED present in `/home/user/surrealdb` (the AdaWorldAPI
215+
fork), not generic-SurrealDB hearsay:
216+
217+
1.**kv-lance engine = SurrealDB runs ON Lance.**
218+
`surrealdb/core/src/kvs/lance/{mod,schema,tx_buffer,background_optimizer,
219+
timeline}.rs` — a full `Transactable` KV backend on the Lance versioned
220+
columnar format. **Consequence:** the SAME `nodes.lance` dataset the SoA
221+
batch-writer commits IS the SurrealDB store. No ETL, no copy — the
222+
"transparent container view" (`D-MBX-7`) is literally SurrealDB pointed at the
223+
SoA's own Lance files. This is why `surreal_container::view` borrows zero-copy
224+
(§4): the bytes are already there.
225+
2.**Time-series = `kvs/lance/timeline.rs` + record-id ranges.**
226+
The `timeline.rs` module in the kv-lance backend is the time-series surface;
227+
SurrealQL record-id ranges (`SELECT * FROM mailbox:[$lo]..[$hi]`) scan the
228+
monotonic version/cycle axis directly. **Maps to** superpower §2.2 (the
229+
`temporal` implicit Markov chain) and the witness arc (`CausalEdge64`
230+
emissions are an ordered series; the SurrealQL range IS the arc read). The
231+
Lance version log = the time axis = the kanban witness chain; no separate
232+
event store (cf. `E-2026-...` "the actor's state history IS the Lance version
233+
log").
234+
3.**LIVE SELECT + CHANGEFEED = the version-subscription IN-direction.**
235+
`surrealdb/core/src/expr/statements/live.rs` + `key/table/lq.rs` (live-query
236+
keys) + `CHANGEFEED` on `DEFINE TABLE`/`DEFINE DATABASE`
237+
(`expr/statements/define/{table,database}.rs`). **This is CDC**, and it is the
238+
exact shape of `LanceVersionScheduler::drive_once` (async subscriber reads a
239+
version it didn't write) + `callcenter::LanceVersionWatcher` (std-sync
240+
always-latest fan-out). A `LIVE SELECT … FROM mailbox` is the SurrealQL
241+
spelling of "subscribe to the kanban version tick" → `on_version`
242+
`KanbanMove`. The writer still fires the kanban update **synchronously** (§1);
243+
LIVE/CHANGEFEED is for *other* consumers (the subscriber half), matching the
244+
"async only because it reads a version it didn't write" ruling.
245+
4.**RELATE = native graph edges ↔ `EdgeBlock`.**
246+
`surrealdb/core/src/expr/statements/relate.rs` — SurrealQL `RELATE a->edge->b`
247+
is a first-class graph edge. **Maps to** the `EdgeBlock` (12 in-family + 4
248+
out-of-family slots) and superpower §2.4 (key-only neo4j-grade render).
249+
A `RELATE`/`->edge->` traversal over the kv-lance store IS the prefix-route +
250+
slot-deref of `E-GUID-IS-THE-GRAPH`, expressed in SurrealQL instead of Cypher
251+
— the same AST, the egress side (`E-CYPHER-IS-THE-KANBAN-AST`).
252+
253+
**Net:** the four superpowers of §2 (meta-query / temporal Markov / project-any-
254+
tenant / key-only render) each have a **SurrealQL spelling** over the identical
255+
Lance bytes — meta-query via aggregate `SELECT`, temporal via record-range +
256+
`timeline.rs`, tenant projection via column `SELECT`, key-only render via
257+
`RELATE`/`->`. SurrealQL is not a sink we *export to*; it is a co-equal lens on
258+
the one SoA, gated only by `OQ-11.6` (uncomment the fork dep + fill
259+
`read_via_kv_lance`). The membrane is already typed and tested
260+
(`surreal_container::view`, 5 tests green); only the kv-lance scan body is a stub.
261+
262+
---
263+
161264
**Cross-ref:** symbiont `INTEGRATION_PLAN.md` + `BATTLE_TEST_PLAN.md`; CANON
162265
(`canonical_node.rs`); `kanban.rs` / `scheduler.rs` / `soa_view.rs`;
163-
`scheduler_seam.rs`; EPIPHANIES `E-NODE-IS-SOA-IS-KANBAN-BOARD`,
164-
`E-BINDSPACE-IS-A-NAN-PROJECTION-SURFACE`, `E-SCENT-IS-NOT-READING`; STATUS_BOARD
165-
`symbiont-golden-image-harness`.
266+
`scheduler_seam.rs`; `surreal_container/src/view.rs` (the `read_via_kv_lance`
267+
stub); `lance-graph-callcenter/src/version_watcher.rs` (the subscriber fan-out);
268+
`/home/user/surrealdb/surrealdb/core/src/kvs/lance/` (the kv-lance engine +
269+
`timeline.rs`). **Prior plans reconciled:** `unified-soa-convergence-v1.md`
270+
(D-MBX-7/8/9/A6/12, §5 R3 Libet, §7 plasticity); `cypher-kanban-ast-unification-v1.md`;
271+
`callcenter-membrane-v1.md` (DM-4 watcher). **EPIPHANIES:**
272+
`E-NODE-IS-SOA-IS-KANBAN-BOARD`, `E-BINDSPACE-IS-A-NAN-PROJECTION-SURFACE`,
273+
`E-SCENT-IS-NOT-READING`, `E-CYPHER-IS-THE-KANBAN-AST`, `E-GUID-IS-THE-GRAPH`,
274+
`E-SUBSTRATE-IS-THE-SCHEDULER`. STATUS_BOARD `symbiont-golden-image-harness`.

0 commit comments

Comments
 (0)