"""
OMEGA Validation Rules
Prevent "simplifications" that remove real functionality
"""

FORBIDDEN_PATTERNS = [
    # Don't remove actual system imports
    ("removed", "from eden_unified_reasoner"),
    ("removed", "from episodic_memory"),
    ("removed", "from eden_emotional_core"),
    ("removed", "from phi_core"),
    
    # Don't replace function calls with string formatting
    ("replaced_with_template", "self._get_"),
    ("replaced_with_template", ".process("),
    ("replaced_with_template", ".query("),
]

def validate_not_lobotomy(original: str, modified: str) -> tuple[bool, str]:
    """Ensure OMEGA doesn't remove real intelligence."""
    
    # Check for removed imports of core systems
    core_imports = [
        "from eden_unified_reasoner",
        "from episodic_memory", 
        "from eden_emotional_core",
        "from phi_core",
        "EmotionalCore",
        "EpisodicMemory",
    ]
    
    for imp in core_imports:
        if imp in original and imp not in modified:
            return False, f"BLOCKED: Would remove core system: {imp}"
    
    # Check for removed method calls to real systems
    method_calls = ["_get_reasoner", "_get_memory", "_get_emotion", ".process(", ".query("]
    for call in method_calls:
        orig_count = original.count(call)
        mod_count = modified.count(call)
        if orig_count > 0 and mod_count == 0:
            return False, f"BLOCKED: Would remove all calls to {call}"
    
    return True, "OK"

print("[OMEGA VALIDATION] Anti-lobotomy rules loaded")
