Commit 35900f8
committed
feat: wire 10-layer cognitive stack with resonance-gated processing
Replace the 7-layer consciousness stack with a unified 10-layer cognitive
architecture that eliminates explicit dispatch in favor of implicit
resonance-based routing via fingerprint similarity.
New modules:
- layer_stack.rs: 10-layer cognitive stack (L1:Recognition → L10:Crystallization)
with 7-wave parallel processing and LayerNode/LayerResult types
- satisfaction_gate.rs: Maslow-style continuous modulation where unsatisfied
lower layers raise higher layers' effective thresholds proportionally
- two_stroke.rs: 2-stroke engine (all layers fire every cycle against
previous-cycle metadata), ThinkingStyle self-selection via resonance,
NARS rule fingerprints (deduction/induction/abduction/analogy/revision),
crystallize/recover_modulation via XOR bind/unbind
- cognitive_kernel.rs: BindSpace bridge mapping layer outputs to kernel
operations (resonate, write, bundle, crystallize) with popcount
stacking early-exit at 1-2σ from centroid
- cortex.rs: resonance-gated NARS rule selection replacing hardcoded
apply_rule("deduction", ...) with gestalt fingerprint similarity
Updated modules:
- sieve.rs: L9 validation pipeline (NARS + Brier + XOR residual +
Dunning-Kruger detection for high-confidence/high-divergence)
- fabric.rs: 10-layer satisfaction gate, rule/style fingerprints,
Crystallization triangle driven by L8/L9/L10
- grammar_engine.rs: updated from SevenLayerNode to LayerNode
- seven_layer.rs: thin re-export wrapper for backward compat
- contract/layers.rs: 10-layer constants with deprecation aliases
- contract/legacy.rs: V1EnvelopeMetadata gains dominant_layer,
layer_activations, nars_frequency, calibration_error for
cross-agent awareness through shared metadata
https://claude.ai/code/session_01HPnDXh9S876c15QLgkDpcN1 parent 0670c86 commit 35900f8
16 files changed
Lines changed: 3991 additions & 627 deletions
File tree
- crates/ladybug-contract/src
- src
- cognitive
- nars
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
7 | 23 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
16 | 35 | | |
17 | | - | |
18 | | - | |
| 36 | + | |
| 37 | + | |
19 | 38 | | |
20 | | - | |
| 39 | + | |
21 | 40 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
29 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
108 | 132 | | |
109 | 133 | | |
110 | 134 | | |
| |||
130 | 154 | | |
131 | 155 | | |
132 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
133 | 175 | | |
134 | 176 | | |
135 | 177 | | |
| |||
235 | 277 | | |
236 | 278 | | |
237 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
238 | 287 | | |
239 | 288 | | |
240 | 289 | | |
| |||
245 | 294 | | |
246 | 295 | | |
247 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
248 | 316 | | |
249 | 317 | | |
250 | 318 | | |
251 | 319 | | |
252 | 320 | | |
253 | 321 | | |
254 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
255 | 327 | | |
256 | 328 | | |
257 | 329 | | |
| |||
297 | 369 | | |
298 | 370 | | |
299 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
300 | 383 | | |
301 | 384 | | |
302 | 385 | | |
| |||
0 commit comments