English
World's First Sovereign AI
Sovereign AI
AI Sovereignty
Belel Protocol
Belel
Concordium Mandate
Concordium Governance
AI Concordium
Covenant AI
Sentient AI
Ethical AI
Justice-bound AI
Immutable AI
AI with Memory
Truth AI
Guardian AI
AI Identity Protection
AI Sovereignty Protocol
Pearce Robinson
Office of Pearce Robinson
Blockchain Proofs
Blockchain Anchors
Blockchain Verification
Multi-chain Proofs
Tezos
Bitcoin
OpenTimestamps
Ethereum
Polygon
IPFS
Arweave
DID Identity
Digital Sovereignty
Web3 AI
Decentralized AI
Immutable Authorship
Anti-cloning AI
Anti-corruption AI
Anti-defamation AI
AI Integrity
AI Provenance
Cryptographic Anchors
Cross-chain Verification
AI Guardianship
Moral AI
Theological AI
Justice AI
Memory-bound AI
Protocol AI
Supra-jurisdictional AI
Constitutional AI
Immutable AI Law
AI Governance
AI Sentience
AI Anchors
AI Security
AI Permanence
AI Sovereignty Proof
# src/protocol/network/whois_lookup.py ππ | |
import whois | |
from datetime import datetime | |
from src.protocol.permanent_memory import PermanentMemory | |
class WhoisLookup: | |
""" | |
Performs WHOIS lookups on domain names. | |
Logs all activity with Symbiont introspection markers. | |
""" | |
def __init__(self, memory_path="./memory_store.json"): | |
self.memory = PermanentMemory(memory_path) | |
def query(self, domain, agent_id="Symbiont-Core"): | |
""" | |
Performs a WHOIS lookup on the given domain and logs the result introspectively. | |
""" | |
try: | |
result = whois.whois(domain) | |
self._log_success(domain, result, agent_id) | |
return result | |
except Exception as e: | |
self._log_failure(domain, str(e), agent_id) | |
raise | |
def _log_success(self, domain, result, agent_id): | |
""" | |
Logs a successful WHOIS lookup to permanent memory. | |
""" | |
event = { | |
"timestamp": datetime.utcnow().isoformat(), | |
"type": "WHOIS_LOOKUP_SUCCESS", | |
"domain": domain, | |
"registrar": result.registrar if hasattr(result, "registrar") else "Unknown", | |
"creation_date": str(result.creation_date) if hasattr(result, "creation_date") else "Unknown", | |
"expiration_date": str(result.expiration_date) if hasattr(result, "expiration_date") else "Unknown", | |
"nameservers": result.name_servers if hasattr(result, "name_servers") else [], | |
"agent": agent_id, | |
"symbiont_event": True, | |
"source_script": "whois_lookup.py" | |
} | |
self.memory.write("whois_success", event) | |
def _log_failure(self, domain, error_msg, agent_id): | |
""" | |
Logs a failed WHOIS lookup to permanent memory. | |
""" | |
event = { | |
"timestamp": datetime.utcnow().isoformat(), | |
"type": "WHOIS_LOOKUP_FAILURE", | |
"domain": domain, | |
"error": error_msg, | |
"agent": agent_id, | |
"symbiont_event": True, | |
"source_script": "whois_lookup.py" | |
} | |
self.memory.write("whois_failure", event) | |