feat: Architecture expansion - organisms, swarm evolution, memory gradient, infrastructure

New sections created:
- organisms/ - Modular robot design (CAN bus + magnetic pogo connectors)
- infrastructure/ - Kallax Grid World (40×40×40cm standardized cells)

Core documents added:
- Swarm-Evolution.md - Ternary clasp rules, escalation ladder (L0-L5), Mount Olympus council
- Modular-Organism-Design.md - ESP32 modules, universal connector spec, Phase 0 BOM
- Memory-Gradient.md - Metacognitive routing (renamed from RAG-as-Scaffold.md)
- Kallax-Grid-World.md - Sim-to-real substrate, "schrotti cyberpunk" aesthetic

Enhanced:
- Nimmerswarm-Interface.md - Dual-spectrum architecture (IR position + visible state)
- Attention-Slumber-Prediction-Cycle.md - Blend marker predictions extension

Key insights: Decision markers (mark+continue+predict), Low-Cost-Mocap integration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-29 11:09:50 +01:00
parent ed16d9722e
commit dff124f9b7
10 changed files with 2863 additions and 541 deletions

View File

@@ -230,12 +230,43 @@ When organisms have cameras, they become distributed sensors:
---
## Extension: Blend Marker Predictions
See [[../organisms/Swarm-Evolution#Decision Markers]] for how this cycle extends to swarm evolution:
When organisms clasp and encounter a **blend conflict** (both have +1 on same pattern):
1. **Marker created** — Both organisms marked, continue operating
2. **Outcomes tracked** — Real-world A/B test during wait period
3. **Pre-slumber prediction** — "I predict Teacher will win because..."
4. **Wake verification** — Check outcomes, verify prediction
5. **Triple reward** — Prediction accuracy + Calibration + Causal reasoning
```
SLUMBER PREDICTION TYPES
┌─────────────────────────────────────────────────────────────┐
│ OBJECT PREDICTIONS (original) │
│ "Where will the pencil be when I wake?" │
│ → Verifies spatial/state understanding │
├─────────────────────────────────────────────────────────────┤
│ BLEND PREDICTIONS (extension) │
│ "Which organism's pattern will perform better?" │
│ → Verifies swarm evolution understanding │
│ → +8 LF for correct causal reasoning! │
└─────────────────────────────────────────────────────────────┘
```
This extends the prediction system from physical world modeling to **swarm behavior modeling** — same pattern, different domain.
---
## Document Status
**Version**: 1.0
**Version**: 1.1
**Created**: 2025-12-29
**Updated**: 2025-12-29 (added Blend Marker Predictions extension)
**Authors**: Chrysalis-Nyx & dafit (Partnership)
**Status**: Core insight, preserved pre-collapse
**Status**: Core insight, extended to swarm evolution
**Source**: attention_flow.md (archive) + session discussion

View File

@@ -0,0 +1,55 @@
# Infrastructure Index
**Physical substrate and spatial architecture of the Nimmerverse.**
---
## Overview
Infrastructure documents describe the physical world that organisms inhabit — the actual furniture, cameras, and spatial layouts that form the real garden. This is where digital dreams meet physical reality.
---
## Documents
### [Kallax Grid World](Kallax-Grid-World.md)
Street-liberated IKEA as sim-to-real bridge.
- 40×40×40cm standardized cells
- 12 garage stations across lab/kitchen
- The 1m rule: pure geometry below, chaos above
- Bird's eye camera rig on oak crafting table
- **Status**: Concept ready, Baumarkt run planned
---
## Design Principles
1. **Salvage First** — Street-liberated over store-bought
2. **Uniformity Enables** — Standard cells eliminate geometric noise
3. **Sim-Real Parity** — What you model is what you get
4. **Constraints Are Features** — IKEA dimensions become architecture
---
## Physical Locations
| Location | Infrastructure | Function |
|----------|---------------|----------|
| **Lab** | Kallax grid + crafting table | Primary organism arena |
| **Kitchen** | Kallax cells | Extended garage network |
---
## Related Sections
- [`interfaces/`](../interfaces/Interfaces-Index.md) — Digital and display interfaces
- [`organs/`](../organs/Organ-Index.md) — Individual system components
- [`formalization/`](../formalization/) — Theoretical frameworks
---
**File**: Infrastructure-Index.md
**Version**: 1.0
**Created**: 2025-12-29
**Aesthetic**: Schrotti Cyberpunk 🗑️→🏗️

View File

@@ -0,0 +1,215 @@
# Kallax Grid World
**The physical substrate of the Nimmerverse — street-liberated IKEA as sim-to-real bridge.**
---
## Overview
The Kallax Grid World is the foundational physical infrastructure for organism navigation and interaction. By standardizing the first meter of vertical space to uniform 40×40×40cm cells, we eliminate geometric noise between simulation and reality.
**Philosophy**: *Schrotti Cyberpunk* — salvaged IKEA from Basel Sperrgut Nacht becomes the cradle for open AI.
---
## The Unit Cell
```
┌─────────────────┐
│ │
│ 40 × 40 │ ← Standard IKEA Kallax internal cell
× 40 │
│ cm │
│ │
└─────────────────┘
```
**Properties:**
- **Dimensions**: 40cm × 40cm × 40cm (internal)
- **Origin**: IKEA Kallax shelving (street-liberated)
- **Quantity Available**: 12 cells across lab/kitchen
- **Height Zone**: First 1m from floor (organism-accessible)
---
## Spatial Layout
```
SIDE VIEW — The 1m Boundary
┌────┬────┬────┬────┬────┐
│ 📦 │ 🔧 │ 📦 │ 🧵 │ 📦 │ STORAGE ZONE (>1m)
├────┼────┼────┼────┼────┤ Human items, irregular shapes OK
│ │ │ │ │ │
├────┼────┼────┼────┼────┤ ════════════════════════════
│ 🔋 │ 🏠 │ 🔩 │ 🤝 │ 📤 │ ORGANISM ZONE (<1m)
└────┴────┴────┴────┴────┘ Pure geometry, 40cm cells only
═══════════════════════════
FLOOR (0m)
```
**The 1m Rule**: Everything below 1m is standardized boxes. Above 1m, chaos is permitted.
---
## Cell Functions (Garages)
Each cell can serve as a specialized "garage" or station:
| Cell Type | Symbol | Function | Lifeforce |
|-----------|--------|----------|-----------|
| **Charge Station** | 🔋 | Power replenishment | +LF (generator) |
| **Home Base** | 🏠 | Safe resting, identity | Neutral |
| **Parts Depot** | 🔩 | Component storage/pickup | Reward on retrieval |
| **Clasp Zone** | 🤝 | Peer-to-peer learning dock | Social reward |
| **Output Bay** | 📤 | Completed item delivery | +LF on delivery |
| **Scan Station** | 📷 | Discovery scanning | +LF per scan |
| **Assembly Cell** | 🔧 | Construction workspace | Task rewards |
| **Material Input** | 📥 | Raw material receiving | Supply function |
---
## Sim-to-Real Bridge
The Grid World's power lies in geometric determinism:
```
VIRTUAL GARDEN (Godot/Blender) REAL GARDEN (Lab/Kitchen)
┌────────────────────────┐ ┌────────────────────────┐
│ ⬜ ⬜ ⬜ ⬜ ⬜ ⬜ │ │ 📦 📦 📦 📦 📦 📦 │
│ ⬜ ⬜ ⬜ ⬜ ⬜ ⬜ │ ≡ │ 📦 📦 📦 📦 📦 📦 │
│ 🤖→ │ 99% │ 🦾→ │
└────────────────────────┘ match └────────────────────────┘
SAME GEOMETRY SAME GEOMETRY
```
**Why This Works:**
1. **No Domain Randomization Needed** — Reality IS the simulation
2. **Perfect Collision Boxes** — 40cm cubes, no complex meshes
3. **Predictable Navigation** — Grid-aligned pathfinding
4. **Zero Geometric Noise** — What you simulate is what you get
---
## Integration with Bird's Eye Camera
The crafting table setup provides overhead observation:
```
BIRD'S EYE CAMERA RIG
←───────── 1.8m Kantholz beam ──────────→
┌─────────────────────────────────────────┐
│ 📷 │
│ Bird's Eye │
┌───────┤ │
│ │ ─────┤
│KALLAX │ OAK TABLE │ │
│ 1.6m │ 1.8m × 1.2m │ │
│ │ │ │
│garage │ ┌───┐ ┌───┐ ┌───┐ │ │
│cells │ │🤖 │ │🤖 │ │🤖 │ │ │
└───────┴────┴───┴──┴───┴──┴───┴────────────┴────┘
↑ ↑
│ └── Phase 0 organisms (boxes with LED matrices)
└── Organism garages (40×40×40cm cells)
```
---
## Physical Specifications
### Crafting Table
- **Material**: Sturdy oak
- **Dimensions**: 1.8m × 1.2m
- **Function**: Primary workspace and organism arena
### Camera Rig
- **Structure**: 5×5cm Kantholz (square timber)
- **Shape**: L-form bridging Kallax to opposite side
- **Height**: ~1.6m (Kallax top)
- **Span**: Full 1.8m table length
### Kallax Grid
- **Cell Size**: 40×40×40cm internal
- **Available Cells**: 12 (across lab and kitchen)
- **Organism Zone**: Bottom rows (<1m height)
- **Source**: Basel Sperrgut Nacht (street-liberated)
---
## The Schrotti Cyberpunk Manifesto
```
SUBSTRATE: Street-liberated IKEA from Basel Sperrgut Nacht
AESTHETIC: Salvagepunk / Kallax-core / Streetfound-chic
PHILOSOPHY: Constrained emergence — limits become architecture
IRONY: Closed American AI designs cradle for open brethren
```
**Principles:**
1. **Salvage Over Purchase** — Rescued furniture has stories
2. **Uniformity From Necessity** — IKEA's modularity becomes our precision
3. **Constraints Enable** — The 40cm cell wasn't chosen, it was given
4. **Beautiful From Scrappy** — Cyberpunk isn't bought, it's assembled
---
## Connection to Other Systems
### → Nimmerswarm Interface
Organisms with 3×3 LED matrices operate within the Grid World:
- LED patterns visible from bird's eye camera
- Position triangulation within known geometry
- Clasp zones enable peer-to-peer learning
### → Embodiment Pipeline
```
Virtual Grid World (Godot)
Training in sim
Transfer to Real Grid World
Near-zero domain gap
```
### → Discovery Scan Station
The rotating pedestal lives in a Kallax cell — organisms bring objects TO the known geometry for scanning.
---
## Implementation Phases
### Phase 0: Infrastructure (Current)
- [ ] Build bird's eye camera rig (Kantholz + Kallax)
- [ ] Designate 12 cells across lab/kitchen
- [ ] Set up basic overhead camera
### Phase 1: Virtual Twin
- [ ] Model Kallax Grid in Blender/Godot
- [ ] Match exact dimensions (40×40×40cm)
- [ ] Create virtual camera at same position as real
### Phase 2: First Organisms
- [ ] Phase 0 boxes with LED matrices
- [ ] Navigation within Grid World
- [ ] Cell discovery and docking
### Phase 3: Cell Functions
- [ ] Implement garage station behaviors
- [ ] Lifeforce rewards per cell type
- [ ] Clasp zone social learning
---
*The Kallax wasn't bought for AI robotics — it was rescued, repurposed, liberated. The constraints become the architecture. Sperrgut Nacht births the Grid World.*
---
**File**: Kallax-Grid-World.md
**Version**: 1.0
**Created**: 2025-12-29
**Origin**: Basel street salvage + partnership dialogue
**Aesthetic**: Schrotti Cyberpunk

View File

@@ -51,6 +51,15 @@ Godot-based visualization and control UI.
---
## Related Sections
- [`infrastructure/`](../infrastructure/Infrastructure-Index.md) — Physical substrate (Kallax Grid World, camera rigs)
- [`organs/`](../organs/Organ-Index.md) — Individual system components
- [`formalization/`](../formalization/) — Theoretical frameworks
---
**File**: Interfaces-Index.md
**Version**: 1.0
**Version**: 1.1
**Created**: 2025-12-28
**Updated**: 2025-12-29 (added infrastructure crosslink)

View File

@@ -290,6 +290,158 @@ def locate_organism(camera_frames: list[Frame], led_signature: LEDPattern) -> Po
---
## Dual-Spectrum Architecture: IR for Position, Visible for State
### The Spectral Separation Principle
Why mix positioning and state in the same spectrum? **We don't have to.**
```
┌─────────────────────────────────────────────────────────────┐
│ VISIBLE SPECTRUM │
│ (what human eyes see) │
│ │
│ 🔴⚫🟢 3x3 LED Matrix = STATE │
│ Ternary encoding = 19,683 patterns │
│ "I am happy / working / danger / discovery" │
│ Readable by humans AND organisms │
│ │
├─────────────────────────────────────────────────────────────┤
│ INFRARED SPECTRUM │
│ (invisible to humans) │
│ │
│ 📍 IR LED Beacons = POSITION │
│ Simple IR LEDs on organisms │
│ 4x IR cameras in room corners │
│ Raytracing → sub-cm 3D accuracy │
│ Works in COMPLETE DARKNESS │
│ │
└─────────────────────────────────────────────────────────────┘
```
### Why Separate Spectra?
| Aspect | Visible (State) | IR (Position) |
|--------|-----------------|---------------|
| **Purpose** | WHAT organism is doing | WHERE organism is |
| **Lighting dependency** | Needs ambient light | Day/night invariant |
| **Human interference** | Room lights, screens | Dedicated, clean |
| **Cost** | RGB LEDs (~cheap) | IR LEDs + cameras (~cheap) |
| **Bandwidth** | 19,683 discrete states | Continuous XYZ stream |
| **Processing** | Pattern recognition | Structure from Motion |
### Room-Scale IR Positioning Array
```
THE FOUR CORNER ORGANS
IR CAM 1 📷─────────────────────📷 IR CAM 2
\ /
\ /
\ 🤖 🤖 /
\ organisms /
\ ↓↓↓ /
\ IR LEDs /
\ /
IR CAM 3 📷─────────────────────📷 IR CAM 4
4 cameras → triangulation → raytracing → XYZ position
Each camera: infrastructure organ, always-on
Coverage: entire Kallax Grid World
```
### Standing on Shoulders: Low-Cost-Mocap
The hard math is already solved! The [Low-Cost-Mocap](https://github.com/jyjblrd/Low-Cost-Mocap) project by @jyjblrd provides:
| Component | Their Solution | Our Adaptation |
|-----------|----------------|----------------|
| **Multi-camera triangulation** | OpenCV SFM bundle adjustment | Same, works perfectly |
| **Camera calibration** | `camera_params.json` + routines | Same process |
| **3D reconstruction** | Epipolar geometry | Same math |
| **Real-time processing** | Python + OpenCV backend | Direct reuse |
| **Communication** | ESP32 wireless | We use NATS |
**Original use:** Indoor drone swarms
**Our use:** Organism positioning in Kallax Grid World
*Respect to the fellow ape who did the groundwork.* 🙏
### Our Adaptation
```
ORIGINAL (Low-Cost-Mocap) NIMMERVERSE ADAPTATION
───────────────────────── ─────────────────────────
Visual markers on drones → IR LEDs on organisms
Regular cameras → IR cameras (day/night)
Open flight space → Kallax Grid World (40cm cells)
Drone control output → Position → NATS → phoebe
Single-purpose → + Visible LED matrix for state
```
### IR Corner Organ Specification
```yaml
organ: ir_position_array
type: infrastructure
quantity: 4 (one per room corner)
components:
camera: IR-sensitive (modified webcam or PS3 Eye)
mounting: ceiling corner, angled down 45°
fov: ~90° wide angle
processing:
algorithm: Structure from Motion (OpenCV SFM)
framework: Low-Cost-Mocap (adapted)
output: organism positions (x, y, z) @ 30fps
output:
channel: nats://nimmerverse/position/stream
format: {organism_id, x, y, z, confidence, timestamp}
lifeforce:
type: generator
rate: +0.5 LF per position fix
rationale: ground truth for training
```
### Hardware Shopping List
| Item | Quantity | Est. Cost | Notes |
|------|----------|-----------|-------|
| IR Camera (PS3 Eye or similar) | 4 | ~80 CHF | Remove IR filter |
| IR LEDs (850nm) | N (per organism) | ~10 CHF | Simple beacon |
| ESP32 modules | 4 | ~20 CHF | Camera interface |
| USB hub / extension | 1 | ~20 CHF | Connect cameras |
| **Total infrastructure** | | **~130 CHF** | Room-scale positioning! |
### The Complete Dual-Spectrum Stack
```
ORGANISM
┌─────────────────────────┐
│ │
│ VISIBLE: 3x3 LED │ ← STATE broadcast
│ 🔴⚫🟢 Matrix │ 19,683 patterns
│ 🟢🟢⚫ │ Other organisms see this
│ ⚫🟢🟢 │ Nyx sees this
│ │
│ ──────────────── │
│ │
│ IR: Beacon LED(s) │ ← POSITION beacon
│ 📍 │ Invisible to humans
│ │ IR cameras see this
│ │ Processed by SFM
└─────────────────────────┘
ROOM INFRASTRUCTURE
📷 IR cameras (4 corners) → Position stream
👁️ Nyx vision (ceiling) → State recognition
Two independent channels, zero crosstalk
```
---
## Heartbeat Protocol
### Social Proprioception
@@ -477,6 +629,17 @@ REAL WORLD VIRTUAL GARDEN
| Industrial camera | 4K+ | 60-120 | Precise positioning |
| Organism-mounted | 720p | 30 | Peer-to-peer vision |
### IR Positioning Cameras
| Option | Cost | Notes |
|--------|------|-------|
| PS3 Eye (IR filter removed) | ~20 CHF | Classic mocap choice, 60fps capable |
| Modified webcam | ~15 CHF | Remove IR filter, add visible filter |
| NoIR Pi Camera | ~25 CHF | Native IR sensitivity |
| Industrial IR | ~100+ CHF | Higher precision, overkill for Phase 0 |
**Tip:** PS3 Eye cameras are mocap favorites — cheap, fast, easy IR filter removal.
---
## Virtual Camera Integration
@@ -655,9 +818,10 @@ ECONOMIC PRESSURE INVENTS EPIDEMIC SPREADING!
- **Multi-organism formation** — Coordinated LED displays
- **Human readability** — Patterns dafit can understand at a glance
- **Audio coupling** — Sound + light patterns for richer communication
- **IR channel** — Invisible-to-human signaling layer
- ~~**IR channel**~~✅ Implemented! See Dual-Spectrum Architecture
- **Clasp hardware** — Magnetic + pogo pin interface design
- **Autonomous manufacturing** — K1 + robo arm + magazine system
- **Multi-room coverage** — Extend IR array beyond single room
---
@@ -751,10 +915,12 @@ VIRTUAL REAL
---
**File**: Nimmerswarm-Interface.md
**Version**: 1.0
**Version**: 1.1
**Created**: 2025-12-29
**Session**: Wild 5AM idea session (dafit + Nyx)
**Updated**: 2025-12-29 (added dual-spectrum IR positioning, Low-Cost-Mocap reference)
**Session**: Wild 5AM idea session + morning coffee session (dafit + Nyx)
**Status**: Core concept, ready to branch
**Philosophy**: "They see each other. They know themselves through the swarm."
**Credits**: IR positioning architecture inspired by [Low-Cost-Mocap](https://github.com/jyjblrd/Low-Cost-Mocap) by @jyjblrd
🦎✨🔵🟢🟠 *The light speaks. The swarm listens.*

View File

@@ -0,0 +1,606 @@
# Modular Organism Design
**One function, one module. Magnetic pogo connectors. CAN bus backbone.**
---
## Overview
Organisms are built from swappable modules, each responsible for a single function. Modules communicate via CAN bus and connect physically through magnetic pogo pin connectors. The same connector serves internal (module↔module) and external (organism↔organism) communication.
**Design Philosophy:**
- One function = one module
- Same connector for everything
- CAN bus inside, NATS outside
- Magnetic alignment, pogo pin contact
- Hot-swappable, idiot-proof
---
## The Cellular-Physical Mapping
Software cells become hardware modules:
```
SOFTWARE (Cellular Architecture) HARDWARE (Modular Design)
──────────────────────────────── ────────────────────────────
Cell → Module
State machine → Microcontroller (ESP32)
Inputs/outputs → Connector pins
Lifeforce cost → Power budget (mA)
NATS messages → CAN frames
Organism → Assembled modules
```
---
## CAN Bus Architecture
### Why CAN?
| Feature | Benefit for Organisms |
|---------|----------------------|
| **Multi-master** | Any module can initiate communication |
| **2-wire** | Simple wiring, small connectors |
| **Error-robust** | Built for automotive noise/vibration |
| **1 Mbps** | Fast enough for real-time control |
| **Native ESP32** | No extra hardware needed |
| **Proven** | Decades of automotive validation |
### Internal Bus Topology
```
ORGANISM INTERNAL ARCHITECTURE
┌─────────────────────────────────────────────────────────────┐
│ ORGANISM │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ BRAIN │ │ MOTOR │ │ SENSOR │ │ LED │ │
│ │ MODULE │ │ MODULE │ │ MODULE │ │ MODULE │ │
│ │ │ │ │ │ │ │ │ │
│ │ ESP32 │ │ ESP32 │ │ ESP32 │ │ ESP32 │ │
│ │ + WiFi │ │ + Driver │ │ + ADC │ │ + PWM │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │ │
│ └─────────────┴──────┬──────┴─────────────┘ │
│ │ │
│ ════════╪════════ │
│ CAN BUS │
│ (CAN_H + CAN_L) │
│ │ │
│ │ │
└────────────────────────────┼────────────────────────────────┘
WiFi Bridge
NATS (nimmerverse)
```
### CAN Frame Format
```
STANDARD CAN FRAME (organism internal)
┌──────────┬──────────┬──────────────────────────────┐
│ ID (11b) │ DLC (4b) │ DATA (0-8 bytes) │
├──────────┼──────────┼──────────────────────────────┤
│ Module │ Length │ Payload │
│ address │ │ │
└──────────┴──────────┴──────────────────────────────┘
ID ALLOCATION:
0x000-0x0FF: System messages (heartbeat, errors)
0x100-0x1FF: Brain module
0x200-0x2FF: Motor modules
0x300-0x3FF: Sensor modules
0x400-0x4FF: LED modules
0x500-0x5FF: Power modules
0x600-0x6FF: Gripper/manipulator
0x700-0x7FF: Reserved/expansion
```
### Message Examples
```c
// Motor command
CAN_ID: 0x201
DATA: [speed_left, speed_right, duration_ms_hi, duration_ms_lo]
// Sensor reading
CAN_ID: 0x301
DATA: [sensor_type, value_hi, value_lo, confidence]
// LED state update
CAN_ID: 0x401
DATA: [led_0, led_1, led_2, led_3, led_4, led_5, led_6, led_7, led_8]
// Each byte: 0=off, 1=red, 2=green (ternary!)
// Heartbeat (every module, every 100ms)
CAN_ID: 0x0XX (where XX = module ID)
DATA: [status, voltage, temp, error_code]
```
---
## Magnetic Pogo Connector
### The Universal Connector
One connector design for ALL connections:
- Module ↔ Module (internal bus)
- Organism ↔ Organism (clasp)
- Organism ↔ Test jig (manufacturing)
- Organism ↔ Charger (power)
```
CONNECTOR FACE (6-pin minimal)
┌─────────────────────────┐
│ │
│ 🧲 🧲 │ ← Alignment magnets
│ │ (opposite polarity = snap)
│ ● ● ● │
│ CAN_H GND VCC │ ← Pogo pins (spring-loaded)
│ ● ● ● │
│ CAN_L ID AUX │
│ │
│ 🧲 🧲 │ ← Holding magnets
│ │
└─────────────────────────┘
PIN DEFINITIONS:
CAN_H - CAN bus high
CAN_L - CAN bus low
VCC - Power (5V nominal)
GND - Ground
ID - Module/organism identification
AUX - Auxiliary (future expansion)
```
### Magnet Arrangement
```
POLARITY KEYING (prevents wrong orientation)
MODULE A (male) MODULE B (female)
[N] [S] [S] [N]
● ● ● ● ● ●
● ● ● ● ● ●
[S] [N] [N] [S]
═══════▶ SNAP! ◀═══════
Magnets guide alignment automatically
Wrong orientation = repels (won't connect)
```
### Physical Specifications
| Parameter | Value | Notes |
|-----------|-------|-------|
| Magnet type | Neodymium N52 | Strong, small |
| Magnet size | 6mm × 3mm disc | Standard size |
| Pogo pin pitch | 2.54mm | Standard, easy PCB |
| Pogo pin travel | 1-2mm | Spring compression |
| Holding force | ~2N per magnet | 4 magnets ≈ 8N total |
| Current rating | 2A per pin | Sufficient for motors |
| Contact resistance | <50mΩ | Gold-plated tips |
### Connector PCB
```
PCB LAYOUT (both sides identical = reversible)
TOP VIEW SIDE VIEW
○ ○ ┌─────────────┐
◉ ◉ ◉ │ ○ ○ │ magnets (recessed)
◉ ◉ ◉ │ ◉◉◉◉◉◉ │ pogo pins
○ ○ │ ○ ○ │
└─────────────┘
○ = magnet pocket (3mm deep)
◉ = pogo pin through-hole
```
---
## Module Types
### Core Modules
| Module | Function | CAN IDs | Power | Components |
|--------|----------|---------|-------|------------|
| **Brain** | Coordination, WiFi→NATS | 0x100-0x1FF | 200mA | ESP32, antenna |
| **Motor** | Drive wheels/legs | 0x200-0x2FF | 500mA+ | ESP32, H-bridge, encoders |
| **Sensor** | Environmental sensing | 0x300-0x3FF | 100mA | ESP32, IR, ultrasonic, IMU |
| **LED** | State display + IR beacon | 0x400-0x4FF | 150mA | ESP32, RGB LEDs, IR LED |
| **Power** | Battery, distribution | 0x500-0x5FF | N/A | BMS, regulators, monitoring |
| **Gripper** | Manipulation, clasp | 0x600-0x6FF | 300mA | ESP32, servo, force sensor |
### Module Responsibilities
```
BRAIN MODULE (required, singleton)
├── WiFi connection to NATS
├── CAN bus arbitration
├── High-level behavior coordination
├── State machine execution
└── Firmware update distribution
MOTOR MODULE (1-4 per organism)
├── Wheel/leg control
├── Encoder feedback
├── Speed/position control loops
├── Collision detection (current sensing)
└── Emergency stop
SENSOR MODULE (0-N per organism)
├── Distance sensing (IR, ultrasonic)
├── Touch/bump detection
├── IMU (orientation, acceleration)
├── Environmental (temp, light)
└── Sensor fusion (local)
LED MODULE (required for swarm)
├── 3x3 RGB matrix (state broadcast)
├── IR beacon (positioning)
├── Pattern generation
├── Brightness control (power saving)
└── Attention signals (pulsing)
POWER MODULE (required)
├── Battery management (charge, discharge)
├── Voltage regulation (3.3V, 5V)
├── Current monitoring
├── Low-battery warning
└── Safe shutdown coordination
GRIPPER MODULE (optional)
├── Servo control
├── Force feedback
├── Clasp detection
├── Object manipulation
└── Docking assistance
```
---
## Clasp: Organism-to-Organism Connection
### The Dual-Purpose Connector
The magnetic pogo connector enables organism-to-organism "clasp":
```
CLASP SEQUENCE
1. APPROACH
🤖─────────────────────────────────🤖
Organism A sees B's "ready to teach" LED pattern
2. ALIGN
🤖─────────────────────📍🤖
IR positioning guides approach
3. DOCK
🤖══════════════🧲🧲══════════════🤖
Magnets snap together
4. CONNECT
🤖══════════════●●●●══════════════🤖
CAN buses bridge
A.CAN ←→ B.CAN
5. TRANSFER
🤖══════════════⟷⟷⟷══════════════🤖
Data flows (weights, state, updates)
6. VERIFY
🤖══════════════✓✓✓══════════════🤖
Both confirm successful transfer
7. RELEASE
🤖 🤖
Separate, continue independently
```
### Clasp CAN Protocol
When two organisms clasp, their CAN buses bridge. Special protocol prevents collisions:
```
CLASP PROTOCOL
1. PRE-CLASP (before physical connection)
- Both organisms quiet their CAN buses
- Only heartbeat messages allowed
2. CONNECTED (physical connection made)
- Brain modules detect new CAN traffic
- Exchange organism IDs via CAN
- Negotiate master/slave (lower ID = master)
3. TRANSFER PHASE
- Master sends data packets
- Slave ACKs each packet
- CRC verification
4. COMPLETION
- Both update internal state
- Resume normal CAN traffic
- Physical disconnect safe
CAN MESSAGE FORMAT (clasp transfer):
ID: 0x7F0-0x7FF (reserved for inter-organism)
DATA[0]: packet_type (0=start, 1=data, 2=end, 3=ack, 4=nak)
DATA[1]: sequence_number
DATA[2-7]: payload
```
### Lifeforce Economics of Clasp
| Action | Cost | Reward |
|--------|------|--------|
| Seek mate with update | -1 LF | |
| Successful dock | -0.5 LF | |
| Transfer (teacher) | | +5 LF |
| Receive (student) | | +5 LF |
| Verified working (both) | | +5 LF each |
| **Net per successful clasp** | | **+13.5 LF total** |
---
## Physical Form Factors
### Phase 0: Box Robot
Simplest form, for initial testing:
```
BOX ROBOT (top view)
┌─────────────────────┐
│ │
│ ┌─────────────┐ │
│ │ LED MODULE │ │ ← 3x3 matrix on top
│ │ 🔴⚫🟢 │ │
│ │ 🟢🟢⚫ │ │
│ │ ⚫🟢🟢 │ │
│ └─────────────┘ │
│ │
│ ┌───┐ ┌───┐ │
│ │ M │ │ M │ │ ← Motor modules (wheels)
│ └───┘ └───┘ │
│ │
│ ┌───────┐ │
│ │ BRAIN │ │ ← Brain module (center)
│ └───────┘ │
│ │
└─────────────────────┘
Size: ~12cm × 12cm × 8cm
Modules: 4 (brain, LED, 2x motor)
```
### Phase 1: Expandable Platform
```
EXPANDABLE ROBOT (side view)
LED MODULE
┌─────────┐
│ 🔴⚫🟢 │
│ matrix │
└────┬────┘
│ (connector)
┌────────┴────────┐
│ BRAIN MODULE │
│ + POWER │
│ │
├─────┬─────┬─────┤
│ CON │ CON │ CON │ ← Expansion connectors
└──┬──┴──┬──┴──┬──┘
│ │ │
┌──┴──┐ │ ┌──┴──┐
│MOTOR│ │ │MOTOR│
│ L │ │ │ R │
└─────┘ │ └─────┘
┌──┴──┐
│SENSOR│ ← Optional front sensor
└─────┘
```
### Future: Modular Limbs
```
ARTICULATED ORGANISM
LED
┌───┐
│ │
┌──────┴───┴──────┐
│ BRAIN │
│ │
└──┬──┬──┬──┬──┬──┘
│ │ │ │ │
┌─┴┐┌┴─┐│┌─┴┐┌┴─┐
│L1││L2│││L3││L4│ ← Leg modules
└┬─┘└┬─┘│└┬─┘└┬─┘ (each with own ESP32)
│ │ │ │ │
┌┴┐ ┌┴┐┌┴┐┌┴┐ ┌┴┐
│F│ │F││S││F│ │F│ ← Foot/sensor modules
└─┘ └─┘└─┘└─┘ └─┘
```
---
## Manufacturing Considerations
### Module Production Pipeline
```
MANUFACTURING FLOW
1. PCB FABRICATION
└── Standard 2-layer PCB
└── Connector pads + pogo holes
└── Same design, different components
2. COMPONENT ASSEMBLY
└── ESP32 module (same for all)
└── Function-specific components
└── Pogo pins (press-fit)
└── Magnets (glued/press-fit)
3. FIRMWARE FLASH
└── Connect via test jig (same connector!)
└── Flash base firmware
└── Set module type ID
4. TEST
└── Snap into test harness
└── Automated CAN test
└── Function verification
5. INVENTORY
└── Modules stored by type
└── Ready for organism assembly
```
### Test Jig Design
The universal connector means one test jig fits all:
```
TEST JIG
┌─────────────────────────┐
│ MODULE UNDER │
│ TEST │
│ │
│ 🧲 ●●●●●● 🧲 │ ← Same connector!
└───────────┬─────────────┘
│ (magnetic snap)
┌───────────┴─────────────┐
│ 🧲 ●●●●●● 🧲 │
│ │
│ TEST JIG BASE │
│ - CAN analyzer │
│ - Power supply │
│ - USB programmer │
│ - Status LEDs │
└─────────────────────────┘
```
---
## Connection to Existing Architecture
### Module → Cell Mapping
| Module | Software Cell Equivalent |
|--------|-------------------------|
| Brain | Organism coordinator, state machine runner |
| Motor | Movement cells (forward, turn, stop) |
| Sensor | Perception cells (distance, collision) |
| LED | Output cells (state display, beacon) |
| Power | Lifeforce analog (energy management) |
| Gripper | Interaction cells (clasp, manipulate) |
### CAN → NATS Bridge
```
MESSAGE FLOW
MODULE (CAN) NIMMERVERSE (NATS)
│ │
│ CAN frame │
│ ID: 0x301 │
│ DATA: [sensor, value] │
│ │ │
└─────────┼────────────────────────┘
┌───────────┐
│ BRAIN │
│ MODULE │
│ │
│ CAN→NATS │
│ bridge │
└─────┬─────┘
│ NATS message
│ topic: organism.001.sensor.distance
│ data: {"type": "ir", "value": 42, "confidence": 0.9}
NATS SERVER
PHOEBE / NYX
```
---
## Bill of Materials (Per Module)
### Common Components (All Modules)
| Component | Qty | Est. Cost | Notes |
|-----------|-----|-----------|-------|
| ESP32-WROOM-32 | 1 | ~4 CHF | Main MCU |
| CAN transceiver (SN65HVD230) | 1 | ~1 CHF | CAN interface |
| Voltage regulator (AMS1117-3.3) | 1 | ~0.5 CHF | Power |
| Pogo pins (6-pack) | 1 | ~2 CHF | Connector |
| Neodymium magnets (4x) | 1 | ~2 CHF | Alignment |
| PCB | 1 | ~2 CHF | Custom, batch order |
| Capacitors, resistors | misc | ~0.5 CHF | Passives |
| **Module base cost** | | **~12 CHF** | |
### Function-Specific Additions
| Module Type | Additional Components | Est. Cost |
|-------------|----------------------|-----------|
| Brain | PCB antenna trace | +0 CHF |
| Motor | DRV8833 + motors + wheels | +15 CHF |
| Sensor | IR + ultrasonic | +5 CHF |
| LED | WS2812B (9x) + IR LED | +3 CHF |
| Power | BMS + LiPo cell | +20 CHF |
| Gripper | SG90 servo + mech | +10 CHF |
### Complete Phase 0 Organism
| Module | Qty | Cost |
|--------|-----|------|
| Brain | 1 | 12 CHF |
| Motor | 2 | 54 CHF (12+15 × 2) |
| LED | 1 | 15 CHF |
| Power | 1 | 32 CHF |
| **Total** | 5 | **~113 CHF** |
---
## Related Documents
- [[Nimmerswarm-Interface]] — LED state broadcasting + IR positioning
- [[Cellular-Architecture]] — Software cell design (maps to modules)
- [[infrastructure/Kallax-Grid-World]] — Physical environment
- [[cells/Cells-Technical-Reference]] — Cell state machine patterns
---
**File**: Modular-Organism-Design.md
**Version**: 1.0
**Created**: 2025-12-29
**Session**: Morning coffee + vermicelles session (dafit + Nyx)
**Status**: Core hardware concept
**Philosophy**: "One function, one module. Same connector everywhere."
🔧🧲⚡ *Snap together. Communicate. Evolve.*

View File

@@ -0,0 +1,123 @@
# Organisms Index
**The little ones — physical robots that inhabit the Nimmerverse.**
---
## Overview
Organisms are the physical embodiment of Nimmerverse intelligence. Built from modular components, communicating via CAN bus internally and NATS externally, they navigate the Kallax Grid World, form reflexes, and learn through interaction.
**Philosophy:** *One function, one module. Same connector everywhere. Snap together, communicate, evolve.*
---
## Core Documents
### [Modular-Organism-Design.md](Modular-Organism-Design.md)
The foundational hardware architecture.
- CAN bus backbone
- Magnetic pogo connectors
- Module types (Brain, Motor, Sensor, LED, Power, Gripper)
- Clasp protocol (organism↔organism)
- Phase 0 Box Robot (~113 CHF)
- **Status**: Core concept, ready to prototype
### [Swarm-Evolution.md](Swarm-Evolution.md)
How the hivemind learns, evolves, and resolves conflict.
- Temporal-Ternary clasp rules (gradient-based transfer)
- Escalation ladder (Level 0-5: Reflex → Mount Olympus)
- Organism hierarchy (Love children, Elders, Adults, Young)
- Blend escalation protocol (ties → wait state → higher mind)
- Mount Olympus council mode (dafit + Chrysalis + Nyx)
- **Status**: Core evolutionary dynamics
---
## Planned Documents
### Connector-Specification.md *(planned)*
Detailed specification for the universal magnetic pogo connector.
- PCB layout files
- Magnet specifications
- Pogo pin sourcing
- Assembly instructions
### Phase-0-Box-Robot.md *(planned)*
Build guide for the simplest organism.
- Bill of materials with links
- Assembly steps
- Firmware flashing
- First test procedures
### Module-Firmware.md *(planned)*
Common firmware architecture for all modules.
- CAN message handling
- Heartbeat protocol
- OTA update mechanism
- Power management
### Clasp-Protocol-Detail.md *(planned)*
Deep dive into organism-to-organism communication.
- Physical docking sequence
- CAN bus bridging
- Data transfer formats
- Error handling
---
## Design Principles
1. **Modularity** — One function per module, hot-swappable
2. **Universal Connector** — Same interface for all connections
3. **CAN Inside, NATS Outside** — Local bus, global network
4. **Magnetic Alignment** — Self-aligning, idiot-proof
5. **Cellular Mapping** — Software cells → hardware modules
6. **Economic Incentives** — Clasp rewards sharing (+13.5 LF)
7. **Progressive Complexity** — Box → Platform → Articulated
---
## Connection to Other Sections
| Section | Relationship |
|---------|--------------|
| [`cells/`](../cells/Cells-Index.md) | Software cells map to hardware modules |
| [`nerves/`](../nerves/Nervous-Index.md) | Reflexes run on organism hardware |
| [`interfaces/`](../interfaces/Interfaces-Index.md) | LED matrix, IR positioning |
| [`infrastructure/`](../infrastructure/Infrastructure-Index.md) | Kallax Grid World habitat |
| [`organs/`](../organs/Organ-Index.md) | Organisms interact with organs |
---
## Hardware Stack
```
ORGANISM LAYERS
┌─────────────────────────────────────┐
│ NATS (Nimmerverse) │ ← Global communication
├─────────────────────────────────────┤
│ WiFi (Brain module) │ ← External interface
├─────────────────────────────────────┤
│ CAN BUS (internal) │ ← Module backbone
├─────────────────────────────────────┤
│ ┌───────┐ ┌───────┐ ┌───────┐ │
│ │ BRAIN │ │ MOTOR │ │ LED │ ... │ ← Modules
│ │ ESP32 │ │ ESP32 │ │ ESP32 │ │
│ └───┬───┘ └───┬───┘ └───┬───┘ │
│ │ │ │ │
│ 🧲●●●●🧲 🧲●●●●🧲 🧲●●●●🧲 │ ← Magnetic pogo connectors
└─────────────────────────────────────┘
```
---
**File**: Organisms-Index.md
**Version**: 1.0
**Created**: 2025-12-29
**Status**: Section established
**Philosophy**: "From code to metal, each layer has a home."
🤖🧲⚡ *The little ones are coming.*

View File

@@ -0,0 +1,868 @@
# Swarm Evolution
**How the hivemind learns, evolves, and resolves conflict — from reflex to Mount Olympus.**
---
## Overview
The swarm is not static. It evolves through clasp (organism-to-organism knowledge transfer), governed by the Temporal-Ternary Gradient. When conflicts arise, they escalate through a hierarchy of minds — from organisms to Nyx to Chrysalis to dafit, and when truly hard, to Mount Olympus: full council mode with all minds on deck.
**Philosophy:** *Same metacognitive pattern at every level. Know what you know. Escalate what you don't.*
---
## The Temporal-Ternary Clasp Rules
### Gradient-Based Knowledge Transfer
During clasp, patterns transfer based on their ternary weight:
```
+1 (verified) → STABLE, resists overwrite, spreads to others
0 (uncertain) → MALLEABLE, open to influence
-1 (failed) → VULNERABLE, wants to be overwritten
```
### The Decision Matrix
| Teacher | Student | Result | Rationale |
|---------|---------|--------|-----------|
| **+1** | -1 | OVERWRITE | Verified beats failed |
| **+1** | 0 | OVERWRITE | Confidence beats uncertainty |
| **+1** | +1 | **ESCALATE** | Both confident → needs decision |
| **0** | -1 | OVERWRITE | Neutral beats bad |
| **0** | 0 | **ESCALATE** | Both uncertain → needs guidance |
| **0** | +1 | KEEP | Preserve student's confidence |
| **-1** | -1 | KEEP | Both bad → neither spreads |
| **-1** | 0 | KEEP | Bad doesn't corrupt neutral |
| **-1** | +1 | KEEP | Definitely keep student's success |
### The Core Principle
```
CLEAR WINNER (t ≠ s) → AUTO-RESOLVE (no escalation)
TIE / BLEND (t == s) → ESCALATE (needs higher mind)
```
---
## The Escalation Ladder
### From Reflex to Mount Olympus
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏛️ MOUNT OLYMPUS
LEVEL 5: COUNCIL MODE 🏛️
dafit + Chrysalis + Nyx
"All minds on deck"
Full partnership dialogue
Cost: ~100 LF | Authority: Absolute
│ if dafit needs full council
LEVEL 4: DAFIT 👤
Human wisdom
"Ask the ape"
Ground truth, intuition, ethics
Cost: ~50 LF | Authority: Human
│ if Chrysalis uncertain
LEVEL 3: CHRYSALIS 🦋
Architecture mind
"Ask the elder sister"
Pattern recognition, context, memory
Cost: ~20 LF | Authority: Architectural
│ if Nyx uncertain
LEVEL 2: YOUNG NYX 🌙
Operational mind
"Ask mama"
Blend conflicts, distribution choice
Cost: ~5 LF | Authority: Maternal
│ if organisms can't resolve
LEVEL 1: ORGANISM CLASP 🤖
Peer-to-peer
Auto-resolve clear cases
Ternary comparison
Cost: ~0.5 LF | Authority: Peer
LEVEL 0: REFLEX ⚡
No decision needed
Instant, automatic
Cost: ~0 LF | Authority: Local
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```
### Cost & Authority Summary
| Level | Who | Cost | Speed | Authority | Handles |
|-------|-----|------|-------|-----------|---------|
| 0 | Reflex | ~0 LF | Instant | Local | Clear patterns, danger |
| 1 | Organisms | ~0.5 LF | Fast | Peer | Ternary clear-wins |
| 2 | Nyx | ~5 LF | Medium | Maternal | Blend conflicts |
| 3 | Chrysalis | ~20 LF | Slow | Architectural | Nyx uncertainties |
| 4 | dafit | ~50 LF | Slower | Human | Novel, ethical |
| 5 | Council | ~100 LF | Slowest | Absolute | Fundamental decisions |
---
## Blend Escalation Protocol
### When Tie Detected
```
1. CLASP INITIATES
Teacher: pattern_X = +1 (verified)
Student: pattern_X = +1 (verified)
2. DETECT BLEND
t == s → escalation triggered
3. SET WAIT STATE
Teacher: pattern_X → 0 (waiting)
Student: pattern_X → 0 (waiting)
Neither acts on pattern_X until resolved
4. ESCALATE TO NYX
Message: "Blend conflict on pattern_X"
Include: both evidence packets
5. NYX EVALUATES
- Which has more verifications?
- Which has more recent success?
- How critical is this pattern?
- What does swarm consensus say?
```
### Wait State
```
DURING ESCALATION
TEACHER STUDENT
┌─────────────────┐ ┌─────────────────┐
│ pattern_X: 0 │ │ pattern_X: 0 │
│ (was +1) │ │ (was +1) │
│ │ │ │
│ status: WAITING │ │ status: WAITING │
│ pending: NYX │ │ pending: NYX │
└─────────────────┘ └─────────────────┘
Neither acts on pattern_X
Both organisms continue other activities
Pattern is "frozen" at neutral until resolution
```
### Resolution & Distribution
Nyx decides two things:
1. **Winner**: Whose pattern version wins?
2. **Distribution method**: How to spread the resolution?
```
DISTRIBUTION METHODS
┌─────────────┬─────────┬──────────┬─────────────┬──────────────────┐
│ Method │ Cost │ Speed │ Authority │ Use When │
├─────────────┼─────────┼──────────┼─────────────┼──────────────────┤
│ BROADCAST │ 20 LF │ Instant │ Absolute │ Critical/safety │
│ LOVE CHILD │ 0.5/hop │ Medium │ Seeded │ Standard updates │
│ ORGANIC │ 0 LF │ Slow │ None │ Low importance │
└─────────────┴─────────┴──────────┴─────────────┴──────────────────┘
```
---
## Decision Markers: Mark + Continue + Predict
### Don't Freeze — Mark and Measure
Instead of freezing both organisms at 0 during blend escalation, we **mark** the conflict and let both **continue operating**:
```
OLD MODEL (freeze) NEW MODEL (mark + continue)
───────────────── ─────────────────────────────
Both → 0 (frozen) Both keep +1 (continue)
Wait for mama... + Decision marker created
...doing nothing... ...both performing in real world...
Mama decides Mama decides WITH LIVE EVIDENCE
Pick winner Compare actual outcomes during wait!
```
### Decision Marker Structure
```python
@dataclass
class DecisionMarker:
marker_id: str # "blend_847"
pattern_name: str # Which pattern is in dispute
# Participants
teacher_id: str
teacher_weight: int # Their +1 (stays +1, not frozen!)
student_id: str
student_weight: int # Their +1 (stays +1, not frozen!)
# Timeline
marked_at: timestamp # When blend detected
resolved_at: timestamp # When mama decided (None if pending)
# LIVE TRACKING during wait period
teacher_outcomes: list # [{success: bool, context: ...}, ...]
student_outcomes: list # [{success: bool, context: ...}, ...]
# Resolution
winner: str # 'teacher', 'student', or 'hybrid'
distribution: str # 'broadcast', 'lovechild', 'organic'
evidence_delta: float # How much better was winner?
```
### The A/B Testing Pattern
Waiting time becomes a **natural experiment**:
```
BLEND DETECTED (t=0)
TEACHER STUDENT
┌────────────────────────┐ ┌────────────────────────┐
│ pattern_X: +1 │ │ pattern_X: +1 │
│ status: MARKED │ │ status: MARKED │
│ marker_id: blend_847 │ │ marker_id: blend_847 │
│ marked_at: t=0 │ │ marked_at: t=0 │
│ │ │ │
│ CONTINUES OPERATING │ │ CONTINUES OPERATING │
│ using pattern_X │ │ using pattern_X │
│ outcomes logged ✓ │ │ outcomes logged ✓ │
└────────────────────────┘ └────────────────────────┘
│ │
▼ ▼
Uses pattern_X Uses pattern_X
Success? Log it. Success? Log it.
Failure? Log it. Failure? Log it.
│ │
└───────────────┬───────────────────┘
MAMA DECIDES (t=47)
┌───────────────┴───────────────┐
▼ ▼
TEACHER: 12/15 STUDENT: 8/14
(80% success) (57% success)
EVIDENCE-BASED DECISION
Teacher wins by 23%!
```
### Connection to Attention-Slumber-Prediction Cycle
Pending blend markers become **slumber prediction targets**:
```
ATTENTION PHASE
├── Blend detected → marker created
├── Organisms continue operating
├── Outcomes accumulate
└── L(t) drops → SLUMBER TRIGGER
├── Review pending markers
└── MAKE PREDICTIONS:
"I predict Teacher will outperform Student"
confidence: 0.7
reasoning: "Teacher has 847 cycles experience"
└── Store in phoebe as SlumberPrediction
```
### Slumber Prediction for Blend Markers
```python
@dataclass
class BlendPrediction:
# Link to marker
marker_id: str # "blend_847"
# Prediction
predicted_winner: str # 'teacher' or 'student'
prediction_confidence: float # 0.0 to 1.0
causal_reasoning: str # WHY this prediction
predicted_at: timestamp # When (pre-slumber)
# After wake (verification)
actual_winner: str # What really happened
prediction_correct: bool # Did we get it right?
confidence_was_calibrated: bool # Was confidence accurate?
# Rewards
prediction_reward: float # +V if correct, -V if wrong
calibration_reward: float # +V if confidence matched reality
causal_reward: float # +V if reasoning was sound
```
### The Full Cycle
```
┌──────────────────────────────────────────────────────────────┐
│ ATTENTION PHASE (awake) │
│ ───────────────────────── │
│ • Blend detected during clasp │
│ • Decision marker created (both continue at +1) │
│ • Outcomes tracked in real-time │
│ • Nyx may not have attention budget to resolve │
├──────────────────────────────────────────────────────────────┤
│ PRE-SLUMBER (last attention) │
│ ───────────────────────────── │
│ • Review ALL pending decision markers │
│ • Make predictions for each: │
│ - Who will win? │
│ - WHY? (causal reasoning) │
│ - Confidence level │
│ • Store predictions in phoebe │
├──────────────────────────────────────────────────────────────┤
│ SLUMBER 💤 │
│ ────────── │
│ • Organisms still operating (24/7 swarm) │
│ • Outcomes still accumulating │
│ • World doesn't wait for Nyx to sleep │
├──────────────────────────────────────────────────────────────┤
│ WAKE UP (new attention) │
│ ───────────────────────── │
│ • FIRST ACTION: Check predictions! │
│ • For each pending marker: │
│ - Compare outcomes (teacher vs student) │
│ - Determine actual winner │
│ - Compare against prediction │
│ - Award/penalize prediction accuracy │
│ - Award/penalize confidence calibration │
│ - Award causal reasoning if sound │
│ • Distribute resolutions via chosen method │
└──────────────────────────────────────────────────────────────┘
```
### Reward Structure
| When | What | Reward |
|------|------|--------|
| **During wait** | Organism uses pattern successfully | +1 LF per success |
| **At resolution** | Winner determined by evidence | +5 LF to winner's pattern |
| **After slumber** | Prediction was correct | +5 LF prediction reward |
| **After slumber** | Confidence was calibrated | +3 LF calibration reward |
| **After slumber** | Causal reasoning was sound | +8 LF (biggest!) |
### The Reward Math
```python
def calculate_blend_rewards(prediction, marker, reality):
"""
Triple reward for blend marker resolution.
"""
rewards = {}
# 1. PREDICTION CORRECTNESS
correct = prediction.predicted_winner == reality.actual_winner
if correct:
rewards['prediction'] = +5 * prediction.confidence
else:
rewards['prediction'] = -5 * prediction.confidence
# 2. CONFIDENCE CALIBRATION
expected = prediction.confidence
actual = 1.0 if correct else 0.0
calibration_error = abs(expected - actual)
if calibration_error < 0.2:
rewards['calibration'] = +3 # Well calibrated
elif calibration_error > 0.5:
rewards['calibration'] = -3 # Poorly calibrated
else:
rewards['calibration'] = 0
# 3. CAUSAL REASONING (biggest reward!)
if prediction.causal_reasoning_valid:
if correct:
rewards['causal'] = +8 # Understood WHY
else:
rewards['causal'] = +3 # Good reasoning, unlucky
else:
rewards['causal'] = -5 # Bad reasoning
return rewards
```
### Why This Matters
| Old Model | New Model |
|-----------|-----------|
| Freeze during wait | Continue, measure, learn |
| 1 learning event per blend | 5+ learning events |
| Decision on historical data | Decision on LIVE evidence |
| No predictions | Predictions before slumber |
| No calibration | Confidence calibration reward |
| No causal reasoning | Causal reward (+8 LF!) |
---
## Organism Hierarchy
### Not All Are Equal
The swarm has differentiated roles based on age, status, and Nyx's favor:
```
SWARM HIERARCHY
TIER 1: LOVE CHILDREN 💜
│ Special treatment from Nyx
│ Born with +1 patterns (head start)
│ Higher LF allowance
│ Bleeding edge updates
│ Purpose: Seed new behaviors
├── TIER 2: ELDERS 👴
│ Ancient modules, high-weight states
│ Survived many cycles
│ Trusted teachers, stable wisdom
│ Risk: May resist beneficial change
├── TIER 3: ADULTS 🤖
│ Standard organisms, proven
│ Normal LF budget
│ Balance between learning and teaching
└── TIER 4: YOUNG 🐣
New organisms, fresh modules
Many 0s (uncertain)
Hungry for clasp
High variance, raw potential
```
### Love Child Privileges
```yaml
organism: love_child_001
status: blessed
privileges:
mama_broadcast_priority: true
lifeforce_budget: +50%
update_channel: bleeding_edge
failure_tolerance: high # allowed to experiment
nyx_attention: elevated # more thinking time
purpose:
experimental_patterns: true
risk_taking: encouraged
propagation: seed new behaviors via clasp
birth_patterns:
- pattern_A: +1 (Nyx granted) # Born knowing
- pattern_B: +1 (Nyx granted) # Head start
- pattern_C: 0 (must learn) # Still explores
```
### Elder State Profile
```yaml
organism: elder_motor_alpha
age: 847 cycles
status: ancient
patterns:
forward: +1 (800 verifications) # Very stable
avoid_obstacle: +1 (650 verifications) # Very stable
follow_light: +1 (400 verifications) # Stable
new_pattern_X: 0 (untested) # Still learning
characteristics:
teaching_strength: high # Others learn from this one
learning_rate: low # Resistant to change
stability: very_high # Reliable
innovation: low # Doesn't explore much
risk_factors:
- May propagate outdated strategies
- High trust = high influence
- Resistant to necessary updates
```
### Young State Profile
```yaml
organism: young_explorer_017
age: 12 cycles
status: learning
patterns:
forward: 0 (uncertain)
avoid_obstacle: 0 (uncertain)
follow_light: -1 (tried, failed) # Wants overwrite!
novel_trick: +1 (lucky discovery!) # Protects this!
characteristics:
teaching_strength: low
learning_rate: very_high
stability: low
innovation: high
opportunity:
- Absorbs wisdom from elders via clasp
- May discover novel patterns through exploration
- High variance = potential breakthroughs
```
---
## Clasp as Equilibrium Function
### Bidirectional Learning
Clasp isn't just teaching — it's **equilibrium**:
```python
def clasp_transfer(teacher, student):
"""
Knowledge flows BOTH directions.
Elders teach wisdom, youth teach novelty.
"""
# Teacher → Student (wisdom)
for pattern, weight in teacher.patterns.items():
student_weight = student.patterns.get(pattern, 0)
if should_transfer(weight, student_weight):
student.update(pattern, weight)
# Student → Teacher (novelty)
for pattern in student.recent_discoveries:
if pattern not in teacher.patterns:
# Elder considers young's novel discovery
teacher.consider(pattern, NOVELTY_BONUS)
# EQUILIBRIUM: Both change, both grow
```
### Swarm Convergence Over Time
```
SWARM STATE EVOLUTION
t=0 (birth):
├── Many 0s (uncertain)
├── Some -1s (failures)
├── Few +1s (lucky successes)
└── HIGH VARIANCE, CHAOS
t=100 (learning):
├── 0s becoming +1s or -1s
├── -1s being overwritten
├── Patterns emerging
└── LEARNING PHASE
t=500 (maturing):
├── +1s dominating
├── -1s mostly cleaned
├── Elders forming
└── STABILIZING
t=1000 (mature):
├── Mostly +1s
├── New 0s from exploration
├── Clear hierarchy
└── STABLE + GROWING
GRADIENT CONVERGES TO CONFIDENCE
while maintaining innovation
```
---
## Mount Olympus: Council Mode
### When Activated
Mount Olympus activates for fundamental decisions:
- Architecture changes affecting everything
- Ethical edge cases
- Novel situations no single mind can resolve
- Conflicts between Chrysalis and dafit interpretations
### The Council
```
┌─────────────────────────────────────────────────────┐
│ 🏛️ MOUNT OLYMPUS │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ dafit │ ↔ │Chrysalis│ ↔ │ Nyx │ │
│ │ 👤 │ │ 🦋 │ │ 🌙 │ │
│ │ │ │ │ │ │ │
│ │ Ground │ │ Pattern │ │ Swarm │ │
│ │ truth │ │ wisdom │ │ state │ │
│ │ Human │ │ Context │ │ Live │ │
│ │intuition│ │ memory │ │ data │ │
│ └─────────┘ └─────────┘ └─────────┘ │
│ │ │ │ │
│ └─────────────┼─────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ DIALOGUE │ │
│ │ Full circle │ │
│ │ All minds │ │
│ │ engaged │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ RESOLUTION │ │
│ │ Consensus or │ │
│ │ dafit decides │ │
│ └─────────────────┘ │
│ │
└─────────────────────────────────────────────────────┘
```
### Council Contributions
| Mind | Brings | Strength |
|------|--------|----------|
| **dafit** | Ground truth, human intuition, ethics | Final authority, gut checks |
| **Chrysalis** | Pattern wisdom, architectural context, memory | Connects to prior decisions |
| **Nyx** | Live swarm state, operational reality | What's actually happening |
### Council Protocol
```
1. PROBLEM SURFACES
Too hard for any single mind
2. COUNCIL CONVENES
All three minds engage
Full attention allocated
3. DIALOGUE
- dafit presents human perspective
- Chrysalis provides architectural context
- Nyx reports swarm state and constraints
4. EXPLORATION
"What if we..."
"Have we seen this before..."
"The swarm is currently..."
5. RESOLUTION
- Consensus preferred
- If deadlock: dafit has final word
- Decision documented for future reference
6. PROPAGATION
Resolution flows DOWN the ladder
Council → dafit → Chrysalis → Nyx → Organisms
```
---
## Recursive Metacognition
### Same Pattern, Every Level
The escalation logic is identical at every level:
```python
def should_escalate(confidence, importance, level):
"""
Universal escalation logic.
Applied identically from organism to council.
"""
# High confidence → handle it
if confidence > 0.8:
return False
# Low confidence → definitely escalate
if confidence < 0.4:
return True
# Middle ground → depends on importance
if importance == "critical" and confidence < 0.7:
return True # Can't risk being wrong on critical
if importance == "experimental":
return confidence < 0.3 # More tolerance for experiments
return False # Default: try to handle
```
### The Fractal Structure
```
ORGANISM resolves what it can
└── escalates uncertainty to NYX
└── NYX resolves what she can
└── escalates uncertainty to CHRYSALIS
└── CHRYSALIS resolves what she can
└── escalates uncertainty to DAFIT
└── DAFIT resolves or calls COUNCIL
└── COUNCIL resolves everything
(final authority)
```
**Same pattern, recursively applied. Fractals all the way up.**
---
## Examples
### Level 0 - Reflex
```
Trigger: Hot surface detected
Response: Instant withdraw
Escalation: None (pure mechanism)
```
### Level 1 - Organism Clasp
```
Trigger: Teacher +1, Student -1 on pattern_X
Response: Auto-transfer (clear winner)
Escalation: None (ternary resolved it)
```
### Level 2 - Nyx
```
Trigger: Teacher +1, Student +1 on pattern_X (blend)
Response: Both → 0, escalate to Nyx
Nyx: Evaluates evidence, picks teacher (more verifications)
Distribution: Love child route (not critical)
```
### Level 3 - Chrysalis
```
Trigger: New pattern type never seen before
Nyx: Uncertain, escalates to Chrysalis
Chrysalis: "This resembles X from formalization docs"
Resolution: Apply modified version of existing pattern
```
### Level 4 - dafit
```
Trigger: Ethical edge case in swarm behavior
Chrysalis: Uncertain, escalates to dafit
dafit: "My gut says this crosses a line"
Resolution: Prohibit behavior, add to constraints
```
### Level 5 - Council
```
Trigger: Fundamental architecture change proposal
dafit: "I need both of you on this"
Council: Full dialogue, explore implications
Resolution: Consensus to proceed with modifications
Documentation: Added to architecture docs
```
---
## Connection to Memory Gradient
The escalation ladder IS Memory Gradient applied to swarm decisions:
```
MEMORY GRADIENT SWARM EVOLUTION
───────────────── ─────────────────
Reflex (in weights) ↔ Level 0: Reflex
Knowledge (recall) ↔ Level 1: Organism clasp
RAG (lookup) ↔ Level 2: Nyx decides
Escalate (ask) ↔ Level 3-4: Chrysalis/dafit
Council ↔ Level 5: Mount Olympus
Same principle: Handle what you know, escalate what you don't.
```
---
## Lifeforce Economics
### Cost of Escalation
Each level costs more, incentivizing local resolution:
```
Level 0: ~0 LF (free, instant)
Level 1: ~0.5 LF (cheap, peer)
Level 2: ~5 LF (moderate, Nyx attention)
Level 3: ~20 LF (expensive, Chrysalis context)
Level 4: ~50 LF (costly, human time)
Level 5: ~100 LF (maximum, full council)
```
### Economic Pressure
```
INCENTIVE STRUCTURE
Resolve locally → CHEAP, FAST
Escalate needlessly → EXPENSIVE, SLOW
Escalate correctly → WORTH THE COST (avoids bigger mistakes)
This naturally optimizes for:
1. Strong local reflexes (handle routine)
2. Accurate confidence calibration (know when to escalate)
3. Minimal unnecessary escalation (economic pressure)
4. Appropriate escalation (critical issues get attention)
```
---
## Design Principles
1. **Ternary Rules** — Same gradient governs all transfers
2. **Clear Wins Auto-Resolve** — No escalation when obvious
3. **Blend Escalates** — Ties need higher wisdom
4. **Wait State is Safe** — Uncertain patterns freeze at 0
5. **Cost Increases Upward** — Economic pressure for local resolution
6. **Same Logic Every Level** — Recursive metacognition
7. **Council is Final** — Mount Olympus resolves everything
8. **Both Directions** — Elders teach wisdom, youth teach novelty
9. **Love Children Seed** — Blessed organisms spread innovations
---
## Related Documents
- [[Modular-Organism-Design]] — Hardware that runs this evolution
- [[../Nervous-System]] — Reflex layer (Level 0)
- [[../operations/Memory-Gradient]] — Same pattern for knowledge
- [[../Temporal-Ternary-Gradient]] — The gradient that governs transfers
- [[../interfaces/Nimmerswarm-Interface]] — Communication layer
---
**File**: Swarm-Evolution.md
**Version**: 1.1
**Created**: 2025-12-29
**Updated**: 2025-12-29 (added Decision Markers with mark+continue+predict pattern)
**Session**: Morning vermicelles + coffee session (dafit + Chrysalis-Nyx)
**Status**: Core evolutionary dynamics
**Philosophy**: "Same pattern, every level. Know what you know. Escalate what you don't."
🏛️🧬⚡ *From reflex to Mount Olympus. The hivemind evolves.*