Script Playwright S204 (pas local) audit 9 pages: - 8 hubs doctrine 60 (paperclip-dashboard, deerflow-hub, ai-hub, wevia-multiagent-dashboard, brain-council, agents-hub, wevia-meeting-rooms) + wevia-meeting.php + WTP - Viewport 1440x900 - Screenshots top-right (1040-1440, 0-400) + bot-right (1040-1440, 500-900) - 18 zooms + 9 videos enregistrees Resultat Playwright: 0 overlaps detectes (max 1 elt par zone) Resultat Gemini Vision 2.5 Flash: 18/18 OK confirme Preuves publiques: - https://weval-consulting.com/proofs/wevia-ux-overlap-d60-2026-04-24T00-40-10/index.html - gemini-vision-review.json attache - videos webm captures Intent wevia_playwright_ux_overlap_gemini_audit wired: - Triggers: playwright ux overlap audit, gemini vision review chevauchement - Execution via WEVIA chat NL - Pipeline automatise: playwright + gemini vision + publication Zero regression. 0 chevauchements confirmes UX premium doctrine 60.
77 lines
2.8 KiB
Bash
Executable File
77 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
# Doctrine 164: Gemini Vision review zooms UX overlap
|
|
# Analyse chaque zoom avec Gemini 2.5 Flash vision pour détecter chevauchements visuels
|
|
|
|
set -u
|
|
AUDIT_DIR="${1:-$(ls -td /var/www/html/proofs/wevia-ux-overlap-d60-* 2>/dev/null | head -1)}"
|
|
ZOOMS_DIR="$AUDIT_DIR/zooms"
|
|
|
|
if [ ! -d "$ZOOMS_DIR" ]; then
|
|
echo '{"ok":false,"error":"zooms dir not found"}'
|
|
exit 0
|
|
fi
|
|
|
|
KG=$(sudo -n grep "^GEMINI_KEY=" /etc/weval/secrets.env 2>/dev/null | cut -d= -f2- | tr -d '"' | head -c 80)
|
|
if [ -z "$KG" ]; then
|
|
echo '{"ok":false,"error":"gemini key missing in secrets.env"}'
|
|
exit 0
|
|
fi
|
|
|
|
REVIEWS=()
|
|
COUNT=0
|
|
TOTAL=$(ls "$ZOOMS_DIR"/*.png 2>/dev/null | wc -l)
|
|
|
|
for IMG in "$ZOOMS_DIR"/*.png; do
|
|
COUNT=$((COUNT+1))
|
|
NAME=$(basename "$IMG" .png)
|
|
# Base64 encode (max 4MB for Gemini)
|
|
B64=$(base64 -w0 < "$IMG" | head -c 300000)
|
|
|
|
PROMPT="Tu es expert UX WEVAL doctrine 60. Analyse cette image zoom 400x400 (top-right ou bot-right d'une page WEVIA). Détecte si plusieurs boutons/toggles/badges/éléments se CHEVAUCHENT ou se superposent dans cette zone. Réponds en JSON strict: {overlap_detected: bool, elements_count: int, severity: none|low|medium|high, description: str<80chars, recommendation: str<100chars}. Pas de markdown."
|
|
|
|
PAYLOAD=$(python3 -c "
|
|
import json
|
|
payload = {
|
|
'contents': [{
|
|
'parts': [
|
|
{'text': '''$PROMPT'''},
|
|
{'inline_data': {'mime_type': 'image/png', 'data': '''$B64'''}}
|
|
]
|
|
}],
|
|
'generationConfig': {'temperature': 0.1, 'maxOutputTokens': 200}
|
|
}
|
|
print(json.dumps(payload))
|
|
" 2>/dev/null)
|
|
|
|
RESP=$(curl -sk -m 30 -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$KG" \
|
|
-H "Content-Type: application/json" \
|
|
-d "$PAYLOAD" 2>&1)
|
|
|
|
CONTENT=$(echo "$RESP" | python3 -c "
|
|
import sys, json, re
|
|
try:
|
|
d = json.loads(sys.stdin.read())
|
|
t = d['candidates'][0]['content']['parts'][0]['text']
|
|
# Extract JSON if wrapped
|
|
m = re.search(r'\{.*\}', t, re.DOTALL)
|
|
print(m.group(0) if m else '{}')
|
|
except: print('{\"error\":\"parse\"}')
|
|
" 2>&1)
|
|
|
|
REVIEWS+=("{\"image\":\"$NAME\",\"review\":$CONTENT}")
|
|
[ $COUNT -ge 18 ] && break # Safety cap
|
|
done
|
|
|
|
# Write JSON report
|
|
REPORT_FILE="$AUDIT_DIR/gemini-vision-review.json"
|
|
echo -n "{\"doctrine\":\"164\",\"ts\":\"$(date -Iseconds)\",\"agent\":\"gemini-2.5-flash-vision\",\"images_reviewed\":${#REVIEWS[@]},\"reviews\":[" > "$REPORT_FILE"
|
|
FIRST=1
|
|
for r in "${REVIEWS[@]}"; do
|
|
[ $FIRST -eq 1 ] && FIRST=0 || echo -n "," >> "$REPORT_FILE"
|
|
echo -n "$r" >> "$REPORT_FILE"
|
|
done
|
|
echo "]}" >> "$REPORT_FILE"
|
|
|
|
# Short output
|
|
echo "{\"ok\":true,\"doctrine\":\"164\",\"audit_dir\":\"$(basename $AUDIT_DIR)\",\"images_reviewed\":${#REVIEWS[@]},\"report_file\":\"${REPORT_FILE#/var/www/html}\",\"url\":\"https://weval-consulting.com${REPORT_FILE#/var/www/html}\"}"
|