diff --git a/api/agent-leads-sync.json b/api/agent-leads-sync.json index 57a6f9943..49334c02c 100644 --- a/api/agent-leads-sync.json +++ b/api/agent-leads-sync.json @@ -1,6 +1,6 @@ { "agent": "V45_Leads_Sync", - "ts": "2026-04-24T02:40:04+02:00", + "ts": "2026-04-24T02:50:03+02:00", "paperclip_total": 48, "active_customer": 4, "warm_prospect": 5, diff --git a/api/source-of-truth.json b/api/source-of-truth.json index 05c2ea6aa..f5590f6ba 100644 --- a/api/source-of-truth.json +++ b/api/source-of-truth.json @@ -1,13 +1,13 @@ { "ok": true, "source": "truth_registry_unified", - "built_at": "2026-04-24T00:40:01+00:00", + "built_at": "2026-04-24T00:50:01+00:00", "agents_count": 1000, "agents_total": 1000, "skills_count": 20176, "skills_total": 20176, - "intents_count": 2336, - "intents_total": 2336, + "intents_count": 2338, + "intents_total": 2338, "brains_count": 25, "doctrines_count": 19, "dashboards_count": 118, @@ -20,7 +20,7 @@ "counts": { "agents": 1000, "agents_total_live": 950, - "intents": 2336, + "intents": 2338, "skills_total": 20176, "brains": 25, "doctrines": 19, diff --git a/api/v83-business-kpi-latest.json b/api/v83-business-kpi-latest.json index 9537c88cd..5b1a66f61 100644 --- a/api/v83-business-kpi-latest.json +++ b/api/v83-business-kpi-latest.json @@ -1,15 +1,15 @@ { "ok": true, "version": "V83-business-kpi", - "ts": "2026-04-24T00:49:52+00:00", + "ts": "2026-04-24T00:51:35+00:00", "summary": { "total_categories": 8, "total_kpis": 64, "ok": 61, - "warn": 2, - "fail": 1, + "warn": 3, + "fail": 0, "wire_needed": 0, - "data_completeness_pct": 98.4 + "data_completeness_pct": 100 }, "by_category": { "revenue": { diff --git a/api/wevia-truth-registry.json b/api/wevia-truth-registry.json index 5a1803673..451b28b64 100644 --- a/api/wevia-truth-registry.json +++ b/api/wevia-truth-registry.json @@ -1,6 +1,6 @@ { "version": "1.0", - "built_at": "2026-04-24T00:40:01+00:00", + "built_at": "2026-04-24T00:50:01+00:00", "purpose": "WEVIA TRUTH REGISTRY · source de vérité unique pour agents/intents/skills/brains/doctrines", "consumers": [ "/api/wevia-master-api.php", @@ -16916,13 +16916,13 @@ ] }, "intents": { - "count": 2336, + "count": 2338, "arena_declared": 310, "arena_wired": 224, "arena_gap": 86, "arena_version": "Wave 115", "by_status": { - "EXECUTED": 1975, + "EXECUTED": 1977, "DISABLED": 17, "ACTIVATED": 229, "PENDING_APPROVAL": 11, @@ -16940,7 +16940,7 @@ "APPROVED_BY_OPUS_20AVR_V4": 1 }, "by_domain": { - "general": 2004, + "general": 2006, "site_web": 14, "agents": 239, "wevads_pipeline": 25, @@ -43883,6 +43883,23 @@ "description": "Retourne audit JSON de tous les markers WEVIA deployes + intents + presets + scripts. Dashboard visuel : /wevia-audit.html", "file": "/api/wired-pending/intent-opus4-wevia-audit.php" }, + { + "name": "wevia_cf_bypass", + "domain": "general", + "status": "EXECUTED", + "triggers": [ + "cfsolve", + "cfbypass", + "flaresolverr", + "cfclearance fetch", + "anticf solve", + "solve turnstile", + "anti-cloudflare" + ], + "source": "opus-doctrine-168", + "description": "", + "file": "/api/wired-pending/intent-opus4-wevia-cf-bypass.php" + }, { "name": "wevia_chrome_launch", "domain": "general", @@ -46753,6 +46770,20 @@ "description": "", "file": "/api/wired-pending/intent-opus4-wevia_plan_directeur.php" }, + { + "name": "wevia_playwright_ux_overlap_gemini_audit", + "domain": "general", + "status": "EXECUTED", + "triggers": [ + "playwright ux overlap audit s204", + "gemini vision review ux chevauchement hubs", + "audit ux top-right bot-right avec preuve video", + "lance playwright audit overlap doctrine 164" + ], + "source": "opus-phase26-doctrine164", + "description": "", + "file": "/api/wired-pending/intent-opus4-wevia_playwright_ux_overlap_gemini_audit.php" + }, { "name": "wevia_postmortem_rca", "domain": "general", @@ -50493,7 +50524,7 @@ "score": 100, "total": 153 }, - "apis_php_count": 1101, + "apis_php_count": 1102, "autonomy_score": 99.5, "autonomy_level": "GODMODE" } \ No newline at end of file diff --git a/api/wired-pending/intent-opus4-email_reach.php b/api/wired-pending/intent-opus4-email_reach.php index 2c1ffac2a..800b9e01a 100644 --- a/api/wired-pending/intent-opus4-email_reach.php +++ b/api/wired-pending/intent-opus4-email_reach.php @@ -9,7 +9,7 @@ return array ( 0 => 'email reach', 1 => 'reachability', ), - 'cmd' => 'echo "intent email_reach · domain ethica_b2b · priority P1 · Reachability 110220/151709 · status LIVE · source arena-wave-114-gap-fix"', + 'cmd' => 'timeout 10 curl -sk http://localhost/api/ethica-stats-api.php | jq -r "\"intent email_reach live - Reachability \" + (.with_email|tostring) + \"/\" + (.total|tostring) + \" (\" + (.pct_email|tostring) + \"%) - source ethica.medecins_validated S95 LIVE\""', 'status' => 'EXECUTED', 'created_at' => '2026-04-19T01:15:00+00:00', 'source' => 'opus-yacine-19avr-arena-gap-wire', diff --git a/api/wired-pending/intent-opus4-hcp_export.php b/api/wired-pending/intent-opus4-hcp_export.php index f3c8f3f26..c2333e31d 100644 --- a/api/wired-pending/intent-opus4-hcp_export.php +++ b/api/wired-pending/intent-opus4-hcp_export.php @@ -9,7 +9,7 @@ return array ( 0 => 'hcp export', 1 => 'export hcp', ), - 'cmd' => 'echo "intent hcp_export · domain ethica_b2b · priority P1 · HCP export CSV 146694 · status LIVE · source arena-wave-114-gap-fix"', + 'cmd' => 'timeout 10 curl -sk http://localhost/api/ethica-stats-api.php | jq -r "\"intent hcp_export live - HCP base \" + (.total|tostring) + \" ready for CSV export - source ethica.medecins_validated S95 LIVE\""', 'status' => 'EXECUTED', 'created_at' => '2026-04-19T01:15:00+00:00', 'source' => 'opus-yacine-19avr-arena-gap-wire', diff --git a/api/wired-pending/intent-opus4-playwright_gemini_v5.php b/api/wired-pending/intent-opus4-playwright_gemini_v5.php new file mode 100644 index 000000000..e03e34b2a --- /dev/null +++ b/api/wired-pending/intent-opus4-playwright_gemini_v5.php @@ -0,0 +1,324 @@ + 'Missing GEMINI_KEY or AGENT_TOKEN in secrets']); + exit; +} + +// Ensure proofs dir +if (!is_dir($PROOFS_DIR)) { + shell_exec('sudo mkdir -p ' . escapeshellarg($PROOFS_DIR) . ' && sudo chown www-data:www-data ' . escapeshellarg($PROOFS_DIR)); +} + +// === BUILD PLAYWRIGHT SCRIPT === +$jsScript = <<<'JSEOF' +const { chromium } = require('/usr/lib/node_modules/playwright'); +const fs = require('fs'); +const path = require('path'); + +const CONF = __CONF__; + +(async () => { + const browser = await chromium.launch({ + headless: true, + args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'] + }); + + const report = { wave: 305, timestamp: new Date().toISOString(), hubs: [], summary: { total: 0, passed: 0, failed: 0 } }; + + const allHubs = [...CONF.hubs_public.map(h => ({ hub: h, auth: false })), ...CONF.hubs_auth.map(h => ({ hub: h, auth: true }))]; + report.summary.total = allHubs.length; + + for (const entry of allHubs) { + const hub = entry.hub; + const safeHub = hub.replace(/\./g, '_'); + const hubResult = { hub, url: `https://weval-consulting.com/${hub}`, auth_required: entry.auth, checks: {}, artifacts: {} }; + + try { + const contextOpts = { + viewport: { width: 1920, height: 1080 }, + recordVideo: { dir: CONF.proofs_dir, size: { width: 1920, height: 1080 } } + }; + if (entry.auth) { + contextOpts.extraHTTPHeaders = { 'X-Agent-Token': CONF.agent_token }; + } + const context = await browser.newContext(contextOpts); + const page = await context.newPage(); + + const url = `${hubResult.url}?cb=${Date.now()}`; + const resp = await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 25000 }); + hubResult.http_status = resp.status(); + await page.waitForTimeout(3500); // let SPA JS + content load + + // === CHECK 1: OVERLAP DETECTION (toggle/button blocs top-right/bottom-right) === + // Exclude A, NAV, HEADER, LINK tags (anchor links = ok) + const overlapCheck = await page.evaluate(() => { + const W = window.innerWidth; + const H = window.innerHeight; + const tr = [], br = []; + document.querySelectorAll('*').forEach(el => { + const s = window.getComputedStyle(el); + if (s.position !== 'fixed' && s.position !== 'absolute') return; + // Exclude anchors, nav, header, link tags + if (['A','NAV','HEADER','LINK','HTML','BODY','SCRIPT','STYLE','META','TITLE'].includes(el.tagName)) return; + // Exclude if inside a nav/header/a + if (el.closest && el.closest('a,nav,header')) return; + const r = el.getBoundingClientRect(); + if (r.width < 10 || r.height < 10) return; + if (r.width > W * 0.6 || r.height > H * 0.6) return; + const tag = el.tagName; + const cls = el.className.toString().slice(0, 80); + const id = el.id.slice(0, 40); + // Top-right quadrant + if (r.right > W - 30 && r.top < 100 && r.left > W * 0.7) { + tr.push({ tag, id, class: cls, pos: `${Math.round(r.left)},${Math.round(r.top)}`, size: `${Math.round(r.width)}x${Math.round(r.height)}` }); + } + // Bottom-right quadrant + if (r.right > W - 30 && r.bottom > H - 100 && r.left > W * 0.7) { + br.push({ tag, id, class: cls, pos: `${Math.round(r.left)},${Math.round(r.bottom)}`, size: `${Math.round(r.width)}x${Math.round(r.height)}` }); + } + }); + return { + top_right_count: tr.length, + bottom_right_count: br.length, + top_right: tr.slice(0, 3), + bottom_right: br.slice(0, 3) + }; + }); + hubResult.checks.overlap = overlapCheck; + hubResult.checks.no_overlap_tr = overlapCheck.top_right_count === 0; + hubResult.checks.no_overlap_br = overlapCheck.bottom_right_count === 0; + + // === CHECK 2: Gemini UX markers present === + const geminiCheck = await page.evaluate(() => { + const html = document.documentElement.outerHTML; + return { + geEntrance: html.includes('geV2Entrance') || html.includes('geEntrance'), + gePulse: html.includes('geV2Pulse') || html.includes('gePulse'), + geAmbient: html.includes('geV2Ambient') || html.includes('geAmbient'), + geShimmer: html.includes('geV2Shimmer') || html.includes('geShimmer') + }; + }); + hubResult.checks.gemini_markers = geminiCheck; + hubResult.checks.has_gemini_v2 = geminiCheck.geEntrance && geminiCheck.gePulse; + + // === CHECK 3: Screenshot full-page + hover === + const shotPath = path.join(CONF.proofs_dir, `${safeHub}.png`); + await page.screenshot({ path: shotPath, fullPage: true }); + hubResult.artifacts.screenshot = `/proofs/playwright-gemini-v5-w305/${safeHub}.png`; + + // === CHECK 4: Hover first card with zoom === + await page.evaluate(() => window.scrollTo(0, 100)); + await page.waitForTimeout(600); + const firstCard = await page.$('.kpi, [class*="card"], .stat-card'); + if (firstCard) { + await firstCard.hover(); + await page.waitForTimeout(1200); + const hoverPath = path.join(CONF.proofs_dir, `${safeHub}_hover.png`); + await page.screenshot({ path: hoverPath }); + hubResult.artifacts.hover = `/proofs/playwright-gemini-v5-w305/${safeHub}_hover.png`; + } + + await page.waitForTimeout(1200); + await context.close(); + + // Rename video + const vids = fs.readdirSync(CONF.proofs_dir).filter(f => f.endsWith('.webm') && !f.includes('_')); + if (vids.length) { + const latest = vids.map(f => ({ f, m: fs.statSync(path.join(CONF.proofs_dir, f)).mtime })).sort((a,b)=>b.m-a.m)[0]; + try { + fs.renameSync(path.join(CONF.proofs_dir, latest.f), path.join(CONF.proofs_dir, `${safeHub}.webm`)); + hubResult.artifacts.video = `/proofs/playwright-gemini-v5-w305/${safeHub}.webm`; + } catch(e) {} + } + + // Verdict + const pass = hubResult.checks.no_overlap_tr && hubResult.checks.no_overlap_br && hubResult.http_status === 200; + hubResult.status = pass ? 'PASS' : 'FAIL'; + if (pass) report.summary.passed++; else report.summary.failed++; + + } catch (err) { + hubResult.status = 'ERROR'; + hubResult.error = err.message.slice(0, 300); + report.summary.failed++; + } + + report.hubs.push(hubResult); + } + + await browser.close(); + fs.writeFileSync(path.join(CONF.proofs_dir, 'report.json'), JSON.stringify(report, null, 2)); + console.log(JSON.stringify({ done: true, summary: report.summary, url: 'https://weval-consulting.com/proofs/playwright-gemini-v5-w305/' }, null, 2)); +})(); +JSEOF; + +$conf = [ + 'proofs_dir' => $PROOFS_DIR, + 'hubs_public' => $HUBS_PUBLIC, + 'hubs_auth' => $HUBS_AUTH, + 'agent_token' => $AGENT_TOKEN +]; +$jsScript = str_replace('__CONF__', json_encode($conf), $jsScript); + +$scriptPath = '/tmp/pw-gemini-v5-w305.js'; +file_put_contents($scriptPath, $jsScript); + +// === EXECUTE PLAYWRIGHT SYNCHRONOUSLY (wait for completion) === +$startTime = time(); +$output = shell_exec('cd /tmp && timeout 180 node ' . escapeshellarg($scriptPath) . ' 2>&1'); +$execTime = time() - $startTime; + +// Check if report.json produced +$reportPath = $PROOFS_DIR . '/report.json'; +$pwReport = null; +if (file_exists($reportPath)) { + $pwReport = json_decode(file_get_contents($reportPath), true); +} + +// === GEMINI VISION UX REVIEW === +// Send first screenshot to Gemini for UX evaluation overlap +$geminiReview = ['skipped' => true, 'reason' => 'no screenshot']; +if ($pwReport && !empty($pwReport['hubs'])) { + $firstHubWithShot = null; + foreach ($pwReport['hubs'] as $h) { + if (!empty($h['artifacts']['screenshot'])) { + $firstHubWithShot = $h; + break; + } + } + if ($firstHubWithShot) { + $shotLocalPath = $PROOFS_DIR . '/' . basename($firstHubWithShot['artifacts']['screenshot']); + if (file_exists($shotLocalPath) && filesize($shotLocalPath) < 4 * 1024 * 1024) { + $imgB64 = base64_encode(file_get_contents($shotLocalPath)); + $prompt = "Tu es un expert UX doctrine 60 WEVAL. Analyse cette capture d'écran hub WEVIA. Détecte:\n1. Chevauchements/overlap de boutons-blocs en HAUT-DROITE et BAS-DROITE (interdits)\n2. Qualité UX: hiérarchie visuelle, lisibilité, espacement\n3. Améliorations concrètes dépassant qualité Opus\n\nRéponds en JSON: {overlap_tr_detected:bool, overlap_br_detected:bool, ux_score:0-10, improvements:[{priority,suggestion}]}."; + + $ch = curl_init("https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_KEY"); + curl_setopt_array($ch, [ + CURLOPT_POST => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HTTPHEADER => ['Content-Type: application/json'], + CURLOPT_TIMEOUT => 30, + CURLOPT_POSTFIELDS => json_encode([ + 'contents' => [['parts' => [ + ['text' => $prompt], + ['inline_data' => ['mime_type' => 'image/png', 'data' => $imgB64]] + ]]], + 'generationConfig' => ['temperature' => 0.3, 'maxOutputTokens' => 1500] + ]) + ]); + $gresp = curl_exec($ch); + $ghttp = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + $gdata = json_decode($gresp, true); + $gtext = $gdata['candidates'][0]['content']['parts'][0]['text'] ?? ''; + $geminiReview = [ + 'hub_analyzed' => $firstHubWithShot['hub'], + 'http_code' => $ghttp, + 'raw_response' => substr($gtext, 0, 2500), + 'image_size_kb' => round(filesize($shotLocalPath) / 1024) + ]; + } + } +} + +// === BUILD INDEX.HTML FOR NAVIGATION === +if ($pwReport) { + $rows = ''; + foreach ($pwReport['hubs'] as $h) { + $st = $h['status'] ?? '?'; + $stClass = $st === 'PASS' ? 'pass' : ($st === 'FAIL' ? 'fail' : 'err'); + $tr = $h['checks']['overlap']['top_right_count'] ?? '?'; + $br = $h['checks']['overlap']['bottom_right_count'] ?? '?'; + $v2 = !empty($h['checks']['has_gemini_v2']) ? '✅' : '❌'; + $shot = $h['artifacts']['screenshot'] ?? null; + $hover = $h['artifacts']['hover'] ?? null; + $video = $h['artifacts']['video'] ?? null; + $rows .= '
Hub analysé: '.htmlspecialchars($geminiReview['hub_analyzed']).'
'.htmlspecialchars($geminiReview['raw_response']).''; + } + + $idx = '
Timestamp: '.$pwReport['timestamp'].'
+| Hub | Status | HTTP | Auth | Gemini v2 | No TR overlap | No BR overlap | Shot | Hover | Video |
|---|
'.htmlspecialchars(json_encode($pwReport, JSON_PRETTY_PRINT)).'+'; + file_put_contents($PROOFS_DIR . '/index.html', $idx); +} + +// === FINAL JSON RESPONSE === +echo json_encode([ + 'intent' => 'playwright_gemini_v5', + 'executed' => true, + 'provider' => 'wevia-autonomous-v5-w305', + 'exec_time_seconds' => $execTime, + 'stdout_tail' => substr($output, -300), + 'playwright_summary' => $pwReport['summary'] ?? null, + 'gemini_review' => [ + 'hub' => $geminiReview['hub_analyzed'] ?? null, + 'http_code' => $geminiReview['http_code'] ?? null, + 'response_excerpt' => isset($geminiReview['raw_response']) ? substr($geminiReview['raw_response'], 0, 500) : null + ], + 'proofs_index' => 'https://weval-consulting.com/proofs/playwright-gemini-v5-w305/index.html', + 'proofs_dir' => 'https://weval-consulting.com/proofs/playwright-gemini-v5-w305/', + 'report_json' => 'https://weval-consulting.com/proofs/playwright-gemini-v5-w305/report.json', + 'timestamp' => date('c') +], JSON_PRETTY_PRINT); diff --git a/api/wired-pending/intent-opus4-s95_pmta.php b/api/wired-pending/intent-opus4-s95_pmta.php index 54322808c..d6fdbbd73 100644 --- a/api/wired-pending/intent-opus4-s95_pmta.php +++ b/api/wired-pending/intent-opus4-s95_pmta.php @@ -8,7 +8,7 @@ return array( 2 => 'agent s95-pmta', 3 => 'invoque s95-pmta', ), - 'cmd' => 'echo {"agent":"S95-PMTA","slug":"s95_pmta","status":"registered","ts":"\$(date -Iseconds)"}', + 'cmd' => 'curl -s -X POST https://wevads.weval-consulting.com/api/sentinel-brain.php --data-urlencode "action=exec" --data-urlencode "cmd=systemctl is-active pmta 2>&1 | head -1; echo ---; pmta status 2>&1 | head -5" --max-time 15', 'status' => 'EXECUTED', 'created_at' => '2026-04-19T17:50:00+00:00', 'source' => 'opus-wire-v26-b2-truth-registry',