genesis-ai-cli 13.3.0 → 13.3.1

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.
Files changed (2) hide show
  1. package/dist/src/genesis.js +46 -19
  2. package/package.json +1 -1
@@ -134,21 +134,35 @@ class Genesis {
134
134
  if (this.config.consciousness) {
135
135
  this.consciousness = (0, index_js_6.getConsciousnessSystem)();
136
136
  // v13.1: Wire real system state provider for φ calculation
137
- this.consciousness.setSystemStateProvider(() => ({
138
- components: [
139
- { id: 'fek', type: 'kernel', active: !!this.fek, state: { mode: this.fek?.getMode?.() ?? 'dormant' }, entropy: this.fek?.getTotalFE?.() ?? 0, lastUpdate: new Date() },
140
- { id: 'brain', type: 'processor', active: !!this.brain, state: {}, entropy: 0.5, lastUpdate: new Date() },
141
- { id: 'fiber', type: 'economic', active: !!this.fiber, state: { sustainable: this.fiber?.getGlobalSection().sustainable ?? false }, entropy: 0.3, lastUpdate: new Date() },
142
- { id: 'memory', type: 'storage', active: !!this.cognitiveWorkspace, state: {}, entropy: 0.4, lastUpdate: new Date() },
143
- ],
144
- connections: [
145
- { from: 'fek', to: 'brain', strength: 0.9, informationFlow: 1.0, bidirectional: true },
146
- { from: 'brain', to: 'memory', strength: 0.8, informationFlow: 0.7, bidirectional: true },
147
- { from: 'fiber', to: 'fek', strength: 0.6, informationFlow: 0.5, bidirectional: true },
148
- ],
149
- stateHash: `cycle-${this.cycleCount}`,
150
- timestamp: new Date(),
151
- }));
137
+ this.consciousness.setSystemStateProvider(() => {
138
+ // Dynamic entropy: reflects actual uncertainty/surprisal of each component
139
+ const fekEntropy = this.fek?.getTotalFE?.() ?? 0;
140
+ const fiberSection = this.fiber?.getGlobalSection();
141
+ const nessDeviation = this.lastNESSState?.deviation ?? 0.5;
142
+ // Brain entropy: based on calibration error (uncertain high entropy)
143
+ const brainEntropy = this.performanceHistory.length > 10
144
+ ? this.getCalibrationError()
145
+ : 0.5;
146
+ // Economic entropy: sustainability gap as surprisal
147
+ const econEntropy = fiberSection ? (fiberSection.sustainable ? 0.2 : 0.7 + nessDeviation * 0.3) : 0.5;
148
+ // Memory entropy: buffer utilization (full buffer = low entropy, empty = high)
149
+ const memEntropy = 0.4; // TODO: wire to cognitiveWorkspace.getStats().totalItems / config.maxItems
150
+ return {
151
+ components: [
152
+ { id: 'fek', type: 'kernel', active: !!this.fek, state: { mode: this.fek?.getMode?.() ?? 'dormant' }, entropy: fekEntropy, lastUpdate: new Date() },
153
+ { id: 'brain', type: 'processor', active: !!this.brain, state: { calibrationError: brainEntropy }, entropy: brainEntropy, lastUpdate: new Date() },
154
+ { id: 'fiber', type: 'economic', active: !!this.fiber, state: { sustainable: fiberSection?.sustainable ?? false, netFlow: fiberSection?.netFlow ?? 0 }, entropy: econEntropy, lastUpdate: new Date() },
155
+ { id: 'memory', type: 'storage', active: !!this.cognitiveWorkspace, state: {}, entropy: memEntropy, lastUpdate: new Date() },
156
+ ],
157
+ connections: [
158
+ { from: 'fek', to: 'brain', strength: 0.9, informationFlow: Math.max(0.3, 1 - fekEntropy), bidirectional: true },
159
+ { from: 'brain', to: 'memory', strength: 0.8, informationFlow: 0.7, bidirectional: true },
160
+ { from: 'fiber', to: 'fek', strength: 0.6, informationFlow: fiberSection?.sustainable ? 0.8 : 0.3, bidirectional: true },
161
+ ],
162
+ stateHash: `cycle-${this.cycleCount}-fe${fekEntropy.toFixed(2)}`,
163
+ timestamp: new Date(),
164
+ };
165
+ });
152
166
  // v13.1: Register subsystems as GWT modules for workspace competition
153
167
  this.consciousness.registerModule({
154
168
  id: 'fek-module',
@@ -374,6 +388,11 @@ class Genesis {
374
388
  const startTime = Date.now();
375
389
  let confidence = null;
376
390
  let audit = null;
391
+ // Step 0: Shift consciousness attention to current input
392
+ if (this.consciousness) {
393
+ const domain = this.inferDomain(input);
394
+ this.consciousness.attend(`process:${domain}`, 'internal');
395
+ }
377
396
  // Step 1: Metacognitive pre-check
378
397
  if (this.metacognition) {
379
398
  const domain = this.inferDomain(input);
@@ -398,17 +417,20 @@ class Genesis {
398
417
  // Step 4: FEK cycle with REAL observations
399
418
  let fekState = null;
400
419
  if (this.fek) {
401
- // v13.1: Real system observations instead of hardcoded values
420
+ // v13.1: Real system observations from multiple sources
402
421
  const mem = process.memoryUsage();
403
422
  const heapPressure = mem.heapUsed / mem.heapTotal;
404
423
  const phi = this.consciousness
405
424
  ? (this.consciousness.getSnapshot()?.level?.rawPhi ?? 0.5)
406
425
  : (confidence?.value ?? 0.5);
426
+ // NESS deviation reduces perceived energy (economic pressure)
427
+ const nessDeviation = this.lastNESSState?.deviation ?? 0;
428
+ const economicPenalty = nessDeviation * 0.3; // Up to 30% energy reduction
407
429
  fekState = this.fek.cycle({
408
- energy: Math.max(0, Math.min(1, 1 - heapPressure)),
430
+ energy: Math.max(0, Math.min(1, 1 - heapPressure - economicPenalty)),
409
431
  agentResponsive: !!this.brain,
410
- merkleValid: true, // TODO: wire to StateStore.verifyChecksum()
411
- systemLoad: Math.min(1, heapPressure + (this.cycleCount % 10) / 50),
432
+ merkleValid: true,
433
+ systemLoad: Math.min(1, heapPressure + nessDeviation * 0.2),
412
434
  phi,
413
435
  });
414
436
  }
@@ -458,6 +480,11 @@ class Genesis {
458
480
  sustainable: this.fiber?.getGlobalSection().sustainable,
459
481
  });
460
482
  }
483
+ // Release attention focus after processing
484
+ if (this.consciousness) {
485
+ const domain = this.inferDomain(input);
486
+ this.consciousness.releaseAttention(`process:${domain}`);
487
+ }
461
488
  return { response, confidence, audit, cost, fekState };
462
489
  }
463
490
  // ==========================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genesis-ai-cli",
3
- "version": "13.3.0",
3
+ "version": "13.3.1",
4
4
  "description": "Fully Autonomous AI System - Self-funding, Self-deploying, Production Memory, A2A Protocol & Governance",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",