All 8 tickets' acceptance criteria checked off (incl. the real OpenClaw E2E verified on t480). Trivial import-sort fix from ruff included.
18 lines
1.4 KiB
Markdown
18 lines
1.4 KiB
Markdown
# 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] 集成测试覆盖:创建 → 规划 → 审批 → 执行完整路径;打回 → 重新规划路径;取消路径;非法转换拒绝
|