Repository navigation
Closed
Labels
agent-runtimeAgent orchestration, memory, and extensionsAgent orchestration, memory, and extensionsblockedBlocked by external evidence or dependencyBlocked by external evidence or dependencyenhancementNew feature or requestNew feature or requestgit-workflowGit and pull request workflowsGit and pull request workflowsgoPull requests that update go codePull requests that update go codehelp wantedExtra attention is neededExtra attention is neededjavascriptPull requests that update javascript codePull requests that update javascript codesecuritySecurity boundary or high-risk capabilitySecurity boundary or high-risk capability高难度
Description
Parent: #98
问题概述 / Summary
当前最多两个 Specialist 和只读 fan-out 可以提供分析,但 Specialist 是明确的 no-tool runtime,不能独立编辑、运行、提交或交付。需要实现真正可交付的多代理编排:工具型子代理、隔离 Worktree、共享任务 DAG/邮箱、提交回收、冲突处理、合并和独立复核。
优先级 / Priority
P1。在单代理编辑/命令/恢复闭环稳定后推进。
当前基线 / Current baseline
- feat(agent): 结构化依赖等待、循环检测与可恢复唤醒 #50 已交付持久依赖等待、循环检测和可恢复唤醒;feat(agent): 模型驱动的有界 child 调度与总预算复核 #51 已交付模型驱动的有界 child 调度与总预算复核。
- Run/Mission/child、审批链、预算、事件、cancel fan-out 和只读 Specialist 已存在。
- Specialist 当前不能调用工具;没有 child-owned branch/worktree、提交收据、合并队列或交付审查。
- 本地 Git 已有 branch/commit,远端 Git/PR 已有受控操作,但缺少并行代理所有权和冲突协议。
范围 / Scope
- 定义
batch-delivery.v1:Root 拆分任务 DAG,声明文件/目录所有权建议、依赖、预算、验证和交付合同。 - Specialist 在 Code/Deliver 下获得显式缩小的工具 profile;默认只访问其 Worktree/任务 Scope,不继承 Root 全部权限、网络或 Secret。
- 每个可变更 child 使用独立 Git worktree/branch、lease、base commit 和 owner token;创建、恢复、取消、清理与 orphan reconciliation 可审计。
- 提供持久任务邮箱/状态流:dispatch、ack、progress、question、evidence、ready-for-review、changes-requested、accepted/aborted。
- child 交付必须包含 commit、diffstat、变更文件、测试收据、已知限制和 base/head;未提交 dirty state 不能标记完成。
- Root 或专用 Reviewer 使用 merge-base 完整 diff、调用链、生命周期和测试强度复核,再进入有序 merge queue。
- 合并前重放最新 base、检测所有权重叠、语义/文本冲突和测试漂移;冲突由明确任务处理,不自动选择一方覆盖。
- 支持失败隔离、预算回收、取消扇出、重试 generation、部分成果保留和最终 focused checks。
非目标 / Non-goals
- 不允许无界自我复制、无限嵌套或 child 自行创建高权限 child。
- 不让多个 Agent 直接写同一工作目录或共享可变 index。
- 不自动 push/开 PR/合并远端分支;外部副作用仍需用户授权。
- 不把 Agent 的“完成”声明当作测试或复核证据。
- 不在当前范围开放 Cyber Specialist。
涉及目录 / Affected directories
internal/coordinator/internal/application/internal/domain/internal/waitgraph/internal/repository/internal/workspace/internal/toolgateway/internal/toolbudget/internal/policy/internal/approval/internal/store/internal/events/internal/httpapi/cmd/web/src/docs/
依赖 / Dependencies
- 被“模型可调用的工作区工具”和“可逆编辑/Checkpoint”阻塞;命令能力通过其传递依赖获得。
- 复用 feat(agent): 结构化依赖等待、循环检测与可恢复唤醒 #50/feat(agent): 模型驱动的有界 child 调度与总预算复核 #51 的 DAG、generation、预算和等待语义,不另建不兼容调度器。
验收条件 / Acceptance criteria
- Root 可并行派发至少两个可交付 child,每个 child 使用不同 worktree/branch 和缩小工具 profile。
- child 无法读取/修改 Scope 外路径,无法继承未显式授予的网络、credential、Debug 或 delete 权限。
- 任务邮箱、DAG、lease、进度、问题、交付和取消在应用重启后可恢复且不重复执行。
- 每份交付绑定 base/head commit、完整 diff、测试/evidence receipt 和已知限制;dirty/uncommitted 状态不能伪装完成。
- 重叠修改、base 漂移、文本/语义冲突和测试失败会阻止合并并创建明确恢复路径。
- Reviewer 不依赖作者摘要,可从 merge-base 完整 diff和调用链独立复核。
- merge queue 逐项应用、每步可回滚/重新验证,失败不会污染其他 child worktree。
- cancel/timeout/crash 后进程、worktree、lease 与预算可安全回收,保留可审查成果。
- 并发、循环依赖、重复消息、stale generation、orphan cleanup 和真实 Git worktree 集成测试通过。
安全边界 / Security boundaries
多代理增加吞吐量,不增加总授权。Root 与所有 child 的 capability 并集不得超过用户对当前 Run 的显式上限。
Metadata
Metadata
Assignees
Labels
agent-runtimeAgent orchestration, memory, and extensionsAgent orchestration, memory, and extensionsblockedBlocked by external evidence or dependencyBlocked by external evidence or dependencyenhancementNew feature or requestNew feature or requestgit-workflowGit and pull request workflowsGit and pull request workflowsgoPull requests that update go codePull requests that update go codehelp wantedExtra attention is neededExtra attention is neededjavascriptPull requests that update javascript codePull requests that update javascript codesecuritySecurity boundary or high-risk capabilitySecurity boundary or high-risk capability高难度
Activity