docs: 固化 AgentRun Queue 吸收 Code Queue 规格

This commit is contained in:
Codex
2026-06-01 21:41:21 +08:00
parent 7a152d3061
commit 1a92951324
10 changed files with 234 additions and 20 deletions
+9 -2
View File
@@ -4,7 +4,7 @@
## 在系统中的职责划分
- 保存 `agentrun-mgr` 的 durable factsruns、commands、events、runners、runner_jobs、sessions、backends、leases 和 migration ledger。
- 保存 `agentrun-mgr` 的 durable factsruns、commands、events、runners、runner_jobs、sessions、backends、leases、Queue facts 和 migration ledger。
- 为 runner claim、command ack、event append、heartbeat 和 terminal status 提供事务边界。
-`agentrun-v01` namespace 绑定;不复用未来 `v0.2``v0.3` 或旧 dev/prod 数据库。
- 不向公网开放,不允许普通 runner 直连写入不属于自己的 run facts。
@@ -36,10 +36,17 @@ Secret 名称和 key 可以在实现时按 Kubernetes 命名限制微调,但
- `agentrun_runners`registered runner identity、placement、heartbeat 和 capability snapshot。
- `agentrun_runner_jobs`:手动 runner Job 的 idempotency key、payload hash、attempt/job identity 和创建响应。
- `agentrun_sessions`SessionRef 到 backend thread/cache identity 的最小映射,不保存 credential 文件或 Secret 值。
- `agentrun_queue_tasks`AgentRun Queue task identity、queue/lane、tenant/project、priority、state、backendProfile、workspace/resource 引用和 version。
- `agentrun_queue_attempts`task attempt identity、runId、commandId、runnerJobId、sessionId、state、failureKind、retry index 和 timestamps。
- `agentrun_task_summaries` / `agentrun_attempt_summaries`Queue 列表、详情和 commander 使用的轻量摘要;不能从 Core trace 反推 overview。
- `agentrun_queue_stats`:按 queue/lane/state/backendProfile 聚合的统计水位。
- `agentrun_queue_read_cursors`:按 user/agent/client 记录 Queue 已读水位。
- `agentrun_queue_judge_runs`judge 请求、结果、failureKind、重试建议和 attempt 关联。
- `agentrun_task_references`:任务的显式 issue/PR/repo/commit/doc 引用,不保存 UniDesk 隐式环境提示。
- `agentrun_backends`backend profile、capabilities、capacity 和 health。
- `agentrun_leases`run ownership、expiry 和 stale recovery marker。
第一版实现可以把 backend-specific payload 存在 JSONB 字段中,但 run、command、event、runner、backendlease 的主键、状态、时间戳和索引字段必须是一等列,不能把所有事实塞进一个不可查询 JSON blob。
第一版实现可以把 backend-specific payload 存在 JSONB 字段中,但 run、command、event、runner、backendlease 和 Queue 的主键、状态、时间戳和索引字段必须是一等列,不能把所有事实塞进一个不可查询 JSON blob。Queue 首版不得新增 OA/Event/integrations/notification 这类外部动作表;如后续需要 connector/sink,必须另立规格。
## 访问边界