diff --git a/.claude/board/AGENT_LOG.md b/.claude/board/AGENT_LOG.md index 18d06eef..b6084d38 100644 --- a/.claude/board/AGENT_LOG.md +++ b/.claude/board/AGENT_LOG.md @@ -1,3 +1,32 @@ +## 2026-06-18 — 5+3 council: mailbox-belief-update-and-substrate-test-v1 (design, no code) + +**Main thread (Opus) + 8-agent council.** Branch `claude/soa-cycle-ownership-sync`. Question: should within-mailbox belief change be a per-item AriGraph belief update ("this thought made me smarter, what did I learn"), best-cased with Sudoku/goban/deepeval? + +**Builders (5):** trajectory (DERIVED read, witness arc IS the revision log, emit at Commit not consume), dto-soa (FITS-COLUMN, no new layer), creative-explorer (2nd-order: competence self-model; 2 axes ΔF+ΔStaunen, single signed delta is the dilution), contradiction-cartographer (**P0: net Δ⟨f,c⟩ is LOSSY** — averaging hides revision-vs-contradiction-commit; carry signed residual + regime tag + qualia delta, reuse `support`/`dissonance`), convergence (single-step delta = OPPORTUNITY `belief_delta()` no new column; multi-cycle arc = D-MBX-A3 not free; `last_write_cycle` doesn't exist yet, `last_active_cycle`+`current_cycle` give the N+1 endpoint only). + +**Critics (brutal):** cross-domain-synthesizer — Sudoku↔edge-Weyl **[S] DROP** (rhyme; two real Weyls in codebase, neither is this), Sudoku field-prop TEST-HARNESS-ONLY (confluence regression), goban **[H] MECHANISM** for support/capture/ko (DROP influence leg [S]), deepeval **DROP** (Python LLM-judge = firewall breach; cherry-pick only the trivial threshold shape). theorem-checker — Sudoku↔Weyl **[S]** (20-regular vertex-transitive → maximally degenerate spectrum = OPPOSITE of φ-Weyl degeneracy-breaking; real statement is a Hoffman coloring bound [G], not Weyl), constraint-prop↔VSA **[H]-skeleton/[S]-semantics** (Tarski fixpoint shared; exact/finite/lossless vs statistical/continuous/lossy differ in the load-bearing property), a Sudoku harness certifies speed+correctness in the deterministic limit ONLY — not the spectral/concentration property. + +**Operator reframe (resolved the critique):** the test is NOT the Weyl spectral connection — it's TWO axes: (1) THROUGHPUT "16M sudoku in 3.4 min" (exact-oracle workload, hard speed+correctness number) vs (2) LEARNING "thinking-style improved exponentially, ceiling x" (= φ-1 humility; the belief-update learning curve). They compose: Sudoku = workload, learning-curve = belief-update measured over it. + +**Outcome:** plan `mailbox-belief-update-and-substrate-test-v1.md` created, slots S2.5b (after the write contract). Verdict: belief-update = derived read (LAND), carry the non-lossy 4-tuple; throughput test valid (drop Weyl label); deepeval dropped. No source/test change — design only. + +## 2026-06-18 — 5+3 council: mailbox-cycle-aware-write-contract-v1 (design, no code) + +**Main thread (Opus) + 8-agent council.** Branch `claude/soa-cycle-ownership-sync`. Drafted `.claude/plans/mailbox-cycle-aware-write-contract-v1.md` (the next code deliverable named by `E-SOA-CYCLE-OWNERSHIP` rule 1) and ran the operator-mandated 5+3. + +**Builders (5):** convergence (OQ-B → reuse `SoaEnvelope::cycle()`, NO version bump; OQ-A → two stamps, phase-pack deferred `OQ-CSV-CYCLEPACK`), dto-soa (FITS-COLUMN/EXTENDS-CANONICAL; `WriteCell` must stay a staging view), trajectory (`temporal.rs` is read-only — plan over-claimed a write seam; HLC keys within-lane order, `current_cycle` keys the lane; OQ-C → Aware-buffer), integration-lead (slots S2.5 pre-S3; 3 increments; not blocked by surrealdb; OQ-D → `WriteOutcome` enum), container-architect (spawn pointer = `identity` 24-bit new `u32` field, not `mailbox_id`; **gate MUST be wrap-aware** else 8–40 min sweep misclassifies post-wrap; `WriteCell` carries `(row,cycle)`; OQ-B no-bump holds iff identity stays in key). + +**Critics (3):** brutally-honest → **HOLD** on 2 P0s (temporal.rs write-sink fiction + unreachable feature-graph) — both CLEARED by operator direction (de-interlace = addressing via GUID identity tail, stale handling LOCAL, no planner dep); reversed 2 builder leans (OQ-D infallible not Result; setters stay `pub`+`#[doc(hidden)]` not `pub(crate)` — breaks `tests/w2_differential.rs`). iron-rule → **YIELDS-WITH-AP** (no violation; conditional on no-production-blind-path guard + `last_write_cycle`/`identity` in `reset_row`+field-isolation SAME commit). baton-handoff → **CATCH-CRITICAL**: `BackingStoreWrite::Singleton(&BindSpace)` has no `current_cycle` → uniform gated signature returns unconditional `Accepted` = C2-divergence sentinel-lie; fix = Singleton cycle-blind-by-construction. CATCH-LATENT: `mailbox_id`(u32)→`NodeGuid::identity`(24b) panics-not-corrupts if >0x00FF_FFFF. + +**Outcome:** all fixes folded into the plan (resolved OQs A–E, P0 addressing rewrite, wrap-aware gate, Singleton contract, test/guard same-commit requirements, 3-increment cascade). Verdict: **LAND as S2.5**, code 5+3-clean. Cold TS+kanban stay Lance-native (lancedb 0.30 / lance 7). No source/test change this entry — design only. + +## 2026-06-18 — repo-sync: SoA cycle-ownership architecture into the migration plan (no code) + +**Main thread (Opus).** Branch `claude/soa-cycle-ownership-sync`. Operator directive: tie the converged BindSpace→SoA architecture into the plan to bring the repo in sync, before the code wiring's 5+3. Docs only. + +Captured (plan ERRATA ADDENDUM 2026-06-18c + `E-SOA-CYCLE-OWNERSHIP`): (1) cycle ownership per-mailbox/per-cycle, LE-contract-enforced on tenant + envelope — the gap is the cycle-blind setters/`BackingStoreWrite` (next code deliverable, 5+3-gated); (2) multi-mailbox interlace is the target, the `backing()` ≤1 assert is W5-transitional (16k=8MB, 16M=8GB, GUID-prefix-routed via L3-resident prefix tables); (3) consumer fork — SoA-fit rotates in, non-fit gets an OGAR `classid→schema` (ClassView/Template, #530/#533); (4) OGAR + Template + Schema-version mandatory at the consumer/persistence boundary. Also recorded that #535 closed the with-engine break + the i4-codebook_index risk via the F32 anchor. + +No source/test change. ## 2026-06-18 — S-series Step 1+2: unbreak --features with-engine + F32-17D bit-exact qualia tenant **Main thread (Opus) + panel.** Branch `claude/with-engine-build-fix`. Two commits: (1) import `QUALIA_DIMS` to unbreak `--features with-engine` (engine_bridge.rs:259 used it unimported — the entire dispatch/unbind lab surface was dormant); (2) restore an F32-17D bit-exact qualia tenant. diff --git a/.claude/board/EPIPHANIES.md b/.claude/board/EPIPHANIES.md index 21633761..d0905268 100644 --- a/.claude/board/EPIPHANIES.md +++ b/.claude/board/EPIPHANIES.md @@ -1,3 +1,17 @@ +## 2026-06-18 — E-SOA-CYCLE-OWNERSHIP — cycle is per-mailbox + per-cycle, LE-contract-enforced; multi-mailbox interlaces; non-fitting consumers get OGAR classid→schema + +**Status:** FINDING (operator-ratified architecture sync; the wiring itself is 5+3-gated before code). Repo brought in sync via the `bindspace-singleton-to-mailbox-soa-v1` ERRATA ADDENDUM 2026-06-18c. + +After the AoS→SoA rotation (done) + the F32 bit-exact anchor (#535), the remaining migration is bounded by four operator-ratified rules: + +1. **Cycle ownership = per-mailbox, per-cycle, byte-explicit in the LE contract of the tenant AND the envelope.** No cycle-blind write; nothing buffers a stale/older mailbox. The gap today: only `consume_firing` is cycle-aware; the per-row setters (`set_content/qualia/edge/meta/temporal`) and `BackingStoreWrite` are cycle-blind. Target: every write carries/checks `current_cycle` (`SoaEnvelope::cycle()` / `current_cycle` / `last_active_cycle`). This is the next code deliverable. + +2. **Multi-mailbox interlace is the target; `backing()`'s `debug_assert(≤1 mailbox)` is W5-transitional, not the design.** 16k open mailboxes ≈ 8 MB (512 B each); 16M ≈ 8 GB — linear, trivial. No open mailbox goes inaccessible at scale because addressing is the canonical GUID prefix-route (classid·HEEL·HIP·TWIG → ~1024 L3-resident prefix tables; trie binds the prefix, masked-load the tail). Per-cycle discipline is per-mailbox. + +3. **Consumer fork — not every consumer rotates into the one SoA.** SoA-fits → rotate onto the SoA columns. Doesn't-fit → a customized OGAR-driven `classid → schema` (per-class ClassView/Template, the Core-First path #530/#533). The ~10 live BindSpace consumers (cypher_bridge, sentence_crystal, fabric, learning/{scm,feedback}, spo/merkle, callcenter/transcode, planner/elevation) split along this line; they migrate at D-MBX-12 (gated on D-MBX-7 + D-MBX-9-surrealdb). Dissolves the "all nine migrate to one SoA" misframe. + +4. **Layering down:** at the consumer/persistence boundary, OGAR (canonical node) + Template (ClassView) + Schema-version (envelope `LAYOUT_VERSION`, currently 2) become mandatory. + ## 2026-06-18 — E-QUALIA-F32-LAB-TENANT — i4 qualia is lossy for codebook_index + energies; the F32-17D BindSpace tenant is the migration's bit-exact anchor **Status:** FINDING (operator-directed "wire F32; one exactness to measure against during the migration"; 3-agent panel LAND — dto-soa FITS-COLUMN, iron-rule LAND-with-AP1-guard, truth-architect PASS-able — supplementing the earlier 8-agent S-series council). diff --git a/.claude/board/INTEGRATION_PLANS.md b/.claude/board/INTEGRATION_PLANS.md index 13827fd5..68228073 100644 --- a/.claude/board/INTEGRATION_PLANS.md +++ b/.claude/board/INTEGRATION_PLANS.md @@ -1,3 +1,28 @@ +## 2026-06-18 — mailbox-belief-update-and-substrate-test-v1 ("what did I learn" = NARS-revision delta + two-axis test; 5+3-ratified; slots S2.5b) + +**Status:** CONJECTURE / design — 5+3 COMPLETE. **Plan file:** `.claude/plans/mailbox-belief-update-and-substrate-test-v1.md`. Parent: `bindspace-singleton-to-mailbox-soa-v1` §11 + `E-SOA-CYCLE-OWNERSHIP`. +**Owns:** the per-item belief-update ("this thought made me smarter") + the two-axis substrate test. +- **Belief-update = NARS-revision delta, DERIVED** (not stored). Single-step = `belief_delta(row)` read method on `MailboxSoaView`, ZERO new column (`(f,c)` off `CausalEdge64` + `qualia` diff). Multi-cycle arc = the queued `D-MBX-A3` witness column (not free). Emit at Commit, not every consume (witness arc IS the revision log — parent §11.2). +- **Must NOT be lossy net Δ⟨f,c⟩** (contradiction-cartographer P0): carry signed residual `(Δw⁺,Δw⁻)` (reuse `support`/`dissonance`) + regime tag (Revision vs contradiction-commit) + qualia delta. Accumulates into a per-mailbox **competence self-model** (creative-explorer 2nd-order). +- **Two-axis test:** Axis-1 THROUGHPUT "16M sudoku in 3.4 min" (exact-oracle constraint workload; certifies speed+correctness, **NOT Weyl/spectral** — that's [S] RHYME, dropped); Axis-2 LEARNING "thinking-style improved exponentially, ceiling x = φ-1 humility" (native integer metric; **deepeval DROPPED** = Python LLM-judge firewall breach). They compose: Sudoku = workload, learning-curve = belief-update over it. goban = secondary belief-state harness ([H] support/capture/ko; drop influence leg). +**Key decisions:** both math critics (cross-domain + theorem-checker) graded Sudoku↔edge-Weyl [S] RHYME (20-regular degenerate spectrum is opposite of φ-Weyl's degeneracy-breaking) — reframed to throughput per operator. Sequencing S2.5b (after the write contract). +**Repos:** lance-graph, branch `claude/soa-cycle-ownership-sync`. Grounded by an 8-agent 5+3 (2026-06-18). + +--- + +## 2026-06-18 — mailbox-cycle-aware-write-contract-v1 (every SoA write carries/checks its cycle; 5+3-ratified; slots as S2.5) + +**Status:** CONJECTURE / design — 5+3 council COMPLETE (LAND after plan-edit fixes, all applied). **Plan file:** `.claude/plans/mailbox-cycle-aware-write-contract-v1.md`. Child of `bindspace-singleton-to-mailbox-soa-v1` rule 1 (`E-SOA-CYCLE-OWNERSHIP`). +**Owns:** the per-cycle write-awareness contract — `write_row(row, cycle, &WriteCell) -> WriteOutcome`, `last_write_cycle: [u32;N]` (2nd stamp), `identity: u32` spawn pointer (GUID tail), wrap-aware gate, local stale handling. +- **Resolved OQs:** A→two stamps (phase-pack deferred `OQ-CSV-CYCLEPACK`); B→**no version bump** (reuse `current_cycle`/`SoaEnvelope::cycle()`; identity stays in key); C→Aware-buffer (`WriteDisposition`, not `EpistemicMode` reuse); D→infallible `WriteOutcome::{Accepted,Stale,Future}` (W4b `Arc` precedent = category error); E→**S2.5** pre-S3, own `mailbox-thoughtspace` gate. +- **P0 fixes folded:** de-interlace is ADDRESSING (GUID identity tail), NOT planner-routing — `temporal.rs` write-sink was fiction (read-only `deinterlace()`) + unreachable under the feature gate; stale handling is LOCAL (no planner dep). `BackingStoreWrite::Singleton` is cycle-blind-by-construction (gate is Mailbox-only until W7 deletes BindSpace) — else a C2-divergence sentinel-lie. +- **P1 fixes folded:** wrap-aware gate (`wrapping_sub`+half-range, else 8–40 min sweep misclassifies post-wrap stragglers); setters stay `pub`+`#[doc(hidden)]` (`pub(crate)` breaks `tests/w2_differential.rs`); `last_write_cycle`+`identity`→`reset_row`+field-isolation matrix SAME commit; no-production-blind-path guard SAME commit (I-LEGACY); `mailbox_id` not overloaded (≤0x00FF_FFFF when used as spawn pointer). +- **3 increments:** Inc1 contract floor (no bump) → Inc2 gated mutator+stamps+identity+tests → Inc3 engine_bridge consumers (post-#535). Cold TS+kanban stay Lance-native (lancedb 0.30 / lance 7). +**Key decisions:** iron-rule verdict YIELDS-WITH-AP (no violation, conditional on the two same-commit guards); brutally-honest HOLD→cleared by operator addressing direction; baton-handoff CATCH-CRITICAL (Singleton arm) folded. Not blocked by surrealdb/D-MBX-9. +**Repos:** lance-graph, branch `claude/soa-cycle-ownership-sync`. Grounded by an 8-agent 5+3 (convergence/dto-soa/trajectory/integration-lead/container-architect + brutally-honest/iron-rule/baton-handoff, 2026-06-18). + +--- + ## 2026-06-15 — integrated-cognitive-planner-v1 (ONE Rubicon/kanban/ractor/thinking-style/AST↔Elixir planner; ~90% EXISTS, 6 additive seams + addressing + cognitive-cycle sequencer) **Status:** RESEARCH MAP + REFERENCE DOC (capture-before-dilution; pre-expansion). **Plan file:** `.claude/plans/integrated-cognitive-planner-v1.md`. diff --git a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md index 618efbb3..0c118041 100644 --- a/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md +++ b/.claude/plans/bindspace-singleton-to-mailbox-soa-v1.md @@ -3,6 +3,12 @@ > **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`. > > **ERRATA ADDENDUM (2026-06-18, `E-DMBXA2-SHIPPED-RECONCILE`):** the "D-MBX-A2 is the current gating gap" clause above is now superseded. D-MBX-A2's **column carrier is Shipped** — landed AFTER the 2026-06-13 snapshot via W1 `22f5120a` (temporal/expert/sigma) + W1b `707360dc` (dense content/topic/angle Hamming planes) + W1c + W4a `BackingStore`/`BackingStoreWrite` shim, with accessors + parity + field-isolation tests. **S1 is effectively done** (columns + feature-gated shim). The §6 S1 gate (`D-CE64-MB-1-impl` par-tile apex / `PR-NDARRAY-MIRI-COMPLETE`) was **sidestepped** (enum-over-trait shim, OQ-C resolved in `backing.rs`), not satisfied. OQ-1 RESOLVED (dense planes hot, not ≤6B ref). "S/P/O role slices" = **NON-GAP** (VSA-unbind vs `grammar/role_keys`, not a column). **S2** (engine_bridge re-home) is ~80% pre-absorbed by the W4a shim; its residual (re-point the `#[cfg(with-engine)]` lab callers through the shim) folds into **S3** (driver off the singleton), the true next substantive node — gated on OQ-2 + the pre-existing `--features with-engine` compile break (`QUALIA_DIMS` unimported, engine_bridge.rs:259) + the i4-qualia[9] `codebook_index` correctness risk (D-CSV-5b made qualia i4 while the doc comments still claim f32-lossless). +> +> **ERRATA ADDENDUM (2026-06-18c — architecture sync, `E-SOA-CYCLE-OWNERSHIP`):** #535 shipped the `--features with-engine` fix + the **F32-17D bit-exact qualia tenant** (BindSpace-singleton-only, `#[cfg(with-engine)]`) — the migration's single exactness anchor — closing the i4-`codebook_index` risk noted just above. Converged architecture for the remaining migration (operator-ratified this session): +> 1. **Cycle ownership is per-mailbox + per-cycle, LE-contract-enforced.** No cycle-blind write; nothing buffers a stale/older mailbox. Today only `consume_firing` is cycle-aware — the per-row setters (`set_content/qualia/edge/meta/temporal`) **and `BackingStoreWrite`** are cycle-blind: that is THE gap. Target: every write carries/checks `current_cycle`, byte-explicit in the **tenant + envelope** LE contract (`SoaEnvelope::cycle()` / `current_cycle` / `last_active_cycle`). **Batch writes are de-interlaced into per-mailbox/per-cycle lanes by `lance-graph-planner/src/temporal.rs`** — the HLC tick `(server_id, lance_version, hlc_tick)` is the de-interlace key, so an interlaced multi-producer batch (lance / surrealql / ractor / thinking) is combed back into one lane per `(mailbox, cycle)` before it touches a row. **This is the next code deliverable — 5+3-gated before code.** +> 2. **Multi-mailbox interlace is the target; `backing()`'s `debug_assert(mailboxes.len() ≤ 1)` is W5-transitional, NOT the design.** *Granularity matters (Codex #537-P2 correction):* the memory budget is **envelope-granular** (= node-granular), not arena-granular. The canonical **envelope = one 4096-bit node = ~500 B** (key 128 b + value 3968 b). Decomposition: **16k envelopes ≈ 8 MB** is the *hot working set per basin/prefix-table* (L2/L3-friendly); **× ~1024 prefix tables = 16M envelopes ≈ 8 GB** is the *full cold addressable space* (DRAM, with the ~1024 prefix tables themselves L3-resident). Linear and trivial ("so what"). This is **NOT** 16k× `MailboxSoA<1024>`: that type is a fixed 1024-row arena (3 dense `u64` planes × 1024 × 256 × 8 ≈ 6 MiB each → 16k of them ≈ 96 GiB), which is the *transitional* default, never the at-scale design. A mailbox at scale is a per-node unit sized to the thought it owns (`N`≈1, not a hardwired 1024), or a lightweight handle into a shared arena. **Deferred optimization (NOT now):** mailboxes run mostly *half-full*, so a future pass can halve the envelope (4096→2048 bits, ~500→~256 B) once the working set is proven — sequencing rule: *eliminate/consolidate what works first, then shrink*, never shrink ahead of the proof. No open mailbox goes inaccessible at scale: addressing is the **canonical GUID prefix-route** (classid·HEEL·HIP·TWIG cascade → ~1024 prefix tables L3-resident; the trie binds the prefix, masked-load the basin-local tail). **16k-mailbox batch writes amortize against those L3-resident prefix tables** — the ~1024 tables are read once and reused across the whole batch, so the per-mailbox routing cost trends to O(1). Per-cycle discipline is per-mailbox (each owns its `current_cycle`); interlacing is expected and de-interlaced per rule 1. **Scaling is two-phase (now vs later):** *now* "scale" means getting per-mailbox cycle ownership **correct** (the foundation — rule 1); *later* scaling opens two independent axes — **(a) quantity** (16k→16M envelopes, linear per the budget above) and **(b) metaconnectivity** (BNN field perturbation / cross-mailbox meta-edges — the OGAR bipolar-phase pyramid, Walsh-Hadamard on VSA). Neither (a) nor (b) is in scope until the cycle-aware write foundation lands. +> 3. **Consumer fork — NOT every consumer rotates into the one SoA.** SoA-fits → rotate onto the SoA columns (D-MBX-12, gated on D-MBX-7 layout-converge + D-MBX-9 surrealdb). Doesn't-fit → a customized **OGAR-driven `classid → schema`** (per-class ClassView/Template — the Core-First path, #530/#533). The ~10 live `BindSpace` consumers (cypher_bridge, sentence_crystal, fabric/{zero_copy,executor}, learning/{scm,feedback}, spo/merkle, callcenter/transcode, planner/elevation) split along this line. This dissolves the "all nine consumers migrate to one SoA" misframe. +> 4. **Layering down:** at the consumer/persistence boundary, **OGAR (canonical node) + Template (ClassView) + Schema-version (envelope `LAYOUT_VERSION` gate, currently 2)** become mandatory, not optional. > **Status:** CONJECTURE / design (migration spec). NOT yet implemented. > **Date:** 2026-05-27. diff --git a/.claude/plans/mailbox-belief-update-and-substrate-test-v1.md b/.claude/plans/mailbox-belief-update-and-substrate-test-v1.md new file mode 100644 index 00000000..33afed1f --- /dev/null +++ b/.claude/plans/mailbox-belief-update-and-substrate-test-v1.md @@ -0,0 +1,96 @@ +# mailbox-belief-update-and-substrate-test-v1 — "what did I learn" + two-axis substrate test + +> **Status:** CONJECTURE / design. 5+3 council COMPLETE. Rides AFTER the cycle-aware write +> contract (S2.5) → slots **S2.5b**. +> **Date:** 2026-06-18. +> **Parent:** `bindspace-singleton-to-mailbox-soa-v1` §11 (belief-state arc) + `E-SOA-CYCLE-OWNERSHIP`. + +--- + +## Epiphany (less is more) + +**"This thought made me smarter — what did I learn" = the NARS-revision delta, exactly.** It is a +**DERIVED read** of `CausalEdge64` (which already stamps `frequency()` / `confidence()`), not a new +stored structure. The witness arc IS the revision log (parent §11.2 iron rule) — a per-consume quad +would be the parallel-struct anti-pattern the rule forbids. + +--- + +## The belief-update (council-ratified) + +- **Single-step delta = 0-friction win** (convergence OPPORTUNITY): a `belief_delta(row) -> BeliefDelta` + read method on `MailboxSoaView`, **zero new column** — `(f,c)` reads off `edges[row]` + a `qualia` + subtraction. Pure `Copy` microcopy arithmetic, no `&mut self` (data-flow rule). +- **Multi-cycle arc = the already-queued `D-MBX-A3` witness column** (`[CausalEdge64; W]`); NOT free, + but already planned. Do not pretend the arc is free (convergence DROP of the over-claim). +- **It MUST NOT be the lossy net Δ⟨f,c⟩** (contradiction-cartographer P0). NARS revision *averages*, + so confidence rises whether evidence **agreed** or **collided** — net Δ cannot tell + learning-by-revision from learning-by-contradiction-commit. Carry: + 1. the **signed residual `(Δw⁺, Δw⁻)`** (reuse `a2a_blackboard::{support:[u16;4], dissonance:f32}`), + 2. the **regime tag** (Revision vs contradiction-commit — `detect_contradictions` same-S-same-O-diff-relation), + 3. the **qualia delta** (Staunen→Wisdom — `QualiaI4_16D` diff), + 4. net Δ⟨f,c⟩ as the *summary*, never the *record*. +- **Emitted at Commit** (Rubicon col 4), not every consume (trajectory) — the AriGraph SPO-G quad is + the durable witness; AriGraph is thinking tissue, not a new service (dto-soa: FITS-COLUMN). +- **Second-order (creative-explorer):** the per-item delta accumulates into a per-mailbox + **competence self-model** — *which kinds of items reliably grow this compartment* — the measurable + φ-1 Dunning-Kruger surface. The per-item delta is a special case of this self-model. + +--- + +## Two-axis substrate test + +Two DIFFERENT claims; want BOTH; they compose (Sudoku = workload, learning-curve = belief-update +measured over it). + +### Axis 1 — THROUGHPUT + CORRECTNESS floor: "solved 16M sudoku in 3.4 min" + +- **What it is:** a raw speed benchmark on an **exact-oracle constraint workload** (Sudoku has unique + solutions → correctness is free; 16M instances → hard throughput number; ties to the 16M-envelope / + 1024-prefix / 8–40 min budget). +- **What it certifies:** the field-propagation engine is **fast + correct at scale** (a *speed* claim). +- **What it does NOT certify (critic guard):** it is **NOT** a Weyl/spectral or concentration + certification. Both cross-domain-synthesizer and theorem-checker graded "Sudoku ↔ edge-Weyl" as + **[S] RHYME** — the Sudoku graph is 20-regular/vertex-transitive (maximally *degenerate* spectrum), + the opposite of the degeneracy-*breaking* aperiodic spreading φ-Weyl models. **Drop the "edge-Weyl" + label.** theorem-checker's salvage: a fine *exact-oracle regression test for monotone-fixpoint + propagation in the deterministic limit* — state it as throughput, nothing spectral. + +### Axis 2 — LEARNING: "improved thinking-style at exponential rate, ceiling at x" + +- **What it is:** the belief-update (Axis-1 delta) accumulated into the competence self-model, plotted + as a learning curve. **"ceiling at x" = the φ-1 humility ceiling** (canon: "φ-1 ceiling = permanent + humility"). +- **What it certifies:** the substrate gets **smarter, not just faster** — the cognition differentiator. +- **Metric is NATIVE** (Δ⟨f,c⟩ + signed residual + qualia — the substrate's own integer metrics). + **deepeval = DROP** (Python LLM-judge in a Rust-native substrate = firewall breach + Python-inference + anti-pattern; cross-domain [S]). Borrow at most its trivial `(case, threshold)→pass/fail` *shape* = + already `cargo test`. + +### Secondary harness — goban (not Sudoku, not core dep) + +`Sagebati/goban` as a **belief-state** harness: liberties≈support, capture≈belief-death, +ko≈contradiction-cycle are **[H] MECHANISM** (support-counter zero-crossing; history-keyed cycle ban). +**Drop the influence≈resonance leg ([S] rhyme).** Test-harness only; substrate stays game-agnostic. + +--- + +## Sequencing + +S2.5 (cycle-aware write contract) → **S2.5b** (this: `belief_delta()` read + Axis-1/Axis-2 harness). +Axis-1 (Sudoku throughput) can land independently as a bench; Axis-2 needs `belief_delta()` + +(for history) `D-MBX-A3`. Cold persistence stays Lance-native (lancedb 0.30 / lance 7). + +--- + +## Council grades (8-agent 5+3, 2026-06-18) + +| Agent | Verdict | +|---|---| +| trajectory-cartographer | DERIVED read; arc IS the revision log; emit at Commit not consume | +| dto-soa-savant | FITS-COLUMN (derived read + AriGraph quad); no new layer | +| creative-explorer | RICH — per-item delta is a special case of the competence self-model; 2 axes (ΔF + ΔStaunen) | +| contradiction-cartographer | net Δ⟨f,c⟩ is LOSSY — carry signed residual + regime tag + qualia delta | +| convergence-architect | single-step = OPPORTUNITY (no new column); multi-cycle arc = D-MBX-A3 (not free) | +| cross-domain-synthesizer | Sudoku↔Weyl [S] DROP; Sudoku field-prop TEST-HARNESS-ONLY; goban [H] (drop influence); deepeval DROP | +| theorem-checker | Sudoku↔Weyl [S]; constraint-prop↔VSA [H]-skeleton/[S]-semantics; throughput certifies speed+correctness only | diff --git a/.claude/plans/mailbox-cycle-aware-write-contract-v1.md b/.claude/plans/mailbox-cycle-aware-write-contract-v1.md new file mode 100644 index 00000000..61b1c539 --- /dev/null +++ b/.claude/plans/mailbox-cycle-aware-write-contract-v1.md @@ -0,0 +1,176 @@ +# mailbox-cycle-aware-write-contract-v1 — every SoA write carries/checks its cycle + +> **Status:** CONJECTURE / design. 5+3-gated before code. +> **Date:** 2026-06-18. +> **Parent:** `bindspace-singleton-to-mailbox-soa-v1.md` rule 1 (`E-SOA-CYCLE-OWNERSHIP`). +> **Owns:** *"the timing needs to be assigned to the mailbox; nothing buffers a stale/older +> mailbox or writes without cycle awareness — per cycle crystal-clear via the LE contract of +> the tenant AND the envelope."* + +--- + +## Epiphany (less is more) + +**Today every per-row write is cycle-blind.** `consume_firing` is the *only* cycle-aware +mutator. The 11 `set_*` setters on `MailboxSoA` and the 8 on `BackingStoreWrite` do +`self.col[row] = v` — no clock, no gate. A late batch from cycle *c-3* can silently overwrite +a row the owner already advanced past. **The fix is one cycle-aware write path; the per-field +setters stop being public mutation doors.** + +--- + +## The gap (precise) + +| Surface | Cycle-aware? | +|---|---| +| `MailboxSoA::consume_firing(row)` | ✅ checks `last_active_cycle[row] == current_cycle`, stamps it | +| `MailboxSoA::set_{edge,qualia,meta,entity_type,temporal,expert,sigma,content,topic,angle}` | ❌ blind `self.col[row] = v` | +| `BackingStoreWrite::set_{content,qualia,edge,meta,entity_type,temporal,expert,sigma}` | ❌ blind passthrough | +| `engine_bridge` writers (`dispatch_busdto`, `persist_cycle`, `write_qualia_17d`, `ingest_codebook_indices`) | ❌ call blind setters | + +`last_active_cycle: [u32; N]` (sentinel `u32::MAX`) is the **consumption** stamp — overloading +it for writes would corrupt `consume_firing`'s same-cycle idempotency guard +(`I-LEGACY-API-FEATURE-GATED`: same name, different semantics under a flag = forbidden). + +--- + +## Council resolutions (5+3, 2026-06-18) + +The 5+3 (convergence / dto-soa / trajectory / integration-lead builders + brutally-honest +critic, with operator architecture direction) resolved the OQs and fixed two P0s: + +- **OQ-A → two stamps.** Add `last_write_cycle: [u32; N]`; never overload `last_active_cycle` + (would break `consume_firing`'s exact-match same-cycle idempotency — confirmed DROP). The + phase-bit single-field pack is type-isomorphic but guard-divergent → deferred probe + `OQ-CSV-CYCLEPACK`, not now. Add `last_write_cycle` to **`reset_row`** + the **field-isolation + matrix test** (a new `[u32; N]` that `reset_row` forgets is the exact leak the test catches). +- **OQ-B → no header field, no version bump.** The batch/owner cycle is already `self.current_cycle` + (and `SoaEnvelope::cycle()` on the trait side). `write_row`'s `cycle` param is compared against + `self.current_cycle`. `ENVELOPE_LAYOUT_VERSION` stays 2. +- **OQ-C → Aware-buffer** for `cycle > current_cycle` (Strict-reject loses concurrent producer + work in the multi-producer interlace target). Use a write-side `WriteDisposition`, do NOT reuse + the reader's `EpistemicMode` verbatim. +- **OQ-D → infallible `WriteOutcome::{Accepted, Stale, Future}`.** The W4b `Arc::get_mut` Result + precedent is a CATEGORY ERROR here: ownership is compile-proven (`&mut self`, E-CE64-MB-4), so + stale/future is a valid in-domain *outcome*, not an aliasing failure. (If a sub-call can fail, + that sub-call is `Result`, separately.) +- **OQ-E → S2.5**, its own pre-S3 node behind `mailbox-thoughtspace` (default-OFF); S3 then + dissolves the singleton onto an already-cycle-gated surface. Not blocked by surrealdb/D-MBX-9; + #535 cleared the `with-engine` break. + +### P0 fix — de-interlace is ADDRESSING, not planner-routing (operator direction) + +The original §2 routed stale writes to `lance-graph-planner/src/temporal.rs`. **Rejected** — +`temporal.rs::deinterlace()` is a read-only projection (no write sink), and the planner is +unreachable from a `mailbox-thoughtspace` build (feature-graph: `with-planner`/`lab` only). +Replacement: + +- **Mailbox pointer at spawn = the GUID identity tail (last 6 hex / `identity(24-bit)`)**, the + canonical bootstrap address; or an **ephemeral version-time-series-aware pointer** mapped to it. + A write finds its mailbox by *identity*, so "which mailbox owns this write" is an addressing + lookup, not a query-time de-interlace. +- **Stale-write handling is LOCAL** to the mailbox — a small `stale_writes` buffer (Aware) or a + drop-with-telemetry counter (Strict) — **no `lance-graph-planner` dependency**. Testable in + isolation with synthetic stale batches. +- **Cold time-series + kanban stay Lance-native** (lancedb 0.30 / lance 7.0.0) — Lance versions + ARE the time series; do NOT invent a surreal-specific TS format (resolves OQ-11.6/D-MBX-9 + direction: stay native). +- **Setters stay `pub` + `#[doc(hidden)]`** with a migration pointer to `write_row` — `pub(crate)` + breaks `tests/w2_differential.rs` (separate compilation unit). A test/debug_assert proves no + production path reaches a blind setter once `write_row` is the live door (blind+gated coexistence + is the I-LEGACY-API-FEATURE-GATED hazard; the guard is mandatory). + +### Scale framing (operator, deferred — NOT this deliverable) + +- **Ractor recycling:** reuse a pool of ~16k ractor mailboxes across SoA generations; **16k + mailboxes per cycle = one table prefix** (one basin of the ~1024). +- **Full-sweep latency:** 1024 prefixes × ~0.5–2.5 s/cycle (16k substrate cost) ≈ **8–40 min** for + a full 16M-envelope pass. Sizing only; not in scope until the cycle-aware foundation lands. + +--- + +## Primary proposal — P1: stamped envelope + gated `write_row` + +1. **One mutator.** `fn write_row(&mut self, row, cycle: u32, cell: &WriteCell) -> WriteOutcome`. + The 11 `set_*` stay **`pub` + `#[doc(hidden)]`** with a migration pointer to `write_row` + (NOT `pub(crate)` — that breaks `tests/w2_differential.rs`, a separate compilation unit). +2. **Gate — WRAP-AWARE, against `self.current_cycle` (NOT planner-routed):** + - Compare via `current_cycle.wrapping_sub(cycle)`: `== 0` → **Accepted** (stamp + `last_write_cycle[row] = cycle`); `< 0x8000_0000` → **Stale**; else → **Future**. Naive + `` misclassifies post-wrap stragglers as Future across the 8–40 min sweep — wrap-aware is mandatory. + - **Stale/Future handling is LOCAL** (per the P0-fix block above): a `stale_writes` buffer + (Aware/`WriteDisposition::Buffer`) or a drop-with-telemetry counter (Strict). **No + `lance-graph-planner`/`temporal.rs` dependency** — the rejected §-original temporal routing + is dead; do not re-introduce it. + - **Singleton arm is cycle-blind BY CONSTRUCTION (CATCH-CRITICAL fix).** `BindSpace` owns no + `current_cycle`; `BackingStoreWrite::Singleton` returns `WriteOutcome::Accepted` + unconditionally with a `debug_assert`/doc: *"the cycle gate is a Mailbox-only guarantee until + W7 deletes BindSpace."* The differential harness asserts cycle-gating ONLY on the Mailbox arm + (else the uniform signature is a C2-divergence sentinel-lie / I-LEGACY hazard). +3. **Two stamps, not one.** Keep `last_active_cycle` (consumption). Add + `last_write_cycle: [u32; N]` (write). `consume_firing` untouched. **Both `last_write_cycle` AND + the new `identity` field MUST be added to `reset_row` + the field-isolation matrix test in the + SAME commit** (a `[u32;N]`/`u32` that `reset_row` forgets is the exact leak the test catches — + iron-rule mandatory). **(OQ-A)** +4. **LE contract, byte-explicit — NO version bump (OQ-B).** The owner cycle is already + `self.current_cycle` (and `SoaEnvelope::cycle()` trait-side); `write_row`'s `cycle` compares + against `self.current_cycle`. `ENVELOPE_LAYOUT_VERSION` stays **2** — holds as long as + `identity` lives in the GUID **key** (recomposed positionally from arena `family` + row), NOT a + new persisted value column. + - *Spawn pointer:* new `identity: u32` field = canon GUID identity tail (last 6 hex / 24-bit; + high byte zero, `debug_assert`). Do **not** overload `mailbox_id` (its meaning is the + corpus/`classid` handle). `family`/basin is a table-level constant (one per arena, 16k + mailboxes = one prefix table). Constraint: a `mailbox_id` used as a spawn pointer must be + `<= 0x00FF_FFFF` (else `NodeGuid::new` panics) — route through `NodeGuid::local(identity)`. + - *Tenant:* `WriteCell { row, cycle, }` — carries `(row, cycle)` so a + buffered stale write stays self-describing. Plan MUST enumerate which of the 8 columns each of + the 4 writer sites (`dispatch_busdto` / `persist_cycle` / `write_qualia_17d` / + `ingest_codebook_indices`) writes, so no site forgets `cycle`. +5. **Feature gate.** Land behind `mailbox-thoughtspace` (default-OFF, same gate as `BackingStore`). + The blind setters coexist during transition ONLY with a `debug_assert`/test proving **no + production path reaches a blind setter once `write_row` is the live door** — this guard ships in + the SAME commit as `write_row` (its absence = VIOLATES I-LEGACY-API-FEATURE-GATED). + +### Alternatives (for the council to weigh) + +- **P2 — stamp-only (observability).** Record `last_write_cycle`, never reject. Cheap, weak: a + stale write still lands; only detectable post-hoc. (Likely too weak for "nothing buffers stale".) +- **P3 — type-state `CycleToken<'c>`.** Setters require `&CycleToken<'c>` borrowed for one cycle; + cross-cycle write = compile error (E-CE64-MB-4 flavor). Strongest, most invasive; touches every + call site. Possibly S3-era, not now. + +--- + +## Open questions — ALL RESOLVED by the 5+3 (see "Council resolutions" above) + +- **OQ-A → two `[u32; N]` stamps** (phase-pack deferred as `OQ-CSV-CYCLEPACK`). +- **OQ-B → no header field, no version bump** (reuse `current_cycle`; identity stays in key). +- **OQ-C → Aware-buffer** via write-side `WriteDisposition` (not `EpistemicMode` reuse). +- **OQ-D → infallible `WriteOutcome::{Accepted,Stale,Future}`** (W4b `Arc` precedent = category error). +- **OQ-E → S2.5**, own pre-S3 node behind `mailbox-thoughtspace`. + +Remaining (deferred, not gating this deliverable): +- **OQ-CSV-CYCLEPACK:** can a phase-tagged single `[u32; N]` carry both stamps without coupling + `consume_firing`'s exact-match guard to the write gate's ordering guard? (Probe behind a + four-invariant differential test, incl. the `2^31` wrap + `u32::MAX` sentinel.) + +--- + +## Cascade — split into 3 landable increments (integration-lead) + +**Inc 1 (one PR) — contract floor.** `lance-graph-contract` confirm `SoaEnvelope::cycle()` reuse; +**NO `ENVELOPE_LAYOUT_VERSION` bump** (OQ-B). No engine gate, no surrealdb. + +**Inc 2 (one PR) — gated mutator + stamps + identity.** `mailbox_soa.rs` (`write_row` wrap-aware, +`last_write_cycle: [u32;N]`, `identity: u32`, setters stay `pub`+`#[doc(hidden)]`+pointer, +`reset_row` clears both new fields, `stale_writes` local buffer/telemetry) + `backing.rs` +(`BackingStoreWrite` cycle param; **Singleton arm cycle-blind-by-construction**) + tests +(differential stale/current/Future, `consume_firing` unaffected, field-isolation matrix EXTENDED to +`last_write_cycle`+`identity`, no-production-blind-path guard). All behind `mailbox-thoughtspace`. + +**Inc 3 (splittable) — consumers.** `engine_bridge.rs` 4 writer sites carry `cycle` via `WriteCell` +(post-#535 `with-engine` fix). **`temporal.rs` is NOT in the cascade** — de-interlace is addressing +(GUID identity tail) + local stale handling; no planner dep. + +Cold time-series + kanban (S4-era) stay **Lance-native** (lancedb 0.30 / lance 7.0.0) — Lance +versions ARE the time series; no surreal-specific TS format.