From d2bfe812feb6bcff17242045dae8e61fefdab114 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 09:49:15 +0000 Subject: [PATCH 01/10] =?UTF-8?q?feat(planner):=20A6=20=E2=80=94=20PlanRes?= =?UTF-8?q?ult.emitted=5Fedges,=20the=20vart-seam=20persist=20surface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `pub emitted_edges: Vec` (little-endian CausalEdge64/EpisodicEdges64 words — the radix key the vart/surreal seam C7 persists) to both PlanResult structs (planner lib.rs + contract plan.rs). Swept ALL construction sites workspace-wide first (the A2 lesson): 4 planner sites populated `Vec::new()`; the contract PlanResult is unconstructed (0 sites). Empty by default — the collapse gate populates it in a later wire. Builds offline (planner + contract); contract 553 tests green, no regression. Board: LATEST_STATE #450 Recently-Shipped row + AGENT_LOG A6 entry (PR_ARC #450 entry owed — board-hygiene follow-up). https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .claude/board/AGENT_LOG.md | 6 ++++++ .claude/board/LATEST_STATE.md | 1 + crates/lance-graph-contract/src/plan.rs | 4 ++++ crates/lance-graph-planner/src/api.rs | 1 + crates/lance-graph-planner/src/lib.rs | 7 +++++++ 5 files changed, 19 insertions(+) diff --git a/.claude/board/AGENT_LOG.md b/.claude/board/AGENT_LOG.md index a7da9daa..362b91ab 100644 --- a/.claude/board/AGENT_LOG.md +++ b/.claude/board/AGENT_LOG.md @@ -1,3 +1,9 @@ +## [Main thread / Opus, autoattended] A6 — PlanResult.emitted_edges (the vart-seam persist surface); #450 MERGED + +**Branch:** claude/jolly-cori-clnf9 (synced to merged main 91e9ec7). **#450 MERGED** → main (syllogism capstone + spec §0–14 + vart + A1 + A2 + the bridge rung-fix). **A6:** added `pub emitted_edges: Vec` (LE `CausalEdge64`/`EpisodicEdges64` words — the radix key C7 persists) to BOTH `PlanResult` structs (planner `lib.rs:99` + contract `plan.rs:30`); swept ALL construction sites workspace-wide first (the A2 lesson) → 4 planner sites (api.rs:183, lib.rs:197/234/291) populated `Vec::new()`; contract PlanResult unconstructed (0 sites). Planner+contract build offline; contract 553 tests green (+3 A1). Empty-by-default; the collapse gate populates it (later wire). Board: LATEST_STATE #450 row + this entry; PR_ARC #450 entry owed. Next: A3 (I4x64 carrier). + +--- + ## [Main thread / Opus, autoattended] 5-agent council reviewed the NAL syllogism capstone → SOUND kernel, integration roadmap spec'd **Branch:** claude/jolly-cori-clnf9. Council R1–R5 (Opus, full-file reads, E-READ-NOT-GREP). **R1** NAL-correct (figures/rules/premise-orders byte-match canonical OpenNARS; omitted Comparison/Analogy intentional — need `<->` copula CE64 can't carry). **R2** firewall+layer SOUND; the 3 truth-fns verified byte-identical to BOTH ndarray::hpc::nars AND forward(). **R3** SOUND + applied doc fix (predicate is a *typed placeholder*; compose_p won't synthesize the induced/abduced relation). **R4** SOUND + applied doc fix (EW64 fold must be **slot-0-anchored**, not a blind left-fold that None-cascades; EdgeRef→CE64 must honor family via OGIT class + 1-based local). **R5** FIX-NEEDED *at integration only* — kernel sound, but zero callers; the capstone (3-path glue / rung elevation / cranelift↔elixir) is unwired. diff --git a/.claude/board/LATEST_STATE.md b/.claude/board/LATEST_STATE.md index 67dd7bf3..206cc78b 100644 --- a/.claude/board/LATEST_STATE.md +++ b/.claude/board/LATEST_STATE.md @@ -18,6 +18,7 @@ | PR | Merged | Title | What it added | |---|---|---|---| +| **#450** | 2026-06-01 | NAL syllogism capstone + atoms/styles/NAL → planner-DTO unification (A1/A2) | **`causal-edge::syllogism`** — hardwired NAL **figure** resolver (`Figure{Chain,ChainRev,SharedSubject,SharedObject}` + `figure()`/`syllogize()`; SPO term-sharing → Deduction/Induction/Abduction + signed mantissa; the reasoning kernel, Pearl-2³-analogue). **A1** `contract::nars::InferenceType::{to,from}_mantissa` (zero-dep cross-crate rule bridge) + `From`. **A2** `rung: RungLevel` on both `ThinkingContext` structs (the meta-aware handle). Unification spec §0–14 (`.claude/specs/atoms-styles-nal-planner-dto-unification-v1.md`) + **vart vendored** (`/home/user/vart`). Branch `claude/jolly-cori-clnf9`. _(PR_ARC #450 entry owed.)_ | | **#411** | 2026-05-27 | Cognitive substrate: locked 33-TSV atom layer + 34-tactic recipes + escalation loop | **D-PERSONA-1** `contract::escalation` + `planner::mul::escalation` (CollapseHint/InnerCouncil/EpiphanyDetector/GhostEcho/WisdomMarker/Checklist, 13 tests). **`contract::atoms`** — LOCKED 33-dim TSV `CANONICAL_ATOMS` (3 Pearl + 9 Rung + 5 Σ + 8 Ops + 4 Presence + 4 Meta) + `I4x32` carrier. **`contract::recipes`** — 34-tactic metadata catalogue. **`contract::recipe_kernels`** — the 34 tactics as 34 `Tactic` impls + registry over a shared `ThoughtCtx`. Charter D0: **ladybug-rs has no relation, rewrite-not-port**; lattice is **SPOQ** (SPO 2³ causal + Q qualia overlay); business = OGIT sidecar; markers gate the datapath/control/gate partition. Green: escalation 13 / atoms 3 / recipes 4 / recipe_kernels 5 + 446 prior, no warnings. Branch `claude/splat3d-cpu-simd-renderer-MAOO0` (39 commits). See PR_ARC #411. | | **#389** | 2026-05-16 | fix(sprint-12/wave-F): codex P2 — AttentionMaskBackend impl for AttentionMaskSoA + canonical MailboxId import | Codex P2 follow-on to PR #388. Adds `AttentionMaskBackend` trait impl for `AttentionMaskSoA` (Wave-F surface coherence) and converges duplicate `MailboxId` imports onto the canonical contract definition. Merge commit `b526485`. | | **#388** | 2026-05-16 | impl(sprint-12/wave-F partial): D-CSV-10 sigma-tier-router + AttentionMask + splat ops + governance (6 of 12 workers landed) | Sprint-12 Wave F fleet partial landing. **D-CSV-10** `SigmaTierRouter` crate (Rubicon-resonance ΔF + threshold → Σ10 commit, hand-tuned threshold per OQ-CSV-6, tracked as TD-SIGMA-TIER-THRESHOLDS-1); **D-CSV-12** scalar splat op fleet on i4 (`splat_gaussian`, `score_hole_closure`, `replay_coherence`, `emit_if_epiphany`); **AttentionMask** SoA + actor + backend surface; W-F8 TYPE_DUPLICATION_MAP refresh (records two-`TrustTexture` coexistence as TD-TRUST-TEXTURE-DUPE-1); W-F10 sprint-11 Opus meta-review; W-F11 i4-substrate-decisions knowledge doc; W-F12 cognitive-substrate-convergence-v2 plan draft (608 lines). Merge commit `77f2d26`. | diff --git a/crates/lance-graph-contract/src/plan.rs b/crates/lance-graph-contract/src/plan.rs index 74d5fd56..48e50497 100644 --- a/crates/lance-graph-contract/src/plan.rs +++ b/crates/lance-graph-contract/src/plan.rs @@ -38,6 +38,10 @@ pub struct PlanResult { pub free_will_modifier: f64, /// Compass score (if assessed). pub compass_score: Option, + /// Emitted connectome edges — little-endian `u64` words + /// (`CausalEdge64` / `EpisodicEdges64`), the radix key the vart/surreal + /// seam persists. Empty until the collapse gate populates it. + pub emitted_edges: Vec, } /// Query features detected during parsing. diff --git a/crates/lance-graph-planner/src/api.rs b/crates/lance-graph-planner/src/api.rs index 6ae146d5..0126d871 100644 --- a/crates/lance-graph-planner/src/api.rs +++ b/crates/lance-graph-planner/src/api.rs @@ -187,6 +187,7 @@ impl Planner { strategies_used: strategy_names, free_will_modifier: 1.0, compass_score: None, + emitted_edges: Vec::new(), }) } diff --git a/crates/lance-graph-planner/src/lib.rs b/crates/lance-graph-planner/src/lib.rs index dc5677e1..deb93199 100644 --- a/crates/lance-graph-planner/src/lib.rs +++ b/crates/lance-graph-planner/src/lib.rs @@ -109,6 +109,10 @@ pub struct PlanResult { pub free_will_modifier: f64, /// Compass score (if navigating unknown territory). pub compass_score: Option, + /// Emitted connectome edges — little-endian `u64` words + /// (`CausalEdge64` / `EpisodicEdges64`), the radix key the vart/surreal + /// seam (C7) persists. Empty until the collapse gate populates it. + pub emitted_edges: Vec, } impl PlannerAwareness { @@ -201,6 +205,7 @@ impl PlannerAwareness { strategies_used: strategy_names, free_will_modifier, compass_score: None, + emitted_edges: Vec::new(), }) } GateDecision::Sandbox { reason } => Err(PlanError::GateBlocked { reason }), @@ -238,6 +243,7 @@ impl PlannerAwareness { strategies_used: strategy_names, free_will_modifier: compass.modified_score, compass_score: Some(compass.score), + emitted_edges: Vec::new(), }) } } @@ -295,6 +301,7 @@ impl PlannerAwareness { strategies_used: strategy_names, free_will_modifier: 1.0, compass_score: None, + emitted_edges: Vec::new(), }) } } From 51887a400d9ce22a4ca5b78ae57773d7f638f38b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 10:02:04 +0000 Subject: [PATCH 02/10] docs(north-star): capture the two reference diagrams + north-star integration plan (WD-1..WD-9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two ViewAngles as the durable aspirational north star (`.claude/north-star/`): business (Odoo-in-Rust × OGIT+DOLCE+GoBD → Elixir/OTP) ∥ semantic (the cognitive substrate, §9–14). The pair IS the §14 dual grammar. Killer thesis: GoBD compliance is a consequence of the firewall (no LLM on the hot path → deterministic → replayable/auditable), not a bolted-on feature. Integration plan (`north-star-integration-v1.md`) maps current (capstone + A1 + A2 shipped, A6 on branch) → target, and enumerates the 9 open wiring decisions (WD-1..WD-9) for the 5-developer council. No Delta Lake on the subscription path (vart hot clock + Lance native versions + SurrealDB LIVE). PNG binaries: harness didn't persist the uploads; textual capture stands in until dropped in. https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .claude/board/INTEGRATION_PLANS.md | 7 +++ .claude/north-star/README.md | 72 ++++++++++++++++++++++ .claude/plans/north-star-integration-v1.md | 41 ++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 .claude/north-star/README.md create mode 100644 .claude/plans/north-star-integration-v1.md diff --git a/.claude/board/INTEGRATION_PLANS.md b/.claude/board/INTEGRATION_PLANS.md index 2566a4b3..e90282e8 100644 --- a/.claude/board/INTEGRATION_PLANS.md +++ b/.claude/board/INTEGRATION_PLANS.md @@ -1,3 +1,10 @@ +## 2026-06-01 — north-star-integration-v1 (the two-ViewAngle destination: business "Odoo-in-Rust × OGIT+DOLCE+GoBD" ∥ semantic cognitive-substrate §9–14; maps current→target + the 9 wiring decisions WD-1..WD-9 for the 5-dev council) + +**Status:** PROPOSAL / pre-council. **Plan file:** `.claude/plans/north-star-integration-v1.md`. **North star:** `.claude/north-star/README.md` (the 2 reference diagrams, textual capture; PNG slots open). Shipped: §3 capstone + A1 rule + A2 rung (#450), A6 emission surface (branch). The council irons WD-1 (I4x32D 2-halves vs 4-view OGIT O/G/I/T) · WD-2 (OGIT resolver) · WD-3 (vart key + indexes) · WD-4 (version subscription — **no Delta Lake**: vart+Lance-native+SurrealDB-LIVE) · WD-5 (ractor + Belief/Goal BDI) · WD-6 (**Rust core vs Elixir OTP/BEAM split** — the big one) · WD-7 (Figure 4→64 moods) · WD-8 (GoBD audit) · WD-9 (DeepNSM dual-view head2head). The determinism→GoBD thesis: the firewall IS the compliance guarantee. + +--- + + ## 2026-05-31 — episodic-risc-spine-v1 (the converged episodic addressing spine: 3 lifecycle-separated structures — CAM/OGIT identity, Lance-version pseudo-radix index, CLAM ephemeral KV; EW64 episodic edges with a 4-bit inherited palette; bounded-horizon compression) **Status:** ACTIVE — contract slices shipped (D-EW64-1, D-VIEW-1; + VersionScheduler D-MBX-9-IN, head2head D-H2H-1); core/cold CI-gated. **Plan file:** `.claude/plans/episodic-risc-spine-v1.md`. **Finding:** EPIPHANIES E-EPISODIC-CLOSURE. diff --git a/.claude/north-star/README.md b/.claude/north-star/README.md new file mode 100644 index 00000000..7c588270 --- /dev/null +++ b/.claude/north-star/README.md @@ -0,0 +1,72 @@ +# North Star — the two reference diagrams (aspirational, 2026-06-01) + +> **Drop the PNGs here** as `business-viewangle-odoo-ogit-dolce-gobd.png` and +> `semantic-viewangle-cognitive-substrate.png` (the harness didn't persist the +> uploads, so this README is the faithful textual capture until the binaries land). +> +> **READ BY:** anyone wiring the atoms+styles+NAL → planner-DTO unification, the +> ractor/surreal/vart seams, or the Odoo-in-Rust business layer. This is the +> *destination*; `.claude/specs/atoms-styles-nal-planner-dto-unification-v1.md` +> (§0–14) is the design; `.claude/plans/north-star-integration-v1.md` is the path. + +## The meta-point: the two diagrams ARE the dual grammar (spec §14) + +- **Picture 1 = the BUSINESS ViewAngle** — *"ODoo in Rust × OGIT + DOLCE + GoBD → Deterministische Business-Logik in Elixir (OTP/BEAM)"*. The product framing. +- **Picture 2 = the SEMANTIC ViewAngle** — the cognitive substrate, a 1:1 render of spec §9–14. The technical framing. + +The same system, resolved under two grammars — the pair **demonstrates the §14 dual-view thesis it documents**. head2head between them is the integration. + +## The killer thesis (why this beats Odoo *and* every LLM-agent business tool) + +**GoBD compliance is a *consequence* of the firewall, not a feature bolted on.** +No LLM on the hot path → deterministic → **replayable + auditable** → +Nachvollziehbarkeit / Vollständigkeit / Unveränderbarkeit / Ordnung. LLM-based +automation **structurally cannot** be GoBD-auditable (LLM reasoning isn't +replayable). NARS-micro-truth → syllogism reasoning over an **immutable vart/Lance +versioned store** *can*. The "similarity PROPOSES / CAM ADDRESSES" firewall IS the +compliance guarantee. + +--- + +## Picture 1 — BUSINESS ViewAngle (Odoo-in-Rust) + +Header: *32.000+ Aktoren · Goal/Belief State Updates · Kanban-Orchestrierung · Lance Versioning · SurrealDB Live Actions.* + +- **GRAMMATIK – SEMANTIK – BUSINESS** (3-layer): Grammatik (Syntax) → Bedeutung (Semantik, **NSM/DeepNSM**) → **Business Grammatik (Pragmatik)** [Rollen, Regeln, Kontext & Ziele]. +- **OGIT VERERBTE KLASSEN & OPERATIONEN**: OGIT Base Class → Vererbte (inherited) Klassen → Schema → **Maskierung (Bitmask)** → Reasoning (Regelwerk). *"Alle Klassen, Attribute, Operationen, Constraints vererbbar & komposierbar."* +- **DOLCE ONTOLOGIE**: Endurants (Dinge) · Perdurants (Prozesse) · Qualitäten/Rollen · Relationen. +- **GoBD COMPLIANCE** (6): Nachvollziehbarkeit · Vollständigkeit · Richtigkeit · Zeitgerechte Erfassung · Unveränderbarkeit · Ordnung & Aufbewahrung. +- **DETERMINISTISCHE BUSINESS-LOGIK (ODoo in Rust)** — *Kompilierbar · Testbar · Replaybar · Auditierbar*: + - INPUT: UI/API · Importe · Events · IoT/Geräte · Externe Dienste. + - **RActor Mailbox System (OTP/BEAM) — 32.000+ parallele Aktoren**: RActor A1..An → Mailbox → **Belief State (Weltmodell) + Goal State (Ziele)** → **Reasoning Engine (deterministisch)**. + - **OGIT Reasoning Pipeline**: Pattern Matching → Regel-Ableitung → Constraint Solving → Prozess-Ableitung (100%) → Aktion/Transition. + - **SELBSTORCHESTRIERUNG – KANBAN BOARD**: BACKLOG · NEXT · DOING · VERIFY · DONE — *Board Updates via Lance Versioning.* +- **SURREALDB (Live) — Event Store & Actions**: Daten → Live Queries → **Live Actions (Trigger/Funktionen)**. +- **LANCE VERSIONING (Delta-Lake-Style)**: Immutable Snapshots (Versioned Tables) → Delta Logs (Changes) → Time Travel (Replay) → Branching (Scenarios). +- **SUBSCRIBERS**: Boards · Aktoren · External Services · Dashboards. +- **RUST CORE ENGINE** (Hochperformant · Speichersicher · WASM-Ready · Kompilierte Rules) + **ELIXIR (OTP/BEAM)** (Fault Tolerant · Supervision Trees · RActor Concurrency · Hot Code Upgrade). +- **PROZESS ABLAUF (100% deterministisch)**: Ereignis → Interpretation → OGIT Regelwerk → Reasoning → Prozess-Schritt → Aktion → State Update → **Audit Log**. +- **AUDIT & COMPLIANCE (GoBD)**: Unveränderbare Logs · Vollständige Historie · Nachvollziehbare Prozesse · Export/Archiv (GoBD-konform). +- Footer: *OGIT (Struktur) + DOLCE (Ontologie) + Grammatik/Semantik (Bedeutung) → deterministische Business-Prozesse wie ODOO. Skalierbar auf 32.000+ Aktoren · Echtzeit · Konsistent · Auditierbar · Zukunftssicher.* + +## Picture 2 — SEMANTIC ViewAngle (the cognitive substrate; render of spec §9–14) + +Example input: *"How can we reduce customer churn for our SaaS product while improving LTV?"* + +1. **DUAL GRAMMAR (§14)** — two ViewAngles, head2head-resolved: **SEMANTIC** (DeepNSM → meaning: parse & roles, core NSM, concept lattice) **VS BUSINESS** (OGIT → stakes: **Objectives, Gaps, Impacts, Tradeoffs** = the OGIT lens). HEAD2HEAD RESOLUTION (aligned meaning ↔ stakes; tensions/complements/priorities). +2. **RESOLVER (§9-10)** — **I4x32D → OGIT class → best-practice template + attention bitmask (for free)**: I4x32D encoding (*"integrated 4-view 32D latent"*) → OGIT classifier (multi-label, problem archetype) → best-practice template (playbooks/patterns/anti-patterns) → attention bitmask (what's relevant). +3. **REASONING (§12.2) — CAPSTONE ✓**: NARS micro-truth (f, c) → **`Figure::syllogize`** (*"temporal & eternal syllogistic forms, 64 moods"*) → DERIVED **(style=mood, rung=abstraction, rule=inference)** → **LE EDGE** (S→P Linked-Expectation; strength/mood/time/context). +4. **REPRESENTATION (§12.3)** — edge → **vart radix** (the connectome): LE edge → VART RADIX addressing (`α.β.γ.δ.ε.ζ.η.θ` = 8-position Base-16 surreal address) → CONNECTOME STORE (hypergraph of LE edges + attributes) → INDEXES (by concept · by rung · by time/**vart version** · by style/rule). +5. **ORCHESTRATION (§13)** — ractor mailboxes ↔ surreal/**vart ACTIVE Rubicon kanban** (vart versions = the clock): RACTORS (isolated concurrent workers) ↔ MAILBOXES (async, backpressure) ↔ RUBICON KANBAN (BACKLOG/NEXT/DOING/VERIFY/DONE) ↔ SURREAL/VART CLOCK (vart versions advance time = immutable ticks). +6. **META-AWARE (§12.4) — A2 ✓**: awareness chain over episodic basins, **addressable by `rung`**: episodic basins → awareness chain (r0→r1→…→rn, increasing abstraction) → `get_awareness(r=n)` (jump to the right altitude) → uses (select perspective · control reasoning depth · meta-decide/monitor). +7. **OUTPUT (§13)** — **epiphanies · facts · high-signal separation**: epiphanies (non-obvious high-utility connections) → facts (justified, sourced) → high-signal separation (rank/filter/dedupe/explain/stress-test) → deliverables (recommendations/plans/experiments/metrics) → **feedback loop** (outcomes → new episodic basins). + +NOTES (from the diagram): *vart versions = clock (immutable total order); every edge time-stamped in vart; all components composable & replaceable.* + +## Shipped (✓) vs target, against Picture 2 + +- **§3 CAPSTONE ✓** = `causal-edge::syllogism` (`Figure`/`figure()`/`syllogize()`) — merged #450. +- **§6 A2 ✓** = `rung: RungLevel` on `ThinkingContext` — merged #450. +- **§3 `rule`** = A1 `InferenceType::{to,from}_mantissa` + `From` — merged #450. +- **§4 entry arrow** = A6 `PlanResult.emitted_edges` (the LE edge → vart) — branch. +- **TARGET (the run):** §2 resolver = A3 (I4x32D carrier) + A4 (OGIT resolver); §3 moods = A5; §4 store/§5 kanban = C7 (vart/surreal); §5 actors = C6 (ractor). Plus the business layer (OGIT classes, GoBD audit, Elixir/Rust split). diff --git a/.claude/plans/north-star-integration-v1.md b/.claude/plans/north-star-integration-v1.md new file mode 100644 index 00000000..8d80c3c3 --- /dev/null +++ b/.claude/plans/north-star-integration-v1.md @@ -0,0 +1,41 @@ +# North-Star Integration — current state → the two-ViewAngle destination (v1) + +**Status:** PROPOSAL / pre-council. North star: `.claude/north-star/README.md` (the two reference diagrams). Design: `.claude/specs/atoms-styles-nal-planner-dto-unification-v1.md` §0–14. **This plan enumerates the open WIRING DECISIONS for the 5-developer council to iron out** before the A3→C7 + business-layer run. + +## Current state (shipped + in-flight) + +| Picture-2 band | Status | Code | +|---|---|---| +| §3 Reasoning (capstone) | ✅ merged #450 | `causal-edge::syllogism` — `Figure`/`figure()`/`syllogize()` (4 SPO figures) | +| §3 `rule` | ✅ merged #450 | `contract::nars::InferenceType::{to,from}_mantissa` + `From` (A1) | +| §6 Meta-aware handle | ✅ merged #450 | `rung: RungLevel` on both `ThinkingContext` (A2) | +| §4 entry arrow | 🔵 branch | `PlanResult.emitted_edges: Vec` (A6) | +| §2 Resolver | ⬜ A3+A4 | `atoms::I4x32`→`I4x32D` carrier (pack `todo!()`); `ThinkingStyle→I4x32D` resolver; OGIT classifier | +| §3 moods | ⬜ A5 | style-biased figure try-order; the 4→64 mood expansion | +| §4 store / §5 kanban | ⬜ C7 | vart-backed `DemotionSink` + `VersionScheduler`; `surreal_container` (BLOCKED(C)) | +| §5 actors | ⬜ C6 | `lance-graph-supervisor` (ractor); `ConsumerEnvelope::Plan` + the supervisor→child forward | +| Business layer (P1) | ⬜ | OGIT inherited classes + bitmask; GoBD audit; the Rust/Elixir runtime; `/home/user/odoo` reference | + +Reusable assets already present: `vart` (vendored `/home/user/vart`), `LanceVersionWatcher` (working LIVE primitive, callcenter), the merkle-chained `UnifiedAuditEvent` + `AuditSink`/`JsonlAuditSink`/`LanceAuditSink` (PR #364/#366), `head2head` (#446), `episodic_edges`/`DemotionSink` + `scheduler::VersionScheduler` (#446/#448), `OGIT` + `odoo` repos cloned. + +## The open WIRING DECISIONS (council deliverable) + +- **WD-1 — I4x32D layout: 2 halves vs 4-view OGIT.** jan decided "ride two i4×32 halves (64 lanes)"; Picture-2 §2 says *"integrated 4-view 32D latent"*. Is the `D` *dual* (2×32) or *4-view* (4×32, one plane per OGIT **O/G/I/T** stake — Objectives/Gaps/Impacts/Tradeoffs)? The 4-view reading grounds the carrier in the OGIT stakes lens. **Decide the carrier shape + the per-view/half semantics** (gates A3/A4). +- **WD-2 — The OGIT resolver (§2).** How does `I4x32D → OGIT class (multi-label) → best-practice template + attention bitmask` wire? Which OGIT class structure (the inherited classes from Picture-1)? Where do "best-practice templates" (playbooks/patterns/anti-patterns) live — `recipe.rs::PersonaRecipe` as the OGIT-inherited codebook? The bitmask = `ViewAngle` presence (D-VIEW-1, §10). Concrete adjacency, not a flat map. +- **WD-3 — vart key projection + connectome store (§4).** The `α.β.γ.δ.ε.ζ.η.θ` 8-position Base-16 address = the 8-byte `CausalEdge64`/`EpisodicEdges64` u64 → `FixedSizeKey::<8>::from(edge)`. Pin the BE key projection (S→P→O / family→local) for prefix-shared basins; LE `to_le_bytes` stays the value. Define the 4 indexes (by concept / rung / vart-version / style·rule) over vart. +- **WD-4 — version-update subscription + active Rubicon kanban (§5).** Confirmed **NO Delta Lake**: vart (hot MVCC clock) + Lance native versions (durable) + **SurrealDB LIVE** (the push trigger / "Live Actions"). Wire `LanceVersionWatcher`→`DatasetVersion`→`VersionScheduler::on_version`→`KanbanMove`→ractor (the `WatchReceiver→on_version→try_advance_phase` adapter). Unblock `surreal_container` BLOCKED(C) (the kv-lance fork dep). +- **WD-5 — ractor seam + Belief/Goal state (§5 / C6).** `ConsumerEnvelope::Plan` arm + the one `supervisor.rs:198` supervisor→child forward; emissions ride as `CollapseGateEmission` batons. Map the **Belief State (Weltmodell) + Goal State (Ziele)** BDI framing onto the substrate (belief = the connectome/NARS truth; goal = the kanban target). +- **WD-6 — Rust core vs Elixir (OTP/BEAM) runtime split.** Picture-1's title is "Business-Logik **in Elixir**", with a **Rust core** (WASM-ready, compiled rules) + Elixir (supervision trees, hot-code-upgrade, fault tolerance). Is `ractor` (Rust) the in-process actor mesh and **Elixir the outer OTP supervision + hot-upgrade shell**? How does the §13 dual-compile (cranelift template **vs** Elixir clause from one `FIGURE_RULES` table) realize this? **The biggest architectural decision** — the runtime boundary. +- **WD-7 — Figure 4→64 moods (§3).** Expand the 4 SPO-term-sharing figures to the "temporal & eternal syllogistic forms (64 moods)" — what is the increment, and does it stay firewall-clean (integer figure detection)? Or keep 4 + treat moods as the (figure × temporal-tag × copula) product? +- **WD-8 — GoBD audit & compliance wiring.** Map the existing merkle-chained `UnifiedAuditEvent` + `AuditSink` + vart-immutability + Lance time-travel onto the **6 GoBD criteria**. Determinism = the replay guarantee. Define the audit-log → export/archive (GoBD-konform) surface. +- **WD-9 — DeepNSM facts-proposer + dual-view head2head (§1).** Wire grammar → DeepNSM (meaning) ∥ OGIT (stakes) → `head2head` resolution. How the `grammar::inference` "grammar resolution IS reasoning" intent (now bridged by A1's `From`) triggers NARS→syllogism→reasoning. + +## Council assignment (5 developers, one cluster each) + +- **R1 — Carrier & Resolver:** WD-1, WD-2. +- **R2 — Representation & vart:** WD-3, WD-7. +- **R3 — Orchestration (surreal/Lance/vart subscription) & GoBD:** WD-4, WD-8. +- **R4 — ractor seam & the Rust/Elixir runtime split:** WD-5, WD-6 (the big one). +- **R5 — Reasoning & grammar facts-proposer:** WD-9, plus the §3 mood/firewall sanity for WD-7. + +Each returns: per-WD **decision + rationale + concrete wiring (files/types) + risk/firewall note + offline-buildability**. Iron rules apply: read full files (`E-READ-NOT-GREP`), firewall (similarity proposes / CAM addresses), zero-dep contract, no Delta Lake on the subscription path. From 733cf4808d802f99d6a1b5d27efdf2ee9ebc6143 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 10:09:19 +0000 Subject: [PATCH 03/10] =?UTF-8?q?docs(plan):=205-dev=20council=20resolutio?= =?UTF-8?q?n=20=E2=80=94=20all=209=20north-star=20wiring=20decisions=20iro?= =?UTF-8?q?ned=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R1–R5 (full-file reads) resolved WD-1..WD-9 with no conflicts. The load-bearing call (WD-6): ractor IS the runtime — no BEAM/NIF/port; Elixir is the gen_server idiom (shipped) + an optional build-time elixir_clause() source-emitter (emit≠execute, off the hot path); a live BEAM would break the replay/GoBD thesis. WD-1: I4x32D = dual (4-view rejected on firewall). WD-3: vart = 4 trees, BE key, Tree::clone() snapshot. WD-4: the loop's one wire = WatchReceiver:: observed_version(); no Delta Lake. WD-8: GoBD 4-of-6 already shipped; determinism = replay = the moat. WD-9: the one new wire = the 4096→256 palette projection + WinnerCriterion::Repulsion. Cross-cutting invariant: the 256-entry palette codebook is ONE (proposer == resolver). Almost the whole surface is offline-shippable now; gated tail = A3.5 (JIT codebook) + surreal LIVE (fork-coords). Ratification gates flagged for jan. https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .claude/board/AGENT_LOG.md | 6 +++++ .claude/plans/north-star-integration-v1.md | 28 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/.claude/board/AGENT_LOG.md b/.claude/board/AGENT_LOG.md index 362b91ab..d8f9fd1b 100644 --- a/.claude/board/AGENT_LOG.md +++ b/.claude/board/AGENT_LOG.md @@ -1,3 +1,9 @@ +## [Main thread / Opus, autoattended] 5-dev council ironed out the 9 north-star wiring decisions (WD-1..WD-9) + +**Branch:** claude/jolly-cori-clnf9. North star: `.claude/north-star/README.md` (the 2 ViewAngle diagrams). Plan + resolution: `.claude/plans/north-star-integration-v1.md`. R1–R5 (Opus, full-file reads, E-READ-NOT-GREP). **All 9 WD resolved, no conflicts.** Headlines: **WD-1** I4x32D = DUAL (4-view rejected on firewall — O/G/I/T is business, not a carrier axis). **WD-2** OGIT resolver: i4-distance PROPOSES → ClassView ADDRESSES; bitmask = `FieldMask` not `ViewAngle`. **WD-3** vart = 4 trees, BE key `[S,P,O,tail]`, snapshot = `Tree::clone()` (no Snapshot type). **WD-4** the loop's one wire = `WatchReceiver::observed_version()`; Delta Lake redundant; surreal BLOCKED(C) = fork-coords only. **WD-5** Belief = connectome+EW64, Goal = KanbanColumn — BDI reads the substrate, no new ractor state. **WD-6 (the big one)** **ractor IS the runtime — no BEAM/NIF/port**; Elixir = idiom + optional build-time `elixir_clause()` source-emitter (emit≠execute); §13 dual-compile = one table → 2 pure lowerings (a live BEAM would break replay/GoBD). **WD-7** keep 4 figures; mood = (figure×copula×temporal) tag product, literal-64-branch = firewall breach. **WD-8** GoBD 4-of-6 already shipped; determinism = replay = the moat; missing = retention WORM-seal + `audit-export` GoBD-Z3 + Verfahrens-hook. **WD-9** the one new wire = the 4096→256 palette projection (driver) + `WinnerCriterion::Repulsion`. **Cross-cutting invariant:** the 256-entry palette codebook is ONE (proposer == resolver). Almost the entire A3→A5+C6+WD-4+WD-8+WD-3+WD-9 surface is **offline-shippable now**; gated tail = A3.5 (JIT codebook + elixir emitter) + surreal LIVE (fork-coords). Ratification gates flagged for jan: G-CODEBOOK, A3.5, surreal BLOCKED(C), GoBD-hash. + +--- + ## [Main thread / Opus, autoattended] A6 — PlanResult.emitted_edges (the vart-seam persist surface); #450 MERGED **Branch:** claude/jolly-cori-clnf9 (synced to merged main 91e9ec7). **#450 MERGED** → main (syllogism capstone + spec §0–14 + vart + A1 + A2 + the bridge rung-fix). **A6:** added `pub emitted_edges: Vec` (LE `CausalEdge64`/`EpisodicEdges64` words — the radix key C7 persists) to BOTH `PlanResult` structs (planner `lib.rs:99` + contract `plan.rs:30`); swept ALL construction sites workspace-wide first (the A2 lesson) → 4 planner sites (api.rs:183, lib.rs:197/234/291) populated `Vec::new()`; contract PlanResult unconstructed (0 sites). Planner+contract build offline; contract 553 tests green (+3 A1). Empty-by-default; the collapse gate populates it (later wire). Board: LATEST_STATE #450 row + this entry; PR_ARC #450 entry owed. Next: A3 (I4x64 carrier). diff --git a/.claude/plans/north-star-integration-v1.md b/.claude/plans/north-star-integration-v1.md index 8d80c3c3..4d5add6b 100644 --- a/.claude/plans/north-star-integration-v1.md +++ b/.claude/plans/north-star-integration-v1.md @@ -39,3 +39,31 @@ Reusable assets already present: `vart` (vendored `/home/user/vart`), `LanceVers - **R5 — Reasoning & grammar facts-proposer:** WD-9, plus the §3 mood/firewall sanity for WD-7. Each returns: per-WD **decision + rationale + concrete wiring (files/types) + risk/firewall note + offline-buildability**. Iron rules apply: read full files (`E-READ-NOT-GREP`), firewall (similarity proposes / CAM addresses), zero-dep contract, no Delta Lake on the subscription path. + +--- + +## COUNCIL RESOLUTION (5-dev, 2026-06-01) — all 9 WD ironed out + +| WD | DECISION | The one new wire | Offline? | +|---|---|---|---| +| **WD-1** (R1) | **`I4x32D` = DUAL** `{instance: I4x32, reference: I4x32}` (64 lanes). 4-view **REJECTED** — O/G/I/T is the *business ViewAngle's* stakes question, never a carrier axis (firewall: "business is not an atom"). Confirms jan's §8. | `I4x32::pack/unpack` (un-`todo!()`) + `I4x32D`; unblocks `recipe.rs`. | ✅ | +| **WD-2** (R1) | OGIT resolver = 2-stage CAM: i4 distance **PROPOSES** → OGIT `ClassView` **ADDRESSES**. `recipe.rs::PersonaRecipe` = the inherited template codebook (fills plane 1). **Attention bitmask = `class_view::FieldMask`, NOT `ViewAngle`** (ViewAngle is the 4-bit *selector*; `attention = class.view_schema(angle) & row.presence_bitmask`). | `ThinkingStyle→I4x32` bridge (A4). Gated tail: `StyleRegistry::register_recipe` (A3.5, reopens Cranelift). | ✅ (attention path shipped) | +| **WD-3** (R2) | **4 vart trees** keyed by BE projection `[S,P,O,…tail]` (NOT `from(edge.0)`), value = frozen `to_le_bytes()`. Indexes: by-concept (primary) · by-rung · by-style·rule; **by-time is intrinsic MVCC**. Snapshot = **`Tree::clone()`** (no `Snapshot` type in the fork). | `project_be(edge)→FixedSizeKey<8>` + the 4-tree wrapper (vendored vart). | ✅ | +| **WD-4** (R3) | The IN-loop adapter `drive_in_loop` owned by the supervisor: `WatchReceiver→DatasetVersion→on_version→KanbanMove→try_advance_phase`. **Delta Lake redundant** (vart clock + Lance `versions()` + SurrealDB LIVE). surreal BLOCKED(C) = fork-coords only; loop ships **now** against `LanceVersionWatcher`. | **`pub observed_version(&self)->u64`** on `WatchReceiver` — the single load-bearing edit. | ✅ (gated: real surreal LIVE) | +| **WD-5** (R4) | ractor seam = one `ConsumerEnvelope::Plan(PlanStep)` arm + the `supervisor.rs:191` forward. **Belief = connectome/NARS-truth + EW64 column; Goal = `KanbanColumn` target** — BDI is a *reading* of the substrate, no new ractor state; batons = `CollapseGateEmission`. | the `Plan` arm + the forward (replace the `DispatchNotImplemented` stub). | ✅ | +| **WD-6** (R4) | **`ractor` (Rust) IS the runtime** — mesh **and** OTP supervision/fault-tolerance/hot-load. **No BEAM/NIF/port/gRPC.** "Elixir" = the gen_server *idiom* (shipped: `ExecTarget::Elixir=3` tag + `recipe.rs` open/closed) + an **optional build-time `elixir_clause()` source-emitter** (emit, never execute, off the hot path). §13 dual-compile = one `FIGURE_RULES` table → 2 pure lowerings. A live BEAM would break replay/GoBD + offline. | (decision only — no runtime change). `elixir_clause()` rides A3.5. | ✅ | +| **WD-7** (R2+R5) | **Keep the 4 `Figure` variants.** 64 moods = `figure(2b) × copula(2b) × temporal(2b)` **derived `u8` tag**, never truth math. **Literal 64-branch enum = firewall breach (R5).** Temporal source = structural chain-position. | `mood_tag(figure, copula, temporal)` (post-`syllogize`, reads existing fields). | ✅ | +| **WD-8** (R3) | GoBD **4-of-6 already shipped** (`UnifiedAuditEvent` merkle chain + `verify_chain`/`audit-verify` + `LanceAuditSink` + vart/Lance immutability). **Determinism = replay = the firewall = the compliance moat** (validated; LLM tools structurally can't). | Missing *Aufbewahrung*: **G1** retention WORM-seal · **G2** `audit-export` GoBD-Z3 bundle · **G3** Verfahrens-hook. All additive. | ✅ | +| **WD-9** (R5) | Wire the 3-stage relay (3-of-4 hops shipped via A1). Dual-view selector = `head2head` + a **new `WinnerCriterion::Repulsion`** (SemDiD, additive zero-dep); `margin` = the §14 tension → escalate. | **the 4096→256 palette projection** (driver fn: SpoTriple 12-bit rank → CausalEdge64 8-bit palette idx). | ✅ | + +### CROSS-CUTTING INVARIANT (R5 ↔ R1) — ratify +**The 256-entry palette codebook is ONE.** The 4096→256 projection the DeepNSM proposer uses (WD-9) MUST be the *same* codebook the `I4x32D` OGIT resolver addresses (WD-2) — else the proposer and resolver fork. The WD-9 palette projection is lossy (4096→256): collisions are semantically-near (CAM nearest-centroid) and `syllogize` output is a *proposal* confirmed downstream (small `margin` → escalate), so the hazard is bounded — but the shared-codebook invariant is the guard. + +### RATIFICATION GATES (jan) +- **G-CODEBOOK** — confirm the single shared 256-entry palette codebook (proposer projection == resolver codebook). +- **A3.5 deferred** — `StyleRegistry::register_recipe` + `elixir_clause()` emitter (reopens the Cranelift JIT surface) is its own later slice; confirm. +- **surreal BLOCKED(C)** — needs a human with fork access to supply the `surrealdb { git, branch, features=["kv-lance"] }` dep; not a design block. +- **GoBD hash** — FNV-1a is tamper-*evident*, cross-platform-deterministic (by design); if a regulator demands crypto non-repudiation, swap `AuditMerkleRoot::chain` → BLAKE3/SHA-256 behind a feature flag (`canonical_bytes()` stays frozen). + +### UNBLOCKED RUN ORDER (all offline unless noted) +**A3** (I4x32D carrier) → **A4** (resolver bridge + FieldMask attention) → **A5** (figure-bias + mood_tag) → **WD-9** (palette projection + `WinnerCriterion::Repulsion`) → **C6** (`ConsumerEnvelope::Plan` + forward) → **WD-4** (`observed_version()` + `drive_in_loop`) → **WD-3** (vart 4-tree store) → **WD-8** (G1/G2/G3 audit surfaces). Gated tail: **A3.5** (JIT codebook + elixir emitter), **surreal LIVE** (BLOCKED(C) fork-coords). From 8456088b1863fb4c4cbb38991cc38823c9354ebb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 10:10:35 +0000 Subject: [PATCH 04/10] =?UTF-8?q?docs(plan):=20WD-6=20refinement=20?= =?UTF-8?q?=E2=80=94=20optional=20cold=20codegen=20=3D=20JITSon=20(craneli?= =?UTF-8?q?ft=20fork)=20in=20lance-graph-planner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dual-compile's cranelift lowering is JITSon (the JIT template format), compiled by the cranelift fork, living in lance-graph-planner (JitCompile strategy / jitson_kernel / StyleRegistry::warm_cache). ExecTarget::Jit = JITSon→cranelift-fork cold-compile → KernelHandle, hot-exec in-process (the 'optional cold codegen'). Distinct from ExecTarget::Elixir (external .ex source emitter). Hot path stays integer/deterministic; cold compile is a perf substitution, replay-safe. Gated in A3.5 with the JIT codebook. https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .claude/plans/north-star-integration-v1.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.claude/plans/north-star-integration-v1.md b/.claude/plans/north-star-integration-v1.md index 4d5add6b..bd949a95 100644 --- a/.claude/plans/north-star-integration-v1.md +++ b/.claude/plans/north-star-integration-v1.md @@ -67,3 +67,14 @@ Each returns: per-WD **decision + rationale + concrete wiring (files/types) + ri ### UNBLOCKED RUN ORDER (all offline unless noted) **A3** (I4x32D carrier) → **A4** (resolver bridge + FieldMask attention) → **A5** (figure-bias + mood_tag) → **WD-9** (palette projection + `WinnerCriterion::Repulsion`) → **C6** (`ConsumerEnvelope::Plan` + forward) → **WD-4** (`observed_version()` + `drive_in_loop`) → **WD-3** (vart 4-tree store) → **WD-8** (G1/G2/G3 audit surfaces). Gated tail: **A3.5** (JIT codebook + elixir emitter), **surreal LIVE** (BLOCKED(C) fork-coords). + +### WD-6 refinement (jan) — the optional cold codegen is JITSon (cranelift fork), in lance-graph-planner + +The §13 dual-compile's *compilation* lowering is **JITSon** — the JIT template format (`contract::jit::JitTemplate`, "JITSON"), compiled by the **cranelift fork** (AdaWorldAPI, same fork-everything pattern as ndarray/vart/elixir/surrealdb/ruff), living in **`lance-graph-planner`** (the `JitCompile` strategy + `jitson_kernel`; `StyleRegistry::warm_cache`/`register_recipe`). This is the **"optional cold codegen"**: style/figure kernels are compiled **COLD** (at style-registration / warm-cache time) into a cached `KernelHandle`, then the hot path calls the compiled fn-pointer — `ExecTarget::Jit`. + +It is DISTINCT from `ExecTarget::Elixir` (the even-colder external `.ex` source emitter for a customer's *external* BEAM). So one `FIGURE_RULES` table lowers three ways: +- **`Native`** — interpreted, in-process (no compile). +- **`Jit`** — **JITSon → cranelift-fork** cold-compile → `KernelHandle`, hot-exec, in-process. **The primary optimization** ("optional cold codegen"). +- **`Elixir`** — emit `.ex` source, external cold-path, optional (never executes in the north-star runtime). + +The hot reasoning path stays integer/deterministic regardless of which lowering backs it — the cold compile is a *performance* substitution, not a semantic one (replay-safe: same table → same kernel → same `CausalEdge64`). This refines, not changes, WD-6: ractor is still the only runtime; JITSon/cranelift is the cold-compile *of* the in-process kernels, gated with the rest of the JIT codebook in **A3.5**. From e09aa48ab215e6d5c0f9c515a7480ec4636c20e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 11:03:37 +0000 Subject: [PATCH 05/10] docs(plan): ratify gates (G-CODEBOOK, A3.5, surreal fork URL, GoBD deferred) + process doctrine G-CODEBOOK confirmed (one shared 256-entry palette codebook, proposer==resolver). A3.5 deferred (StyleRegistry/JITSon/elixir emitters, own slice). surreal BLOCKED(C) coordinate = github.com/AdaWorldAPI/surrealdb (kv-lance); WD-4 loop ships now against LanceVersionWatcher regardless. GoBD hash deferred (keep FNV-1a). Process doctrine: 5-agent research council before planning + 3x brutally-honest council after planning. https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .claude/plans/north-star-integration-v1.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.claude/plans/north-star-integration-v1.md b/.claude/plans/north-star-integration-v1.md index bd949a95..d67fadb5 100644 --- a/.claude/plans/north-star-integration-v1.md +++ b/.claude/plans/north-star-integration-v1.md @@ -78,3 +78,18 @@ It is DISTINCT from `ExecTarget::Elixir` (the even-colder external `.ex` source - **`Elixir`** — emit `.ex` source, external cold-path, optional (never executes in the north-star runtime). The hot reasoning path stays integer/deterministic regardless of which lowering backs it — the cold compile is a *performance* substitution, not a semantic one (replay-safe: same table → same kernel → same `CausalEdge64`). This refines, not changes, WD-6: ractor is still the only runtime; JITSon/cranelift is the cold-compile *of* the in-process kernels, gated with the rest of the JIT codebook in **A3.5**. + +--- + +## GATE RATIFICATION (jan, 2026-06-01) + the process doctrine + +**Gates confirmed:** +- **G-CODEBOOK ✅** — the single shared 256-entry palette codebook is ratified: the WD-9 proposer projection (4096→256) and the WD-2 OGIT resolver address into the **same** codebook. The proposer and resolver must not fork. +- **A3.5 ✅ deferred** — `StyleRegistry::register_recipe` + the JITSon/`elixir_clause` emitters are their own later slice (reopens the Cranelift fork surface). The A3→A4 attention/resolution path does NOT wait on it. +- **surreal BLOCKED(C) — coordinate supplied:** fork = **https://github.com/AdaWorldAPI/surrealdb** (`features=["kv-lance"]`). Records the BLOCKED(C) coordinate; full offline-build unblock still needs the branch/rev (+ likely vendoring like vart). Per R3, the WD-4 loop ships **now** against `LanceVersionWatcher` regardless — surreal LIVE is the later swap. +- **GoBD hash — deferred (future idea):** keep FNV-1a (tamper-evident, cross-platform deterministic). Revisit BLAKE3/SHA-256-behind-a-flag only if a regulator demands crypto non-repudiation. + +**PROCESS DOCTRINE (standing, per jan):** every plan is sandwiched — +1. **5-agent RESEARCH council BEFORE planning** (fan-out exploration → informs the plan; the R1–R5 council served this). +2. **3× BRUTALLY-HONEST council AFTER planning** (adversarial red-team → must clear before execution). +This is now the default rigor for any non-trivial slice. "Keeps it airtight." From c0d569e7a024e7ba801e5421c7c6a553d7bf3f56 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 13:44:05 +0000 Subject: [PATCH 06/10] =?UTF-8?q?docs(doctrine):=20ephemeral=E2=86=92warm?= =?UTF-8?q?=E2=86=92cold=20lifecycle=20=E2=80=94=20the=20pinned=20codebook?= =?UTF-8?q?/hydration=20model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Captures the design-dialogue resolution (jan, 2026-06-01) the 5-dev council + 3x brutal red-team converged on. The premise correction: 256 palette is a COLD codec, reasoning never folds. Three tiers: hot 16-bit/64k O(1) exact composition (zero aliasing in sentence chaining) / warm SoA Quartett-bitmask edges hydrated via deterministic multiplex-Louvain over syntax+semantics+pragmatics links / cold vart adaptive-radix-per-OGIT O(1) context loci (Minecraft palette, 16x256 families, sparse class-inherited cross-family, 256-bit member masks + set-ops). Sedimentation: collapse-gate-committed + frozen -> DemotionSink -> radix loci (= global_context + CAM address + GoBD anchor + rung A2, at once). G-CODEBOOK re-scoped as lifecycle formats; firewall top to bottom. Authoritative context for the A3 research council. https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .../ephemeral-warm-cold-lifecycle.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 .claude/knowledge/ephemeral-warm-cold-lifecycle.md diff --git a/.claude/knowledge/ephemeral-warm-cold-lifecycle.md b/.claude/knowledge/ephemeral-warm-cold-lifecycle.md new file mode 100644 index 00000000..89a962f3 --- /dev/null +++ b/.claude/knowledge/ephemeral-warm-cold-lifecycle.md @@ -0,0 +1,169 @@ +# Ephemeral → Warm → Cold — the lifecycle / codebook / hydration doctrine (v1, 2026-06-01) + +> **READ BY:** anyone wiring the `I4x32D` carrier (A3/A4), the connectome store +> (WD-3/C7), the codebook/palette, the ractor hydration seam, or the GoBD audit. +> This pins the format + reasoning model the 5-dev council + 3× brutal red-team +> converged on, plus jan's design-dialogue resolution (2026-06-01). It is the +> authoritative context for the A3 research council. +> +> **Companion docs:** `.claude/specs/atoms-styles-nal-planner-dto-unification-v1.md` +> (§0–14, the design), `.claude/plans/north-star-integration-v1.md` (the WD +> resolution + the 3× brutal red-team), `.claude/north-star/README.md` (the two +> ViewAngle diagrams). + +--- + +## 0. The premise correction (what the brutal red-team caught, and how jan resolved it) + +The 3× brutally-honest council (B1/B3) flagged the ratified **G-CODEBOOK** invariant +as a fiction: the DeepNSM proposer lives in **4096-space** (COCA vocab ranks), the +`causal-edge` resolver in **256-space** (8-bit palette), no projection connects them, +and a 4096→256 fold is **16:1** — manufacturing false syllogistic middle terms +(`o1 == s2` on quantized indices ≈ a fallacy of four terms) that the "small margin → +escalate" guard cannot catch (the margin is *large* precisely when the counterfeit is +confident). + +**That whole objection rested on a wrong premise: that the 256-palette fold sits on the +reasoning path. It does not.** jan's resolution, verbatim in spirit: + +> *"We don't need 256 for temporal formats. As long as data is ephemeral we can afford +> O(1) or 4096… grammar resolution is ephemeral… we don't need to introduce aliasing in +> the sentence chaining AT ALL."* + +**The 256 palette is a cold-storage codec. Reasoning never folds.** This document is the +corrected model. + +--- + +## 1. The three-tier lifecycle (the spine of everything) + +| Tier | Form | Width | Reasoning op | Lives where | +|---|---|---|---|---| +| **HOT / ephemeral** | exact term IDs | **16-bit / 64k, O(1)** | **composition** (`a∘b`), exact | grammar resolution / sentence chaining; sparse (~4096 basins / 32k sentences) | +| **WARM / implicit** | SoA bitmap columns (Quartett masks) | **256-bit member masks** | edges **hydrate** via deterministic multiplex-Louvain over sem/syn/prag links | BindSpace SoA; never stored as explicit edges | +| **COLD / explicit** | vart radix **context loci** (Minecraft palette) | **16 families × 256**, sparse cross | **set-op selection** (Quartett); only collapse-gate-committed facts calcify | OGIT vart radix; O(1), versioned, immutable | + +**Vertical gradient — the one-line architecture:** + +> **hot** (plastic, 16-bit exact composition) → **warm** (SoA bitmap, Louvain-hydrated +> edges) → **cold** (frozen, O(1) radix context loci). + +Things reason fluidly at the top and **sediment** truth to the bottom (`DemotionSink`, +plasticity `ALL_HOT → frozen`). Same firewall top to bottom; one substrate (vart) holds +the cold loci. + +--- + +## 2. HOT — sentence chaining, exact, zero aliasing + +- Term identity = **16-bit (64k), O(1) direct index** — generous headroom over the 4096 + COCA vocab (room for compounds, OGIT entities, instances). Exact integer equality: + `o1 == s2` compares full term IDs → **zero aliasing, by construction.** +- **Composition (`a∘b`) happens HERE** (ephemeral, exact) — this is where the syllogism's + term-sharing + the NARS truth math run on *full-resolution* identities. The DeepNSM + `SpoTriple` (12-bit / 4096 vocab) feeds this directly; **no fold.** +- This is the **syntax + semantics** layer (the *semantic ViewAngle*: parse & roles → core + NSM meaning → concept lattice). Syntax and semantics fuse here per **The Click** + (parsing = meaning = one VSA op). +- **Width-coincidence hazard (newtype it in A3):** the 16-bit term space, `ClassId` (u16), + `MetaFilter.thinking_mask` (64-style bitset), `class_view::FieldMask` (64-field + presence), and the `I4x32D` atom-lanes (64) all coincide in width but **NOT** in meaning. + Give them nominal newtypes so cross-wiring is a *compile error* (the + `I-LEGACY-API-FEATURE-GATED` 5×-bug pattern lives exactly here). + +## 3. WARM — edges hydrate from the SoA (AGI-as-SoA, made literal) + +- **Edges are not stored — they are the runtime behavior of the SoA under dispatch** + (CLAUDE.md P0, AGI-as-glove). An "edge" = AND two property-masks; a community falls out. + Nothing persists until it earns it. +- Basins emerge as **communities** via **deterministic multiplex-Louvain** over three + link-layers = the **3-split**: **semantic** (meaning similarity), **syntactic** (SPO + structure), **pragmatic** (OGIT-stake). One community structure resolved across all three + = the `head2head` dual-view, realized as graph community detection. +- **Quartett bitmap index** (the cold/warm representation jan pinned): + - per family, **one 256-bit mask per property**: `mask[property_x]` = which of the 256 + members have property X. "Which dogs have X" = a 32-byte read. + - **continuous attributes are bucketed** (km/h → ordinal buckets, one mask each) — same + binning discipline as the Pearl bands / σ-ladders / i4 rungs. + - relations = **set-ops**: overlap/term-sharing = `a & b` + `popcount`; distance = + Hamming/Jaccard. `FieldMask` (class *has* property) is the **transpose** of the + member-mask (members *have* property). +- **Determinism pin (GoBD):** classic Louvain is order/resolution-dependent. Hydration MUST + be deterministic — **fixed visit order** (the stable SoA index), **fixed resolution γ**, + and **local/incremental** (active neighborhood, never a global re-cluster). + +## 4. COLD — sedimentation into O(1) context loci + +- **Fixed** = collapse-gate-committed (F below floor / named / cited) **+** plasticity-frozen + (`is_frozen()`, the `ALL_HOT → frozen` descent). The `DemotionSink` pushes it down → it + **calcifies into the cold OGIT vart radix.** +- The radix path **is** its address: `FixedSizeKey` lookup = O(key-length) = **O(1)** for + fixed-width keys; vart MVCC stamps it at a version (immutable, append-only). +- **vart adaptive radix = the Minecraft palette:** `Node4 → 16 → 48 → 256` sizes to + occupancy; sparse families ride small nodes, dense families ride `Node256`. **Per-OGIT + partition** — the key is **OGIT-class-first, then term** (= the EW64 family-first keying; + this *resolves* the brutal council's S-first-vs-family-first conflict). +- Structure: **16 families × 256 archetypes** (= 4096, the basin space); **dense within-family** + (the shipped `network.rs` 256×256 *only if you keep dense*; jan's smart move replaces it + with the **256-bit member bitmask + set-ops**, ~70× cheaper); **sparse cross-family** — + each OGIT class points to **3–16** cross-family basins, hardcoded from the class + the + **OGIT mask** (the `FieldMask` / Picture-1 "Maskierung" doing double duty). +- Each settled **context locus is four things at once:** + 1. **The Click's `global_context`** — the prior reshaping the next cycle's F-landscape; + warm hydration resolves *toward* the loci. + 2. **The firewall's CAM address** — propose/hydrate above, address a fixed locus below. + 3. **The GoBD anchor** — immutable + versioned = *Unveränderbarkeit*; replay = re-derive + hot/warm + read the loci (you never recompute what calcified). + 4. **The rung-addressable awareness chain (A2)** — `get_awareness(r=n)` jumps to the locus + at altitude `r`; the radix is keyed by term *and* indexable by rung. + +--- + +## 5. The firewall, top to bottom (the one invariant) + +**similarity PROPOSES** (DeepNSM float / the warm Louvain hydration / the semantic-differential +splat) → **CAM ADDRESSES** (the 16-bit exact term, the 256-bit member-mask set-ops, the cold +radix locus). Integer LE everywhere below the membrane; float/language only *above* it +(upstream, ephemeral). **Determinism = replay = GoBD**, achieved by: exact hot composition + +deterministic warm hydration + immutable versioned cold loci. + +## 6. The 3-split ↔ the dual grammar (why two ViewAngles, not three) + +The classic semiotic trichotomy maps onto the architecture: +- **Syntax** (Grammatik: structure/well-formedness) = term identity / the SPO parse skeleton. +- **Semantics** (Bedeutung: NSM/DeepNSM) = meaning bound into roles. +- **Pragmatics** (Business Grammatik: roles/context/**goals**) = OGIT O/G/I/T stakes. + +The dual grammar collapses syntax+semantics into the **semantic ViewAngle** (per The Click, +parse = meaning = one op) and renames pragmatics the **business ViewAngle**. `head2head` = +aligning meaning ↔ stakes = the *(syntax+semantics) ↔ pragmatics* resolution. + +## 7. G-CODEBOOK, re-scoped (SUPERSEDES the 2026-06-01 ratification) + +NOT "one 256 codebook." Term-identity has **lifecycle formats**: hot **16-bit exact** / warm +**256-bit member-masks** / cold **16×256-per-family radix**. The "4096→256" is the +**commit/eviction codec** (off the reasoning path). OGIT classes (pragmatics) are a *separate* +addressing layer. The SPO term-palette is shared per-family, so cold archetype-level `o1==s2` += "same archetype" (the intended aggregate granularity); **live chaining never folds.** + +## 8. Cost + +- Warm: 256-bit mask = 32 bytes/basin; ~4096 basins ≈ **128 KB** (vs ~9 MB dense 256×256). + ~70× cheaper, adaptive (sparse basins ≈ free), Minecraft-cheap. +- Cold: bounded property count × 32 bytes/family — KBs. + +## 9. What this means for the slices + +- **A3 (the carrier) is unaffected by all of §1–8** — it is the `I4x32D` carrier + `pack/unpack`, + the dependency root, fully offline. Its real footprint is the **2 `todo!()`s in `atoms.rs`** + (the brutal council confirmed `recipe.rs` is an uncompiled orphan, NOT unblocked by A3). A3 + ratifies the open carrier sub-decisions: **sign/scale per AtomGroup**, the **32-vs-33 lane** + fold, and **newtyping the width-coincidences** (§2). +- **A4** (resolver → `FieldMask` attention) is the propose(i4-distance)→address(`ClassView`) seam. +- The **warm Louvain hydration** + the **cold vart-radix Quartett loci** + the **`DemotionSink` + sedimentation** are downstream slices (post-A4), but A3/A4 must not contradict this model. +- **Remaining concrete must-fixes** the brutal council surfaced (independent of the codebook): + `recipe.rs` orphan (don't claim A3 unblocks it); `ractor`'s `bon` dep missing from the offline + cache (C6 is "offline after one fetch" or `[patch]` to `/home/user/ractor`); + `PlanStep`→`CollapseGateEmission` (the real baton type); the replay **timestamp** leak (the + audit merkle root hashes `SystemTime::now()` — make it a captured input). From 4003fa4d9bcec0d2b7ebd0f85cc4a3b131060e4c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 14:57:02 +0000 Subject: [PATCH 07/10] =?UTF-8?q?docs(plan):=20A3=20carrier=20plan=20v1=20?= =?UTF-8?q?=E2=80=94=20synthesized=20from=20the=205-agent=20research=20cou?= =?UTF-8?q?ncil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I4x32D dual carrier + I4x32::pack/unpack (two's-complement nibble per the QualiaI4_16D sibling, sign-agnostic, saturate [-8,7]) + AtomGroup::is_signed() + AtomLane(u8) newtype + delete 4 stale BLOCKED notes + tests. Scope = the 2 atoms.rs todo!()s (+ one counterfactual field flip); zero new deps; offline green; 553-test baseline; recipe.rs orphan NOT unblocked. Next: 3x brutal red-team -> execute. https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .claude/plans/a3-carrier-v1.md | 96 ++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .claude/plans/a3-carrier-v1.md diff --git a/.claude/plans/a3-carrier-v1.md b/.claude/plans/a3-carrier-v1.md new file mode 100644 index 00000000..d3ce6c13 --- /dev/null +++ b/.claude/plans/a3-carrier-v1.md @@ -0,0 +1,96 @@ +# A3 — the `I4x32D` carrier + `pack`/`unpack` (plan v1, 2026-06-01) + +> Slice **A3** of the north-star run — the dependency root. Synthesizes the 5-agent +> research council (R1–R5, 2026-06-01). Context: +> `.claude/knowledge/ephemeral-warm-cold-lifecycle.md`, spec §8–11. Branch +> `claude/jolly-cori-clnf9`. **Next:** 3× brutally-honest red-team → fix → execute. + +## Scope (one line) + +Implement `I4x32::pack`/`unpack` (the two `todo!()`s) **+** add `I4x32D` (dual carrier) +**+** `AtomGroup::is_signed()` **+** the `AtomLane(u8)` newtype **+** delete the 4 stale +`BLOCKED:` notes **+** tests — all in `lance-graph-contract::atoms` (plus one field flip in +`counterfactual.rs`). **Zero new deps, offline, regression-safe** (553-test baseline). + +## Research synthesis (R1–R5) + +- **Carrier (R1/R5):** `I4x32D = { instance: I4x32, reference: I4x32 }` — dual, 64 i4 lanes, + `repr(C, align(16))`, **32 bytes**. `instance` = per-step weighting; `reference` = the + OGIT-class-inherited template; *adjacency between planes = A4's resolution* (so A3 must + ship the dual, or A4 has nothing to be adjacent to — R5 FLAG-1). `pack/unpack` operate + **per plane**. +- **Algorithm (R2):** the shipped `QualiaI4_16D` (`qualia.rs:173-263`) is the canonical + sibling. **Two's-complement nibble** (NOT offset-binary — 3 confirmations: qualia get/set, + `edge.rs` mantissa, `nars.rs` from_mantissa). **Even lane → low nibble, odd → high** + (byte `k` holds lanes `2k`,`2k+1`); sign-extend `(x<<4)>>4`; saturate `clamp(-8,7)`. + `pack/unpack` are **sign-agnostic** (take a pre-scaled `&[i8;32]`, saturate identically) → + **decoupled from the sign/scale table.** Signatures **frozen**: `pack(&[i8;32]) -> Self`, + `unpack(&self) -> [i8;32]` (`recipe.rs:55`'s `I4x32Stub=[i8;32]` is the waiting consumer). +- **Sign/scale (R1):** add `AtomGroup::is_signed()` (precedent `high_heel.rs:1083`): + **Pearl/Rung/Sigma → false** (unsigned ordinal `[0,7]`); **Operation/Presence/Meta → true** + (signed `[−8,7]`; the 3 ± pairs deduce↔induce d18/19, authentic↔performance d25/26, + exploration d31). The carrier saturates `[−8,7]` regardless; the caller pre-scales. +- **32-vs-33 (R1):** ride two halves — verbosity (d32) → plane-1 lane-0; all 33 + `CANONICAL_ATOMS` dims stay locked (`catalogue_is_locked_33_in_order` enforces `dim==index`); + spare = lanes 33–63. Presence+Meta (4+4) canonical; "8 spare" is stale. +- **Range (R1):** `[−8,7]`, **saturating** (not `[−7,7]`, not wrapping) — `-8` is live. +- **Newtypes (R3):** **`AtomLane(u8)` in A3** (`repr(transparent)`; gate `atom(lane: AtomLane)`; + retype `Atom.dim: AtomLane`; flip `counterfactual::SplitPoles.axis: u8 → AtomLane`) — **zero + external callers** (only in-file site `atoms.rs:180`; `recipe.rs` refs are dead/orphan). + Optionally stake **`TermId(u16)`** (greenfield, hot-tier identity). **DEFER to A4:** + `StyleId`/`StyleMask`/`FieldId` (touch `cognitive-shader-driver` + ontology — ≥12 sites) and + the `ClassId` promotion. `RungLevel`/`ThinkingStyle` are already enums — don't newtype. +- **Scope/offline (R4):** footprint = exactly the 2 `todo!()`s; `recipe.rs` is an orphan + (no `pub mod recipe;`) — **A3 does NOT unblock it**; both `todo!()`s are **unreachable** + (553 lib tests pass, none reach them); `cargo check/test -p lance-graph-contract --offline` + → **exit 0** today; A3 adds no dep. +- **Firewall (R5):** carrier is integer bytes (no float); `pack/unpack` lossless+deterministic; + the only float-adjacent quantity is the i4-distance, which only PROPOSES and lives in + `cognitive-shader-driver`, not `atoms.rs`. Carrier *queries* the address side, never + *contains* it (an i4 lane can't hold a u16). + +## Deliverables + +- **D-A3-1 — `I4x32::pack`/`unpack`** (`atoms.rs:83,88`): two's-complement nibble round-trip per + R2 (even→low, odd→high, `(x<<4)>>4`, `clamp(-8,7)`). Optional private `const fn sext4(u8)->i8`. + Signatures unchanged. +- **D-A3-2 — `I4x32D { instance: I4x32, reference: I4x32 }`**: `repr(C, align(16))`, 32 bytes; + per-plane `pack`/`unpack` wrappers; doc the instance/reference semantics + "adjacency = A4". +- **D-A3-3 — `AtomGroup::is_signed()`**: Pearl/Rung/Sigma→false, Operation/Presence/Meta→true. + Documents the caller's pre-scale convention (carrier stays sign-agnostic). +- **D-A3-4 — `AtomLane(u8)` newtype** + gate `atom()` + retype `Atom.dim` + flip + `counterfactual::SplitPoles.axis`; (optional) `TermId(u16)`. Update `atoms.rs:196` test + (`a.dim as usize` → `a.dim.get()`). +- **D-A3-5 — delete/replace the 4 stale `BLOCKED:` notes** (`atoms.rs:39-52`) citing spec §8–11. +- **D-A3-6 — tests** (mirror `qualia.rs` + `v2_layout_tests`): pack/unpack round-trip all lanes, + full `[−8,7]` sweep, saturation clamp, **sign-correctness** (catches offset-binary), + **lane-order** (even-low/odd-high), **lane-isolation matrix** (I-LEGACY-API bit-boundary), + zero, extremes, exhaustive nibble; `I4x32D` `size_of==32`/`align==16`; `is_signed()` per group; + `AtomLane` gating. Keep `carrier_layout_is_16_bytes`. **553 baseline must stay green.** + +## Out of scope (R4 — do NOT touch) + +`recipe.rs` (orphan, double-blocked on D-ATOM-1 + `StyleRegistry`), `jit::StyleRegistry`, the A4 +resolver/`FieldMask` attention, `vart`/cold-radix, warm Louvain/`DemotionSink`, `ractor`/`bon`, +and the width-coincident neighbors `ClassId`/`thinking_mask`/`FieldMask` (newtype *against*, don't +redefine — `StyleId`/`StyleMask`/`FieldId` are A4). The 30+ other crate `todo!()`s. + +## Offline + baseline + +`cargo check -p lance-graph-contract --offline` + `cargo test -p lance-graph-contract --offline` +(green today: exit 0, **553 passed**). A3 = pure nibble arithmetic on `[u8;16]`↔`[i8;32]`, zero +new deps. Regression gate: 553 + the new A3 tests, all green. + +## Open jan flags (non-blocking) + +- **Rung encoding:** 9 rung lanes each `[0,7]` vs an off-by-one if one lane held rung-index 1–9 — + a caller/A4 quantization convention, orthogonal to `pack/unpack`. One-line confirm later. +- **`TermId(u16)` now or at the hot-store slice?** Greenfield either way; staking it in A3 costs + nothing. Recommend stake. + +## Firewall / determinism + +`pack/unpack` are lossless+deterministic (`unpack(pack(v)) == v.clamp(-8,7)`), pure integer — below +the membrane. `is_signed()` documents the caller's pre-scale (the propose side). `AtomLane` makes the +width-coincidence cross-wire a compile error. Nothing in A3 leaks float/language onto the hot path or +touches the address side. Clean. From 86b1d07dd240904b4f60a7d5e4ec97c638fc90f9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 15:24:30 +0000 Subject: [PATCH 08/10] =?UTF-8?q?feat(contract):=20A3=20=E2=80=94=20I4x32/?= =?UTF-8?q?I4x64=20signed-i4=20CAM=20codec=20(pack/unpack)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements I4x32::pack/unpack (the 2 todo!()s) + adds I4x64 (256-bit / 64 signed-i4 dims) + sext4. Two's-complement signed-i4 nibble codec (even->low, odd->high, saturate [-8,7]), byte-compatible with QualiaI4_16D and the CausalEdge64 mantissa; sign-agnostic (the caller pre-scales). The carrier is a deterministic N-wide CAM address + sparse-intensity "smell" — NOT a similarity vector (no vector search, no float; the {instance,reference} dual is rejected, the "64" was 64 poles not lanes). The 33 locked atoms occupy dims 0..32 of I4x64; 31 spare. The bipolar -introspection..+exploration pole semantics + any asymmetric scaling ride the caller's pre-scale (A4). Resolved the 3 stale BLOCKED layout notes -> resolution-pointers. 9 hardened tests incl. the absolute-bit offset-binary catch (B1). Contract lib 562 green (553 baseline + 9), offline, zero new deps. recipe.rs untouched (orphan); counterfactual.rs untouched (B3 SERIOUS-3). Synthesized from the 5-agent research council + 3x brutal red-team; jan's clarification collapsed the dual. Board: STATUS_BOARD D-A3, LATEST_STATE, AGENT_LOG, a3-carrier-v1.md SHIPPED, lifecycle doctrine clarification (same commit, per board-hygiene rule). https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .claude/board/AGENT_LOG.md | 6 + .claude/board/LATEST_STATE.md | 2 + .claude/board/STATUS_BOARD.md | 4 + .../ephemeral-warm-cold-lifecycle.md | 10 + .claude/plans/a3-carrier-v1.md | 14 ++ crates/lance-graph-contract/src/atoms.rs | 207 ++++++++++++++++-- 6 files changed, 223 insertions(+), 20 deletions(-) diff --git a/.claude/board/AGENT_LOG.md b/.claude/board/AGENT_LOG.md index d8f9fd1b..eb830c81 100644 --- a/.claude/board/AGENT_LOG.md +++ b/.claude/board/AGENT_LOG.md @@ -1,3 +1,9 @@ +## [Main thread / Opus, autoattended] D-A3 SHIPPED — I4x32/I4x64 signed-i4 CAM codec (5-research + 3-brutal sandwich) + +**Branch:** claude/jolly-cori-clnf9. Implemented `atoms::I4x32::pack`/`unpack` (the 2 `todo!()`s) + `I4x64` (256-bit, 64 signed dims) + `sext4`. Two's-complement signed-i4 nibble (even→low/odd→high, saturate [−8,7], sign-agnostic). Carrier = deterministic **CAM address + sparse-intensity "smell"** (jan: NO vector search; `{instance,reference}` dual REJECTED — "64" = 64 poles, not lanes; bipolar `−introspection..+exploration` rides the caller's pre-scale). Resolved the 3 stale BLOCKED notes. Hardened tests incl. the absolute-bit offset-binary catch (B1). Contract lib **562 green** (553 +9), offline, zero new deps. Process: 5-agent research (R1–R5) → A3 plan → 3× brutal (B1 algorithm-sound + range/test fixes; B2 scope/regression-safe, 553 exact; B3 forward-traps) → jan clarification collapsed the dual → ship. Next: A4 (CAM-address resolver + `AtomGroup::is_signed` + `AtomLane`/`LaneMask`). + +--- + ## [Main thread / Opus, autoattended] 5-dev council ironed out the 9 north-star wiring decisions (WD-1..WD-9) **Branch:** claude/jolly-cori-clnf9. North star: `.claude/north-star/README.md` (the 2 ViewAngle diagrams). Plan + resolution: `.claude/plans/north-star-integration-v1.md`. R1–R5 (Opus, full-file reads, E-READ-NOT-GREP). **All 9 WD resolved, no conflicts.** Headlines: **WD-1** I4x32D = DUAL (4-view rejected on firewall — O/G/I/T is business, not a carrier axis). **WD-2** OGIT resolver: i4-distance PROPOSES → ClassView ADDRESSES; bitmask = `FieldMask` not `ViewAngle`. **WD-3** vart = 4 trees, BE key `[S,P,O,tail]`, snapshot = `Tree::clone()` (no Snapshot type). **WD-4** the loop's one wire = `WatchReceiver::observed_version()`; Delta Lake redundant; surreal BLOCKED(C) = fork-coords only. **WD-5** Belief = connectome+EW64, Goal = KanbanColumn — BDI reads the substrate, no new ractor state. **WD-6 (the big one)** **ractor IS the runtime — no BEAM/NIF/port**; Elixir = idiom + optional build-time `elixir_clause()` source-emitter (emit≠execute); §13 dual-compile = one table → 2 pure lowerings (a live BEAM would break replay/GoBD). **WD-7** keep 4 figures; mood = (figure×copula×temporal) tag product, literal-64-branch = firewall breach. **WD-8** GoBD 4-of-6 already shipped; determinism = replay = the moat; missing = retention WORM-seal + `audit-export` GoBD-Z3 + Verfahrens-hook. **WD-9** the one new wire = the 4096→256 palette projection (driver) + `WinnerCriterion::Repulsion`. **Cross-cutting invariant:** the 256-entry palette codebook is ONE (proposer == resolver). Almost the entire A3→A5+C6+WD-4+WD-8+WD-3+WD-9 surface is **offline-shippable now**; gated tail = A3.5 (JIT codebook + elixir emitter) + surreal LIVE (fork-coords). Ratification gates flagged for jan: G-CODEBOOK, A3.5, surreal BLOCKED(C), GoBD-hash. diff --git a/.claude/board/LATEST_STATE.md b/.claude/board/LATEST_STATE.md index 206cc78b..d1921e34 100644 --- a/.claude/board/LATEST_STATE.md +++ b/.claude/board/LATEST_STATE.md @@ -10,6 +10,8 @@ --- +> **2026-06-01 — shipped (autoattended)** (D-A3): `lance_graph_contract::atoms` — `I4x32::pack`/`unpack` implemented (the 2 `todo!()`s gone) + new `I4x64` (256-bit / 64 signed-i4 dims, `repr(C, align(16))`, 32 B) + private `sext4`. Two's-complement signed-i4 nibble codec (byte-compatible with `QualiaI4_16D` + the `CausalEdge64` mantissa), sign-agnostic (caller pre-scales). The carrier is a deterministic **CAM address** + sparse-intensity "smell" — NO vector search, no float; the `{instance,reference}` dual is rejected ("64" = 64 poles). Contract lib **562 green** (+9), offline, zero new deps. The bipolar `−introspection..+exploration` pole semantics + asymmetric scaling ride the caller's pre-scale (A4). Plan `.claude/plans/a3-carrier-v1.md`; doctrine `.claude/knowledge/ephemeral-warm-cold-lifecycle.md`. +> > **2026-06-01 — PR-in-flight (autoattended)** (D-EW64-2): `lance_graph_contract::episodic_edges::EpisodicEdges64::{promote, strongest}` — MRU "promote" strengthens an edge to slot 0 (the hot / most-immediate position); fire→front, un-refired ages toward slot 3 and evicts to the cold connectome; **slot order IS the strength ranking** (no per-edge weight stored — the co-addressed `CausalEdge64` plasticity carries the Hebbian weight, recency is the slot index). Realizes `E-EW64-STRENGTH-IS-CE64-PLASTICITY` (the user's "stronger immediate edges"). Zero-dep; contract lib 533 green (+5), default clippy clean, episodic_edges.rs pedantic+nursery clean. The surreal-LIVE "wingman" that drives `promote` stays GATED on OQ-11.6 (LanceDB-LIVE fallback exists) — this is the substrate-agnostic hot-tier mechanism it calls. --- diff --git a/.claude/board/STATUS_BOARD.md b/.claude/board/STATUS_BOARD.md index 015bc858..880aefb1 100644 --- a/.claude/board/STATUS_BOARD.md +++ b/.claude/board/STATUS_BOARD.md @@ -10,6 +10,10 @@ --- +## D-A3 — I4x32/I4x64 signed-i4 CAM codec (carrier `pack`/`unpack` + the 256-bit wide carrier) + +**Status:** Shipped (branch `claude/jolly-cori-clnf9`; contract lib **562 green**, offline). `I4x32::pack`/`unpack` (two's-complement signed-i4 nibble; even→low/odd→high; saturate `[−8,7]`; sign-agnostic) + new `I4x64` (256-bit / 64 signed dims) + private `sext4`. The carrier is a deterministic 32×/64× **CAM address** + sparse-intensity "smell" — NOT a similarity vector (no vector search, no float; the `{instance,reference}` dual REJECTED, "64" = 64 poles). 33 atoms → dims 0..32. Resolved the 3 stale BLOCKED notes. Plan `.claude/plans/a3-carrier-v1.md` (5-research + 3-brutal sandwich). Next: A4 (CAM-address resolver + `is_signed` + `AtomLane`/`LaneMask` newtypes). + ## D-EW64-2 — EpisodicEdges64 MRU promote (Hebbian hot-tier "stronger immediate edges") | D-id | deliverable | status | PR / evidence | diff --git a/.claude/knowledge/ephemeral-warm-cold-lifecycle.md b/.claude/knowledge/ephemeral-warm-cold-lifecycle.md index 89a962f3..ccc1ac83 100644 --- a/.claude/knowledge/ephemeral-warm-cold-lifecycle.md +++ b/.claude/knowledge/ephemeral-warm-cold-lifecycle.md @@ -167,3 +167,13 @@ addressing layer. The SPO term-palette is shared per-family, so cold archetype-l cache (C6 is "offline after one fetch" or `[patch]` to `/home/user/ractor`); `PlanStep`→`CollapseGateEmission` (the real baton type); the replay **timestamp** leak (the audit merkle root hashes `SystemTime::now()` — make it a captured input). + +--- + +## Clarification (jan, 2026-06-01) — the carrier is a CAM address, not a similarity vector + +**No vector search.** `I4-32D`/`I4-64D` is a deterministic **N×CAM address** (128/256-bit) whose sparse non-zero **signed** dims are the intensity "smell". `D` = signed **Dimensions** (32 → 64 poles; 64 → 128 poles); each dim is a bipolar axis (sign = pole, e.g. −introspection..+exploration). There is **no `{instance, reference}` dual** ("64" was 64 poles, not lanes). The ONLY fuzzy step in the whole stack is a coarse "this smells like odoo → financial OGIT" route; everything else — including the A4 resolver — is **CAM addressing**, not i4-distance nearest-template search. The hot path is integer CAM addressing end to end; float/similarity is the coarse upstream smell only. + +**Range:** the carrier stores signed i4 `[−8,7]` (two's-complement, byte-compatible with the i4 substrate). Any asymmetric bipolar mapping (`−7..+8` style) is the **caller's pre-scale**, never the carrier's storage. + +A3 shipped this carrier (`I4x32`/`I4x64`); see `.claude/plans/a3-carrier-v1.md` § SHIPPED. diff --git a/.claude/plans/a3-carrier-v1.md b/.claude/plans/a3-carrier-v1.md index d3ce6c13..fd412e27 100644 --- a/.claude/plans/a3-carrier-v1.md +++ b/.claude/plans/a3-carrier-v1.md @@ -94,3 +94,17 @@ new deps. Regression gate: 553 + the new A3 tests, all green. the membrane. `is_signed()` documents the caller's pre-scale (the propose side). `AtomLane` makes the width-coincidence cross-wire a compile error. Nothing in A3 leaks float/language onto the hot path or touches the address side. Clean. + +--- + +## SHIPPED (2026-06-01) — revised per jan's clarification + +**The dual is dropped.** jan: "I4-32D = 32 signed dimensions = 64 poles; focus/fan-out are opposite poles; I4-64D is also fine (256 bit)." `D` = signed **Dimensions**, not Dual; "64" was 64 **poles**, not lanes. So B3's BLOCKER-1/2 (dual semantics, per-plane vs whole-carrier, `I4x64` naming) **dissolve** — the carrier is ONE signed-dim vector. + +**No vector search.** jan: the carrier is a deterministic **32×CAM address** + sparse-intensity "smell"; the only fuzzy step is a coarse "this smells like odoo → financial OGIT" route. A4 = CAM addressing, NOT i4-distance nearest-template search. No float anywhere. + +**What shipped (`atoms.rs`, contract lib 562 green, offline):** `I4x32::pack`/`unpack` (two's-complement signed-i4 nibble, even→low/odd→high, `sext4`, saturate `[−8,7]`, sign-agnostic) · `I4x64` (256-bit / 64 signed dims, same codec; 33 atoms → dims 0..32, 31 spare) · `sext4` (private) · 3 BLOCKED notes → resolution-pointers · 9 hardened tests incl. the absolute-bit offset-binary catch (B1 WATCH-1). + +**Range:** two's-complement `[−8,7]` (byte-compatible with `QualiaI4_16D` / the `CausalEdge64` mantissa). jan's `−7(introspection)..+8(exploration)` asymmetric mapping rides the **caller's pre-scale** (A4) — codec is sign-agnostic. + +**Deferred to A4** (B3 + jan): the CAM-address resolver (no vector search), `AtomGroup::is_signed()`, the `AtomLane`/`LaneMask` newtypes (firewall guard — must NOT be bare `u64`), the bipolar catalogue reframe. NOT touched: `counterfactual.rs` (B3 SERIOUS-3), `recipe.rs` (orphan). diff --git a/crates/lance-graph-contract/src/atoms.rs b/crates/lance-graph-contract/src/atoms.rs index 390ba183..08fe938d 100644 --- a/crates/lance-graph-contract/src/atoms.rs +++ b/crates/lance-graph-contract/src/atoms.rs @@ -33,23 +33,28 @@ //! request class → `MappingRow` → `Marking::Financial` → bookkeeping savant. Never an atom. // --------------------------------------------------------------------------- -// Open layout questions (genuinely unresolved — do NOT guess) +// Layout — RESOLVED (A3, 2026-06-01) +// See `.claude/knowledge/ephemeral-warm-cold-lifecycle.md` + spec §8 + jan's clarification. // --------------------------------------------------------------------------- -// BLOCKED: 32-vs-33 reconciliation. The TSV is 33 dims (3+9+5+8+4+4); the shipped -// carrier floor is i4-32 (32 lanes). E-AGICHAT-DIMENSION-CONTRACT says "i4 × 33 (or -// 32 + 1)". Decide: does the carrier hold 32 lanes with the 33rd folded into a spare, -// ride two halves, or is one family trimmed by one? Until decided, the carrier below -// is `I4x32` (32 lanes) and the catalogue lists 33 logical atoms with `dim` 0..33. +// RESOLVED — carrier shape. The carrier is N **signed** i4 dimensions; the SIGN is the +// bipolar pole (e.g. focus +/fan-out −, love +/hate −), so a "± pair" is conceptually ONE +// signed dim. `I4x32` = 32 signed dims (64 poles, 16 B); `I4x64` = 64 signed dims +// (128 poles, 256 bit / 32 B). There is NO `{instance, reference}` dual — the resolver +// (A4) compares two such vectors by INTEGER i4 distance (no float). ("64" in spec §8 was +// 64 poles, not 64 lanes.) -// BLOCKED: "8 spare" vs "4 Presence + 4 Meta". STYLE_ENCODING.md describes the last 8 -// dims as "8 spare"; the dimension-contract body names them 4 Presence + 4 Meta. The -// catalogue below uses Presence+Meta; confirm which is canonical before wiring. +// RESOLVED — 32-vs-33. The 33 logical atoms occupy dims 0..32 of the 64-dim `I4x64` +// carrier (dims 33..63 spare). No trim, no out-of-band lane; the catalogue stays locked +// at 33. (Collapsing the ± pairs into single signed dims is a later catalogue reframe — A4.) -// BLOCKED: per-group i4 sign/scale. The ordinal ladders (Pearl/Rung/Σ) want unsigned -// magnitude (level along the ladder); the few ± lanes (deduce↔induce in Ops, exploration -// in Meta, authentic↔performance in Presence) want signed. Cite FormatBestPractices.md; -// confirm the per-group convention before implementing pack/unpack scaling. +// RESOLVED — "8 spare" vs "4 Presence + 4 Meta": Presence+Meta (4+4) is canonical +// (`group_counts_match_the_contract` hard-asserts it). "8 spare" was stale STYLE_ENCODING.md. + +// RESOLVED — sign/scale: the carrier stores signed i4 `[−8, 7]` (two's-complement) +// UNIFORMLY; `pack`/`unpack` are sign-agnostic (the caller pre-scales). Unsigned ordinal +// groups (Pearl/Rung/Σ) use `[0, 7]`; bipolar dims use the full `[−8, 7]`. +// (`AtomGroup::is_signed` + the integer-distance resolver are A4.) // --------------------------------------------------------------------------- // Bare-metal carrier (no SIMD here — dispatch through cognitive-shader-driver) @@ -74,18 +79,91 @@ impl I4x32 { /// The all-zero style vector (every lane neutral). pub const ZERO: Self = Self { bytes: [0u8; 16] }; - /// Pack 32 signed bytes (one per lane) into the i4 carrier, saturating to [−8, 7]. + /// Pack 32 signed dims into the i4 CAM carrier, saturating to `[−8, 7]`. /// - /// Pre-scaling (f32 → i8) is the caller's job per the group convention — see the - /// `// BLOCKED: per-group i4 sign/scale` note above and `FormatBestPractices.md`. + /// The carrier is a **sparse, deterministic 32×CAM address** (128-bit) — the non-zero + /// dims are the intensity "smell". Resolution is CAM addressing, **not** vector search. + /// Each dim is a signed bipolar axis (sign = pole, e.g. −introspection..+exploration). + /// Two's-complement nibble: dim `2k` → low nibble of byte `k`, `2k+1` → high nibble + /// (byte-compatible with `QualiaI4_16D` and the `CausalEdge64` mantissa). `pack` is + /// **sign-agnostic** and only saturates — pre-scaling (f32 → i4, incl. any asymmetric + /// pole mapping) is the caller's job. No float, no SIMD here. pub fn pack(values: &[i8; 32]) -> Self { - let _ = values; - todo!("I4x32::pack — bare-metal nibble pack; implement after the sign/scale convention is fixed") + let mut bytes = [0u8; 16]; + let mut k = 0; + while k < 16 { + let lo = (values[2 * k].clamp(-8, 7) as u8) & 0x0F; + let hi = (values[2 * k + 1].clamp(-8, 7) as u8) & 0x0F; + bytes[k] = lo | (hi << 4); + k += 1; + } + Self { bytes } } - /// Unpack the 32 lanes to signed bytes (sign-extended i4, range [−8, 7]). + /// Unpack the 32 dims to signed bytes (sign-extended i4, range `[−8, 7]`). pub fn unpack(&self) -> [i8; 32] { - todo!("I4x32::unpack — bare-metal nibble unpack") + let mut out = [0i8; 32]; + let mut k = 0; + while k < 16 { + let b = self.bytes[k]; + out[2 * k] = sext4(b & 0x0F); + out[2 * k + 1] = sext4(b >> 4); + k += 1; + } + out + } +} + +/// Sign-extend a 4-bit two's-complement nibble to `i8` in `[−8, 7]`. +#[inline] +const fn sext4(nibble: u8) -> i8 { + (((nibble & 0x0F) << 4) as i8) >> 4 +} + +/// Packed 64-dim signed-i4 vector — the wide CAM carrier (`I4-64D`, 256 bit). +/// +/// 64 signed i4 **dimensions** in 32 bytes (two nibbles per byte). Same role as [`I4x32`] +/// at double the width: a sparse, deterministic 64×CAM address whose non-zero dims are the +/// intensity "smell". Each dim is a signed bipolar axis (sign = pole). The 33 locked atoms +/// occupy dims 0..32; dims 33..63 are spare. Resolution is CAM addressing, **not** vector +/// search — no float, no `{instance, reference}` dual. `pack`/`unpack` are sign-agnostic +/// (the caller pre-scales). +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(C, align(16))] +pub struct I4x64 { + bytes: [u8; 32], +} + +impl I4x64 { + /// The all-zero vector (every dim neutral). + pub const ZERO: Self = Self { bytes: [0u8; 32] }; + + /// Pack 64 signed dims into the i4 carrier, saturating to `[−8, 7]`. + /// + /// Two's-complement nibble (dim `2k` → low, `2k+1` → high); sign-agnostic. + pub fn pack(values: &[i8; 64]) -> Self { + let mut bytes = [0u8; 32]; + let mut k = 0; + while k < 32 { + let lo = (values[2 * k].clamp(-8, 7) as u8) & 0x0F; + let hi = (values[2 * k + 1].clamp(-8, 7) as u8) & 0x0F; + bytes[k] = lo | (hi << 4); + k += 1; + } + Self { bytes } + } + + /// Unpack the 64 dims to signed bytes (sign-extended i4, range `[−8, 7]`). + pub fn unpack(&self) -> [i8; 64] { + let mut out = [0i8; 64]; + let mut k = 0; + while k < 32 { + let b = self.bytes[k]; + out[2 * k] = sext4(b & 0x0F); + out[2 * k + 1] = sext4(b >> 4); + k += 1; + } + out } } @@ -209,4 +287,93 @@ mod tests { assert_eq!(count(Presence), 4); assert_eq!(count(Meta), 4); } + + // ---- A3: the signed-i4 CAM codec (I4x32 / I4x64) ---- + + #[test] + fn pack_unpack_round_trips_every_dim() { + let mut v = [0i8; 32]; + for (d, slot) in v.iter_mut().enumerate() { + *slot = ((d as i8) % 15) - 7; // distinct, in [−7, 7] + } + assert_eq!(I4x32::pack(&v).unpack(), v); + } + + #[test] + fn pack_unpack_full_signed_range() { + for val in -8..=7i8 { + let v = [val; 32]; + assert_eq!(I4x32::pack(&v).unpack(), v, "value {val} must round-trip"); + } + } + + #[test] + fn pack_saturates_out_of_range() { + assert_eq!(I4x32::pack(&[100i8; 32]).unpack(), [7i8; 32]); + assert_eq!(I4x32::pack(&[-100i8; 32]).unpack(), [-8i8; 32]); + assert_eq!(I4x32::pack(&[8i8; 32]).unpack(), [7i8; 32]); // just outside + + assert_eq!(I4x32::pack(&[-9i8; 32]).unpack(), [-8i8; 32]); // just outside − + } + + #[test] + fn encoding_is_twos_complement_not_offset_binary() { + // Absolute-bit assertions — the ONLY guard that catches an offset-binary codec + // (pack∘unpack round-trips under either). Two's-complement: −8→0x8, −1→0xF, + // +7→0x7, 0→0x0. Offset-binary would give −8→0x0, 0→0x8 — caught here. + let mut v = [0i8; 32]; + v[0] = -8; + assert_eq!(I4x32::pack(&v).bytes[0] & 0x0F, 0x8); + v[0] = -1; + assert_eq!(I4x32::pack(&v).bytes[0] & 0x0F, 0xF); + v[0] = 7; + assert_eq!(I4x32::pack(&v).bytes[0] & 0x0F, 0x7); + v[0] = 0; + assert_eq!(I4x32::pack(&v).bytes[0] & 0x0F, 0x0); + } + + #[test] + fn dim_order_even_low_odd_high() { + let mut v = [0i8; 32]; + v[0] = 1; // even dim → low nibble + v[1] = 2; // odd dim → high nibble + assert_eq!(I4x32::pack(&v).bytes[0], 0x21); + } + + #[test] + fn adjacent_dims_are_isolated() { + // Setting dim 2k must not perturb dim 2k+1 (shared byte) — the bit-boundary + // discipline (I-LEGACY-API-FEATURE-GATED). + let mut v = [0i8; 32]; + v[4] = -8; + let out = I4x32::pack(&v).unpack(); + for (d, &x) in out.iter().enumerate() { + let want = if d == 4 { -8 } else { 0 }; + assert_eq!(x, want, "dim {d} must be {want}"); + } + } + + #[test] + fn zero_is_all_neutral() { + assert_eq!(I4x32::ZERO.unpack(), [0i8; 32]); + assert_eq!(I4x32::pack(&[0i8; 32]), I4x32::ZERO); + } + + #[test] + fn extremes_round_trip_all_dims() { + assert_eq!(I4x32::pack(&[-8i8; 32]).unpack(), [-8i8; 32]); + assert_eq!(I4x32::pack(&[7i8; 32]).unpack(), [7i8; 32]); + } + + #[test] + fn i4x64_layout_and_round_trip() { + assert_eq!(core::mem::size_of::(), 32); + assert_eq!(core::mem::align_of::(), 16); + let mut v = [0i8; 64]; + for (d, slot) in v.iter_mut().enumerate() { + *slot = ((d as i8) % 15) - 7; + } + assert_eq!(I4x64::pack(&v).unpack(), v); + assert_eq!(I4x64::pack(&[100i8; 64]).unpack(), [7i8; 64]); + assert_eq!(I4x64::ZERO.unpack(), [0i8; 64]); + } } From af2b1889caba7b72f88187a11c80c9e70575f232 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 15:28:46 +0000 Subject: [PATCH 09/10] =?UTF-8?q?docs(contract):=20A3=20=E2=80=94=20drop?= =?UTF-8?q?=20the=20f32-round-trip=20framing=20(texture=E2=86=92style=20is?= =?UTF-8?q?=20integer,=20~4=20cycles)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shipped pack/unpack are already pure integer (i8/u8 nibbles, zero f32). The docs wrongly said "caller pre-scales f32→i4" — that implies the round-trip jan rejects. Corrected: the i4 texture arrives integer and stays integer; texture → thinking style is the fastest route (~4 CPU cycles), a branchless integer transform (CAM address → style), never a float compute or vector search. The asymmetric bipolar pole lives in the i4 encoding (sign + magnitude), not an f32 mapping. A4's resolver inherits the 4-cycle integer budget. Doc-only; 562 tests unaffected. (atoms.rs pack/I4x64 docs + a3-carrier-v1.md + lifecycle doctrine.) https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .claude/knowledge/ephemeral-warm-cold-lifecycle.md | 4 ++++ .claude/plans/a3-carrier-v1.md | 4 ++++ crates/lance-graph-contract/src/atoms.rs | 10 ++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.claude/knowledge/ephemeral-warm-cold-lifecycle.md b/.claude/knowledge/ephemeral-warm-cold-lifecycle.md index ccc1ac83..ecdb8bda 100644 --- a/.claude/knowledge/ephemeral-warm-cold-lifecycle.md +++ b/.claude/knowledge/ephemeral-warm-cold-lifecycle.md @@ -177,3 +177,7 @@ addressing layer. The SPO term-palette is shared per-family, so cold archetype-l **Range:** the carrier stores signed i4 `[−8,7]` (two's-complement, byte-compatible with the i4 substrate). Any asymmetric bipolar mapping (`−7..+8` style) is the **caller's pre-scale**, never the carrier's storage. A3 shipped this carrier (`I4x32`/`I4x64`); see `.claude/plans/a3-carrier-v1.md` § SHIPPED. + +## Correction (jan, 2026-06-01) — no f32 round-trip; texture → style in ~4 CPU cycles + +The carrier→style path is **integer end to end**: **no f32 round-trip** anywhere (no caller-side f32→i4 pre-scale on the hot path). The i4 texture arrives as signed bytes and stays integer; **texture → thinking style is the fastest route, ~4 CPU cycles** (a branchless integer transform / CAM address → style), never a float compute or vector search. Any asymmetric bipolar pole mapping lives in the i4 encoding (sign + magnitude), not f32. **This supersedes the earlier "caller pre-scales f32→i4" phrasing** (§2/§9): f32 is not on the texture→style route at all. diff --git a/.claude/plans/a3-carrier-v1.md b/.claude/plans/a3-carrier-v1.md index fd412e27..96192477 100644 --- a/.claude/plans/a3-carrier-v1.md +++ b/.claude/plans/a3-carrier-v1.md @@ -108,3 +108,7 @@ touches the address side. Clean. **Range:** two's-complement `[−8,7]` (byte-compatible with `QualiaI4_16D` / the `CausalEdge64` mantissa). jan's `−7(introspection)..+8(exploration)` asymmetric mapping rides the **caller's pre-scale** (A4) — codec is sign-agnostic. **Deferred to A4** (B3 + jan): the CAM-address resolver (no vector search), `AtomGroup::is_signed()`, the `AtomLane`/`LaneMask` newtypes (firewall guard — must NOT be bare `u64`), the bipolar catalogue reframe. NOT touched: `counterfactual.rs` (B3 SERIOUS-3), `recipe.rs` (orphan). + +### Correction (jan, 2026-06-01) — no f32 round-trip; texture → style in ~4 CPU cycles + +The carrier path is **integer end to end** — **no f32 round-trip** (not even a caller-side f32→i4 pre-scale on the hot path). The i4 texture arrives as signed bytes (the "smell") and stays integer; **texture → thinking style is the fastest route, ~4 CPU cycles** — a branchless integer transform (CAM address → style), never a float compute, never a vector search. The asymmetric bipolar pole (`−introspection..+exploration`) lives in the **i4 encoding itself** (sign + magnitude), not an f32 mapping. **This supersedes the earlier "caller pre-scales f32→i4" phrasing.** A4's resolver inherits the 4-cycle integer budget (CAM address → style), no f32. diff --git a/crates/lance-graph-contract/src/atoms.rs b/crates/lance-graph-contract/src/atoms.rs index 08fe938d..2283e87f 100644 --- a/crates/lance-graph-contract/src/atoms.rs +++ b/crates/lance-graph-contract/src/atoms.rs @@ -86,8 +86,10 @@ impl I4x32 { /// Each dim is a signed bipolar axis (sign = pole, e.g. −introspection..+exploration). /// Two's-complement nibble: dim `2k` → low nibble of byte `k`, `2k+1` → high nibble /// (byte-compatible with `QualiaI4_16D` and the `CausalEdge64` mantissa). `pack` is - /// **sign-agnostic** and only saturates — pre-scaling (f32 → i4, incl. any asymmetric - /// pole mapping) is the caller's job. No float, no SIMD here. + /// **sign-agnostic** and only saturates. There is **NO f32 round-trip** — the i4 texture + /// arrives as signed bytes (the "smell") and stays integer; texture → thinking style is + /// the fastest route (~4 CPU cycles), a branchless integer transform, never a float + /// compute. The asymmetric bipolar pole lives in the i4 encoding itself. No SIMD here. pub fn pack(values: &[i8; 32]) -> Self { let mut bytes = [0u8; 16]; let mut k = 0; @@ -126,8 +128,8 @@ const fn sext4(nibble: u8) -> i8 { /// at double the width: a sparse, deterministic 64×CAM address whose non-zero dims are the /// intensity "smell". Each dim is a signed bipolar axis (sign = pole). The 33 locked atoms /// occupy dims 0..32; dims 33..63 are spare. Resolution is CAM addressing, **not** vector -/// search — no float, no `{instance, reference}` dual. `pack`/`unpack` are sign-agnostic -/// (the caller pre-scales). +/// search — no float, no `{instance, reference}` dual. `pack`/`unpack` are sign-agnostic; +/// **no f32 round-trip** — the i4 texture stays integer end to end (texture → style ~4 cycles). #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[repr(C, align(16))] pub struct I4x64 { From a7be258b7b5954f9b7b959edc88edf1f418a2191 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 1 Jun 2026 17:43:49 +0000 Subject: [PATCH 10/10] ci+fix: mold linker for the test job + CodeRabbit polish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI fix (the real `test (stable)` failure): the `test` job ran `cargo test --no-run` with the default GNU `ld`, which OOMs linking the heavy lance+datafusion integration-test binaries (intermittent — `test-with-coverage` linked the same commit fine). Add `rui314/setup-mold@v1` to the `test` job, as already used by release.yml / rust-publish.yml. The failure was a linker resource issue, NOT a source defect: `git diff origin/main` touches zero lines of causal-edge; the 46-65 bit layout (inference mantissa / temporal) is byte-identical to main, and those deprecation lines are pre-existing warnings. CodeRabbit polish (no logic change): move `sext4` onto `impl I4x32` (carrier- method rule; I4x64 reuses `I4x32::sext4`); north-star plan status → RATIFIED; a3-carrier plan Scope marked HISTORICAL with the SHIPPED section authoritative. Contract lib still 562 green, offline. https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7 --- .claude/plans/a3-carrier-v1.md | 4 +++- .claude/plans/north-star-integration-v1.md | 2 +- .github/workflows/rust-test.yml | 5 +++++ crates/lance-graph-contract/src/atoms.rs | 21 ++++++++++++--------- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.claude/plans/a3-carrier-v1.md b/.claude/plans/a3-carrier-v1.md index 96192477..f11566fd 100644 --- a/.claude/plans/a3-carrier-v1.md +++ b/.claude/plans/a3-carrier-v1.md @@ -5,7 +5,9 @@ > `.claude/knowledge/ephemeral-warm-cold-lifecycle.md`, spec §8–11. Branch > `claude/jolly-cori-clnf9`. **Next:** 3× brutally-honest red-team → fix → execute. -## Scope (one line) +> ⚠️ **§ SHIPPED (bottom) is the source of truth.** The Scope / Research-synthesis / Deliverables sections below are the *original pre-clarification plan* (dual `I4x32D`, `AtomLane`, `is_signed`, the `counterfactual.rs` flip). They were **superseded** by jan's clarification: the carrier is ONE signed-dim vector (`I4x32`/`I4x64`), the newtypes + flip are deferred to A4, `counterfactual.rs` is untouched. + +## Scope (one line) — HISTORICAL (pre-clarification) Implement `I4x32::pack`/`unpack` (the two `todo!()`s) **+** add `I4x32D` (dual carrier) **+** `AtomGroup::is_signed()` **+** the `AtomLane(u8)` newtype **+** delete the 4 stale diff --git a/.claude/plans/north-star-integration-v1.md b/.claude/plans/north-star-integration-v1.md index d67fadb5..15131712 100644 --- a/.claude/plans/north-star-integration-v1.md +++ b/.claude/plans/north-star-integration-v1.md @@ -1,6 +1,6 @@ # North-Star Integration — current state → the two-ViewAngle destination (v1) -**Status:** PROPOSAL / pre-council. North star: `.claude/north-star/README.md` (the two reference diagrams). Design: `.claude/specs/atoms-styles-nal-planner-dto-unification-v1.md` §0–14. **This plan enumerates the open WIRING DECISIONS for the 5-developer council to iron out** before the A3→C7 + business-layer run. +**Status:** RATIFIED (council resolved + gates ratified 2026-06-01; the open-WD framing below is kept for traceability — final calls are in § COUNCIL RESOLUTION). North star: `.claude/north-star/README.md` (the two reference diagrams). Design: `.claude/specs/atoms-styles-nal-planner-dto-unification-v1.md` §0–14. **This plan enumerates the open WIRING DECISIONS for the 5-developer council to iron out** before the A3→C7 + business-layer run. ## Current state (shipped + in-flight) diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index ba88e049..1ef9e27f 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -47,6 +47,11 @@ jobs: run: | rustup toolchain install ${{ matrix.toolchain }} rustup default ${{ matrix.toolchain }} + - name: Setup mold linker + # Heavy lance+datafusion integration-test binaries OOM the default GNU `ld` + # at the `cargo test --no-run` link step (intermittent). mold links them + # fast + low-memory (already used by release.yml / rust-publish.yml). + uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 with: shared-key: "lance-graph-deps" diff --git a/crates/lance-graph-contract/src/atoms.rs b/crates/lance-graph-contract/src/atoms.rs index 2283e87f..52e8c76a 100644 --- a/crates/lance-graph-contract/src/atoms.rs +++ b/crates/lance-graph-contract/src/atoms.rs @@ -108,18 +108,21 @@ impl I4x32 { let mut k = 0; while k < 16 { let b = self.bytes[k]; - out[2 * k] = sext4(b & 0x0F); - out[2 * k + 1] = sext4(b >> 4); + out[2 * k] = Self::sext4(b & 0x0F); + out[2 * k + 1] = Self::sext4(b >> 4); k += 1; } out } -} -/// Sign-extend a 4-bit two's-complement nibble to `i8` in `[−8, 7]`. -#[inline] -const fn sext4(nibble: u8) -> i8 { - (((nibble & 0x0F) << 4) as i8) >> 4 + /// Sign-extend a 4-bit two's-complement nibble to `i8` in `[−8, 7]`. + /// + /// Carrier-owned (the nibble codec belongs to the carrier, not a free fn); + /// `I4x64` reuses it via `I4x32::sext4`. + #[inline] + const fn sext4(nibble: u8) -> i8 { + (((nibble & 0x0F) << 4) as i8) >> 4 + } } /// Packed 64-dim signed-i4 vector — the wide CAM carrier (`I4-64D`, 256 bit). @@ -161,8 +164,8 @@ impl I4x64 { let mut k = 0; while k < 32 { let b = self.bytes[k]; - out[2 * k] = sext4(b & 0x0F); - out[2 * k + 1] = sext4(b >> 4); + out[2 * k] = I4x32::sext4(b & 0x0F); + out[2 * k + 1] = I4x32::sext4(b >> 4); k += 1; } out