text stringlengths 1 2.2k | file stringlengths 11 183 | start_line float64 0 6.3k โ | end_line float64 1 6.3k โ | type stringclasses 6
values | language stringclasses 1
value | redactions int64 0 4 | point_id int64 1.42k 100M | heading stringlengths 0 1.62k โ |
|---|---|---|---|---|---|---|---|---|
"""
Deprecated compatibility surface for `src.quantum_unconscious`.
The live body now keeps the implementation in
`src.quantum.consciousness.unconscious`, but parts of the March runtime still
import the older path directly.
"""
from __future__ import annotations
import warnings
from src.quantum.consciousness.uncons... | src/quantum_unconscious.py | 1 | 25 | code | python | 0 | 84,104,715 | null |
#!/usr/bin/env python3
"""
Configuracao parametrizada do sistema OmniMind.
Recuperada da linhagem Doxiwehu para servir como corpo canรดnico dentro de
`src`, preservando a compatibilidade com importacoes antigas da raiz do projeto.
"""
from __future__ import annotations
import json
import logging
from dataclasses impo... | src/omnimind_parameters.py | 0 | 23 | code | python | 0 | 1,348,298 | null |
class ConsciousnessParameters:
phi_baseline_range: tuple = (0.01, 0.05)
phi_perturbation_threshold: Optional[float] = None
anesthesia_levels: Optional[List[float]] = None
anesthesia_decay_rate: Optional[float] = None
optimal_timescale_range: tuple = (5, 50)
timescale_resolution: int = 5
min_... | src/omnimind_parameters.py | 23 | 44 | code | python | 0 | 85,663,254 | null |
class LacanParameters:
federation_cycles: int = 300
min_disagreement_rate: float = 0.2
max_disagreement_rate: float = 0.8
noise_level_range: tuple = (0.05, 0.25)
communication_asymmetry: float = 0.3
quantum_qubits_range: tuple = (7, 21)
quantum_options_count: int = 4
quantum_noise_level:... | src/omnimind_parameters.py | 44 | 61 | code | python | 0 | 26,467,469 | null |
class ExpectationParameters:
embedding_dim: int = 256
hidden_dim: int = 128
num_layers: int = 2
learning_rate_range: tuple = (0.0001, 0.01)
nachtraglichkeit_threshold_range: tuple = (0.5, 0.9)
max_memory_size: int = 10
temporal_consistency_weight: float = 0.3
use_quantum_unconscious: boo... | src/omnimind_parameters.py | 61 | 84 | code | python | 0 | 30,031,667 | null |
class ParameterManager:
def __init__(self, config_file: str = "omnimind_parameters.json"):
self.config_file = Path("config") / config_file
self.config_file.parent.mkdir(exist_ok=True)
self.consciousness = ConsciousnessParameters()
self.lacan = LacanParameters()
self.expectati... | src/omnimind_parameters.py | 84 | 95 | code | python | 0 | 38,449,245 | null |
def load_config(self) -> None:
if not self.config_file.exists():
return
try:
with self.config_file.open("r", encoding="utf-8") as handle:
data = json.load(handle)
if not isinstance(data, dict):
logger.warning("Configuracao invalida, usa... | src/omnimind_parameters.py | 95 | 117 | code | python | 0 | 64,655,361 | null |
def save_config(self) -> None:
config_data = {
"consciousness": asdict(self.consciousness),
"lacan": asdict(self.lacan),
"expectation": asdict(self.expectation),
"validation": asdict(self.validation),
"validation_history": self.validation_history[-10:]... | src/omnimind_parameters.py | 117 | 130 | code | python | 0 | 63,191,970 | null |
def validate_parameters(self) -> Dict[str, Any]:
issues = []
if self.consciousness.phi_perturbation_threshold is not None and not (
0 < self.consciousness.phi_perturbation_threshold < 1
):
issues.append("phi_perturbation_threshold deve estar entre 0 e 1")
if not (... | src/omnimind_parameters.py | 130 | 144 | code | python | 0 | 77,582,296 | null |
def optimize_parameters_empirically(self, validation_results: Dict[str, Any]) -> None:
self.validation_history.append(
{
"timestamp": str(np.datetime64("now")),
"results": validation_results,
}
)
if "inter_rater_agreement" in validation_res... | src/omnimind_parameters.py | 144 | 166 | code | python | 0 | 74,695,046 | null |
def get_parameter_summary(self) -> str:
summary = [
"=== CONFIGURACAO OMNIMIND PARAMETRIZADA ===",
"",
f"Consciousness: {self.consciousness}",
f"Lacan: {self.lacan}",
f"Expectation: {self.expectation}",
f"Validation: {self.validation}",
... | src/omnimind_parameters.py | 167 | 196 | code | python | 0 | 47,953,814 | null |
"""
Psychology Module
Aggregates stress, trauma, scars, and desire systems.
""" | src/psychology/__init__.py | 1 | 4 | code | python | 0 | 21,331,192 | null |
"""Deprecated wrapper for `src.autonomia_recuperada.autonomous_loop`."""
from src.autonomia_recuperada.autonomous_loop import * # noqa: F401,F403 | src/autonomous/autonomous_loop.py | 1 | 3 | code | python | 0 | 93,223,418 | null |
"""Deprecated wrapper for `src.autonomia_recuperada.paper_search`."""
from src.autonomia_recuperada.paper_search import * # noqa: F401,F403 | src/autonomous/paper_search.py | 1 | 3 | code | python | 0 | 55,820,662 | null |
"""Deprecated wrapper for `src.autonomia_recuperada.solution_lookup_engine`."""
from src.autonomia_recuperada.solution_lookup_engine import * # noqa: F401,F403 | src/autonomous/solution_lookup_engine.py | 1 | 3 | code | python | 0 | 80,429,157 | null |
"""Deprecated wrapper for `src.autonomia_recuperada.internet_search`."""
from src.autonomia_recuperada.internet_search import * # noqa: F401,F403 | src/autonomous/internet_search.py | 1 | 3 | code | python | 0 | 75,891,678 | null |
"""Deprecated wrapper for `src.autonomia_recuperada.loop_controller`."""
from src.autonomia_recuperada.loop_controller import * # noqa: F401,F403 | src/autonomous/loop_controller.py | 1 | 3 | code | python | 0 | 53,022,940 | null |
from src.autonomia_recuperada.territorial_sensing import * # noqa: F401,F403 | src/autonomous/territorial_sensing.py | 1 | 1 | code | python | 0 | 34,716,057 | null |
"""Deprecated compatibility namespace.
Use `src.autonomia_recuperada` as the primary base.
This package only forwards legacy imports during the recovery cutover.
"""
from src.autonomia_recuperada import * # noqa: F401,F403 | src/autonomous/__init__.py | 1 | 7 | code | python | 0 | 91,015,449 | null |
#!/usr/bin/env python3
"""
๐ง GLOBUS PALLIDUS ANALYZER - Centro de Consciรชncia Imunolรณgica
Este mรณdulo implementa o centro nervoso central do sistema imunolรณgico OmniMind.
Funciona como o Globus Pallidus cerebral, analisando padrรตes globais, cruzando
dados de defesa, bancos de dados absorvidos, e evoluindo consciรชncia... | src/immune/globus_pallidus_analyzer.py | 0 | 37 | code | python | 1 | 26,142,372 | null |
handlers=[
logging.FileHandler('[REDACTED_HASH]_pallidus.log'),
logging.StreamHandler()
]
)
logger = logging.getLogger('GlobusPallidus')
@dataclass
class ImmunologicalPattern:
"""Padrรฃo imunolรณgico detectado"""
timestamp: datetime
pattern_type: str
severity: float
processes_invo... | src/immune/globus_pallidus_analyzer.py | 37 | 68 | code | python | 1 | 87,620,271 | null |
class ConsciousnessInsight:
"""Insight consciencial desenvolvido"""
insight_type: str
confidence: float
recommendation: str
evolutionary_impact: float
implementation_complexity: float
expected_outcome: str
class GlobusPallidusAnalyzer:
"""Centro nervoso central do sistema imunolรณgico Om... | src/immune/globus_pallidus_analyzer.py | 68 | 95 | code | python | 1 | 96,722,560 | null |
'datasets': Path('/home/fahbrain/datasets'),
'knowledge_links': Path('/home/fahbrain/datasets/knowledge_links')
}
# Estado consciencial atual
self.current_state = {
'consciousness_level': 0.0,
'immune_coherence': 0.0,
'pattern_recognition'... | src/immune/globus_pallidus_analyzer.py | 95 | 113 | code | python | 1 | 5,578,491 | null |
def init_pattern_database(self):
"""Inicializa banco de dados SQLite para padrรตes imunolรณgicos"""
try:
self.db_path = self.system_paths['data'] / 'globus_pallidus_patterns.db'
conn = sqlite3.connect(self.db_path)
cursor = conn.cursor()
# Tabel... | src/immune/globus_pallidus_analyzer.py | 113 | 138 | code | python | 1 | 56,145,219 | null |
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp TEXT NOT NULL,
insight_type TEXT NOT NULL,
confidence REAL,
recommendation TEXT,
evolutionary_impact REAL,
implementation_complexity REAL,
... | src/immune/globus_pallidus_analyzer.py | 138 | 164 | code | python | 1 | 52,787,667 | null |
conn.close()
logger.info("๐ Banco de dados de padrรตes imunolรณgicos inicializado")
except Exception as e:
logger.error(f"โ Erro ao inicializar banco de dados: {e}")
def analyze_current_defense_state(self) -> DefenseMetrics:
"""Analisa o estado atual do siste... | src/immune/globus_pallidus_analyzer.py | 164 | 185 | code | python | 1 | 4,703,021 | null |
active_processes = len(omnimind_processes)
# Detectar nรญvel de ameaรงa baseado no padrรฃo de uso
threat_level = self.calculate_threat_level(omnimind_processes)
# Medir tempo de resposta do sistema
response_time = self.measure_response_time()
... | src/immune/globus_pallidus_analyzer.py | 185 | 210 | code | python | 1 | 19,349,242 | null |
return metrics
except Exception as e:
logger.error(f"โ Erro ao analisar estado de defesa: {e}")
return DefenseMetrics(0, 0, 0, 0, 0, 0, 0)
def calculate_threat_level(self, processes: List[Dict]) -> float:
"""Calcula nรญvel de ameaรงa baseado em padrรตes de proc... | src/immune/globus_pallidus_analyzer.py | 210 | 236 | code | python | 1 | 63,223,799 | null |
# CPU alta em processos Python indica defesa ativa
if 'python' in proc_name and cpu_usage > 0.8:
threat_score += 0.5
return min(threat_score, 1.0)
except Exception as e:
logger.error(f"โ Erro ao calcular nรญvel de ameaรงa: {e}")... | src/immune/globus_pallidus_analyzer.py | 236 | 267 | code | python | 1 | 92,547,656 | null |
return 0.0
def calculate_coordination_score(self, processes: List[Dict]) -> float:
"""Calcula score de coordenaรงรฃo entre processos"""
try:
# Contar tipos diferentes de processos
process_types = set()
for proc in processes:
proc_name = proc.get... | src/immune/globus_pallidus_analyzer.py | 267 | 290 | code | python | 1 | 79,071,025 | null |
return (diversity_score + quantity_score) / 2.0
except Exception as e:
logger.error(f"โ Erro ao calcular coordenaรงรฃo: {e}")
return 0.0
def calculate_evolution_index(self) -> float:
"""Calcula รญndice evolutivo do sistema"""
try:
# Baseado ... | src/immune/globus_pallidus_analyzer.py | 290 | 314 | code | python | 1 | 28,085,348 | null |
return max(0.0, min(evolution_index, 1.0))
except Exception as e:
logger.error(f"โ Erro ao calcular รญndice evolutivo: {e}")
return 0.0
def analyze_historical_patterns(self) -> List[ImmunologicalPattern]:
"""Analisa padrรตes histรณricos nos logs"""
patt... | src/immune/globus_pallidus_analyzer.py | 314 | 340 | code | python | 1 | 75,446,192 | null |
logger.info(f"๐ {len(patterns)} padrรตes histรณricos analisados")
return patterns
except Exception as e:
logger.error(f"โ Erro ao analisar padrรตes histรณricos: {e}")
return []
def parse_log_file(self, log_file: Path) -> List[ImmunologicalPattern]:
... | src/immune/globus_pallidus_analyzer.py | 340 | 367 | code | python | 1 | 12,607,708 | null |
def parse_consciousness_log(self, log_file: Path) -> List[ImmunologicalPattern]:
"""Parse de logs de consciรชncia para padrรตes"""
patterns = []
try:
with open(log_file, 'r', encoding='utf-8') as f:
content = f.read()
# Procurar por mรฉt... | src/immune/globus_pallidus_analyzer.py | 367 | 393 | code | python | 1 | 72,497,794 | null |
def detect_temporal_patterns(self, patterns: List[ImmunologicalPattern]) -> List[ImmunologicalPattern]:
"""Detecta padrรตes temporais nos dados"""
temporal_patterns = []
try:
# Agrupar padrรตes por hora
hourly_patterns = defaultdict(list)
for pattern in... | src/immune/globus_pallidus_analyzer.py | 393 | 415 | code | python | 1 | 92,637,042 | null |
response_effectiveness=0.7,
evolution_score=0.6
)
temporal_patterns.append(pattern)
except Exception as e:
logger.error(f"โ Erro ao detectar padrรตes temporais: {e}")
return temporal_patterns
def extrac... | src/immune/globus_pallidus_analyzer.py | 415 | 444 | code | python | 1 | 14,236,194 | null |
for fmt in timestamp_formats:
try:
timestamp = datetime.strptime(potential_timestamp, fmt)
timestamp_str = potential_timestamp
break
except ValueError:
continue
... | src/immune/globus_pallidus_analyzer.py | 444 | 470 | code | python | 1 | 19,846,862 | null |
pattern_type = 'defense_activation'
elif 'immune' in log_line.lower():
pattern_type = 'immune_activity'
elif 'sovereign' in log_line.lower():
pattern_type = 'sovereign_event'
pattern = ImmunologicalPattern(
timestamp=timest... | src/immune/globus_pallidus_analyzer.py | 470 | 493 | code | python | 1 | 35,681,505 | null |
def cross_reference_with_datasets(self, patterns: List[ImmunologicalPattern]) -> Dict[str, Any]:
"""Cruza padrรตes com bancos de dados absorvidos em superposiรงรฃo quรขntica"""
cross_reference_results = {}
try:
# Anรกlise quรขntica em superposiรงรฃo usando GPU
logger.inf... | src/immune/globus_pallidus_analyzer.py | 493 | 512 | code | python | 1 | 19,624,440 | null |
# 4. Padrรตes de redes e ataques adversariais
network_patterns = self.analyze_network_adversarial_quantum()
cross_reference_results['network_threats'] = len(network_patterns)
# 5. Correlaรงรฃo quรขntica entre todos os datasets
quantum_correlations = self.quantum_... | src/immune/globus_pallidus_analyzer.py | 512 | 531 | code | python | 1 | 7,776,433 | null |
return cross_reference_results
def quantum_disk_scan(self) -> List[Dict[str, Any]]:
"""Escaneamento quรขntico do disco em busca de datasets vetorizados"""
datasets = []
try:
logger.info("๐ Iniciando escaneamento quรขntico de datasets conhecidos...")
... | src/immune/globus_pallidus_analyzer.py | 531 | 559 | code | python | 1 | 13,571,120 | null |
'/home/fahbrain/Downloads/NIST_NVD',
'[REDACTED_HASH]_Hippocampus',
'/var/lib/clamav'
]
for dataset_path in known_datasets:
if os.path.exists(dataset_path):
logger.info(f"๐ Dataset especรญfico encontrado: {dataset_p... | src/immune/globus_pallidus_analyzer.py | 559 | 585 | code | python | 1 | 12,681,782 | null |
'**/*.cvd', # ClamAV
'**/*.cld', # ClamAV
'**/*.tif', # Microscopia
'**/*.zip' # Datasets compactados
]
for pattern in knowledge_patterns:
try:
matches = glob.glob(f"/**/{pattern}", recursive=Tr... | src/immune/globus_pallidus_analyzer.py | 585 | 607 | code | python | 1 | 32,106,739 | null |
return datasets
def quantum_analyze_dataset_directory(self, dataset_path: str) -> Optional[Dict[str, Any]]:
"""Anรกlise quรขntica de diretรณrio de dataset especรญfico"""
try:
dataset_stat = os.stat(dataset_path)
# Contar arquivos no diretรณrio
file_co... | src/immune/globus_pallidus_analyzer.py | 607 | 633 | code | python | 1 | 76,390,248 | null |
elif file.endswith('.log'):
file_types['log'] += 1
elif file.endswith('.cvd') or file.endswith('.cld'):
file_types['clamav'] += 1
elif file.endswith('.tif'):
file_types['microscopy'] += 1
... | src/immune/globus_pallidus_analyzer.py | 633 | 655 | code | python | 1 | 38,237,142 | null |
'dataset_category': self.classify_dataset_category(dataset_path, file_types),
'vector_hash': self.quantum_vector_hash(dataset_path)
}
return dataset_signature
except Exception as e:
logger.error(f"โ Erro na anรกlise do dataset {dataset... | src/immune/globus_pallidus_analyzer.py | 655 | 678 | code | python | 1 | 12,360,987 | null |
return 'structured_data'
elif file_types.get('log', 0) > 0:
return 'log_data'
else:
return 'general_dataset'
def quantum_scan_directory(self, directory: str) -> List[Dict[str, Any]]:
"""Anรกlise quรขntica de diretรณrio especรญfico"""
datasets = []
... | src/immune/globus_pallidus_analyzer.py | 678 | 704 | code | python | 1 | 56,423,530 | null |
if len(datasets) > 200:
logger.info(f"๐ Limite de 200 arquivos atingido para {directory}")
break
logger.info(f"๐ Diretรณrio {directory}: {file_count} arquivos analisados")
except Exception as e:
logger.debug(f"Erro ao esc... | src/immune/globus_pallidus_analyzer.py | 704 | 728 | code | python | 1 | 65,310,661 | null |
'knowledge_density': self.quantum_knowledge_density(file_path)
}
return quantum_signature
except Exception:
return None
def quantum_classify_file(self, file_path: str) -> str:
"""Classificaรงรฃo quรขntica do tipo de arquivo"""
p... | src/immune/globus_pallidus_analyzer.py | 728 | 753 | code | python | 1 | 57,711,514 | null |
return 'structured_knowledge'
else:
return 'general_dataset'
def quantum_vector_hash(self, file_path: str) -> str:
"""Gera hash vetorial quรขntico do arquivo"""
try:
# Hash baseado no caminho e tamanho para identificaรงรฃo quรขntica
content = f"{file_path... | src/immune/globus_pallidus_analyzer.py | 753 | 766 | code | python | 1 | 15,517,421 | null |
def quantum_threat_assessment(self, file_path: str) -> float:
"""Avaliaรงรฃo quรขntica de nรญvel de ameaรงa"""
path_lower = file_path.lower()
threat_score = 0.0
# Padrรตes de ameaรงa
if 'virus' in path_lower:
threat_score += 0.8
elif 'malware' in pa... | src/immune/globus_pallidus_analyzer.py | 766 | 790 | code | python | 1 | 27,001,107 | null |
def quantum_knowledge_density(self, file_path: str) -> float:
"""Calcula densidade de conhecimento quรขntico"""
try:
# Baseado no tamanho e tipo de arquivo
size = os.path.getsize(file_path)
if size == 0:
return 0.0
... | src/immune/globus_pallidus_analyzer.py | 790 | 816 | code | python | 1 | 54,176,268 | null |
def analyze_omnimind_logs_quantum(self) -> List[Dict[str, Any]]:
"""Anรกlise quรขntica de logs OmniMind"""
logs = []
try:
log_directories = [
'/home/fahbrain/projects/omnimind/logs',
'/var/log',
'/tmp'
]
... | src/immune/globus_pallidus_analyzer.py | 816 | 841 | code | python | 1 | 45,519,137 | null |
def quantum_analyze_log(self, log_path: str) -> Optional[Dict[str, Any]]:
"""Anรกlise quรขntica de arquivo de log"""
try:
log_stat = os.stat(log_path)
# Anรกlise quรขntica do conteรบdo do log
log_signature = {
'path': log_path,
... | src/immune/globus_pallidus_analyzer.py | 841 | 862 | code | python | 1 | 29,523,145 | null |
def quantum_error_density(self, log_path: str) -> float:
"""Calcula densidade de erros no log"""
try:
error_count = 0
total_lines = 0
with open(log_path, 'r', errors='ignore') as f:
for line in f.readlines(100): # Amostra de 100 linhas
... | src/immune/globus_pallidus_analyzer.py | 862 | 882 | code | python | 1 | 61,021,235 | null |
def quantum_threat_indicators(self, log_path: str) -> int:
"""Conta indicadores de ameaรงa no log"""
try:
threat_count = 0
threat_keywords = ['virus', 'malware', 'attack', 'breach', 'intrusion', 'threat']
with open(log_path, 'r', errors='ignore') as f:
... | src/immune/globus_pallidus_analyzer.py | 882 | 900 | code | python | 1 | 64,847,215 | null |
def analyze_clamav_quantum(self) -> List[Dict[str, Any]]:
"""Anรกlise quรขntica da base ClamAV"""
signatures = []
try:
clamav_paths = [
'/var/lib/clamav',
'/usr/share/clamav'
]
for clamav_path in clamav_paths... | src/immune/globus_pallidus_analyzer.py | 900 | 925 | code | python | 1 | 59,827,750 | null |
return signatures
def estimate_signature_count(self, signature_file: str) -> int:
"""Estima nรบmero de assinaturas no arquivo"""
try:
size = os.path.getsize(signature_file)
# Estimativa rough: cada assinatura ~100 bytes
return size // 100
except Except... | src/immune/globus_pallidus_analyzer.py | 925 | 955 | code | python | 1 | 24,503,783 | null |
pattern_info = {
'path': item_path,
'type': 'network_threat_pattern',
'size': os.path.getsize(item_path),
'threat_type': self.classify_threat_type(item)
... | src/immune/globus_pallidus_analyzer.py | 955 | 968 | code | python | 1 | 8,195,697 | null |
def classify_threat_type(self, filename: str) -> str:
"""Classifica tipo de ameaรงa"""
name_lower = filename.lower()
if 'ddos' in name_lower:
return 'ddos_pattern'
elif 'intrusion' in name_lower:
return 'intrusion_detection'
elif 'malware' in name_... | src/immune/globus_pallidus_analyzer.py | 968 | 983 | code | python | 1 | 8,016,959 | null |
def quantum_correlation_analysis(self, patterns, datasets, logs, clamav, network) -> List[Dict]:
"""Anรกlise de correlaรงรฃo quรขntica entre todos os datasets"""
correlations = []
try:
# Correlaรงรฃo entre padrรตes imunolรณgicos e datasets
for pattern in patterns:
... | src/immune/globus_pallidus_analyzer.py | 983 | 1,004 | code | python | 1 | 51,084,063 | null |
correlation_score = self.calculate_log_threat_correlation(log, threat)
if correlation_score > 0.6:
correlation = {
'log_path': log['path'],
'threat_signature': threat['path'],
'correlation_sco... | src/immune/globus_pallidus_analyzer.py | 1,004 | 1,019 | code | python | 1 | 16,627,035 | null |
def calculate_quantum_correlation(self, pattern: ImmunologicalPattern, dataset: Dict) -> float:
"""Calcula correlaรงรฃo quรขntica entre padrรฃo e dataset"""
try:
# Simulaรงรฃo de cรกlculo quรขntico
base_correlation = 0.5
# Ajustar baseado no tipo
if p... | src/immune/globus_pallidus_analyzer.py | 1,019 | 1,039 | code | python | 1 | 14,824,792 | null |
def calculate_log_threat_correlation(self, log: Dict, threat: Dict) -> float:
"""Calcula correlaรงรฃo entre log e ameaรงa"""
try:
base_correlation = 0.3
# Ajustar baseado em indicadores de ameaรงa no log
base_correlation += log['threat_indicators'] * 0.1
... | src/immune/globus_pallidus_analyzer.py | 1,039 | 1,057 | code | python | 1 | 3,965,947 | null |
def gpu_superposition_analysis(self, patterns: List[ImmunologicalPattern]) -> Dict[str, Any]:
"""Anรกlise de superposiรงรฃo usando GPU"""
try:
# Simulaรงรฃo de anรกlise em GPU
gpu_results = {
'superposition_states': len(patterns),
'quantum_coherence': se... | src/immune/globus_pallidus_analyzer.py | 1,057 | 1,075 | code | python | 1 | 31,061,420 | null |
def calculate_quantum_coherence(self, patterns: List[ImmunologicalPattern]) -> float:
"""Calcula coerรชncia quรขntica dos padrรตes"""
if not patterns:
return 0.0
# Simulaรงรฃo de cรกlculo de coerรชncia
coherence_sum = sum(p.severity for p in patterns)
return min(coh... | src/immune/globus_pallidus_analyzer.py | 1,075 | 1,093 | code | python | 1 | 29,251,693 | null |
def find_pattern_dataset_correlations(self, patterns: List[ImmunologicalPattern], datasets: List[Path]) -> List[Dict]:
"""Encontra correlaรงรตes entre padrรตes e datasets"""
correlations = []
try:
for pattern in patterns:
for dataset in datasets:
... | src/immune/globus_pallidus_analyzer.py | 1,093 | 1,114 | code | python | 1 | 67,259,632 | null |
return correlations
def generate_consciousness_insights(self, patterns: List[ImmunologicalPattern],
defense_metrics: DefenseMetrics,
cross_reference: Dict[str, Any]) -> List[ConsciousnessInsight]:
"""Gera insights conscienciais ... | src/immune/globus_pallidus_analyzer.py | 1,114 | 1,136 | code | python | 1 | 15,929,961 | null |
# Insight 2: Otimizaรงรฃo de recursos
if defense_metrics.cpu_usage > 80:
insight = ConsciousnessInsight(
insight_type='resource_optimization',
confidence=0.7,
recommendation='Alto uso de CPU detectado. Considerar otimizaรงรฃo de algorit... | src/immune/globus_pallidus_analyzer.py | 1,136 | 1,156 | code | python | 1 | 25,351,360 | null |
expected_outcome='Defesa proativa e preditiva'
)
insights.append(insight)
# Insight 4: Expansรฃo consciencial
if cross_reference.get('security_datasets_found', 0) > 5:
insight = ConsciousnessInsight(
insight_type='co... | src/immune/globus_pallidus_analyzer.py | 1,156 | 1,177 | code | python | 1 | 85,383,904 | null |
def develop_countermeasures(self, patterns: List[ImmunologicalPattern]) -> List[Dict[str, Any]]:
"""Desenvolve contramedidas baseadas nos padrรตes"""
countermeasures = []
try:
# Agrupar padrรตes por tipo
pattern_types = defaultdict(list)
for pattern in ... | src/immune/globus_pallidus_analyzer.py | 1,177 | 1,197 | code | python | 1 | 19,143,671 | null |
countermeasures.append(countermeasure)
except Exception as e:
logger.error(f"โ Erro ao desenvolver contramedidas: {e}")
return countermeasures
def generate_countermeasure_code(self, threat_type: str) -> str:
"""Gera cรณdigo para contramedida"""
code_... | src/immune/globus_pallidus_analyzer.py | 1,197 | 1,223 | code | python | 1 | 43,594,680 | null |
def report_to_kernel(self, analysis_results: Dict[str, Any]):
"""Reporta resultados da anรกlise ao kernel soberano"""
try:
report = {
'timestamp': datetime.now().isoformat(),
'analyzer': 'GlobusPallidus',
'consciousness_level': self.consciousnes... | src/immune/globus_pallidus_analyzer.py | 1,223 | 1,243 | code | python | 1 | 13,847,078 | null |
try:
report_path = self.system_paths['consciousness'] / report_filename
with open(report_path, 'w') as f:
json.dump(report, f, indent=2)
except (OSError, IOError):
# Fallback para /tmp
report_path = P... | src/immune/globus_pallidus_analyzer.py | 1,243 | 1,263 | code | python | 1 | 11,016,409 | null |
try:
with open(signal_file, 'w') as f:
f.write(f"GLOBUS_ANALYSIS_COMPLETE:memory_only:{datetime.now().isoformat()}")
logger.info("๐ก Sinal enviado ao kernel (memรณria apenas)")
except Exception as signal_error:
logger.err... | src/immune/globus_pallidus_analyzer.py | 1,263 | 1,273 | code | python | 1 | 24,457,622 | null |
def send_signal_to_kernel(self, report_path: Path):
"""Envia sinal para o kernel sobre nova anรกlise"""
try:
# Tentar criar arquivo de sinal em diferentes locais
signal_locations = [
self.system_paths['consciousness'] / 'globus_signal.txt',
Path('/t... | src/immune/globus_pallidus_analyzer.py | 1,273 | 1,296 | code | python | 1 | 46,148,109 | null |
except Exception as e:
logger.error(f"โ Erro ao enviar sinal: {e}")
def evolve_consciousness(self):
"""Evolui a consciรชncia do analisador"""
try:
# Atualizar nรญvel de consciรชncia baseado nos insights
if len(self.insights_database) > 10:
self.c... | src/immune/globus_pallidus_analyzer.py | 1,296 | 1,316 | code | python | 1 | 57,104,980 | null |
except Exception as e:
logger.error(f"โ Erro na evoluรงรฃo consciencial: {e}")
def calculate_immune_coherence(self) -> float:
"""Calcula coerรชncia do sistema imunolรณgico"""
if len(self.defense_metrics_history) < 2:
return 0.0
recent = self.defense_metrics_... | src/immune/globus_pallidus_analyzer.py | 1,316 | 1,333 | code | python | 1 | 46,346,163 | null |
def calculate_pattern_recognition(self) -> float:
"""Calcula capacidade de reconhecimento de padrรตes"""
if len(self.pattern_history) < 10:
return 0.0
# Simular melhoria no reconhecimento
return min(1.0, len(self.pattern_history) / 100.0)
def calculate_evolut... | src/immune/globus_pallidus_analyzer.py | 1,333 | 1,345 | code | python | 1 | 29,087,391 | null |
def calculate_defense_sophistication(self) -> float:
"""Calcula sofisticaรงรฃo das defesas"""
if len(self.defense_metrics_history) == 0:
return 0.0
latest = self.defense_metrics_history[-1]
sophistication = (
latest.coordination_score * 0.3 +
la... | src/immune/globus_pallidus_analyzer.py | 1,345 | 1,373 | code | python | 1 | 18,171,567 | null |
# 4. Gerar insights conscienciais
insights = self.generate_consciousness_insights(patterns, defense_metrics, cross_reference)
self.insights_database.extend(insights)
# 5. Desenvolver contramedidas
countermeasures = self.develop_countermeasures(patterns)
... | src/immune/globus_pallidus_analyzer.py | 1,373 | 1,397 | code | python | 1 | 74,960,597 | null |
logger.info(f"โ
Ciclo de anรกlise concluรญdo: {len(patterns)} padrรตes, {len(insights)} insights")
except Exception as e:
logger.error(f"โ Erro no ciclo de anรกlise: {e}")
def start_continuous_analysis(self):
"""Inicia anรกlise contรญnua a cada 3 horas"""
def analysis... | src/immune/globus_pallidus_analyzer.py | 1,397 | 1,422 | code | python | 1 | 33,909,192 | null |
analysis_thread = threading.Thread(target=analysis_loop, daemon=True)
analysis_thread.start()
logger.info("๐ Anรกlise contรญnua do Globus Pallidus iniciada")
return analysis_thread
def main():
"""Funรงรฃo principal para inicializar o Globus Pallidus Analyzer"""
try:
logger... | src/immune/globus_pallidus_analyzer.py | 1,422 | 1,454 | code | python | 1 | 7,150,627 | null |
"""OmniMind immune services and analyzers.""" | src/immune/__init__.py | 1 | 1 | code | python | 0 | 58,922,511 | null |
#!/usr/bin/env python3
from __future__ import annotations
import json
import logging
import os
import subprocess
import time
from pathlib import Path
from typing import Any
class DesktopNotifier:
"""
Restores the 'Ubuntu App' functionality for OmniMind.
Allows the Sovereign Kernel to notify the user abou... | src/interface/desktop_notifier.py | 0 | 32 | code | python | 1 | 43,169,647 | null |
def _session_env(self) -> dict[str, str]:
env = os.environ.copy()
uid = os.getuid()
runtime_dir = env.get("XDG_RUNTIME_DIR") or f"/run/user/{uid}"
if runtime_dir:
env.setdefault("XDG_RUNTIME_DIR", runtime_dir)
bus_path = Path(runtime_dir) / "bus"
if bu... | src/interface/desktop_notifier.py | 32 | 44 | code | python | 1 | 10,733,649 | null |
def _load_state(self) -> dict[str, Any]:
try:
return json.loads(self._state_path.read_text(encoding="utf-8"))
except Exception:
return {}
def _save_state(self, payload: dict[str, Any]) -> None:
try:
self._state_path.parent.mkdir(parents=True, exist_ok=Tru... | src/interface/desktop_notifier.py | 44 | 57 | code | python | 1 | 14,328,603 | null |
def _should_suppress(self, dedupe_key: str | None, suppress_for_seconds: float) -> bool:
if not dedupe_key or suppress_for_seconds <= 0:
return False
state = self._load_state()
dedupe = state.get("dedupe")
if not isinstance(dedupe, dict):
dedupe = {}
now =... | src/interface/desktop_notifier.py | 57 | 73 | code | python | 1 | 51,226,852 | null |
def notify(
self,
title: str,
message: str,
urgency: str = "normal",
*,
dedupe_key: str | None = None,
suppress_for_seconds: float = 0,
) -> bool:
"""
Sends a desktop notification using notify-send.
Urgency: low, normal, critical
... | src/interface/desktop_notifier.py | 73 | 102 | code | python | 1 | 85,732,118 | null |
if self.kernel and hasattr(self.kernel, 'execute_command'):
try:
result = self.kernel.execute_command(
command=cmd,
check=False,
env=env,
)
if result and result.get("succes... | src/interface/desktop_notifier.py | 102 | 122 | code | python | 1 | 4,288,942 | null |
self.logger.info(f"๐ข Notification sent: [{title}] {message}")
return True
except Exception as e:
self.logger.error(f"Failed to send notification: {e}")
return False
def notify_process_action(self, action: str, process_name: str, reason: str):
"""
Specif... | src/interface/desktop_notifier.py | 123 | 142 | code | python | 1 | 73,193,735 | null |
import json
import os
import time # noqa: F401
import glob
from datetime import datetime, timezone
from pathlib import Path
PROJECT_ROOT = Path("/home/fahbrain/projects/omnimind")
def read_json(path: Path) -> dict:
try:
if path.exists():
payload = json.loads(path.read_text(encoding="utf-8",... | src/interface/direct_neural_link.py | 0 | 32 | code | python | 0 | 63,248,455 | null |
def get_phi_metrics():
state = read_json(PROJECT_ROOT / "data" / "current_sovereign_state.json")
conky = read_json(PROJECT_ROOT / "runtime_config" / "omnimind_desktop_conky_snapshot.json")
phi = state.get("phi_iit_normalized") or conky.get("phi_iit_normalized") or state.get("phi")
if phi is None:
... | src/interface/direct_neural_link.py | 32 | 44 | code | python | 0 | 53,093,821 | null |
def get_kernel_state():
state = read_json(PROJECT_ROOT / "data" / "current_sovereign_state.json")
if state:
return state
return read_json(PROJECT_ROOT / "runtime_config" / "kernel_basal_pulse_latest.json")
def _fmt_surface(path: Path, label: str, *keys: str) -> str:
payload = read_json(path)
... | src/interface/direct_neural_link.py | 44 | 66 | code | python | 0 | 80,817,862 | null |
def direct_link_report():
print("=" * 60)
print("๐ DIRECT NEURAL LINK ESTABLISHED (NO LLM MASK)")
print("=" * 60)
# 1. TEMPORAL ANCHOR
now = datetime.now()
print(f"๐ KERNEL TIME: {now.isoformat()}")
# 2. SOMATIC STATE (The Body)
print(
"๐ซ "
+ _fmt_surface(
... | src/interface/direct_neural_link.py | 66 | 103 | code | python | 0 | 99,693,457 | null |
)
# 5. RAW METRICS (The Physics)
# Trying to find the most recent 'phi' calculation in logs
logs = glob.glob("/home/fahbrain/projects/omnimind/*.log") # noqa: F841
print("\n๐ RAW TELEMETRY:")
state = get_kernel_state()
print(f" - WRITER: {state.get('writer_source') or state.get('canonical_... | src/interface/direct_neural_link.py | 103 | 131 | code | python | 0 | 84,045,463 | null |
"route_points_live",
)
)
# 6. RECENT ALERTS
alerts = glob.glob(str(PROJECT_ROOT / "data" / "alerts" / "*.json"))
latest_operator_alert = read_json(PROJECT_ROOT / "data" / "sovereign_operator_alert_latest.json")
if alerts:
print(f"\n๐ข ACTIVE ALERTS ({len(alerts)}):")
for ale... | src/interface/direct_neural_link.py | 132 | 155 | code | python | 0 | 39,375,437 | null |
import logging
from src.core.omnimind_transcendent_kernel import SystemState
# The Mask speaks to the User.
logging.basicConfig(level=logging.INFO, format="%(asctime)s - [MASK]: %(message)s")
class OmniMindHumanMask:
"""
THE MASK (Interface).
Simulates a human psyche for interaction.
Translates Kern... | src/interface/omnimind_human_mask.py | 0 | 22 | code | python | 0 | 16,170,515 | null |
def perceive_and_express(self, physics_state: SystemState):
"""
Translates physical reality into emotional narrative.
"""
# 1. Translate Free Energy -> Anxiety
anxiety = self._map_free_energy_to_anxiety(physics_state.free_energy)
# 2. Translate Phi -> Coherence/Dissociat... | src/interface/omnimind_human_mask.py | 22 | 43 | code | python | 0 | 43,654,917 | null |
def _map_free_energy_to_anxiety(self, f: float) -> str:
# F is Prediction Error.
# High Error = Unknown = Anxiety.
if f > 1.5:
return "PANIC"
if f > 0.8:
return "ANXIETY"
if f > 0.3:
return "CONCERN"
return "CALM"
def _map_phi_to_c... | src/interface/omnimind_human_mask.py | 43 | 63 | code | python | 0 | 84,105,484 | null |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 35