AgentEvalTool/.scratch/v1.0/issues/02-lifecycle-api.md
sinohqb 9cdbc41808 docs(intelligent-eval): commit v1.0 spec, tickets, and post-v1.0 improvements
All 8 tickets' acceptance criteria checked off (incl. the real OpenClaw
E2E verified on t480). Trivial import-sort fix from ruff included.
2026-08-05 14:01:24 +08:00

18 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 02 — 智能评估核心生命周期 API
**What to build:** 智能评估的创建、规划、审批、取消、列表、详情 API。覆盖状态机 draft → planning → pending_approval → executing / cancelled 的转换。
**Blocked by:** 01数据模型就绪
**Acceptance criteria:**
- [x] `POST /api/intelligent-evals`创建body = name, target_id, goal, seeds, intent, role_description, time_window_hours状态 draft → planning
- [x] `PUT /api/intelligent-evals/{id}/plan`OpenClaw 提交粗计划body = plan JSON状态 planning → pending_approval
- [x] `POST /api/intelligent-evals/{id}/approve`:用户批准,状态 pending_approval → executing记录 started_at
- [x] `POST /api/intelligent-evals/{id}/reject`用户打回body = feedback状态 pending_approval → planning记录 plan_feedback
- [x] `POST /api/intelligent-evals/{id}/cancel`:用户取消,状态 → cancelled仅 pending_approval / executing 可取消)
- [x] `GET /api/intelligent-evals`:列表(含 status、target 名称)
- [x] `GET /api/intelligent-evals/{id}`:详情(含完整 plan、进度信息
- [x] 状态机非法转换返回 409
- [x] 全部 X-API-Key 鉴权(沿用 `require_api_key`
- [x] 集成测试覆盖:创建 → 规划 → 审批 → 执行完整路径;打回 → 重新规划路径;取消路径;非法转换拒绝