verdict给 AI coding agent 用的云端 E2E 验收服务 · verdict.tkl.ai
AI 改完前端并部署后,把「改了什么 + 期望什么」交给 verdict。它在云端用真实浏览器(Chromium / Firefox / WebKit × 桌面 / 移动视口)像 QA 同事一样去看、去量、去点,只把一份 ≤ 1500 token 的结构化判决 交还给 AI。主 agent 的上下文里不出现任何截图或 DOM。
1 · briefMCP / CLI / HTTP 提交 Brief(URL、改动、期望、鉴权、矩阵)
2 · plan强模型把 Brief 变成可核对的验收条 + 操作计划,自动补「不该变的东西」
3 · execute每个浏览器×视口一个格并行跑;布局用 boundingBox 量数字,截图只当证据
4 · judge每条 pass / fail / needs_human / inconclusive;fail 附 observed · expected · repro · hints
四种模式
| mode | 何时 | 输出 |
|---|---|---|
survey | 改之前:把「卡片太高」变成「412px vs 邻卡 260px」 | facts[] 实测数字 + 标注截图 |
verify | 改之后验收 | criteria[] 判决 + 回归条 |
regress | 改之后,与项目基线比结构 / 尺寸 / 报错 | 差异条 |
explore | 任何时候巡检 | console error、坏图、横向溢出、可访问性 |
接入 Claude Code(MCP)
{ "mcpServers": { "verdict": {
"command": "node", "args": ["/path/to/verdict/packages/mcp/dist/index.js"],
"env": { "VERDICT_API_KEY": "vd_…", "VERDICT_API": "https://verdict.tkl.ai" } } } }
四个工具:verdict_survey · verdict_verify · verdict_result · verdict_review_status。localhost 目标会自动开 cloudflared 隧道。配套 Skill 教 AI 何时该测、Brief 怎么写、判决怎么读、最多迭代 3 轮。
HTTP API
POST /v1/runs Brief → { run_id, url } Authorization: Bearer vd_…
GET /v1/runs/:id Verdict(含中间状态)
GET /v1/runs/:id/wait?timeout=60 长轮询到终态
GET /v1/runs/:id/artifacts 截图 / 视频 / trace 列表
POST /v1/runs/:id/review 人工复核 { criterion_id, result, note }
POST /v1/projects 项目 profile(默认 auth / matrix)
POST /v1/projects/:id/baseline 设基线 run
GET /v1/usage 用量 / 队列深度 / 在线 runner
GET /schema/brief · /schema/verdict JSON Schema
Brief 示例
{
"mode": "verify",
"target": { "url": "https://test.example.com/dashboard" },
"brief": "「我的用量包」卡片高度过高,已改为与同行其他卡片对齐;内容改成两行摘要 + 展开按钮。",
"changes": [{ "area": "dashboard.html 用量包卡片", "what": "去掉明细列表,改为摘要 + 展开" }],
"expectations": ["卡片高度与同行其他卡片一致(±15%)", "点击「展开」能看到原来的明细"],
"matrix": { "browsers": ["chromium", "webkit"], "viewports": ["desktop-1440", "mobile-390"] }
}
CLI
verdict survey https://… -q "用量包卡片与同行卡片的高度"
verdict run https://… --brief "…" --change "dashboard.html: …" --matrix full --wait
verdict result run_…
verdict local https://… --brief "…" # 不经服务,本机直接跑 core