AgentEvalTool/.scratch/intelligent-eval-cron-pool/issues/02-cron-pool-management.md
sinohqb 1aa453ef0a feat(intelligent-eval): add cron pool data model and task queue API
Implement Ticket 01 of intelligent eval cron pool architecture (ADR-0007):

- Add 4 new tables: task_queue, cron_pool, config_snapshots, decision_logs
- Implement task enqueueing logic with priority calculation
- Implement task assignment and completion APIs
- Add unit tests (9) and integration tests (7)
- Update CONTEXT.md with new vocabulary
- Add ADR-0007 documenting cron pool architecture decision

All 760 tests passing.
2026-08-12 02:13:21 +08:00

19 lines
1.1 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 — Cron 池管理(平台侧)
**What to build:** 封装 OpenClaw CLI 客户端,实现 Cron 池的创建、删除、扩容、缩容逻辑,提供池状态查询和手动扩缩容 API。
**Blocked by:** 01 — 数据模型 + 任务入队 API
**Status:** ready-for-agent
- [ ] 封装 OpenClaw CLI 客户端(`openclaw automations create/remove/list`
- [ ] 实现池初始化逻辑(启动时创建 min_size 个 cron
- [ ] 实现池扩容逻辑busy/total > 0.8 且 total < max_size 时扩容
- [ ] 实现池缩容逻辑idle > min_size * 2 且 total > min_size 时缩容)
- [ ] 实现 `GET /api/openclaw/cron-pool` API查询池状态
- [ ] 实现 `POST /api/openclaw/cron-pool/scale` API手动扩缩容
- [ ] 实现 cron 状态同步(从 OpenClaw 侧同步到平台 DB
- [ ] 单元测试:扩容/缩容逻辑、状态同步
- [ ] 集成测试:手动触发扩容 → cron 数量增加;手动触发缩容 → cron 数量减少
- [ ] **可演示**:手动触发扩容,看到 cron 数量从 5 增加到 10查询池状态 API 返回正确的统计信息