Isaac Quarenta commited on
Commit
bc87f31
·
1 Parent(s): 3be1ac4

feat(jev): consciência 1-10 → System-1 rápido / System-2 consciente total

Browse files
Files changed (1) hide show
  1. modules/api.py +12 -5
modules/api.py CHANGED
@@ -8437,10 +8437,14 @@ class AkiraAPI:
8437
  jev_analysis['routing'] = jev_routing.data
8438
  self.logger.info(f"⚡ [JEV] Route: {jev_routing.data.get('route_to', 'unknown')} (conf: {jev_routing.data.get('confidence', 0):.2f})")
8439
 
8440
- # Depth (System 1 vs System 2)
8441
  if jev_depth and jev_depth.success:
8442
  jev_analysis['depth'] = jev_depth.data
8443
- self.logger.info(f"⚡ [JEV] Depth: {jev_depth.data.get('depth_score', '?')}/5 → {jev_depth.data.get('system_type', '?')} (conf: {jev_depth.data.get('confidence', 0):.2f})")
 
 
 
 
8444
 
8445
  if jev_proactive and jev_proactive.success:
8446
  jev_analysis['proactive'] = jev_proactive.data
@@ -8458,11 +8462,14 @@ class AkiraAPI:
8458
  except Exception as e:
8459
  self.logger.warning(f"⚡ [JEV PRE-CLASS] Erro (non-blocking): {e}")
8460
 
8461
- # ⚡ SYSTEM 1 vs SYSTEM 2 CONTROL baseado no depth score do JEV
 
 
 
8462
  jev_depth_data = jev_analysis.get('depth', {}) if jev_analysis else {}
 
8463
  system_type = jev_depth_data.get('system_type', 'System 1')
8464
- depth_score = float(jev_depth_data.get('depth_score') or 1)
8465
- use_system_two = (system_type == "System 2") or depth_score >= 4.0
8466
  if use_system_two:
8467
  max_iterations = max(max_iterations, 3)
8468
  self.logger.info(f"🧠 [SYSTEM 2] Modo deliberativo ativo — depth={depth_score}/5 max_iterations={max_iterations}")
 
8437
  jev_analysis['routing'] = jev_routing.data
8438
  self.logger.info(f"⚡ [JEV] Route: {jev_routing.data.get('route_to', 'unknown')} (conf: {jev_routing.data.get('confidence', 0):.2f})")
8439
 
8440
+ # Depth (System 1 vs System 2) — escala 1-10 para gate de consciência
8441
  if jev_depth and jev_depth.success:
8442
  jev_analysis['depth'] = jev_depth.data
8443
+ raw_depth = float(jev_depth.data.get('depth_score', 2) or 2)
8444
+ # jev entrega 1-5, mapeia para 1-10 (x2) para dial de consciência
8445
+ consciousness_10 = max(1, min(10, round(raw_depth * 2)))
8446
+ jev_analysis['consciousness_10'] = consciousness_10
8447
+ self.logger.info(f"🧠 [JEV CONSCIOUSNESS] {consciousness_10}/10 (raw {raw_depth}/5) → {jev_depth.data.get('system_type', '?')} (conf: {jev_depth.data.get('confidence', 0):.2f})")
8448
 
8449
  if jev_proactive and jev_proactive.success:
8450
  jev_analysis['proactive'] = jev_proactive.data
 
8462
  except Exception as e:
8463
  self.logger.warning(f"⚡ [JEV PRE-CLASS] Erro (non-blocking): {e}")
8464
 
8465
+ # 🧠 SYSTEM 1 vs SYSTEM 2 — Gate de Consciência 1-10
8466
+ # 1-3: reflexo rápido (CoT skip, minimal_history=4)
8467
+ # 4-6: equilibrado (CoT condicional, minimal_history=8)
8468
+ # 7-10: profunda e totalmente consciente (CoT forçado, minimal_history=12, System-2 deliberativo)
8469
  jev_depth_data = jev_analysis.get('depth', {}) if jev_analysis else {}
8470
+ consciousness_10 = int(jev_analysis.get('consciousness_10', 5) or 5)
8471
  system_type = jev_depth_data.get('system_type', 'System 1')
8472
+ use_system_two = (consciousness_10 >= 7) or (system_type == "System 2")
 
8473
  if use_system_two:
8474
  max_iterations = max(max_iterations, 3)
8475
  self.logger.info(f"🧠 [SYSTEM 2] Modo deliberativo ativo — depth={depth_score}/5 max_iterations={max_iterations}")