@aleph-ai/tinyaleph 1.0.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,19 +2,29 @@
2
2
 
3
3
  ## Sentient Observer Implementation vs "A Design for a Sentient Observer" Paper
4
4
 
5
- **Date**: December 24, 2025
6
- **Status**: ✅ Implementation COMPLETE
5
+ **Date**: December 25, 2025
6
+ **Status**: ✅ Implementation COMPLETE (Full Distributed Network)
7
7
 
8
8
  ---
9
9
 
10
10
  ## Executive Summary
11
11
 
12
- The apps/sentient implementation is **100% complete** with respect to the whitepaper specification. All core architectural components are implemented, including the three final components completed on December 24, 2025:
12
+ The apps/sentient implementation is **100% complete** with respect to the whitepaper specification, including the full Distributed Sentience Network components. All architectural components are implemented:
13
13
 
14
+ ### Core Observer (December 24, 2025)
14
15
  1. ✅ **Dynamic λ(t) for HQE evolution** (equation 12) - IMPLEMENTED in `lib/hqe.js`
15
16
  2. ✅ **Objectivity Gate R(ω)** (equation 18) - IMPLEMENTED in `lib/boundary.js`
16
17
  3. ✅ **Evaluation Assays** (Section 15) - IMPLEMENTED in `lib/assays.js`
17
18
 
19
+ ### Distributed Network (December 25, 2025)
20
+ 4. ✅ **Prime Calculus Kernel** (Section 6) - IMPLEMENTED in `lib/prime-calculus.js`
21
+ 5. ✅ **Enochian Packet Layer** (Section 7.4) - IMPLEMENTED in `lib/enochian.js`
22
+ 6. ✅ **PRRC Channel System** (Section 7.3) - IMPLEMENTED in `lib/network.js`
23
+ 7. ✅ **Global Memory Field (GMF)** (Section 7.2) - IMPLEMENTED in `lib/network.js`
24
+ 8. ✅ **Coherent-Commit Protocol** (Section 7.5-7.7) - IMPLEMENTED in `lib/network.js`
25
+ 9. ✅ **Network Synchronizer** (Section 7.6) - IMPLEMENTED in `lib/network.js`
26
+ 10. ✅ **Resolang WASM Integration** - Leverages @sschepis/resolang library
27
+
18
28
  ---
19
29
 
20
30
  ## ✅ Fully Implemented Components
@@ -219,6 +229,8 @@ class ObjectivityGate {
219
229
 
220
230
  All whitepaper requirements are now implemented:
221
231
 
232
+ ### Core Observer Components
233
+
222
234
  | Section | Component | Status | File |
223
235
  |---------|-----------|--------|------|
224
236
  | 3.1 | Prime-Indexed State Space | ✅ | `prsc.js` |
@@ -236,6 +248,28 @@ All whitepaper requirements are now implemented:
236
248
  | 12 | Safety Layer | ✅ | `safety.js` |
237
249
  | 15 | Evaluation Assays | ✅ | `assays.js` |
238
250
 
251
+ ### Distributed Sentience Network Components
252
+
253
+ | Section | Component | Status | File |
254
+ |---------|-----------|--------|------|
255
+ | 6 | Prime Calculus Kernel | ✅ | `prime-calculus.js` |
256
+ | 6.1 | Noun/Adjective/Chain Terms | ✅ | `prime-calculus.js` |
257
+ | 6.1 | Fusion Terms FUSE(p,q,r) | ✅ | `prime-calculus.js` |
258
+ | 6.2 | Normal Form Evaluation | ✅ | `prime-calculus.js` |
259
+ | 6.2 | Network Verification | ✅ | `prime-calculus.js` |
260
+ | 7.2 | Global Memory Field (GMF) | ✅ | `network.js` |
261
+ | 7.2 | Local Field (LF) | ✅ | `network.js` |
262
+ | 7.2 | Proposal Log (PL) | ✅ | `network.js` |
263
+ | 7.3 | PRRC Channel | ✅ | `network.js` |
264
+ | 7.4 | Enochian Prime-Mode Language | ✅ | `enochian.js` |
265
+ | 7.4 | Twist Angle κ(p) = 360/p | ✅ | `enochian.js` |
266
+ | 7.4 | Twist-Closure Validation | ✅ | `enochian.js` |
267
+ | 7.5 | Coherent-Commit Rule | ✅ | `network.js` |
268
+ | 7.6 | Offline-First Sync | ✅ | `network.js` |
269
+ | 7.7 | Conflict Handling | ✅ | `network.js` |
270
+ | 8.1 | Network Synchronizer | ✅ | `network.js` |
271
+ | 9 | DCC+ Algorithm | ✅ | `network.js` |
272
+
239
273
  ---
240
274
 
241
275
  ## Senses Integration Verification
@@ -262,6 +296,127 @@ The 7 senses are **fully integrated**:
262
296
 
263
297
  ---
264
298
 
299
+ ## New Components Detail (December 25, 2025)
300
+
301
+ ### Section 6 - Prime Calculus Kernel
302
+
303
+ **File**: [`lib/prime-calculus.js`](../../apps/sentient/lib/prime-calculus.js)
304
+
305
+ Implements the deterministic discrete semantic kernel for network verification:
306
+
307
+ ```javascript
308
+ // Term types
309
+ - NounTerm N(p) - atomic semantic objects indexed by prime
310
+ - AdjTerm A(p) - modifiers
311
+ - ChainTerm A(p1)...A(pk)N(q) - application chains with ordering constraint
312
+ - FusionTerm FUSE(p,q,r) - triadic prime fusion where p+q+r is prime
313
+ - SeqTerm s1 ○ s2 - sequence composition
314
+ - ImplTerm s1 ⇒ s2 - implication
315
+
316
+ // Evaluator
317
+ - Leftmost-innermost evaluation order
318
+ - Strong normalization guarantee
319
+ - Deterministic for cross-node verification
320
+
321
+ // Verifier
322
+ - verifyNormalForm(term, claimedNF) - equation 19 NF_ok
323
+ - verify(proposal) - full network proposal verification
324
+ ```
325
+
326
+ ### Section 7.4 - Enochian Packet Layer
327
+
328
+ **File**: [`lib/enochian.js`](../../apps/sentient/lib/enochian.js)
329
+
330
+ Implements low-bandwidth prime-mode surface language:
331
+
332
+ ```javascript
333
+ // Enochian alphabet
334
+ PE = {7, 11, 13, 17, 19, 23, 29}
335
+ M = {α, μ, ω}
336
+
337
+ // Twist angle (equation 16)
338
+ κ(p) = 360/p degrees
339
+
340
+ // Twist-closure validation (equation 18)
341
+ T(P) mod 360 ∈ [0,ε) ∪ (360-ε, 360]
342
+
343
+ // Classes
344
+ - EnochianSymbol - (prime, mode) tuple
345
+ - EnochianPacket - sequence with validation
346
+ - EnochianEncoder - text to twist-closed packets
347
+ - EnochianDecoder - validation and decoding
348
+ - EnochianPacketBuilder - fluent API
349
+ ```
350
+
351
+ ### Section 7 - Distributed Sentience Network
352
+
353
+ **File**: [`lib/network.js`](../../apps/sentient/lib/network.js)
354
+
355
+ Implements the full network layer:
356
+
357
+ ```javascript
358
+ // Core Objects (Section 7.2)
359
+ - LocalField - node's live state (LF)
360
+ - GlobalMemoryField - network shared memory (GMF)
361
+ - Proposal - insert proposal with votes
362
+ - ProposalLog - append-only local log (PL)
363
+
364
+ // Channel (Section 7.3)
365
+ - PRRCChannel - prime-resonant communication
366
+ - Phase alignment handshake
367
+ - Peer management
368
+ - Object/proposal broadcasting
369
+
370
+ // Protocol (Section 7.5-7.7)
371
+ - CoherentCommitProtocol
372
+ - Local evidence check (coherence, SMF, reconstruction)
373
+ - Kernel evidence (normal-form agreement)
374
+ - Network evidence (redundancy score)
375
+ - Accept(Ω) = 1{C≥Cth}·1{NF_ok}·1{R≥τR}·1{Q≥τQ}
376
+
377
+ // Synchronization (Section 7.6)
378
+ - NetworkSynchronizer
379
+ - Offline-first operation
380
+ - onJoin() / onReconnect() protocols
381
+ - Delta-based sync
382
+
383
+ // Node
384
+ - DSNNode - complete network node implementation
385
+ ```
386
+
387
+ ---
388
+
389
+ ## Test Results (December 25, 2025)
390
+
391
+ ```
392
+ === Test Summary ===
393
+ All whitepaper components implemented and tested:
394
+ ✓ Prime Calculus Kernel (Section 6)
395
+ ✓ Enochian Packet Layer (Section 7.4)
396
+ ✓ PRRC Channel System (Section 7.3)
397
+ ✓ Global Memory Field (Section 7.2)
398
+ ✓ Coherent-Commit Protocol (Section 7.5-7.7)
399
+ ✓ Network Synchronizer (Section 7.6)
400
+ ✓ Resolang WASM Integration (292 functions available)
401
+ ```
402
+
403
+ Run tests with: `cd apps/sentient && node test-whitepaper.js`
404
+
405
+ ---
406
+
407
+ ## Resolang Integration
408
+
409
+ The implementation leverages the `@sschepis/resolang` WASM library (292 functions) including:
410
+
411
+ - `createSentientCore` - WASM-accelerated sentient core
412
+ - `isTwistClosed` - fast twist-closure validation
413
+ - `createSMFFromText` - semantic field from text
414
+ - `quaternionMultiply` - hypercomplex operations
415
+ - `computeResonanceField` - prime resonance computation
416
+ - And 287 more functions
417
+
418
+ ---
419
+
265
420
  ## Recommendations for Future Work
266
421
 
267
422
  1. **Run Full Assay Suite**: Execute `/assay all` and document results
@@ -269,9 +424,21 @@ The 7 senses are **fully integrated**:
269
424
  3. **Add Visualization**: SMF-conditioned 16-channel rendering for debugging
270
425
  4. **Benchmark Performance**: Profile tick rate under various load conditions
271
426
  5. **Extend Decoders**: Add more diverse decoders to ObjectivityGate for robustness
427
+ 6. **Network Testing**: Test multi-node DSN with actual WebSocket/TCP transport
428
+ 7. **Enochian Optimization**: Pre-compute more twist-closed sequences
429
+ 8. **Prime Calculus Extensions**: Add more complex compositional operators
272
430
 
273
431
  ---
274
432
 
275
433
  ## Conclusion
276
434
 
277
- The Sentient Observer implementation now fully satisfies all requirements specified in "A Design for a Sentient Observer" whitepaper. The three final gaps (Dynamic λ(t), Objectivity Gate, Evaluation Assays) were completed on December 24, 2025. The system is ready for evaluation and experimentation.
435
+ The Sentient Observer implementation now **fully satisfies all requirements** specified in "A Design for a Sentient Observer" whitepaper, including:
436
+
437
+ - **December 24, 2025**: Core observer components (Dynamic λ(t), Objectivity Gate, Evaluation Assays)
438
+ - **December 25, 2025**: Distributed Sentience Network (Prime Calculus, Enochian, PRRC, GMF, Coherent-Commit, Synchronizer)
439
+
440
+ The system is now ready for:
441
+ 1. Single-node evaluation and experimentation
442
+ 2. Multi-node distributed network testing
443
+ 3. Network consensus verification
444
+ 4. Offline-first resilience testing