Files
weval-l99/v110_proof.py
2026-04-24 04:38:58 +02:00

98 lines
4.0 KiB
Python

#!/usr/bin/env python3
"""V110 E2E proof: Multi-agent + cyber_tips + capabilities intents live"""
import asyncio, json, os
from playwright.async_api import async_playwright
OUT = "/var/www/html/api/blade-tasks/v110-multi-agent-tips-proof"
os.makedirs(OUT, exist_ok=True)
async def main():
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True, args=['--no-sandbox'])
context = await browser.new_context(
viewport={'width':1920,'height':1080},
record_video_dir=OUT
)
page = await context.new_page()
# Load Hub
await page.goto("https://weval-consulting.com/all-ia-hub.html?v=v110", wait_until='load', timeout=30000)
await page.wait_for_timeout(2500)
# Disable human mode for multi-agent test
await page.evaluate("() => document.getElementById('human-chk').click()")
await page.wait_for_timeout(500)
# Test 1: Multi-agent
await page.fill('#inp-chat', 'agis en multi agent et fais un bilan complet')
await page.click('#btn-chat')
await page.wait_for_timeout(25000)
multi_out = await page.evaluate("""() => {
const msgs = Array.from(document.querySelectorAll('#out-chat .msg'));
return msgs.slice(-2).map(m => ({
cls: m.className,
text: m.textContent.trim().substring(0, 600)
}));
}""")
print("MULTI-AGENT test:")
for m in multi_out:
print(f" [{m['cls']}] {m['text']}")
await page.screenshot(path=f"{OUT}/01-multi-agent.png", full_page=True)
# Test 2: cyber tips
await page.fill('#inp-chat', 'show tips')
await page.click('#btn-chat')
await page.wait_for_timeout(8000)
tips_out = await page.evaluate("""() => {
const msgs = Array.from(document.querySelectorAll('#out-chat .msg'));
return msgs.slice(-2).map(m => ({
cls: m.className,
text: m.textContent.trim().substring(0, 600)
}));
}""")
print("\nCYBER TIPS test:")
for m in tips_out:
print(f" [{m['cls']}] {m['text']}")
await page.screenshot(path=f"{OUT}/02-cyber-tips.png", full_page=True)
# Test 3: capabilities
await page.fill('#inp-chat', 'que peux tu faire')
await page.click('#btn-chat')
await page.wait_for_timeout(8000)
caps_out = await page.evaluate("""() => {
const msgs = Array.from(document.querySelectorAll('#out-chat .msg'));
return msgs.slice(-2).map(m => ({
cls: m.className,
text: m.textContent.trim().substring(0, 600)
}));
}""")
print("\nCAPABILITIES test:")
for m in caps_out:
print(f" [{m['cls']}] {m['text']}")
await page.screenshot(path=f"{OUT}/03-capabilities.png", full_page=True)
await context.close()
await browser.close()
# Verdicts
multi_ok = 'executed' in ' '.join([m['text'] for m in multi_out]).lower() and '14 agents' in ' '.join([m['text'] for m in multi_out])
tips_ok = 'cyber_tips' in ' '.join([m['text'] for m in tips_out]) or 'CF-Bypass' in ' '.join([m['text'] for m in tips_out])
caps_ok = 'capabilities' in ' '.join([m['text'] for m in caps_out]).lower() or 'orchestrer' in ' '.join([m['text'] for m in caps_out])
report = {
'v110': 'multi-agent-tips-capabilities',
'multi_agent_real_exec': multi_ok,
'cyber_tips_intent_wired': tips_ok,
'capabilities_intent_wired': caps_ok,
'VERDICT': 'ALL_WIRED' if (multi_ok and tips_ok and caps_ok) else 'PARTIAL'
}
with open(f"{OUT}/proof.json",'w') as f:
json.dump(report, f, indent=2)
print("\n=== V110 VERDICT:", report['VERDICT'])
print(json.dumps(report, indent=2))
asyncio.run(main())