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

75 lines
3.3 KiB
Python

#!/usr/bin/env python3
"""V140 E2E - Truth strip shows autonomy + NonReg badges with color coding"""
import asyncio, json, os
from playwright.async_api import async_playwright
OUT = "/var/www/html/api/blade-tasks/v140-truth-health-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'])
ctx = await browser.new_context(viewport={'width':1920,'height':1080})
page = await ctx.new_page()
errs = []
page.on('pageerror', lambda e: errs.append(str(e)))
await page.goto("https://weval-consulting.com/all-ia-hub.html?v=v140", wait_until='load', timeout=30000)
await page.wait_for_timeout(3000)
state = await page.evaluate("""() => {
const aut = document.getElementById('v140-autonomy');
const nr = document.getElementById('v140-nonreg');
return {
autonomy_html: aut?.innerHTML,
autonomy_text: aut?.textContent,
nonreg_html: nr?.innerHTML,
nonreg_text: nr?.textContent,
nonreg_title: nr?.title,
// Verify V139 still loaded all 6
agents: document.getElementById('v139-agents')?.textContent,
dashboards: document.getElementById('v139-dashboards')?.textContent
};
}""")
print("V140 state:", json.dumps(state, indent=2))
await page.screenshot(path=f"{OUT}/01-full-header.png", clip={'x':0,'y':0,'width':1920,'height':120})
# Verify all else still works (regression)
await page.click('[data-view="dashboards"]')
await page.wait_for_timeout(3500)
dash_state = await page.evaluate("""() => ({
tiles: document.querySelectorAll('#dash-grid a').length,
filters: document.querySelectorAll('.dash-filter').length
})""")
await ctx.close()
await browser.close()
verdict = 'OK' if (
state['autonomy_text'] and 'GODMODE' in state['autonomy_text'] and '100' in state['autonomy_text'] and
state['nonreg_text'] and '/' in state['nonreg_text'] and
state['agents'] and '906' in state['agents'] and
state['dashboards'] and '96' in state['dashboards'] and
dash_state['tiles'] >= 80 and
not errs
) else 'PARTIAL'
report = {
'v140': 'truth-health-badges',
'autonomy_displayed': bool(state['autonomy_text'] and 'GODMODE' in state['autonomy_text']),
'autonomy_preview': state['autonomy_text'],
'nonreg_displayed': bool(state['nonreg_text'] and '/' in state['nonreg_text']),
'nonreg_preview': state['nonreg_text'],
'v139_agents_intact': '906' in (state['agents'] or ''),
'v139_dashboards_intact': '96' in (state['dashboards'] or ''),
'dashboards_tab_still_84': dash_state['tiles'] >= 80,
'filters_still_present': dash_state['filters'] >= 15,
'js_errors': errs,
'VERDICT': verdict
}
with open(f"{OUT}/proof.json",'w') as f: json.dump(report, f, indent=2)
print("=== VERDICT:", verdict)
print(json.dumps(report, indent=2))
asyncio.run(main())