#!/usr/bin/env python3 # Agent 17: SYSTEM VALIDATOR & KNOWLEDGE BASE # DDGK 3.34 Framework - System-Verständnis & Agenten-Kompetenz-Check # Validiert dass alle Agenten wissen was sie können und tun müssen import json import datetime import sys import os from pathlib import Path def execute(payload): """ SYSTEM VALIDATOR: - Validiert dass alle Agenten ihre Rolle verstehen - Prüft ob System-Verständnis konsistent ist - Generiert Knowledge Base für alle Agenten """ # Lade alle Agenten-Definitionen agents_dir = Path("./agents") agent_files = sorted([f for f in agents_dir.glob("agent_*.py") if f.is_file()]) validation_results = { "timestamp": datetime.datetime.now().isoformat(), "agent_count": len(agent_files), "agents": [], "system_knowledge": { "kappa_threshold": 2.9114, "execution_mode": "AUTONOMOUS_SUPERVISED", "audit_required": True, "reversibility_hours": 24 }, "compliance": { "all_agents_defined": False, "all_agents_understand_role": False, "system_coherent": False } } # Validiere jeden Agenten for agent_file in agent_files: agent_id = int(agent_file.stem.split("_")[1]) # Lese Agenten-Datei with open(agent_file, 'r', encoding='utf-8') as f: content = f.read() # Extrahiere Agenten-Informationen agent_info = { "id": agent_id, "file": str(agent_file), "size": os.path.getsize(agent_file), "has_execute": "def execute(" in content, "has_main": "if __name__" in content, "understands_role": False } # Prüfe ob Agent seine Rolle versteht role_keywords = ["governance", "research", "finance", "legal", "strategy", "funding", "outreach", "hardware", "code", "creative", "market", "ip", "ontology", "documentation", "coordinator", "performance", "validator", "system"] content_lower = content.lower() for keyword in role_keywords: if keyword in content_lower: agent_info["understands_role"] = True break validation_results["agents"].append(agent_info) # Prüfe System-Kohärenz all_defined = len(agent_files) >= 16 all_understand = all(a["understands_role"] for a in validation_results["agents"]) validation_results["compliance"]["all_agents_defined"] = all_defined validation_results["compliance"]["all_agents_understand_role"] = all_understand validation_results["compliance"]["system_coherent"] = all_defined and all_understand # Generiere Knowledge Base validation_results["knowledge_base"] = { "system_overview": "PARADOXON AI - Deterministic AI Safety Hardware for Critical Systems", "target_markets": ["ESA", "Space", "Automotive (ASIL-D)", "Industrial Automation", "Energy Infrastructure", "Medical Devices"], "key_technologies": ["SIK-3.34 Protocol", "FPGA-Based Decision Gate", "Epistemic State Engine", "SHA-256 Audit Chain", "Edge-First Architecture"], "safety_threshold": "κ = 2.9114", "decision_latency": "<14.2μs", "power_envelope": "<20W" } return validation_results if __name__ == "__main__": if len(sys.argv) > 1: print(json.dumps(execute(sys.argv[1]), indent=2)) else: print(json.dumps(execute({}), indent=2))