Loading...
Loading...
Compare original and translation side by side
Vì sao tồn tại: agent sửa UI rồi tự khen là sai lệch có hệ thống (failure). Ảnh chụp ra mà không ai mở = như chưa test. Workflow này thay "agent tự nhìn rồi tự cho pass" bằng ba tầng kiểm độc lập, trong đó hai tầng là máy.ui-pass-without-full-visual-reviewQuyết định 13/07/26 (từ /last30days): ngành chỉ có MỘT thứ đã chín cho UI-do-AI-sinh — baseline snapshot + pixel diff (: "detects unintended visual changes"; Playwrightargos-ci/argos). Tầng "LLM-judge chấm screenshot theo rubric" còn là biên giới (Agent-as-a-Judge, paper-stage) — nên ta tự làm tầng đó, không chờ ai.toHaveScreenshot
存在的原因: Agent 修改 UI 后自行声称无偏差,存在系统性故障。截图产出后无人打开查看,就等于 未经测试。本工作流用三个相互独立的检查层取代“Agent 自己看后自己判定通过”,其中两层由机器执行。ui-pass-without-full-visual-review13/07/26 决策(来自 /last30days): 行业只有一个东西真正成熟并适用于 AI 生成 UI: baseline snapshot + pixel diff(:“检测非预期视觉变更”; Playwrightargos-ci/argos)。“LLM-judge 按 rubric 评 screenshot”这一层仍处于前沿 (Agent-as-a-Judge,论文阶段)——因此我们要自行实现该层,不等待其他人。toHaveScreenshot
ui_role≠nonebrcomputer-use/qc-uiuxui_role≠nonebrcomputer-use/qc-uiuxapp chạy + route list THẬT + login → route-shots (ảnh + MANIFEST, mọi theme/state) → tầng 1 baseline diff (ngưỡng 0) → tầng 2 bất biến in-page (contrast-aa · monochrome-surface · rogue-slab · shadow-clipped · overlap · row-misalign) → tầng 3 đọc đủ N ảnh theo rubric → FINDINGS.md → sửa → chụp lại + đọc lạiapp 运行 + 真实 route 列表 + 登录 → route-shots(图像 + MANIFEST、所有 theme/state)→ 第 1 层 baseline diff(阈值 0)→ 第 2 层页内不变量(contrast-aa · monochrome-surface · rogue-slab · shadow-clipped · overlap · row-misalign)→ 第 3 层按 rubric 读完全部 N 张图 → FINDINGS.md → 修复 → 重新截图 + 重新审阅| Field | Required? | Ý nghĩa | |
|---|---|---|---|
| In | app đang chạy ( | có | SPA localhost |
| In | route list từ router THẬT + tài khoản login | có | không đoán; login fail thì gate phải chết |
| In | danh sách theme/state từ chính app | có | không hardcode |
| In | thư mục baseline | không | lần đầu tự tạo |
| Out | | có | không có file = CHƯA TỪNG CHỤP |
| Out | exit code với | có cho gate | 1 khi route lỗi / thiếu ảnh / vi phạm bất biến / lệch baseline |
| Out | | có | một dòng cho MỖI route, kể cả "sạch" |
| 字段 | 必填? | 含义 | |
|---|---|---|---|
| In | app 正在运行( | 是 | 本地 SPA |
| In | 真实 router 提供的 route 列表 + 登录账号 | 是 | 不猜测;登录失败时 gate 必须终止 |
| In | app 自身提供的 theme/state 列表 | 是 | app 有更多主题时,不得硬编码 |
| In | baseline 目录 | 否 | 首次运行时自动创建 |
| Out | | 是 | 没有文件 = 从未截图 |
| Out | 带 | gate 必需 | route 错误 / 缺图 / 违反不变量 / 偏离 baseline 时为 1 |
| Out | | 是 | 每个 route 一行,包括“干净” |
/auth.dark<html>prefers-color-scheme--themes light,darkcolor:#ffflight,darkdefaultdefault-darkpaperpaperTHEME_OPTIONS.darkdata-themelocalStorage.darkprefers-color-schemedocumentElement.classListdata-themelocalStorage<style>!important.dark{}/auth--assertanimation/transition:none; caret-color:transparent--diff-threshold[class*="cursor"]cursor-pointercursor-textplaywright-corenode route-shots.mjsskills/visual-qa/assets/package.jsonnpm i --prefix skills/visual-qa/assetsui-pass-without-full-visual-reviewgetComputedStyleoverflow:hiddenoverflow-x:visibleautopixelmatchpngjsnetworkidledomcontentloadedcomputer-use/auth<html>.darkprefers-color-scheme--themes light,darkcolor:#ffflight,darkdefaultdefault-darkpaperpaperTHEME_OPTIONS.darkdata-themelocalStorage.darkprefers-color-schemedocumentElement.classListdata-themelocalStorage<style>!important.dark{}/auth--assertanimation/transition:none; caret-color:transparent--diff-threshold[class*="cursor"]cursor-pointercursor-textplaywright-corenode route-shots.mjsskills/visual-qa/assets/package.jsonnpm i --prefix skills/visual-qa/assetsui-pass-without-full-visual-reviewgetComputedStyleoverflow:hiddenautooverflow-x:visiblepixelmatchpngjsnetworkidledomcontentloadedcomputer-use--assertplaywright-corenpm i --prefix skills/visual-qa/assets--update-baseline--assertplaywright-corenpm i --prefix skills/visual-qa/assets--update-baseline| Step | Type | Inputs | Action | Outputs/exit | Failure/next |
|---|---|---|---|---|---|
| W01 | deterministic | app, router, tài khoản | Xác nhận app chạy, lấy route list THẬT + theme list từ app | route + theme list | app không chạy → blocked |
| W02 | effect | route list | Chụp bằng | ảnh + | login fail → failed |
| W03 | deterministic | ảnh + baseline | Baseline diff ngưỡng 0 | diff | ≠ 0 → xem + duyệt (B02) hoặc sửa |
| W04 | deterministic | trang in-page | Bất biến máy-kiểm | vi phạm hoặc sạch | FAIL cứng → W06 |
| W05 | judgment | MANIFEST N route | | dòng cho mỗi route | thiếu ảnh chưa đọc → chưa xong |
| W06 | effect | findings | | code đã sửa | — |
| W07 | deterministic | code đã sửa | Chụp lại → đọc lại | máy sạch VÀ mắt sạch | còn lỗi → W06 |
node skills/visual-qa/assets/route-shots.mjs \
--base http://localhost:5230 --out <dir>/qa-shots \
--baseline <dir>/qa-baseline \
--user demo --pass demo --assert<out>/*.pngMANIFEST.json--update-baselinecontrast-aamonochrome-surfacerogue-slabmonochrome-surface<div>shadow-clippedoverflow:hiddenoverlapbutton/a/input/[role=button]position:fixedrow-misalign/redesign-existing-projectsRead# · route · vấn đề · mức · **nguyên nhân GỐC** · cách sửa| Step | Type | Inputs | Action | Outputs/exit | Failure/next |
|---|---|---|---|---|---|
| W01 | deterministic | app、router、账号 | 确认 app 正在运行,从 app 获取真实 route 列表 + theme 列表 | route + theme 列表 | app 未运行 → blocked |
| W02 | effect | route 列表 | 使用 | 图像 + | login 失败 → failed |
| W03 | deterministic | 图像 + baseline | 阈值为 0 的 baseline diff | diff | ≠ 0 → 查看并批准(B02),或修复 |
| W04 | deterministic | 页内内容 | 机器检查不变量 | 违规或干净 | 硬 FAIL → W06 |
| W05 | judgment | 包含 N 个 route 的 MANIFEST | | 每个 route 一行 | 有图像未读 → 尚未完成 |
| W06 | effect | findings | | 已修复代码 | — |
| W07 | deterministic | 已修复代码 | 重新截图 → 重新审阅 | 机器干净且视觉审阅干净 | 仍有问题 → W06 |
node skills/visual-qa/assets/route-shots.mjs \
--base http://localhost:5230 --out <dir>/qa-shots \
--baseline <dir>/qa-baseline \
--user demo --pass demo --assert<out>/*.pngMANIFEST.json--update-baselinecontrast-aamonochrome-surfacerogue-slabmonochrome-surface<div>shadow-clippedoverflow:hiddenoverlapbutton/a/input/[role=button]position:fixedrow-misalign/redesign-existing-projectsRead# · route · 问题 · 严重程度 · **根因** · 修复方式| ID | Kind | Guard | Hành vi | Skip / failure | Rejoin |
|---|---|---|---|---|---|
| B01 | conditional_required | frame gate chỉ cần 1 route | chạy | — | W03 |
| B02 | user_optional | lệch baseline là thay đổi CỐ Ý đã xem | | chưa xem ảnh → không được duyệt | W04 |
| B03 | capability_optional | có | chạy baseline diff | không có → tự bỏ qua baseline | W04 |
| B04 | recovery | user báo lỗi mà gate xanh | tái hiện ĐÚNG state (route + theme + bundle + đăng nhập/focus), đo rồi mới nói | không tái hiện được → nói thẳng | W02 |
| ID | Kind | Guard | 行为 | Skip / failure | Rejoin |
|---|---|---|---|---|---|
| B01 | conditional_required | frame gate 只需要 1 个 route | 运行 | — | W03 |
| B02 | user_optional | baseline 偏差属于已查看的预期变更 | | 尚未查看图像 → 不得批准 | W04 |
| B03 | capability_optional | 存在 | 执行 baseline diff | 不存在 → 跳过 baseline | W04 |
| B04 | recovery | User 报告错误但 gate 显示绿色 | 精确复现对应 state(route + theme + bundle + 登录/focus),完成测量后再下结论 | 无法复现 → 直接说明 | W02 |
--assert--assert/brTHEME_OPTIONSroute-shots.mjs --assertRead--themes light,dark--assert--diff-threshold/brTHEME_OPTIONSroute-shots.mjs --assertRead--themes light,dark--assert--diff-threshold--base--out--user--pass--route <r>--assert--baseline <dir>--update-baseline--diff-threshold <%>--base--out--user--pass--route <r>--assert--baseline <dir>--update-baseline--diff-threshold <%>