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.
1.1 KiB
1.1 KiB
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-poolAPI(查询池状态) - 实现
POST /api/openclaw/cron-pool/scaleAPI(手动扩缩容) - 实现 cron 状态同步(从 OpenClaw 侧同步到平台 DB)
- 单元测试:扩容/缩容逻辑、状态同步
- 集成测试:手动触发扩容 → cron 数量增加;手动触发缩容 → cron 数量减少
- 可演示:手动触发扩容,看到 cron 数量从 5 增加到 10;查询池状态 API 返回正确的统计信息