diff --git a/.claude/architecture/README.md b/.claude/architecture/README.md new file mode 100644 index 000000000..fa6286834 --- /dev/null +++ b/.claude/architecture/README.md @@ -0,0 +1,22 @@ +# Architecture notes + +This directory holds cross-substrate *architecture* documents. They are navigation and falsification maps, **not** alternate sources of truth for the byte-level ISA, a new engine specification, or authorization for implementation. + +## Start here + +- [Cartesian Epistemic Self-Model](cartesian-epistemic-self-model.md) — How deterministic thought-first addressing, two orientations of a 64-thought presence matrix, declared CE64 epistemic readings, alpha-channel saccades, demand-scoped relational closure, and provenance could support an independently testable software self-model. Includes current implementation status, measured bounds, known conflicts, scaling risks, and proposed falsification gates. +- [Neurofunctional Rubikon / Moore Synaptic Plasticity](neurofunctional-rubicon-moore-plasticity.md) — Maps ada-rs GoalGenerator/WillEngine, merged qualia-profile #1571, experimental Hyperon/OpenPsi, Heckhausen + Axon Rubikon, Moore tenant/NARS16×8 local learning, and thought-Git into one falsifiable three-timescale control loop. Explicit CE64/W migrations, source-root independence and independent lesion/learning tests. + + +## Source precedence + +When an architecture statement conflicts with current code or a measured source, prefer the canonical code + its current approved decision record. In particular: + +1. [`../knowledge/epistemic-frontier-capstone.md`](../knowledge/epistemic-frontier-capstone.md) — field and layer map with status / open points. +2. [`../plans/ce64-hypothesis-layers-v1.md`](../plans/ce64-hypothesis-layers-v1.md) — thought-lane and dual occupancy experiments. +3. [`../plans/d-holo-h14c-thought-first-v1.md`](../plans/d-holo-h14c-thought-first-v1.md) — actual point-read, bitmap, memory and Lance I/O measurements. +4. [`../../crates/lance-graph-contract/src/epistemic_state5.rs`](../../crates/lance-graph-contract/src/epistemic_state5.rs) and [`../../crates/causal-edge/src/layout.rs`](../../crates/causal-edge/src/layout.rs) — declared epistemic reading and canonical physical CE64 field map. +5. [`../knowledge/software-awareness-provenance-parity.md`](../knowledge/software-awareness-provenance-parity.md) — self-model evidence/oracle boundary and withdrawal of the first SAG runtime build. + +**Writing rule:** Every significant claim must distinguish `CURRENT-CONTRACT`, `MEASURED`, `DECISION`, `PROPOSED`, and `OPEN`. A beautiful diagram is not evidence of shipped behavior. Do not create new opcodes, widen CE64, or conceal migration conflicts in a documentation PR. + diff --git a/.claude/architecture/cartesian-epistemic-self-model.md b/.claude/architecture/cartesian-epistemic-self-model.md new file mode 100644 index 000000000..b794815ba --- /dev/null +++ b/.claude/architecture/cartesian-epistemic-self-model.md @@ -0,0 +1,304 @@ +# Cartesian Epistemic Self-Model: Presence, CE64, Datalog and Saccadic Understanding + +**Status:** ARCHITECTURE / RESEARCH THESIS (2026-10-17). This document separates `CURRENT-CONTRACT`, `MEASURED`, `DECISION`, `PROPOSED` and `OPEN`. It is documentation only: no new runtime, CE64 layout, opcode, authority, ontology, store, or engine is approved here. + +**Thesis:** `lance-graph` can use its own Cartesian-addressed substrate to represent both external concepts and its own executable methods. A thought-first selection reads existing values by address, a presence plane describes where each thought has written, CE64 supplies a declared epistemic reading, and provenance plus independent execution decide what has actually been earned. A demand-scoped relational closure can expose the spaghetti of dependencies. Attention, represented by an ephemeral alpha trace, makes this structure observable without equating activity with evidence. + +**Do not read "holographic" as a visual halo.** In this design it names the *Cartesian-addressing inversion*: the program names its operand tables, the coordinate names their row, and a read does not traverse a parent tree or gather an address from another lane. A Morton/HHTL order may still provide locality. It is not a claim about optical holography or information-theoretic interference. + +## 0. The architectural picture + +```text + SEALED CARTESIAN REFERENCE FRAME + NodeGuid / HHTL / classid / Morton tile / declared reading / version + base is immutable for a sealed reference version + | + +---------------+-----------------+ + | | + LEXICAL + WORLD SOFTWARE SELF-MODEL + COCA / WordNet / Bible symbols / methods / compiled IR + DeepNSM-v2 / SPO events dependency / test / receipts + | | + +---------------+-----------------+ + | + ONE ADDRESSABLE POPULATION + named tables, same row coordinate + | + 64 THOUGHT REALITIES (0..63) + 0: hydrated givens; 1..63: hypotheses + per-thought presence P[t][a] / per-row W[a] + | + +-----------------------+------------------------+ + | | | + ALPHA: ATTENTION RELATIONAL ALGEBRA EPISTEMIC READING + transient saccades masks / Quack / R2IL CE64 59..63 + witness + visits / blind spots proposed Datalog μ not a proof by itself + | | | + +-----------------------+------------------------+ + | + REPLAY / ABLATION / INDEPENDENT ORACLE + predict -> inspect -> compare -> revise claims + | + SELF-MODEL UPDATED ONLY IF EARNED BY EVIDENCE +``` + +This is a *composition hypothesis*. The pieces below have unequal implementation status. In particular a general recursive Datalog engine, autonomous verified self-improvement, all front-end adapters, and the complete CE64 upper-bit migration are **not** shipped by this diagram. + +## 1. Five distinct things, no lossy collapse + +| Question | Surface | What it can answer | What it cannot assert | +|---|---|---|---| +| **Where?** | `NodeGuid`, class, Cartesian row coordinate, sealed codebook | Deterministic identity/address | Semantic truth or authorization | +| **Was there?** | presence bits, per-row written-by word | Which thought occupied which location | Truth, confidence, independence | +| **Why looked?** | `AlphaStamp`, `AlphaOverlay`, `AlphaFocus`, scheduler receipt | Attention order, visits, missed aperture | Proof of existence or belief strength | +| **What is claimed?** | declared CE64 reading, NAL truth, typed propositions | Typed state under a versioned codebook | That a claim was validated | +| **Why believe it?** | source-root ledger, derivation support, temporal and independent oracle receipts | Grounds for evidence revision and certification | Automatic intervention permission | + +These distinctions are invariants, not decorative layers. Presence agreement, equal values, semantic agreement, shared evidential roots, and certified causation are **five different relations**. + +### 1.1 Address is not a reference chase + +Canonical thought-first expression (see D-HOLO-H14c): + +```text +Thought(t)[Table(a)[i] : Table(b)[i]] +``` + +- `t` is the thought/execution perspective, whose program resolves `a` and `b` once. +- `i` is the same Cartesian row coordinate for both operands. +- Each table's own presence bit says whether the operand exists at `i`. +- No `table[a][table[b][i]]`, foreign-lane gather, string lookup in the fold, trie walk to find an operand, or row-first 512-byte reassembly. +- A logical address is **not** a Lance `_rowid`, physical fragment offset, Arrow batch position, or permission grant. Coordinate-to-storage mapping has a versioned safety boundary. +- Different class allocations cannot be AND-ed merely because they use equal ordinals. `AlphaFocus` refuses different allocations. + +### 1.2 Address ≠ semantic distance + +`deepnsm-v2::vocab::PaletteVocab` gives a frequency-ranked 256 × 256 `(basin, identity)` word tile (`WordId` is `u16`). Consecutive addresses proxy *frequency rank*, not semantic closeness. The trained Cam96 codebook provides a separate semantic-similarity reading. COCA counts and PoS readings live beside the word identity; WordNet synsets and language-use functions require explicit mappings and provenance. + +A lexical form may support multiple senses, grammatical readings, or interpretations. The same address can flare for multiple reasons without silently conflating those reasons. A Haspelmath semantic map is a graph of grammatical-function adjacencies, not a pre-existing Euclidean 12 × 12 grammar ISA; any quantized projection must be evaluated against held-out mappings. + +## 2. The epistemic occupancy duality (CORE) + +For one dense 256 × 256 class tile, define: + +```text +M[a,t] ∈ {0,1} a ∈ [0,65,536), t ∈ [0,64) +R[a] = Σ_t M[a,t]·2^t +P[t][a] = M[a,t] +``` + +`R[a]` is one **64-bit written-by word per identity**: who occupies address `a`. +`P[t]` is one **65,536-bit presence mask per thought**: where thought `t` has written. + +They are transposes of the *same logical occupancy matrix*, not two unrelated ontologies. + +- Per orientation per class: `65,536 × 64 bits = 512 KiB`; both orientations occupy `1 MiB`, excluding metadata and values. +- Per-thought mask: `65,536 bits = 8 KiB`. +- At an address: `popcount(R[a] & selected_thoughts)` counts selected present perspectives. +- Across addresses: `popcount(P[t1] & P[t2] & aperture)` counts shared occupied coordinates. +- `popcount(P[t1] ^ P[t2])` is **Hamming distance of coverage**, not semantic or epistemic disagreement. +- `OR` over thought masks yields the union of their **occupancy**. +- An empty bit indicates absence *in that selected surface*, never empirical falsity or a globally unoccupied ontology. + +For multiple value lanes, track **per-(thought,lane)** presence where required; the aggregate written-by word alone cannot answer whether a particular value lane is populated. Do not infer value-level identity or equality from thought-level occupancy. + +**MEASURED:** `coverage_orientation_probe` tested both representations on AVX-512 with a brute-force oracle and disable runs. Perspective count on one address was ~1.1 ns; aperture counts reached ≤0.40 ns/address in the faster orientation. The 2026-10-15 correction to early-exit Q-TH reversed some performance winners; retain both orientations, route by workload and density. See `../plans/ce64-hypothesis-layers-v1.md` § Coverage orientation. + +**MEASURED:** D-HOLO-H14c showed population `AND`/`XOR` ~0.9–1.2 ns per 64-address word on its recorded machine, no payload reads or row assembly for population operators. Point projection read the requested tables directly; terminal materialization remained explicit. These are **probe-specific**, not universal performance promises. + +## 3. One fixed CE64 contract, with declarations and known conflicts + +CE64 is an **ISA/ALU-style 64-bit contract**, not an extra store of self-model objects and not an alternative ontology. Its physical fields have a single canonical layout, while declared typed readings determine permissible interpretation. + +| Bits | Field | Contract / status | +|---|---|---| +| 0..23 | S/P/O | Three 8-bit palette codes; not foreign row IDs | +| 24..31 | F | Frequency/evidence register | +| 32..39 | C | Confidence/evidence register | +| 40..42 | Pearl | Which causal question was posed, **not** proof of causation | +| 43..45 | Orientation | Canonical orientation reading | +| 46..49 | i4 | **DECISION** 2026-10-17: excitation/inhibition; **OPEN migration** from inference-opcode readers | +| 50..52 | maturation/plasticity | **OPEN**: novelty-to-wisdom vs `learn()` plasticity | +| 53..58 | W | **DECISION**: thought-layer breadcrumb 0..63; **OPEN migration** from old corpus-root reading and writer paths | +| 59..63 | `EpistemicState5` | One declared field, `Topology2 × Certification3`; implemented reader contract | + +`EpistemicState5` is a product with `Topology2` = Direct / IndirectKnown / IndirectUnknown / Unknown and `Certification3` = Open / Associated / Related / Supports / CausalCandidate / Causes. **24 meaningful, eight reserved raw codes.** The five-bit word classifies the claim; observation provenance is **not encoded in it**. `raw5 == 0` is *Direct × Open*, **not** a generic unknown. `Epi5Declarations::project_state5` enforces declared `(classid, rail, generation)` and rejects untrusted legacy readings or reserved values. + +The **operation** is in the compiled running thought; the resulting relation has an epistemic reading and a thought breadcrumb. Merely writing a high certification code does not satisfy the external proof obligation. A lane cannot certify itself by emitting its own `Causes` bits. + +**OPEN, do not paper over:** `causal-edge::layout/isa` still documents opcode semantics at 46..49; W has legacy producers and a known `forward`/`syllogize` preservation issue; bits 50..52 are contested; CE64 as a control word vs persisted edge-state needs an explicit transition-ownership law; ndarray has legacy incompatible CE64 readers. These are migration gates, not permission to invent CE128, new opcodes, or a second layout. + +## 4. Attention is a projection, not knowledge + +The alpha channel is an ephemeral, discardable surface over the immutable reference spine: + +- Allocate the whole address domain logically; initially materialize **zero** attention rows. +- `claim(address)` records that attention landed, `AlphaStamp.seq` orders saccades, `visits` counts regressions. +- An unclaimed address returns *not attended*; **never** fall back to a base value to fabricate a visit. +- `AlphaFocus` intersects rung and graph/tenant masks over the **same allocation**. Rung (10 processing levels), NAL capability, CE64 maturation, and Pearl questions are different axes. +- The attention trace can be discarded without invalidating stored evidence or certified results. + +**The visualizer starts blank, but the sealed address space need not be empty.** A flare is a view of activity at an address, not an assertion that a new fact was created. + +Proposed observability projections (no new persistent schema required as a starting assumption): + +1. **Lexical flare:** COCA/WordNet/DeepNSM-v2 resolves a token or sense to a declared address. +2. **Interpretive flare:** another method considers an alternative meaning or grammatical function. +3. **Deductive flare:** Quack/R2IL or a future Datalog fold derives an eligible consequence. +4. **Epistemic flare:** declared CE64 certification or NAL evidence changed *with an eligible witness*. +5. **Self-model flare:** a thought inspects a program, method, compiler refusal, or previous execution receipt. +6. **Counterfactual flare:** a detached alternative world changes a support set, not the immutable givens. + +Do not visually portray attention lines as causal edges. Show separate layers for address, occupancy, declared relation, proof provenance and saccade trajectory. Inactive is not unknown; unknown is not false; false is not an unseen row. + +## 5. Relational closure as demand-scoped explanation, not universal truth + +**PROPOSED:** A Datalog-style rule/value front end names reusable recursive relations over the existing typed class/SoA planes, lowers lawful fragments through `lance-graph-relalg`/Quack/R2IL into mask-RISC, and reuses the canonical execution path. This is *not* a claim that recursive Datalog with negation, joins, mutable provenance and fixed-point execution is currently shipped as one engine. Current `relalg` remains limited (no general μ / hop). + +Example **illustrative syntax**: + +```prolog +depends(A,B) :- calls(A,B). +depends(A,C) :- calls(A,B), depends(B,C). +``` + +For a named finite extensional fact set, positive Datalog provides a least-fixed-point closure. Its results are valid **relative to those facts and rules**, not a guarantee of worldly truth. A source-derived `calls` edge is not sufficient to prove behavior or a causal influence. + +Candidate demand flow: + +```text +Attention(A, horizon, aperture) + -> select declared class / relation / rule handles + -> compose coverage and permission masks BEFORE payload reads + -> demand only the reachable relation subproblem + -> fold matching planes at their common coordinate + -> preserve proof witnesses / unresolved insufficiency + -> return an interpretation or typed refusal +``` + +**Strict boundaries:** +- No gather (`x[y[i]]`) or foreign lane read disguised as a join. A proven preimage mapping is a separately accounted operation, not a free same-coordinate read. +- No strings/atoms in the hot fold. Resolve labels at the typed front end; Atomese/MeTTa head+arity+positions lower to classes/SoA first. +- Negation of a missing fact is not licensed without a **coverage receipt** proving an adequate, current and complete observation window and supported predicate set. +- Hyperon nondeterministic branch multiplicity must be preserved by a parity oracle; a set mask is not automatically a faithful representation of a bag of bindings. +- No second graph evaluator or hidden fallback. Unsupported shapes get a typed refusal. + +## 6. Recursion: the graph can model its own implementation + +Treat software itself as a source corpus, with typed and versioned distinctions between: + +```text +Declared source -> Extracted AST/SPO -> Compiled method / refusal + -> actual execution receipt -> independently verified effect + -> hypothesis about implementation -> authorized proposal (optional) +``` + +A candidate self-model is `H_v = Project(G_v)` for executable program version `v`. +A hypothesis is useful if it makes a **precommitted, falsifiable prediction** about `G_v` or a controlled version `G_{v+1}` that survives independent execution. + +**SAG lineage and caution:** PR #1509 demonstrated a one-concept, one-hop SoftwareGraph based on Quack, but those `awareness.rs`/`method.rs` surfaces were subsequently **removed from main by #1524**. The capstone in `../plans/sag-capstone-alignment-v1.md` is a research alignment, not evidence that the earlier runtime remains shipped. Build on current D-CMR/actual code only. + +Reflection can recurse over **addresses of methods and receipts**, not clone the entire world into a fresh ontology at each depth. Proposed ladder of discriminating abilities: + +1. Find own source/method identity and version. +2. Associate compiled IR with its declared method and measured execution. +3. Predict an observable behavior before running it. +4. Compare the observation with the prediction, including silence only when observable. +5. Ablate one method/assumption with independent source-root accounting. +6. Propose an alternative implementation or attention policy. +7. Repeat the prediction under a holdout test and show improved results at equal budget. + +A recorded reflection chain is not consciousness, independent evidence, or automatic permission to modify code. No recursive self-certification: an independent oracle decides whether a behavioral claim was verified. + +## 7. Counterfactuals: what an empty flare cannot tell us + +For a result `Q` with derivation provenance `Q = (A∧B)∨C`, occupancy alone cannot tell the difference between: + +- all three sources merely present; +- A and B jointly necessary; +- C independently sufficient; +- a duplicated C copied into multiple thought layers. + +`P[t1] & P[t2]` proves only *shared coverage*. The causal/derivational question needs an explicit provenance expression and a detached replay or independent oracle. Removing A alone may leave Q; removing A and C may not. + +**Falsifier:** use one shared physical root copied into multiple thought worlds and two genuinely independent roots in one world. Any procedure using only thought IDs to infer evidential independence fails. + +**Temporal boundary:** pin source revision, class/reading generation, dataset version, decision horizon and relevant codebook. Compare `W0` (factual) with `WX` (ablation) without leaking future evidence. A stale Lance coordinate map or an unauthorized read must refuse rather than silently use a plausible value. + +**No causal inflation:** a Datalog dependency edge is not necessarily a Pearl causal edge; strong co-occurrence is not intervention certification; self-model predictions are not empirical truth until checked. + +## 8. Measurements, scaling and the inconvenient result + +| Surface | Existing probe result | Limitation | +|---|---|---| +| Presence operations | ~0.9–1.2 ns per 64-address word on the tested AVX-512 machine | Counts occupancy, not value equality, meaning or proofs | +| Per-row perspective count | ~1.1 ns on its measured reference grid | 64-lane budget, specific hardware | +| Dual occupancy orientation | 512 KiB per orientation for 64 × 65,536 | Metadata, roots, values and additional value-lane masks excluded | +| Point read | Thought-first tests passed equality + no-row-materialization gates | Work linear in selected lanes; hot/cold locality matters | +| C-lazy dense positional values | At 64 thoughts / 31 lanes, 1% uniform writes: ~1,850 MiB RSS | Page-dense waste; sparse comparator ~25 MiB with slower lookups | +| Lance 13 masked I/O | Clustered sparse reads can cut bytes; scattered sparse reads sometimes do not | Projection/row filtering does not guarantee page read savings | + +These numbers are **documented measurements from October 14–15**, not rerun by this doc. See D-HOLO-H14c for setup, full grids, corrected timer bias, and negative results. + +**Scaling hypothesis:** Keep presence projections cheap and composable, but investigate a residency-aware value layout so 64 hypotheses do not materialize a dense 2 GiB table merely to inspect a sparse attentional neighborhood. Memory, versioned coordinate mapping, data locality, and proof-maintenance cost may dominate bitmap ALU throughput. + +## 9. Experiments that could justify the large claim + +Status of all tests below: **PROPOSED**, not passed. Build no new executor or register merely to make them pass. + +| Gate | Minimal fixture / oracle | Kill condition | +|---|---|---| +| E0 Address | Same logical coordinate across compaction/rewrite; pinned version and oracle | Silent value misattribution or stale map accepted | +| E1 Occupancy | 64×65,536 seeded matrix, per-row/per-thought transpose and scalar oracle | Any popcount or aperture disagreement | +| E2 Absence | Zero value, missing overlay, unvisited address, unseen-but-existing fact, observed-false fact | Any state conflation | +| E3 Reading | All 32 CE64 upper codes under declared/legacy/unknown generations | Reserved or untrusted state accepted; code zero treated as generic unknown | +| E4 Evidence | Duplicated source copied into worlds vs independent sources | Duplicate support counted twice | +| E5 Rule parity | Existing Quack/R2IL masks vs independently executed positive Datalog over finite fixture | Missing/excess answer; unseen negative silently certified | +| E6 Bags | MeTTa nondeterministic 2×2 branch against Hyperon/PeTTa | Four answers collapsed to two by a set mask | +| E7 Nonlocal | Same-address read vs unsupported foreign-lane preimage | Foreign gather presented as zero-copy | +| E8 Ablation | `Q=(A&B)|C`, single and joint cuts, fixed horizon and independent provenance oracle | Wrong survival / history leakage | +| E9 Self-model | Predict effect of a withheld source-code edit before independently executing it | Retrospective prediction or source AST treated as behavioral proof | +| E10 Attention | FIFO, confidence priority, entropy, calibrated EIG and Moore/Staunen under same compute budget | Adaptive policy fails held-out baseline or uses feedback leakage | +| E11 Cost | Sparsity × clustering × k × T, cold/hot, both occupancy orientations and storage arms | No benefit under realistic workloads; unjustified performance claim | +| E12 Authorization | Propose change, then revoke relevant role/policy at commit | A proposed method mutates state without a fresh authorization decision | + +Pre-register baseline, random seeds, source revision, fixtures, oracles, workload, counters, and acceptance thresholds before a run. Include disable/falsifier variants that must fail. Preserve negative results. + +## 10. What success would actually mean + +The strongest **falsifiable** claim is not "we built a mind" or "64 lanes prove AGI". + +It is: + +> With a fixed evidence corpus and fixed execution budget, a graph-backed reasoner can use its own inspectable execution/provenance traces to identify a mistaken interpretation, choose a better method, and achieve a **measurable held-out gain in correct, independently witnessed predictions** without fabricating evidence or changing the canonical ISA. + +The growth path is: +1. **Epistemic microscope:** vocabulary and conceptual loci flare with separate attention/evidence/sense layers. +2. **Counterfactual laboratory:** 64 isolated treatments compare method choice, provenance and prediction. +3. **Falsifiable software self-model:** the graph predicts, observes and revises claims about its implementation. +4. **Cumulative method discovery:** candidate algebraic equivalences become reusable only after independent semantic and cost validation. + +This could transform a knowledge graph from a static catalog of relationships into an experimental instrument for examining *how relationships are inferred*. The major novelty would be **cheap, address-aligned observability composed with rigorous provenance and independent error correction**, not a purportedly magical interpretation of one bitfield. + +## 11. Source-of-truth reading map + +All paths are repository-relative. The notes are intentionally not copied into this architecture; they own their current contracts, dates, and open issues. + +- `../knowledge/epistemic-frontier-capstone.md`: authoritative architectural inventory, statuses, conflicts and source locations. +- `../plans/ce64-hypothesis-layers-v1.md`: 64 thought sessions, dual presence orientations, givens, measured probes. +- `../plans/d-holo-h14c-thought-first-v1.md`: thought-first reads, Hamming population, memory negative result, Lance masked I/O. +- `../../crates/lance-graph-contract/src/alpha.rs`, `alpha_tunnel.rs`, `alpha_focus.rs`: attention, saccades and tenant/rung projection. +- `../../crates/lance-graph-contract/src/epistemic_state5.rs`: five-bit typed declarations, certification and topology product. +- `../../crates/causal-edge/src/layout.rs`: physical CE64 layout; **check conflicts before implementation**. +- `../board/entries/2026-10-17-epistemic-frontier-clicks.md`: operator decisions and open migrations. +- `../board/entries/2026-10-17-ce64-one-layout-moore-synapse-membrane.md`: CE64 reader catalog and Moore-local open questions. +- `../plans/metta-datalog-assimilation-v1-council-v3.md`: **DO NOT BUILD** banner for forbidden foreign-lane gather; follow H14c/H14d instead. +- `../../crates/lance-graph-quack/examples/wired_reasoning_probe.rs`: finite Boolean Datalog-shaped property checks, not full recursive Datalog. +- `../../crates/lance-graph-relalg/src/ir.rs`, `../../crates/lance-graph-nal/src/lib.rs`: current typed IR and NAL lowering entry points. +- `../knowledge/software-awareness-provenance-parity.md`: removed SAG first build, authority separation and independent verification. +- `../knowledge/sag-v2-observability-causality-and-evaluation-addendum.md`: coverage receipts, blind self-prediction, negative observations. +- `../plans/sag-capstone-alignment-v1.md`: consolidated research vocabulary, including inert `ProposedMethod`. +- `../../crates/deepnsm-v2/src/vocab.rs`, `coca.rs`, `codebook.rs`, `examples/bible_wave.rs`: vocabulary/semantic/corpus inputs; distinguish actual code from planned full-stack wiring. + +**Change rule:** Update this document by distinguishing source-backed `CURRENT-CONTRACT` or `MEASURED` from new `PROPOSED` ideas. Never silently "resolve" an upper-bit interpretation conflict, mutate a user-authorized ISA, or infer that historical code remains on `main`. + diff --git a/.claude/architecture/neurofunctional-rubicon-moore-plasticity.md b/.claude/architecture/neurofunctional-rubicon-moore-plasticity.md new file mode 100644 index 000000000..00e8a577d --- /dev/null +++ b/.claude/architecture/neurofunctional-rubicon-moore-plasticity.md @@ -0,0 +1,190 @@ +# Neurofunctional crosswalk: OpenPsi/Rubikon control and Moore-local synaptic plasticity + +**Date:** 2026-10-17 +**Status:** ARCHITECTURE / COMPARATIVE RESEARCH. No runtime code, contract, ABI, or authority change. + +**Operator thesis:** Moore tenant + NARS16×8 is the intended **local synaptic-plasticity substrate**. OpenPsi-style demands and the Heckhausen/Gollwitzer + O'Reilly/Axon Rubikon lineages supply **motivation, goal commitment and control**. Merged lance-graph [#1571](https://github.com/AdaWorldAPI/lance-graph/pull/1571) supplies a **named-state calibration profile**, not synaptic truth, biological feelings or permission to act. + +This is a mapping of *computational functions*, not a claim that a Rust module is anatomically equivalent to a brain region. The relevant sources, actual code, open migrations and independent falsifiers are kept apart. + +## 1. Three interacting timescales + +```text +FAST / LOCAL: 8-neighbour Cartesian membrane + pre/post activity at (i, neighbour-slot) [NOT plain presence] + | + MoorePalettePairs: P/O semantic palette pair (8 × 16 bits) + Nars16x8: F/C evidence reading (8 × 16 bits, candidate) + MooreNars16: Pearl/Energy/Plasticity/Polarity/Epi5 + (8 × 16 bits) + | + reciprocal membrane agreement; observed independent evidence + | + local eligibility + inhibited / excitatory revision proposals + ^ | + | (modulation) | measured outcome + | v +MID / CONTROL: motivation + volition + ada-rs GoalGenerator / OpenPsi demand and modulators + -> desirability / feasibility / cost + -> Rubikon commitment gate + -> maintained goal / if-then cue policy + -> authorized action (separate permission) + -> outcome / temporal credit / disengagement + | | + +------------ modulation ---------+ + | +SLOW / EPISODIC: thought-Git + 0 sealed givens; 1..63 hypothesis branches + -> rebase -> independent evaluation -> squash / land + -> replay / metacognitive revision / reusable method +``` + +The key separation is **what is learned locally**, **what goal is selected**, and **what is justified by evidence**. These must remain different state and authority domains even when compiled to the same R2IL/mask-RISC algebra. + +## 2. Source-backed inventory and status + +| Source | Actual surface | Proposed role | Status | +|---|---|---|---| +| [ada-rs goal_generator.rs](https://github.com/AdaWorldAPI/ada-rs/blob/master/src/cognition/goal_generator.rs) | `AutonomousGoal`, `GoalOrigin` (diagonal lack, counterfactual regret, curiosity, dream, novelty, external), `NeedLevel`, urgency/satisfaction | demand / goal candidate production | Rust implementation exists; heuristics not evidence of human motivation | +| [ada-rs will_engine.rs](https://github.com/AdaWorldAPI/ada-rs/blob/master/src/cognition/will_engine.rs) | `Volition`, `WillConstraint`, `WillState`, `synthesize`, blocked-goal checks | volition ranking / constraints | exists; not integrated with canonical Rubikon commit gate | +| [ada-rs qualia_17d.rs](https://github.com/AdaWorldAPI/ada-rs/blob/master/src/feel/qualia_17d.rs) | 17 named numerical axes | state telemetry input | coordinate contract, not evidence of experience | +| [LG PR #1571](https://github.com/AdaWorldAPI/lance-graph/pull/1571) | `qualia_profile`: 219 named patches, PCS 17D, palette, K residual, mix, device/PCS/observer separation | device→state vocabulary / policy appraisal *after calibration* | MERGED; five shared axis names only, twelve unmeasured transforms, even shared semantics are conjectural | +| [hyperon-openpsi](https://github.com/iCog-Labs-Dev/hyperon-openpsi) | experimental MeTTa demand, modulator, feeling and planner modules | motivation and competing-demand reference | experimental, not a complete available LG cognitive runtime | +| [hyperon-openpsi PR #117](https://github.com/iCog-Labs-Dev/hyperon-openpsi/pull/117) | tie-breaking and demand→distinct-goal repair | negative control: priority must deterministically affect actual choice | OPEN when checked 2026-10-17 | +| [LG Rubicon plan](../plans/rubicon-volition-v1.md) | goal candidate→commitment→cue policy→action→evaluation/disengagement | Heckhausen/Gollwitzer phases | PROPOSED | +| [Axon Rubicon](https://github.com/emer/axon/blob/main/Rubicon.md) | cost/benefit selection, BG-like gating, maintained goal, temporal credit | computational reward / maintenance analogy | external hypothesis and implementation, not shipped LG | +| [FLOW-COG Rubicon convergence](../../docs/architecture/FLOW_COG_RUBICON_ONA_CONVERGENCE.md) | two Rubicon lineages, ONA evidence and OpenPsi ranking separated | source-of-truth ownership | architectural document, not a new runtime | +| [Moore tenant](../../crates/lance-graph-contract/src/moore_tenant.rs) | three eight-lane value tenants, reciprocal slots, `MooreNars16`, CE64 lift/refusals | **local synaptic carrier** | physical layout exists; learned update and witness migration open | +| [Moore one-hop probe](../../crates/cognitive-shader-driver/examples/moore_plasticity_probe.rs) | fixed eight-neighbour schedule, synchronous snapshot update, mask freeze | local perturbation and gated update | probe, not biological STDP | +| [MooreNars16 parity test](../../crates/lance-graph-planner/tests/moore_tenant_isa_equivalence.rs) | CE64 reconstruction observed equivalent for tested shipped operations | encoding equivalence gate | tested in declared homogeneous/core scope | +| [Moore Gomoku](../../crates/cognitive-shader-driver/examples/moore_nars_gomoku_probe.rs) | delayed outcome credited to relative `signature × recipe`, not positional moves | learning benchmark | task probe; not complete synaptic-to-Rubikon loop | + +OpenCog/Hyperon contributes typed compositional symbolic methods and multiple possible bindings. ONA/NAL contributes truth revision and evidence arithmetic. OpenPsi-inspired ranking contributes *motivation*. They should **compile through existing methods**, not become rival persistent graph stores, trust authorities, or scheduler engines. + +## 3. Local plasticity is Moore + NARS16×8, not a CE64 rewrite + +At each deterministic Cartesian cell coordinate, the eight neighbour slots are NW, N, NE, W, E, SW, S, SE. Proposed shared membranes match opposite slots (E↔W, NE↔SW) at the neighbour's own coordinate: **no foreign-row gather**. Reciprocal consistency and version equality are explicit tests. + +Each of the three tenants has eight `u16` lanes, together **48 bytes per cell** for the represented neighbour readings: + +- `MoorePalettePairs`: semantic P/O as `(u8,u8)` per neighbour. +- `Nars16x8` (candidate reading): F/C as `(u8,u8)` per neighbour. NARS F/C denotes evidence support, not an arbitrary synaptic reward score. +- `MooreNars16`: **Pearl3 (bits 0..2), Energy4 (3..6), Plasticity3 (7..9), Polarity1 (10), Epi5 (11..15)**. The exact bit allocation lives in `moore_tenant.rs`. These are Moore-local readings of the canonical CE64 ISA contract, not a new 128-bit causal edge. + +Local context answers address/neighbor direction; use existing canonical fields rather than storing pointers. An explicit observation or activation event is required to interpret a synapse as firing. + +**Two still-open migrations are important:** + +1. The 2026-10-17 operator decision identifies the **Cartesian reciprocal membrane** as the local witness. Current `MooreTenantMut::lift_ce64` instead expects homogeneous W across all eight lanes and refuses `MixedWitness`; W also has a competing **thought-layer breadcrumb** reading. Do not claim the reciprocal membrane law already powers the reader. +2. The operator decision treats CE64 46..49 as signed **excitation/inhibition** and 50..52 as a local maturation/plasticity gear; existing ISA code reads 46..49 as an inference opcode, and 50..52 has an unresolved novelty-vs-plasticity conflict. Only explicit versioned migration can resolve this. Never consume reserved bits silently or create CE128 to escape it. + +**The presence bit is not a spike.** It means a thought/value is represented at an address, not that any firing event took place. Without a separate timestamped activation trace, “co-present means co-active” would fabricate plasticity evidence. + +## 4. OpenPsi + Heckhausen Rubikon: control the goal, not the synapse + +Psychological Heckhausen/Gollwitzer Rubikon: + +```text +PREDECISIONAL: consider goals (desirability, feasibility, uncertainty) + -> witnessed and revocable GOAL COMMITMENT [Rubikon] +PREACTIONAL: form if (cue) then (proposed action) plan +ACTIONAL: action only if policy/capability/role still authorizes it +POSTACTIONAL: observe outcome, evaluate, disengage or re-plan +``` + +Computational O'Reilly/Axon Rubicon contributes BG-inspired goal selection, maintained engaged goal, learned cost/benefit, and *temporal credit assignment* when reward or omission is observed later. Neither authority nor psychological truth follows merely from having that state machine. + +The [OpenPsi source](https://github.com/iCog-Labs-Dev/hyperon-openpsi/blob/main/main/feeling-updaters.metta) distinguishes **Activation, Resolution, SecuringThreshold, SelectionThreshold, Pleasure** as modulators; [modulator-updaters](https://github.com/iCog-Labs-Dev/hyperon-openpsi/blob/main/main/modulator-updaters.metta) contains numeric helper functions. OpenPsi's priority score must not be conflated with NARS confidence or certified CE64 causes. PR #117 highlights a concrete risk: two demands can tie and whichever input happens to be first wins; a broken goal mapper can discard demand identity entirely. Use deterministic tie and downstream-effect falsifiers. + +In `ada-rs`, the `Volition.confidence` float comes from the **will-engine heuristic**; it is not a readout of NARS `C`. #1571's 219 labels are not a substitute for a validated control signal; the device→PCS transform is presently incomplete. No emotion label or utility score authorizes a side effect. + +The invariant remains: + +```text +demand → ranked goal candidate → independent commitment gate + → cue-bound proposal → current action permission + → executed outcome receipt → revised belief / choice +``` + +## 5. Three-factor synaptic learning: the testable new seam + +A candidate three-factor update separates **local activation eligibility**, a **later global/modulatory learning signal**, and **evidence-correct revision**. + +Illustrative mathematical policy, **not shipped code or a new register field**: + +```text +eligibility_ij(t+1) = λ · eligibility_ij(t) + + coactivity(pre_i(t), post_j(t+Δ)) + +Δeffective_gain_ij = η · outcome_modulator(t) · eligibility_ij(t) +``` + +- `eligibility_ij` is a bounded versioned temporal trace, not persistent NARS confidence, nor inferred from a set presence bit. +- `outcome_modulator` comes from an independently observed result relative to a maintained goal, or an explicitly ablatable exploratory policy; it is **not** the raw word "joy" or a high `EpistemicState5` code. +- A gain adjustment governs *future local signal propagation or recipe selection*. `F/C` is revised only when new, independent evidence warrants it. One source copied into two thought branches is still one source. +- Correlated pre/post activity proposes association. It does not establish a Pearl causal relationship or warrant CE64 certification `Causes`. +- Inhibition, polarity, saturation, temporal delay, source-root overlap and Simpson-stratum preservation require their own oracles. +- Do not allocate new byte lanes or an entirely separate plasticity engine before testing what the existing tenants, temporal envelopes and pure R2IL folds can express. + +Thus the stronger replacement for naïve Hebb is: **coactivity makes a local membrane eligible; a witnessed outcome selectively gates the update; independent evidence constrains what it is legal to believe about that membrane**. + +## 6. End-to-end falsifier scenario + +A small sealed environment has **two competing goals**, **delayed feedback**, and observable **local neighbour interactions**. Hold evidence, budget, policies and clocks constant across arms. + +1. Hydrate given observations with distinct source roots and explicit observation coverage. +2. Create **activity events** separate from the Moore presence mask; check reciprocal neighbour identity. +3. Derive candidate goals via `ada-rs::GoalGenerator`; optional OpenPsi-style demand and modulator policy changes *ranking*, not truth. +4. Deliberate and cross the Rubikon only through an independent current commitment gate. +5. Hold the chosen goal across a delay; emit an if-then action only with current permission. +6. Observe completion **or demonstrably covered omission**. Preserve time/source/provenance. +7. Use the observed outcome to update eligible local membranes while preserving NAL source-root accounting. +8. Rebase the thought-Git branch against the new sealed reference; retract changed-premise consequences before replay. +9. Measure held-out predictive performance, correct goal selection, appropriate disengagement, false causal certification, memory, and CPU. + +**Controls:** no plasticity, Hebbian-only, outcome-gated, shuffled/late reward, permuted demand ordering, no Rubikon commitment, no cue plan, and incorrect reciprocal-slot implementation. + +### Kill conditions + +| Gate | What must be falsified | +|---|---| +| NF-0 | Presence accidentally treated as firing | +| NF-1 | Moore E↔W / NE↔SW reciprocity fails on a sealed version | +| NF-2 | Reconstituted Moore three-tenant state diverges from canonical CE64 for declared supported operations | +| NF-3 | One physical observation copied into multiple thought worlds increases confidence twice | +| NF-4 | Shuffled delayed reward strengthens the same “correct” synapses as real credit | +| NF-5 | OpenPsi tie/goal mapping depends on iteration order or discards demand identity | +| NF-6 | Goal cue dispatches after authorization/revocation changes | +| NF-7 | Unmeasured PCS axes silently become known affect coordinates | +| NF-8 | CE64 legacy W, opcode nibble, or reserved Epi5 passes as current canonical reading | +| NF-9 | Simpson pooling reverses an association and still upgrades causal certification | +| NF-10 | Gated plasticity fails to outperform matched-cost baselines on previously unseen cases | + +All scenarios need a from-scratch independent oracle, a deliberately broken alternative that fails, measured wall/CPU/RSS, and replayable versioned receipts. + +## 7. Architecture ownership and next research decision + +- **Synapse:** Moore-local tenants and reciprocal membranes. This is the **intended plasticity substrate**. +- **Belief revision:** ONA/NAL/CE64 with *witnessed independent source roots*, not reward arithmetic. +- **Demand/appraisal:** `ada-rs` goal/will, experimental OpenPsi scoring, optionally #1571 state-profile readings where actually calibrated. +- **Rubikon:** distinct goal selection, maintained commitment, implementation intention and disengagement, with independent authority gates. +- **Method composition:** Hyperon/OpenCog expression semantics through existing typed classes and the R2IL/mask-RISC execution seam. +- **Durability/replay:** thought-Git's sealed versions, not reusable thought-slot numbers. +- **Self-observation:** alpha/holographic saccades observe where attention moved, not what was true. + +**First high-leverage milestone:** Under a fixed evidence and time budget, demonstrate that witnessed delayed goal outcomes improve a local Moore-plasticity learner **without altering NARS evidence math, conflating presence with activity, double counting a witness, or crossing an action gate autonomously**. + +If the learner cannot beat a Hebbian-only and a shuffled-modulator control on unseen cases, the proposed cross-layer cognitive benefit is **refuted for that fixture**, however compelling the anatomical analogy may appear. + +## Source reading order + +1. [Moore synapse / membrane decisions](../board/entries/2026-10-17-ce64-one-layout-moore-synapse-membrane.md), [Moore tenant](../../crates/lance-graph-contract/src/moore_tenant.rs), [Moore parity tests](../../crates/lance-graph-planner/tests/moore_tenant_isa_equivalence.rs), [one-hop plasticity probe](../../crates/cognitive-shader-driver/examples/moore_plasticity_probe.rs). +2. [Ada-rs GoalGenerator](https://github.com/AdaWorldAPI/ada-rs/blob/master/src/cognition/goal_generator.rs), [WillEngine](https://github.com/AdaWorldAPI/ada-rs/blob/master/src/cognition/will_engine.rs) and [Qualia17D](https://github.com/AdaWorldAPI/ada-rs/blob/master/src/feel/qualia_17d.rs). +3. [LG #1571](https://github.com/AdaWorldAPI/lance-graph/pull/1571), [QualiaProfile](../../crates/lance-graph-contract/src/qualia_profile.rs). +4. [OpenPsi experimental MeTTa](https://github.com/iCog-Labs-Dev/hyperon-openpsi), [PR #117](https://github.com/iCog-Labs-Dev/hyperon-openpsi/pull/117), [Axon Rubicon model](https://github.com/emer/axon/blob/main/Rubicon.md). +5. [Heckhausen/Gollwitzer sources](../../.arxiv/2026-10_rubicon_gollwitzer_volition_source_excerpts.md), [Rubicon plan](../plans/rubicon-volition-v1.md), [FLOW-COG](../../docs/architecture/FLOW_COG_RUBICON_ONA_CONVERGENCE.md). +6. [Cartesian epistemic self-model](cartesian-epistemic-self-model.md), [thought-Git](../plans/thought-git-api-v1.md) and [CE64 reading](../../crates/lance-graph-contract/src/epistemic_state5.rs). + +**Status of each claim:** `CURRENT-CONTRACT` means source code, `MEASURED` means a documented probe, `DECISION` means a recorded architectural preference, and `PROPOSED` means a testable transfer. No architecture diagram is implementation proof. +