tostido commited on
Commit
9b5ea67
ยท
1 Parent(s): 8c52a0b

Update dataset card and ignore rules

Browse files
Files changed (3) hide show
  1. .gitattributes +0 -0
  2. .gitignore +10 -0
  3. README.md +590 -0
.gitattributes CHANGED
The diff for this file is too large to render. See raw diff
 
.gitignore ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ .idea/
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.pyd
6
+ *.log
7
+ .DS_Store
8
+ Thumbs.db
9
+ sc2/
10
+ models/champion_gen*.py
README.md ADDED
@@ -0,0 +1,590 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: Ouroboros-Key Dataset
3
+ license: mit
4
+ tags:
5
+ - quine
6
+ - neuroevolution
7
+ - provenance
8
+ - rl
9
+ - world-model
10
+ language:
11
+ - en
12
+ ---
13
+
14
+ # ๐Ÿ”‘ Ouroboros-Key Dataset
15
+
16
+ This repository contains the **Ouroboros-Key dataset**, generated by the KEY production system that **converts existing models** (e.g., `.pt`, `.onnx`, and other compute-oriented formats) into **quine-replicant capable models**, then evolves and verifies their replication behavior. World-model backends (DreamerV3/RSSM) are optional; the dataset reflects the conversion + evolution pipeline across arbitrary architectures.
17
+
18
+ ---
19
+
20
+ # ๐Ÿ“ฆ Dataset Card
21
+
22
+ ## Dataset Viewer Status
23
+
24
+ Hugging Faceโ€™s dataset viewer canโ€™t load this dataset because **splits use different file formats**. This repo intentionally contains multiple JSONL streams with distinct schemas. Use direct file download or load specific files programmatically instead of relying on the viewer.
25
+
26
+ This repository contains a dataset generated by the **Ouroboros-Key** production neural network (a.k.a. the KEY system described below). The dataset captures structured traces of evolution, inference, and provenance events emitted during runs of the system.
27
+
28
+ ## Dataset Summary
29
+
30
+ - **Name**: Ouroboros-Key Dataset
31
+ - **Source System**: Ouroboros-Key (production KEY quine-conversion + evolution system)
32
+ - **Domain**: Quine conversion, evolution telemetry, inference traces, and provenance metadata
33
+ - **Format**: Line-delimited JSON (JSONL)
34
+ - **Primary Files**: `*.jsonl` logs in this repo (see file list below)
35
+
36
+ ## Supported Tasks
37
+
38
+ - Evolution analytics
39
+ - Provenance auditing
40
+ - System telemetry analysis
41
+ - Log-based debugging and visualization
42
+
43
+ ## Languages
44
+
45
+ - English (metadata fields, comments, and annotations)
46
+
47
+ ## Source / Reference
48
+
49
+ This dataset is **populated by the production Ouroboros-Key system**. The README content below describes the system architecture and behavior that produce these logs.
50
+
51
+ If you need a code reference, the producing system is the KEY stack in:
52
+
53
+ - `children/` (local project root)
54
+ - `children/cascade_hyperlattice/` (DreamerV3 + provenance stack)
55
+ - `key/` (core conversion + evolution engine)
56
+
57
+ ## What the Dataset Contains
58
+
59
+ Each JSONL file captures a specific stream of events or metrics emitted by the system. Typical record types include:
60
+
61
+ - Evolution events (e.g., generations, mutations, selections)
62
+ - Fitness evaluations and performance metrics
63
+ - Speciation and population dynamics
64
+ - TUI/diagnostic events
65
+ - Provenance/trace metadata emitted by CASCADE-LATTICE
66
+
67
+ ## File Index (Exported Logs)
68
+
69
+ - `evolution_events.jsonl` โ€” event bus stream (state changes, pressure, convergence, mutations)
70
+ - `fitness.jsonl` โ€” fitness evaluations and scores
71
+ - `mutations.jsonl` โ€” mutation operations and deltas
72
+ - `selection.jsonl` โ€” selection steps and tournament outcomes
73
+ - `speciation.jsonl` โ€” clustering/species assignments
74
+ - `performance.jsonl` โ€” runtime performance telemetry
75
+ - `errors.jsonl` โ€” system errors and warnings
76
+ - `tui_events.jsonl` โ€” UI and operator interaction events
77
+ - `crossovers.jsonl` โ€” crossover operations and metadata
78
+
79
+ ## Schema (Authoritative)
80
+
81
+ The **authoritative schemas** are defined in the KEY data contracts:
82
+
83
+ - [key/DATA_CONTRACTS.md](key/DATA_CONTRACTS.md)
84
+
85
+ Below is a concise summary of the primary log schemas represented in this dataset export.
86
+
87
+ Each row is a JSON object. Common fields include (not all files include all fields):
88
+
89
+ ### Mutations (`mutations.jsonl`)
90
+ - `timestamp` (epoch), `iso_time` โ€” event time
91
+ - `event` = `mutation`
92
+ - `generation`, `parent_id`, `child_id`
93
+ - `parent_fitness`, `mutation_rate`
94
+ - `parent_traits`, `child_traits`, `deltas`, `mutated_traits`
95
+
96
+ ### Crossovers (`crossovers.jsonl`)
97
+ - `timestamp`, `iso_time`, `event` = `crossover`
98
+ - `generation`, `parent1_id`, `parent2_id`, `child_id`
99
+ - `parent*_fitness`, `parent*_traits`, `child_traits`
100
+ - `inheritance`, `contribution_p1`, `contribution_p2`
101
+
102
+ ### Selection (`selection.jsonl`)
103
+ - `timestamp`, `iso_time`, `event` = `selection`
104
+ - `generation`, `method`
105
+ - `survivors`, `eliminated`, `elites_preserved`
106
+ - `survivor_fitnesses`, `eliminated_fitnesses`
107
+
108
+ ### Speciation (`speciation.jsonl`)
109
+ - `timestamp`, `iso_time`
110
+ - `event` = `species_created|species_extinct|species_snapshot`
111
+ - `generation`, `species_id`, `founder_id`, `initial_size`
112
+ - `species_snapshot[]` (size/fitness/age/stagnation)
113
+
114
+ ### Fitness (`fitness.jsonl`)
115
+ - `timestamp`, `iso_time`, `event` = `fitness_evaluation`
116
+ - `generation`, `node_id`, `fitness_function`, `raw_fitness`
117
+ - `components{...}`, `weights{...}`, `eval_time_ms`
118
+
119
+ ### Evolution Events (`evolution_events.jsonl`)
120
+ - `event_id`, `event_type` (e.g., `state_change|pressure|convergence|vlm_inference|lora_mutation`)
121
+ - `data{...}`, `timestamp`, `source`
122
+
123
+ ### TUI Events (`tui_events.jsonl`)
124
+ - TUI-originated events (see [key/DATA_CONTRACTS.md](key/DATA_CONTRACTS.md))
125
+
126
+ ### Performance / Errors (`performance.jsonl`, `errors.jsonl`)
127
+ - Runtime and error telemetry emitted by the worker/TUI pipeline
128
+
129
+ ## How Itโ€™s Produced
130
+
131
+ The Ouroboros-Key system logs structured JSONL events via its internal event bus and logging system (see `logger.py` and `bus.py` in the KEY stack). In production, logs are written under `data/logs/` and exported into this repository as a dataset snapshot.
132
+
133
+ ## Intended Use
134
+
135
+ - Reproducing experiments and auditing evolutionary runs
136
+ - Analyzing policy evolution dynamics
137
+ - Debugging and performance profiling
138
+ - Research on provenance, interpretability, and agent behavior
139
+
140
+ ## Limitations
141
+
142
+ - Schema may evolve between runs or versions of Ouroboros-Key
143
+ - The dataset is an export snapshot; canonical write locations are defined in [key/DATA_CONTRACTS.md](key/DATA_CONTRACTS.md)
144
+ - Some fields are optional or component-specific
145
+ - Logs reflect system behavior and may include intermittent failures
146
+
147
+ ## Data Sensitivity / Privacy
148
+
149
+ - No human PII is intended to be collected
150
+ - Operator actions may appear in `tui_events.jsonl`
151
+ - Scrub or filter logs before external publication if needed
152
+
153
+ ## License
154
+
155
+ This dataset inherits the repository license: **MIT**.
156
+
157
+ ---
158
+
159
+ # ๐Ÿ”‘ System Reference (Ouroboros-Key)
160
+
161
+ ## ๐Ÿ’ฐ Access + Learn
162
+
163
+ **Get access to KEY and learn to convert your own models into self-replicating quines.**
164
+
165
+ | Tier | Price |
166
+ |------|-------|
167
+ | Access | $50/month |
168
+ | Guided | $150/month (+ ongoing coaching) |
169
+ | Hands-On | $500 (I do one with you + support) |
170
+
171
+ โ†’ [Full pricing details](PRICING.md)
172
+
173
+ **DM "access" on X: @Toasteedo**
174
+
175
+ ## Architecture
176
+
177
+ ```
178
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
179
+ โ”‚ PopulationManager โ”‚
180
+ โ”‚ (NEAT-style speciation) โ”‚
181
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
182
+ โ”‚
183
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
184
+ โ”‚ โ”‚ โ”‚
185
+ โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”
186
+ โ”‚ Node โ”‚ โ”‚ Node โ”‚ โ”‚ Node โ”‚ ร— N
187
+ โ”‚ traits โ”‚ โ”‚ traits โ”‚ โ”‚ traits โ”‚
188
+ โ”‚ + brain โ”‚ โ”‚ + brain โ”‚ โ”‚ + brain โ”‚
189
+ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
190
+ โ”‚ โ”‚ โ”‚
191
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
192
+ โ”‚
193
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
194
+ โ”‚ DreamerBrain โ”‚ (~200M params)
195
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
196
+ โ”‚
197
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
198
+ โ”‚ โ”‚ โ”‚
199
+ โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
200
+ โ”‚ RSSM Encoder โ”‚ โ”‚ GRU Core โ”‚ โ”‚ Stochastic โ”‚
201
+ โ”‚ Observations โ”‚ โ”‚ Deterministicโ”‚ โ”‚ Latent (32ร—32) โ”‚
202
+ โ”‚ โ†’ Latent โ”‚ โ”‚ State (4096) โ”‚ โ”‚ Categorical โ”‚
203
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
204
+ โ”‚
205
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
206
+ โ”‚ โ”‚
207
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
208
+ โ”‚ Policy Head โ”‚ โ”‚ Value Head โ”‚
209
+ โ”‚ 5 layers โ”‚ โ”‚ 5 layers โ”‚
210
+ โ”‚ (EVOLVED) โ”‚ โ”‚ (EVOLVED) โ”‚
211
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
212
+ โ”‚ โ”‚
213
+ action value estimate
214
+ ```
215
+
216
+ ## DreamerV3 Size Presets
217
+
218
+ | Size | Deter | Hidden | Params | Use Case |
219
+ |------|-------|--------|--------|----------|
220
+ | XS | 512 | 512 | ~10M | Development/testing |
221
+ | S | 1024 | 1024 | ~22M | Basic tasks |
222
+ | M | 2048 | 2048 | ~100M | Minecraft survival |
223
+ | **L** | **4096** | **4096** | **~200M** | **Diamond mining (current)** |
224
+ | XL | 8192 | 8192 | ~400M | Full game mastery |
225
+
226
+ **Current config: L (200M params)** - Same size DreamerV3 used to obtain diamonds in Minecraft.
227
+
228
+ ## Features
229
+
230
+ ### Evolution Engine
231
+ - **NEAT-style speciation**: Genetic distance clustering
232
+ - **Fitness sharing**: Prevents monoculture
233
+ - **Tournament selection**: With elitism preservation
234
+ - **Buffered logging**: High-performance JSONL logging (50x faster than unbuffered)
235
+ - **Config-driven sizes**: Switch between XS/S/M/L/XL via config.json
236
+
237
+ ### Brain Types
238
+
239
+ | Brain | Parameters | Description |
240
+ |-------|------------|-------------|
241
+ | `DreamerBrain` | **~200M (L)** | World model with imagination + policy/value heads |
242
+ | `EmbeddingBrain` | ~99K | Lightweight embedding brain (disabled by default) |
243
+ | `MLPBrain` | ~1K | Simple feedforward baseline |
244
+
245
+ ### DreamerBrain (World Model)
246
+
247
+ DreamerBrain uses the DreamerV3 RSSM architecture to imagine future trajectories:
248
+
249
+ ```
250
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
251
+ โ”‚ DreamerBrain โ”‚
252
+ โ”‚ โ”‚
253
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
254
+ โ”‚ โ”‚ DreamerV3 RSSM (World Model) โ”‚ โ”‚
255
+ โ”‚ โ”‚ - 4096-dim deterministic state (L size) โ”‚ โ”‚
256
+ โ”‚ โ”‚ - 32ร—32 categorical stochastic state โ”‚ โ”‚
257
+ โ”‚ โ”‚ - Imagines 15-step futures โ”‚ โ”‚
258
+ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
259
+ โ”‚ โ”‚ โ”‚
260
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
261
+ โ”‚ โ”‚ โ”‚ โ”‚
262
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
263
+ โ”‚ โ”‚ Policy Head โ”‚ โ”‚ Value Head โ”‚ โ”‚
264
+ โ”‚ โ”‚ (EVOLVED) โ”‚ โ”‚ (EVOLVED) โ”‚ โ”‚
265
+ โ”‚ โ”‚ 5 layers โ”‚ โ”‚ 5 layers โ”‚ โ”‚
266
+ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
267
+ โ”‚ โ”‚ โ”‚ โ”‚
268
+ โ”‚ action value estimate โ”‚
269
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
270
+ ```
271
+
272
+ Unique capabilities:
273
+ - **Imagination rollouts**: See all possible futures before acting
274
+ - **Decision matrix visualization**: Each future trajectory rendered in Rerun
275
+ - **JAX-native**: GPU-accelerated world model inference
276
+ - **Evolved heads only**: World model is pretrained, only policy/value evolve
277
+
278
+ ### Perception (MiniLM)
279
+ - **all-MiniLM-L6-v2**: Frozen 22M param sentence transformer
280
+ - **384-dimensional** embeddings
281
+ - **Evolved projection**: Transforms base embeddings
282
+
283
+ ### Generation (SmolLM) - Optional
284
+ - **SmolLM-135M**: Lightweight generative model
285
+ - **Cross-modal**: Embeddings influence generation temperature
286
+ - Can be disabled for embedding-only mode
287
+
288
+ ### Provenance & Tracking
289
+ - **cascade-lattice integration**: IPFS auto-logging of all events
290
+ - **SwarmLattice**: Fire-and-forget spawn/exploration tracking
291
+ - **Genesis root**: `89f940c1a4b7aa65` (common anchor for all provenance)
292
+ - **Embedding hashes**: Tensor content hashing for reproducibility
293
+
294
+ ### HOLD System (Inference-Level Halt)
295
+ - **Architectural halt**: Blocks inference until human/policy resolution
296
+ - **CASCADE-LATTICE required**: No cascade = No HOLD
297
+ - **Merkle-linked decisions**: Every hold point and resolution recorded
298
+ - **Decision matrix exposed**: action_probs, value, imagined futures visible
299
+
300
+ ```python
301
+ from hold import Hold, HoldPoint
302
+
303
+ # In any brain's forward pass:
304
+ resolution = Hold.get().yield_point(
305
+ action_probs=probs,
306
+ value=value,
307
+ observation=obs,
308
+ brain_id="my_brain",
309
+ )
310
+ # Blocks until: accept(), override(action), or timeout
311
+ final_action = resolution.action
312
+ ```
313
+
314
+ ### Quine Manifold (Branching Realities)
315
+ - **Brain instantiation**: Not simulation - actual brain clones
316
+ - **Exponential branching**: 8 actions โ†’ 8^depth parallel brains
317
+ - **Collapse strategies**: max_value, max_prob, random, or HOLD (manual)
318
+ - **Defensive cloning**: High uncertainty triggers branch spawning
319
+
320
+ ```python
321
+ from manifold import QuineManifold
322
+
323
+ manifold = QuineManifold(brain)
324
+ manifold.expand(depth=2) # 64 parallel realities
325
+ best = manifold.collapse('max_value') # Or HOLD to pick manually
326
+ ```
327
+
328
+ ### Collective Memory (Swarm Intelligence)
329
+ - **SEEK on observe**: Every forward() queries CASCADE for similar experiences
330
+ - **Latent similarity**: Cosine search over historical latent states
331
+ - **Soft bias**: Retrieved experiences gently influence action selection
332
+ - **Cross-agent learning**: Agents share experiences through CASCADE tapes
333
+
334
+ ### Glass Box Visualization
335
+ - **Rerun.io integration**: Real-time visualization of CASCADE events
336
+ - **Full computational transparency**: Hidden states, weight snapshots, computation paths
337
+ - **Single source of truth**: Rerun shows what CASCADE cryptographically proves
338
+ - **DatasetUnity pipeline**: Evolved embedding-based dataset bridging with Kleene fixed-point matching
339
+
340
+ ### Metrics & Logging
341
+ - **wandb integration**: Full experiment tracking
342
+ - **sklearn metrics**: Silhouette, Davies-Bouldin, Calinski-Harabasz
343
+
344
+ ### Classic Features
345
+ - **Violation Pressure**: Trait deviation from stability envelopes
346
+ - **Attractors**: Kleene-style fixed point search
347
+ - **Convergence**: Weighted trait merging with mutation
348
+
349
+ ## Installation
350
+
351
+ ```bash
352
+ # Clone
353
+ git clone https://github.com/your/key
354
+ cd key
355
+
356
+ # Install dependencies
357
+ pip install -r requirements.txt
358
+
359
+ # For GPU acceleration (CUDA 11.8+)
360
+ pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
361
+ ```
362
+
363
+ ## Quick Start
364
+
365
+ ### 1. Configure (config.json)
366
+
367
+ ```json
368
+ {
369
+ "dreamer_brain": {
370
+ "enabled": true,
371
+ "size": "L",
372
+ "deter_dim": 4096,
373
+ "hidden_dim": 4096,
374
+ "policy_layers": 5,
375
+ "value_layers": 5
376
+ },
377
+ "fitness": {
378
+ "function": "dreamer"
379
+ },
380
+ "population": {
381
+ "size": 6
382
+ }
383
+ }
384
+ ```
385
+
386
+ ### 2. Run TUI
387
+
388
+ ```bash
389
+ python app.py
390
+ ```
391
+
392
+ ### 3. Glass Box Mode (Compiled Agents)
393
+
394
+ ```python
395
+ from children.champion_gen1000 import CapsuleAgent
396
+
397
+ # Launch with visualization
398
+ agent = CapsuleAgent(observe_visual=True) # Spawns Rerun viewer
399
+
400
+ # Every inference is visualized with CASCADE proof
401
+ result = agent.forward({"traits": {"x0": 0.5, "x1": 0.3}})
402
+ print(f"Merkle: {result['_merkle_root']}")
403
+
404
+ # Dataset bridging
405
+ unity = agent.data_unity
406
+ old = unity.embed(unity.load_dataframe(df_2023, "2023"))
407
+ new = unity.embed(unity.load_dataframe(df_2024, "2024"))
408
+ matches = unity.bridge(old, new, min_confidence=0.7)
409
+ ```
410
+
411
+ **TUI Controls:**
412
+ - `D` - Dashboard (pulse, VP gauges, event stream)
413
+ - `P` - Population (start/stop evolution, view nodes)
414
+ - `C` - Config (edit any setting with descriptions)
415
+ - `L` - Logs (JSONL log viewer)
416
+ - `X` - Explorer (causation graph)
417
+ - `N` - Neural (brain inspector)
418
+ - `Q` - Quit
419
+
420
+ ## Configuration
421
+
422
+ | Parameter | Default | Description |
423
+ |-----------|---------|-------------|
424
+ | `dreamer_brain.enabled` | `true` | Enable DreamerBrain world models |
425
+ | `dreamer_brain.size` | `L` | Size preset (XS/S/M/L/XL) |
426
+ | `dreamer_brain.deter_dim` | `4096` | Deterministic state dimension |
427
+ | `dreamer_brain.hidden_dim` | `4096` | MLP hidden layer size |
428
+ | `fitness.function` | `dreamer` | Fitness function (dreamer, benchmark) |
429
+ | `population.size` | `6` | Population size |
430
+ | `evolution.generations` | `1000` | Max generations |
431
+
432
+ ## Hardware Requirements
433
+
434
+ | Size | VRAM | RAM | Time/Gen | Notes |
435
+ |------|------|-----|----------|-------|
436
+ | XS (512) | ~2GB | 8GB | ~10s | Development/testing |
437
+ | S (1024) | ~4GB | 8GB | ~30s | Basic tasks |
438
+ | M (2048) | ~8GB | 16GB | ~60s | Minecraft survival |
439
+ | **L (4096)** | **~12GB** | **16GB** | **~80s** | **Diamond mining (current)** |
440
+ | XL (8192) | ~24GB | 32GB | ~120s | Full game mastery |
441
+
442
+ ## Project Structure
443
+
444
+ ```
445
+ key/
446
+ โ”œโ”€โ”€ app.py # Textual TUI - main entry point
447
+ โ”œโ”€โ”€ run.py # Headless evolution runner
448
+ โ”œโ”€โ”€ brain.py # Brain interface + EmbeddingBrain
449
+ โ”œโ”€โ”€ dreamer_brain.py # DreamerBrain - world model with imagination
450
+ โ”œโ”€โ”€ dreamerv3/ # DreamerV3 RSSM implementation (JAX)
451
+ โ”œโ”€โ”€ pod_brain.py # PodBrain - multi-model with LoRA adapter
452
+ โ”œโ”€โ”€ pod.py # Pod communication (Swarm broadcasts)
453
+ โ”œโ”€โ”€ node.py # Node organism with traits + brain
454
+ โ”œโ”€โ”€ population.py # NEAT-style population manager
455
+ โ”œโ”€โ”€ mobile.py # Async swarm with SwarmLattice
456
+ โ”œโ”€โ”€ fitness.py # Pluggable fitness interface
457
+ โ”œโ”€โ”€ fitness_comm.py # Communication fitness (embedding similarity)
458
+ โ”‚
459
+ โ”œโ”€โ”€ # Dataset Bridging
460
+ โ”œโ”€โ”€ bridge.py # DatasetBridge with provenance
461
+ โ”œโ”€โ”€ kleene.py # Fixed-point matching + batch_compare()
462
+ โ”‚
463
+ โ”œโ”€โ”€ # Provenance Infrastructure
464
+ โ”œโ”€โ”€ swarm_lattice.py # Fire-and-forget spawn/exploration tracking
465
+ โ”‚
466
+ โ”œโ”€โ”€ checkpoints.py # Save/load evolution state
467
+ โ”œโ”€โ”€ bus.py # Event bus for logging
468
+ โ”œโ”€โ”€ logger.py # JSONL logging system
469
+ โ”œโ”€โ”€ config.json # Runtime configuration
470
+ โ”œโ”€โ”€ children/ # Compiled agent capsules
471
+ โ””โ”€โ”€ requirements.txt # Dependencies
472
+ ```
473
+
474
+ ## Usage Examples
475
+
476
+ ### Creating Nodes with DreamerBrain
477
+
478
+ ```python
479
+ from brain import create_brain
480
+ from node import Node
481
+
482
+ # Create a DreamerBrain (world model with imagination)
483
+ brain = create_brain('dreamer')
484
+
485
+ # Create a Node with the brain
486
+ node = Node(
487
+ traits={"exploration": 0.7, "caution": 0.3},
488
+ brain=brain
489
+ )
490
+
491
+ # Forward pass - get action + value
492
+ output = brain.forward({"obs": observation})
493
+ action = output["action"] # Discrete action
494
+ value = output["value"] # Estimated value
495
+ latent = output["latent"] # 1536-dim latent state
496
+
497
+ # Imagination - see possible futures
498
+ futures = brain.imagine(n_trajectories=5, horizon=15)
499
+ for i, trajectory in enumerate(futures):
500
+ print(f"Future {i}: value={trajectory[-1]['value']:.3f}")
501
+
502
+ # Evolution - mutate policy/value heads
503
+ child = brain.mutate(rate=0.1)
504
+ ```
505
+
506
+ ### Creating Nodes with PodBrains
507
+
508
+ ```python
509
+ from pod_brain import create_pod_brain
510
+ from node import Node, create_population
511
+
512
+ # Create a PodBrain (multi-model with LoRA adapter)
513
+ brain = create_pod_brain(lora_rank=16, voice_enabled=False)
514
+
515
+ # Create a Node with the brain
516
+ node = Node(
517
+ traits={"creativity": 0.7, "focus": 0.5},
518
+ brain=brain
519
+ )
520
+
521
+ # Use the brain via node.think()
522
+ output = node.think({"text": "hello world"})
523
+ embedding = output["embedding"] # (384,) evolved embedding
524
+
525
+ # Evolution
526
+ child = node.mutate(rate=0.1, mutate_brain=True)
527
+ ```
528
+
529
+ ### Population with PodBrains
530
+
531
+ ```python
532
+ from pod_brain import create_pod_brain
533
+ from node import create_population
534
+
535
+ # Brain factory
536
+ def make_pod():
537
+ return create_pod_brain(lora_rank=8, voice_enabled=False)
538
+
539
+ # Create population
540
+ pop = create_population(
541
+ size=20,
542
+ trait_keys=["speed", "strength", "perception"],
543
+ brain_factory=make_pod
544
+ )
545
+
546
+ # All nodes have PodBrains
547
+ for node in pop:
548
+ print(f"Node {node.id}: brain={node.brain.id[:8]}")
549
+ ```
550
+
551
+ ### Pod Communication (Swarm Broadcasts)
552
+
553
+ ```python
554
+ from pod import Pod, Swarm
555
+
556
+ # Create swarm of communicating pods
557
+ swarm = Swarm(size=5, embed_dim=384)
558
+
559
+ # Initialize with diverse states
560
+ for pod, topic in zip(swarm.pods, ["alpha", "beta", "gamma", "delta", "epsilon"]):
561
+ pod.sense(topic)
562
+
563
+ # Run convergence (broadcast, consensus, align)
564
+ alignments = swarm.converge(rounds=5, align_rate=0.2)
565
+ print(f"Final alignment: {alignments[-1]:.3f}")
566
+
567
+ # Get leader (closest to consensus)
568
+ leader = swarm.get_leader()
569
+ ```
570
+
571
+ ## Swarm Provenance
572
+
573
+ Track agent spawning with fire-and-forget logging:
574
+
575
+ ```python
576
+ from swarm_lattice import SwarmLattice
577
+
578
+ lattice = SwarmLattice(log_dir='runs/swarm')
579
+ record = lattice.record_spawn(
580
+ parent_id='genesis',
581
+ child_id=child_node.id,
582
+ mutation_rate=0.1,
583
+ generation=5,
584
+ )
585
+ print(f"Spawn merkle: {record.merkle_root}")
586
+ ```
587
+
588
+ ## License
589
+
590
+ MIT