Files
weval-l99/guardian-wire.py
2026-04-13 12:43:21 +02:00

34 lines
1.3 KiB
Python

import json,urllib.request
# Guardian: verify cognitive-wire is in production
try:
r=urllib.request.urlopen('https://weval-consulting.com/api/weval-ia-fast.php',timeout=5)
d=json.loads(r.read())
# GET returns status:ok,engine:WEVIA IA
print('Production alive:',d.get('status','?'))
except: pass
# Check file has cognitive-wire
c=open('/var/www/html/api/weval-ia-fast.php').read()
has_wire='cognitive-wire' in c
has_rag='ragCtx' in c
has_ma='maCtx' in c
print(f'cognitive-wire: {has_wire}, RAG: {has_rag}, multi-agent: {has_ma}')
if not has_wire:
print('ALERT: cognitive-wire MISSING from production!')
# Auto-restore from GOLD
import shutil
shutil.copy('/opt/wevads/vault/gold-4avr-brain/weval-ia-fast-FINAL.GOLD','/var/www/html/api/weval-ia-fast.php')
print('AUTO-RESTORED from GOLD')
# Post-restore: remove mirofish duplicate
import subprocess
subprocess.run(['python3','/opt/weval-l99/wevia-antiregression.py'])
# Guardian: WEVCODE v2.0 protection
wc=open('/var/www/html/api/wevcode-superclaude.php').read()
if 'cognitive-wire' not in wc or 'WEVCODE v2.0' not in wc:
print('ALERT: WEVCODE overwritten!')
import shutil
# No auto-restore for wevcode — just alert
else:
print('WEVCODE: v2.0 OK')
# mirofish_check_skip = True