#!/bin/bash # L99 BETON ORCHESTRATOR — chains existing L99 scripts into unified result # Paradigm: ENRICH existing scripts, never fragment. Opus = wiring. Master = executor. set +e cd /opt/weval-l99 mkdir -p results logs beton TS=$(date +%Y%m%d-%H%M%S) OUT=/opt/weval-l99/beton/l99-beton-$TS.json LOG=/opt/weval-l99/logs/l99-beton-$TS.log LATEST=/opt/weval-l99/beton/l99-beton-latest.json echo "[BETON] start $TS" | tee $LOG run_layer() { local id="$1" name="$2" cmd="$3" timeout="${4:-300}" echo "[L$id] $name START $(date +%H:%M:%S)" | tee -a $LOG local t0=$(date +%s) timeout $timeout bash -c "$cmd" >> $LOG 2>&1 local rc=$? local dur=$(($(date +%s)-t0)) echo "[L$id] $name END rc=$rc dur=${dur}s" | tee -a $LOG echo "{\"layer\":\"L$id\",\"name\":\"$name\",\"rc\":$rc,\"duration_s\":$dur}" >> /tmp/l99-beton-layers.jsonl } > /tmp/l99-beton-layers.jsonl # L1 INFRA — disk, docker, services run_layer "01" "INFRA" "df -h / && docker ps --format '{{.Names}} {{.Status}}' && systemctl is-active nginx php8.3-fpm postgresql" 60 # L2 AUTH SOUVERAIN run_layer "02" "AUTH_SSO" "bash /opt/wevia-brain/l99-sso-test.sh 2>&1 || bash /opt/weval-l99/weval-sso-health.sh" 120 # L3 PAGES VISUAL — 126 HTML + screenshots run_layer "03" "PAGES_VISUAL" "python3 /opt/weval-l99/l99-wevia-master-visual.py" 900 # L4 APIs run_layer "04" "APIS" "python3 /opt/weval-l99/l99-deep-scan.py 2>/dev/null || python3 /opt/weval-l99/l99-exhaustive.py" 600 # L5 BRAINS — 167 modules + dormants run_layer "05" "BRAINS" "python3 /opt/weval-l99/l99-ai-scanner.py 2>/dev/null || python3 /opt/weval-l99/gap-detector.py" 300 # L6 AGENTS — 13 IAs souveraines run_layer "06" "AGENTS" "python3 /opt/weval-l99/agent-scanner.py" 180 # L7 PROVIDERS LLM cascade 7 run_layer "07" "PROVIDERS" "curl -s https://weval-consulting.com/api/key-check.php?all=1 | head -100" 60 # L8 DATA RAG — Qdrant 15953 vecteurs run_layer "08" "DATA_RAG" "curl -s http://127.0.0.1:6333/collections | python3 -c 'import sys,json;d=json.load(sys.stdin);print(json.dumps(d))'" 60 # L9 DOCKER — 17 containers run_layer "09" "DOCKER" "docker ps -a --format '{{.Names}}|{{.Status}}|{{.State}}'" 60 # L10 CRONS run_layer "10" "CRONS" "crontab -l | grep -vc '^#' && ls -la /var/log/wevia-director/ 2>/dev/null | tail -20" 30 # L11 BUSINESS E2E — full pipeline run_layer "11" "BUSINESS_E2E" "python3 /opt/weval-l99/l99-master.py" 1800 # L12 SECURITY run_layer "12" "SECURITY" "python3 /opt/weval-l99/l99-security-scan.py 2>/dev/null || echo security-scan-placeholder" 300 # Aggregate python3 </dev/null echo "[BETON] done → $OUT" | tee -a $LOG cat $LATEST | python3 -c "import sys,json;d=json.load(sys.stdin);print('LAYERS:',d['layer_count'],'| TOTALS:',d['totals'],'| SCORE:',d.get('score_pct','?'),'%')"