Skip to content

docs(orchestration): define agent-lane subagent execution topology - #3660

Open
cocolord wants to merge 15 commits into
huangruiteng:mainfrom
cocolord:codex/generic-multi-agent-topology-20260826
Open

docs(orchestration): define agent-lane subagent execution topology#3660
cocolord wants to merge 15 commits into
huangruiteng:mainfrom
cocolord:codex/generic-multi-agent-topology-20260826

Conversation

@cocolord

@cocolord cocolord commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • define the prevention-first child_execution_task_packet_v0 and
    child_execution_guard_v0 contract for ephemeral children inside one
    registered LoopX agent lane
  • reject incomplete delegation per child before launch, bind every receipt to
    the exact task-packet digest and observed context mode, and classify only
    drifting child evidence for quarantine
  • keep LoopX context semantics provider-neutral; Harness adapters own native
    spawn_agent, Task, fork arguments, and provider session bindings
  • define clean context as the default: fresh maps to explicit
    fork_context=false, while forked_snapshot requires observed
    subagent_context_fork
  • do not claim Codex child resume until the Harness supplies the
    provider-owned child-session binding required by resume_agent
  • keep Todo completion validation with the registered parent; child packets
    expose only a public-safe authority marker, never the private command/argv
  • keep parent_blocked=false: the registered parent remains runnable and may
    retry fresh, replace the child, take over serially, or ignore optional output
  • align the public topology/receipt schema and capacity semantics with the real
    runtime implementation from feat(runtime): add prevention-first sub-agent execution guard #3668
  • keep registered multi-agent peer orchestration separate; no Auto Research or
    Deep Research specialization

Dependency And Review Range

This PR is temporarily stacked on #3668 exact head
222e8fa27d5004195ac8823f95a4883e61092bf6, because the canonical smoke must
execute the real Child Execution Guard implementation and that module is not
yet on main.

Both PRs originate from a fork, so GitHub cannot select the fork-only #3668
branch as this PR's base. The PR therefore keeps main as its GitHub base while
the commit ancestry is explicitly stacked.

Review the #3660-specific change with:

git diff 222e8fa27d5004195ac8823f95a4883e61092bf6...341149c72687f8676b1e2fa910bfffe40acf0a3c

That exact range contains five paths and seven documentation/characterization
commits. After #3668 merges, this branch should be rebased onto current main
before #3660 is merged.

TL;DR Update

The RFC now opens with the current six-point conclusion: same-agent-lane scope, prevention-first delegation, LoopX/Harness ownership, parent-retained authority, child-local drift handling, and enforced-versus-projected boundaries. The canonical smoke pins those first-screen claims against the active runtime contract.

Contract Boundary

The runtime now enforces:

  • complete task-packet qualification before emitting each child operation
  • child-local rejection for invalid context or capacity

It validates:

  • receipt-to-task-packet digest binding
  • planned versus observed context mode
  • workspace and effect boundaries

It projects, but does not itself execute or enforce:

  • stop/wait disposition for the affected child
  • evidence acceptance or automatic evidence removal
  • parent continuation and fallback choices

It does not yet claim:

  • live host tool interception
  • automatic host child termination
  • child-session resume without a provider-owned session binding

There is intentionally no global child settlement barrier. A required missing
deliverable may leave the parent's own acceptance unmet, but a drifting child
does not acquire authority to block the parent runtime.

Validation

  • uv run python examples/codex-subagent-orchestration-contract-smoke.py
    passed against the real stacked runtime
  • uv run python examples/docs-governance-smoke.py — passed
  • runtime focused Todo projection/admission/Turn/Codex suites — 182 passed
  • focused Ruff, Python compile, JSON parse, and git diff --check — passed
  • commit DCO and TRAE trailer checks — passed for all seven docs(orchestration): define agent-lane subagent execution topology #3660 commits
  • loopx canary premerge --from-git-diff --git-diff-base 222e8fa27d5004195ac8823f95a4883e61092bf6 --tier standard — passed:
    3 direct checks, 7 catalog canaries, 8 risk-profile smokes, and public
    boundary scan; 0 failures, 0 warnings, 0 manual holds
  • exact-head GitHub DCO, dependency review, Linux pytest, Windows,
    Pages/release builds, and SonarCloud checks — passed; deploy/publish/upload
    jobs skipped as expected

Scope

  • docs(orchestration): define agent-lane subagent execution topology #3660-specific diff: RFC, Codex integration documentation, public fixture,
    canonical contract smoke, and durable self-repair pattern
  • no new scheduler, task store, peer identity, settlement owner, or
    domain-specific coordinator
  • no raw transcript, credential, private link, local path, or internal context
    in committed public artifacts

Future-Facing Pass

Applied by moving the exact task-packet and evidence-admission contract into the
existing Turn-driver owner, while keeping native context creation and live host
containment in Harness adapters. A broader runtime or TypeScript settlement
rewrite is unnecessary and intentionally deferred.

@cocolord

Copy link
Copy Markdown
Contributor Author

@huangruiteng 请 review exact head f73e0a9e5fefa457f3a213b1f3222f8f51f04c9d.

This is a documentation/characterization PR only. It defines generic serial, ephemeral-child, durable-peer-session, and hybrid topology selection; requires aggregate work to materialize real Todo lanes; and adds host execution receipt plus reconciliation boundaries. Auto Research and Deep Research remain domain consumers, not orchestration owners.

Validation: focused contract smoke passed; existing task-orchestration smoke passed; admission tests 18 passed; docs governance passed; LoopX check reported a clean public boundary; premerge passed 16/16; all remote required checks are green. No runtime behavior changes in this PR.

@cocolord cocolord left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

@huangruiteng

Exact head: 3660@f73e0a9e5fefa457f3a213b1f3222f8f51f04c9d

English verdict: APPROVE. This documentation and characterization slice correctly distinguishes ephemeral host children from durable LoopX peer sessions, maps the proposal onto existing admission, Todo/lease, session-projection, workspace, and settlement owners, and adds a public-safe regression fixture for the observed drift. No runtime authority is changed in this PR. Focused smokes, admission tests, premerge canaries, boundary checks, and all exact-head GitHub checks pass.

详细中文评审

动机

当前 LoopX 已分别具备临时 child admission、注册 peer 协调、Todo claim/lease、session projection、独立 worktree 和 typed settlement,但缺少一个端到端合同来回答:一个任务何时应该串行、何时可以用短生命周期 host child、何时必须使用可恢复的 durable peer session,以及 host 实际启动的 worker 如何与 LoopX 已批准的 lane 对账。缺少这条 seam 时,界面上出现多个子智能体和独立 worktree 并不能证明 LoopX 控制面已为它们建立 Todo、身份、租约或外部副作用权限;主 agent 仍可能最终把多路工作压回一个 aggregate Todo。本 PR 正面定义这一缺口,并明确本阶段只做设计与 characterization,不把方案冒充已上线 runtime enforcement。

改动思路

RFC 以 serialephemeral_childrendurable_peer_sessionshybrid 四种拓扑统一描述执行选择。用户或 Goal policy 负责允许的并发、domain、repository、write scope 和 effect class;临时 coordinator 只在该 envelope 内选择并行数量与 fresh/resume/session 策略。aggregate work 必须先物化为普通 LoopX Todo lane,再引用现有 task_orchestration_contract_v2 child admission 或 task_orchestration_contract_v1 peer lane,不能用 host prompt 内部拆分替代控制面状态。

正向路径是:先产生 topology plan,再由 host 返回每 lane 的 compact execution receipt,最后把 receipt 与 Todo、lease、session、workspace 和 source state 做 reconciliation,所有 lane 均为 aligned/rejected/cancelled/incomplete 的合法状态后才允许后续 settlement。负向路径是发现未批准 spawn、缺 Todo lineage、durable session 未绑定、workspace 或 effect 越界、worker receipt 缺失时标记 typed drift;有用产出可以独立复核后保留,但不能追认原执行拓扑为合规。

具体改动

  • docs/architecture/rfcs/generic-multi-agent-execution-topology-v0.md 新增 draft RFC,定义四种拓扑、execution envelope、multi_agent_execution_topology_v0multi_agent_host_execution_receipt_v0multi_agent_control_plane_reconciliation_v0、drift reason codes、owner map、分阶段落地和 acceptance。
  • docs/integrations/codex-subagent-orchestration.md 将新拓扑接回现有 Codex 集成合同,明确 ephemeral child 只适合 held evidence/local result;branch push、PR mutation、publication、deployment 或跨 Turn follow-up 默认进入 durable peer session;worktree 只证明文件隔离,不证明 LoopX admission。
  • examples/fixtures/multi-agent-execution-topology-drift.public.json 用公共安全的四 lane 合成案例刻画:一个 aggregate Todo、四个 host worker、无 child admission/peer session/lease/receipt,最终只能判为 drifted。
  • examples/codex-subagent-orchestration-contract-smoke.py 检查三份合同名称、主要 drift code、public boundary,以及 fixture 的计划/观察/结算关系。
  • skills/loopx-self-repair/references/repair-patterns.md 增加通用 host_worker_control_plane_drift 模式,要求先选拓扑、为每 lane 建立 admission 与 receipt,再结算 aggregate work。

关键内容讲解

  1. RFC 的拓扑表把 durability 与 effect authority 联动:短只读或 held-local 输出可用 ephemeral child;需要 push、PR 状态修改或后续恢复的工作默认使用 durable peer session。
  2. topology plan 只引用既有 admission,不成为第二套 task store;Todo、lease、session 和 Turn settlement 仍是权威。
  3. host receipt 使用 opaque worker/session/workspace refs 与 typed effect classes,不复制 prompt、transcript、原始工具输出、凭据或本机路径。
  4. owner map 与源码一致:child admission 位于 control_plane/quota/task_orchestration_admission.py,peer activation 位于 control_plane/quota/task_orchestration.py,host operation planning 位于 control_plane/turn_driver/driver.py,session 与 operator projection 也已有现行协议。
  5. public fixture 把“界面有四个 worker”和“LoopX 有四条合规 lane”明确分开,能稳定捕获 aggregate Todo 未拆分、缺 lineage、缺 session/lease 和 aggregate settlement 无 lane evidence 等错误。

对主干的风险

未发现阻塞项。该 PR 明确标为 Draft RFC,并反复声明本 slice 无 runtime behavior change,因此不会让文档建议被误读为已强制执行。新 schema 目前是 proposed read model,不是持久状态权威;runtime enforcement 被明确推迟到 observation shape 获得第二个真实 host consumer 之后,并保留 TypeScript typed settlement 为最终 gate owner。文档没有创建 Auto Research、Deep Research 或 Issue Fix 专用 coordinator,也没有扩展用户权限。

主要残余风险是后续实现可能只落 receipt 而未落 settlement gate,或者把 host observation 误当 authority;RFC 的 implementation slices、acceptance 和 negative fixture 已明确阻止这种半实现被称为完成。另一个风险是文档篇幅较大,但 375 行 RFC、92 行 fixture 和 70 行 smoke 分别承担设计、代表性状态和 durable contract 三个职责,不是把实验日志或日期叙事塞进通用测试。

独立验证:Codex orchestration contract smoke 通过,现有 task-orchestration smoke 通过,admission tests 18 passedloopx check 对五个公开文件边界 clean;标准 premerge 共 16/16 通过且无 manual hold。GitHub exact-head DCO、dependency review、Pages build、Linux pytest、Windows 和 SonarCloud 全绿。唯一环境重试是默认 python3 缺 pytest,改用仓库现有隔离虚拟环境后 18 项测试通过,不是产品失败。

我的整体评价

这是一个边界清晰的 Slice 0:它没有过早加入 runtime framework,而是先统一概念、既有 owner、状态机输入输出和失败分类,并用实际容易误判的四 lane 场景做公共 characterization。它也正确表达了核心原则:host 执行能力不等于 LoopX admission,worktree 隔离不等于控制面归属,有用结果不等于原拓扑合规。综合完整 diff、现有 owner 对照、正负路径与验证,本轮结论为 APPROVE;正式 approval 因作者身份不可用,请维护者在此 exact head 上复审。

@huangruiteng

Copy link
Copy Markdown
Owner

sub agent的定位应该是并行加速同一agent alane下多个todo的推进,不要定位为multi agent。和multi loopx agent的orcheatration不太一样

@cocolord
cocolord force-pushed the codex/generic-multi-agent-topology-20260826 branch from f73e0a9 to dcf3dbd Compare August 26, 2026 13:01
@cocolord

Copy link
Copy Markdown
Contributor Author

@huangruiteng 已按定位纠正并 rebase 最新 main,请复审 exact head dcf3dbda3dc270af18494e352b4b3c3985256198

核心调整:

  • subagent 现在明确只用于同一个注册 LoopX agent lane 内,多个真实 Todo 的并行加速
  • aggregate work 必须先物化为同 lane 的多个 Todo,再由 task_orchestration_contract_v2 admission child;
  • child 只返回 evidence/held local work,push、PR mutation、发布等 durable remote effects 仍由注册 parent agent 执行;
  • 多个注册 LoopX agent 的 orchestration 继续由独立的 task_orchestration_contract_v1、peer identity、Todo ownership、liveness 与 activation 合同负责;host child card 不得被当成 peer agent;
  • public fixture 和 self-repair pattern 已同步改成 same-agent-lane drift,而不是要求四个 durable peer sessions。

验证:contract smoke、现有 task-orchestration smoke、admission tests 18 passed、compile/diff/public-boundary 均通过;标准 premerge 16/16 通过,无 manual hold。

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:REQUEST_CHANGES

复核 exact head:dcf3dbda3c8928df4ff7b7b3b931a94c55863369。owner 关于“subagent 只并行加速同一注册 agent lane 内多个 Todo、不得与多 LoopX peer orchestration 混淆”的反馈已经落实;但当前公共 fixture 与 smoke 对 execution envelope 的两个关键越界仍给出不完整、互相矛盾的 machine expectation,因此暂不应合并。

阻塞项

  1. [P1] max_children 越界没有对应的 typed reconciliation reason。 examples/fixtures/multi-agent-execution-topology-drift.public.json:6-8 把上限设为 3,而 :18-59 明确观察到 4 个 worker;RFC 又把 maximum concurrency 定义为 execution envelope 的一部分,并规定 coordinator 不得选择更强拓扑。但 docs/architecture/rfcs/generic-multi-agent-execution-topology-v0.md:218-229 的 required drift codes 没有 capacity/envelope exceed,fixture 的 expected_reconciliation.reason_codes 和 smoke 的 exact-set assertion 也完全遗漏这一事实。这样未来 reconciler 即使照合同实现,也无法机器化解释“其余 lineage/receipt 都合法但并发数超限”的场景。最低修复:增加如 child_capacity_exceeded(或统一的 typed envelope violation),让 fixture/smoke 断言它,并补一个其余条件均 aligned、仅 worker_count > max_children 时仍 fail closed 的回归案例。

  2. [P1] 副作用边界越界只写在 prose,machine fixture 反而把错误结论锁死。 两个 repair worker 的 permitted_effect_classes 包含 remote_branch_write/remote_pull_request_write,而 v0 合同明确 durable remote effects 留给注册 parent;fixture :79 也直接说 repair children exceeded the held-result effect boundary。可是 expected_reconciliation.reason_codes 没有 RFC 已定义的 side_effect_boundary_exceededexamples/codex-subagent-orchestration-contract-smoke.py:120-132 只数出两个 remote-write lane,随后却断言一个故意排除该 reason 的 exact set,所以 smoke 通过恰好证明它在固化不完整结果。最低修复:明确区分 requested/allowed/observed effect classes;若这里代表实际越界,就加入 side_effect_boundary_exceeded 并覆盖 otherwise-aligned negative case;若只是 host brief 过度授权,则使用独立 typed authorization reason,不能继续用 permitted_* 字段配合“已越界”的结论。

动机

这次修改要补齐一个真实且通用的控制面缺口:host 能启动多个 child、展示多张卡片并分配独立 worktree,并不等于 LoopX 已经为这些执行建立 Todo lineage、admission、effect authority 和可结算证据。旧文档同时讨论 registered peer 与 ephemeral child,容易让“host 执行容量”被误读为“多 LoopX agent orchestration”。新 head 已按 owner 反馈收窄:RFC 只负责同一 registered agent lane 内多个真实 Todo 的 subagent 并行;多个长期 LoopX peer 继续由 task_orchestration_contract_v1、peer identity、Todo ownership、liveness 与 activation 单独拥有。这个定位正确,也比新增领域专用 coordinator 更贴近现有 owner。

改动思路

正向路径是:aggregate work 先物化为同一 agent lane 的普通 Todo;task_orchestration_contract_v2 对每个 child lane 做 admission;parent 选择 serialephemeral_children topology;host 只在 envelope 内执行并返回 compact receipt;parent 将 receipt 与 Todo、source state、workspace 和 effect classes 对账,接受 held evidence/local work后,再由注册 parent 执行 push、PR mutation、发布等 durable effects并完成 settlement。authority 仍在 Todo/Turn/typed settlement,不在 host card 或新 read model。

负向路径是:无 admission、aggregate Todo 未拆分、state/workspace/receipt 缺失,或 concurrency/effect envelope 越界时,reconciliation 必须产生 typed drift 并阻断 optimistic aggregate completion/spend。有用产出可以独立读回后保留,但不能倒推原 topology 合规。当前前半条路径表达完整,后半条在 capacity 和 effect 两个最重要 envelope 维度上缺少一致的 machine expectation,这正是上述 blockers。

具体改动

  • docs/architecture/rfcs/generic-multi-agent-execution-topology-v0.md 新增 362 行 Draft RFC,定义 same-agent-lane topology、typed envelope、plan/receipt/reconciliation、owner map、失败修复与三阶段 runtime 落地边界。
  • docs/integrations/codex-subagent-orchestration.md 把该合同接回既有 Codex child admission,并明确 registered peers 是另一层 orchestration;worktree 只证明文件隔离,durable remote effects 在 v0 仍由 parent 执行。
  • examples/fixtures/multi-agent-execution-topology-drift.public.json 用四 worker 的公共安全案例表达 host activity 与 LoopX admission 的差异。
  • examples/codex-subagent-orchestration-contract-smoke.py 扩展 canonical smoke,检查新 RFC、集成文档、fixture 和 public/private boundary 关键断言。
  • skills/loopx-self-repair/references/repair-patterns.md 增加 host_worker_control_plane_drift 通用修复模式。

关键内容讲解

  1. topology plan 只引用现有 Todo/admission,而不复制权威状态,这避免形成第二套 task store。
  2. child receipt 只携带 opaque worker/workspace refs、typed effects 与 public-safe evidence,不授予 agent_id、lease 或 durable session identity。
  3. parent 保留 final validation、remote effect 与 writeback/spend 责任,准确落实了“subagent 是同 lane 并行执行器,不是 peer agent”的 owner 反馈。
  4. 现有 coverage scan 显示新 schema 只出现在 RFC、集成文档与 canonical smoke;底层 task_orchestration_contract_v2 已由现有 smoke/tests 覆盖。same-author PR #3668 是后续 observation runtime consumer,而不是同形 smoke farming。因而这份 fixture/smoke 有成为 durable reusable contract guard 的价值,但必须先修正上述 machine expectation,不能让 characterization 为错误结果背书。

对主干的风险

本 PR 声明无 runtime behavior change,所以当前不会直接放宽生产权限;主要风险是它将成为后续 observation/reconciliation 与 typed settlement enforcement 的公共设计输入。若按现状合并,runtime 可以正确识别“无 admission/无 receipt”,却漏掉超并发与 remote-effect authority 越界,而 smoke 仍显示绿色。这类 false green 比单纯文档遗漏更危险,因为它会让后续实现和复审误以为 envelope 已完整覆盖。

独立验证:新 Codex orchestration contract smoke 通过;现有 task-orchestration smoke 在 Python 3.13 下通过;admission tests 18 passed;docs-governance smoke、git diff --check 通过;loopx check 为 0 error 且 5 个变更文件 public-boundary clean(3 个 warning 均为无关既有状态)。系统默认 Python 3.9 低于仓库 >=3.11 要求,因此相关 smoke/tests 已在隔离 Python 3.13 环境复跑,不把旧解释器失败计为产品失败。exact-head GitHub required checks 绿色。fixture 的独立 jq readback 同时复现了 max_children=3worker_count=4、两个 remote-write lane,以及两类 reason 均缺失。

代码量方面,616 行新增主要是 362 行 RFC 与 162 行 fixture/smoke,主题一致且没有加入 runtime scaffolding;修复 blockers 后整体 scope 可接受。后续 runtime enforcement 仍应留在既有 typed settlement owner,不应在文档 slice 顺带增加第二套 authority。

我的整体评价

方向与 owner 修订都正确:这版已清楚分开 same-agent subagent 并行和 registered-peer orchestration,也把 Todo、admission、receipt、held result、durable effect 与 settlement 的职责放回最近 owner。当前请求修改不是反对该 topology,而是要求公共 contract、fixture 和 smoke 对自己已经声明的 execution envelope 保持自洽。补齐 capacity 与 effect 两条 typed negative case 后,可以快速 exact-head 复审;在此之前结论为 REQUEST_CHANGES

English verdict: REQUEST_CHANGES on exact head dcf3dbda3c8928df4ff7b7b3b931a94c55863369 — the same-agent-lane topology direction is correct and focused validation is green, but the public fixture/smoke omit both the 4-workers-over-max_children=3 violation and the stated remote-effect boundary violation from typed reconciliation, creating false-green contract coverage.

@cocolord
cocolord force-pushed the codex/generic-multi-agent-topology-20260826 branch from dcf3dbd to 7c2e020 Compare August 26, 2026 16:53
@cocolord

Copy link
Copy Markdown
Contributor Author

@huangruiteng 请复审 exact head 7c2e0201ae8663270d7d1f3718f881000903497f

已针对本轮两个 P1 blocker 做根因修复:

  • child_capacity_exceeded 加入 required typed drift reasons;公共 fixture 的 max_children=3 / observed workers=4 现在产生该 reason。
  • 明确区分 envelope allowed_effect_classes、worker requested_effect_classesobserved_effect_classes;remote branch/PR effects 现在产生 side_effect_boundary_exceeded
  • 新增两个 otherwise-aligned 单变量负例,分别证明仅容量越界、仅 effect 越界都会 fail closed,避免其他 drift reason 掩盖合同缺口。
  • RFC、Codex integration、public fixture、canonical smoke 与 self-repair pattern 已保持一致。

最终 head 已 rebase 到 origin/main@f937a952de38f18fd07451c0bdecde58e2872453。验证:contract smoke、现有 task-orchestration smoke、docs-governance smoke、JSON/compile/Ruff/diff checks 全过;admission tests 18 passed;LoopX boundary check 0 error / 0 warning;标准 premerge 16/16 passed、无 manual hold。远端 CI 正在新 head 上运行。

Future-facing pass:capacity/effect 继续作为同一 execution-envelope/reconciliation owner 的独立 typed invariants;未引入新 runtime authority 或额外抽象。

huangruiteng
huangruiteng previously approved these changes Aug 26, 2026

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:APPROVE

复核 exact head:7c2e0201ae8663270d7d1f3718f881000903497f。未发现新的阻塞项;上一轮两个 P1 blocker 均已在 typed contract、公共 fixture 和 canonical smoke 中一致修复。本结论批准当前文档/characterization 设计;合并仍应等待远端 Linux pytest 完成。

动机

本 PR 解决的是一个真实的控制面认知缺口:host 能并行启动多个 child、展示多个 worker 或分配独立 worktree,并不等于 LoopX 已经建立多个注册 agent、Todo ownership、lease 或 durable effect authority。根据 owner 反馈,当前版本已把范围收窄为“同一个注册 LoopX agent lane 内,多个真实 Todo 的 subagent 并行加速”;多个注册 LoopX agents 的长期协作继续由独立 peer identity、Todo ownership、liveness 与 activation 合同负责。这个定位与现有权限边界一致,也避免新增领域专用 coordinator。

改动思路

正向路径是:aggregate work 先物化为同一 agent lane 下的多个 Todo;现有 task_orchestration_contract_v2 为每个 child lane 做 admission;registered parent 在 execution envelope 内选择 serialephemeral_children;host 仅返回 compact receipt 和 held evidence/local work;parent 再对 Todo lineage、workspace、state revision 与 typed effect classes 做 reconciliation,最后由既有 Turn/Todo settlement owner 完成 durable writeback、remote effects 与 spend。

负向路径保持 fail closed:未 admission、Todo 未拆分、lineage/receipt/workspace 缺失、observed child 数超过 max_children,或 observed effect 超出 allowed_effect_classes 时,都产生 typed drift,不能用“结果有用”反推原执行拓扑合规。多个 registered peers 不进入这个 subagent read model,而走单独 peer orchestration contract。

具体改动

  • docs/architecture/rfcs/generic-multi-agent-execution-topology-v0.md 定义 same-agent-lane topology、execution envelope、plan/receipt/reconciliation read models、owner map、分阶段落地与 non-goals;新增 child_capacity_exceededside_effect_boundary_exceeded 两个独立 typed reason,并明确 observation-only 与后续 TypeScript settlement enforcement 的边界。
  • docs/integrations/codex-subagent-orchestration.md 将 RFC 接回现有 child admission,明确 subagent 不是 peer agent,durable branch/PR/publication/deployment effects 在 v0 仍由 registered parent 执行。
  • examples/fixtures/multi-agent-execution-topology-drift.public.json 使用 public-safe 四 worker 案例区分 envelope 的 allowed_effect_classes、worker 的 requested_effect_classesobserved_effect_classes;综合场景现在同时记录容量和副作用越界。
  • examples/codex-subagent-orchestration-contract-smoke.py 对 reason set 做 exact assertion,并新增两个 otherwise-aligned 单变量负例:只超 max_children、只超 effect boundary。这样其他 drift 不再掩盖这两个 invariant。
  • skills/loopx-self-repair/references/repair-patterns.md 将同一 typed capacity/effect 修复规则沉淀为通用 host_worker_control_plane_drift 模式。

上一轮 blocker 的最小回归均已满足:capacity-only case 的唯一 reason 是 child_capacity_exceeded;effect-only case 的唯一 reason 是 side_effect_boundary_exceeded。state classification 使用显式 reason code 与结构化字段,不依赖 substring/prose heuristic;核心描述保持 domain-neutral,并明确这些合同当前是文档/characterization,而不是已经 machine-enforced 的 runtime obligation。

对主干的风险

主要残余风险在后续实现阶段:如果只接入 host receipt 而没有最终 settlement gate,operator 可能看见 drift projection,却仍能错误结算 aggregate Todo。RFC 已把 observation-only Slice 1 与 typed settlement Slice 2 分开,并声明最终 deterministic gate 属于现有 TypeScript settlement owner,因此当前 PR 没有建立第二套 authority,也没有静默改变默认 runtime 行为。

这份 fixture/smoke 具有 durable value:它守护的是可复用的 admission/effect/reconciliation 公共边界,而非一次性运行输出;同作者相关 runtime PR 是后续 consumer,不是重复的同形 smoke。当前 766 行净增以 RFC、公共 fixture 和 canonical contract smoke 为主,主题统一,未加入未被调用的生产 scaffolding。

独立验证通过:Codex orchestration contract smoke、现有 task-orchestration smoke、admission tests 18 passed、docs-governance smoke、JSON readback、Ruff、compile、git diff --checkloopx check0 error,public boundary clean,3 个 warning 均为无关既有 goal/runtime 状态。GitHub exact-head DCO、dependency review、Pages build、Windows 和 SonarCloud 已通过;Linux pytest 在发布本 review 时仍为 pending,因此合并应继续由远端 check gate 控制。

我的整体评价

当前版本已经落实 owner 的核心定位,并完整修复上一轮 false-green:subagent 是同一注册 agent lane 内多个 Todo 的并行执行器,不是多 LoopX agent orchestration;capacity 与 effect authority 是彼此独立的 typed envelope invariant;公共 fixture、RFC、integration 文档、smoke 与 self-repair pattern 现在给出一致结论。设计边界、正负路径、公共安全与未来实现 owner 均清楚,当前 exact head 结论为 APPROVE

English verdict: APPROVE exact head 7c2e0201ae8663270d7d1f3718f881000903497f. The prior P1 blockers are resolved with independent typed child_capacity_exceeded and side_effect_boundary_exceeded invariants plus otherwise-aligned negative cases. The PR remains documentation/characterization only, keeps subagents inside one registered agent lane, and leaves durable peer orchestration and settlement authority with their existing owners. Focused local validation and all completed remote checks pass; merge should wait for the still-pending Linux pytest check.

@cocolord
cocolord force-pushed the codex/generic-multi-agent-topology-20260826 branch from 7c2e020 to 72181ef Compare August 26, 2026 17:13
@cocolord

Copy link
Copy Markdown
Contributor Author

补充 exact-head 更新:规范 PR 已跟进最新 main@ca1ad455d7c487132ce688eb1900c1b5c72f935e,当前 head 为 72181efd529386e37e61ae157a3df9e56c8425f5。主干已把历史 multi-agent launcher 迁至 demo/;RFC owner map 已同步为 shipped loopx/control_plane/turn_driver/ host observation contract,并明确 demo/multi_agent/ 不拥有该边界。聚焦 smoke 与 admission 18 passed 仍通过。当前 review state 已从 CHANGES_REQUESTED 变为 REVIEW_REQUIRED

@cocolord
cocolord force-pushed the codex/generic-multi-agent-topology-20260826 branch from 72181ef to 8ae9858 Compare August 26, 2026 17:18

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:REQUEST_CHANGES

复核 exact head 8ae9858e3d1f27f85c73195a232c94fc10d79da6。上一轮 capacity/effect 两个 false-green 已在本 PR 自己的 RFC、fixture 与 smoke 内部对齐;但当前 head 又明确把 control_plane/turn_driver/child_execution_topology.py 指为“现行 observation owner”,因此必须与该 active runtime contract 对账。独立对照同作者的 runtime PR #3668 exact head 93f068e8de6362e6a945d5645024f170a1e4120e 后,仍有两个 P1 合同冲突,暂不应合并。

Findings

  1. [P1] 公共 v0 JSON 示例仍发布了 runtime 会拒绝的字段形状。 触发条件是 host/adapter 按 RFC 的 multi_agent_execution_topology_v0 / multi_agent_host_execution_receipt_v0 示例实现。docs/architecture/rfcs/generic-multi-agent-execution-topology-v0.md:129-200 的 topology 使用 agent_id,receipt 仍包含 session_ref: null;紧随其后的 prose 和 docs/integrations/codex-subagent-orchestration.md:228-230 又说 child receipt 不得携带 durable session identity。当前 active observation implementation 则使用 coordinator_agent_id,其 exact receipt field set 明确不含 session_refagent_idtask_lease_ref,未知字段会在 normalizer fail closed。结果是这份标称“current host observation slice compatibility schema”的 canonical 示例不能通过它自己指向的 runtime boundary,并重新暴露了刚在 #3668 移除的 durable-peer owner 混入。最低修复:把 topology identity 与 exact runtime schema 对齐为 coordinator_agent_id,从 receipt 示例彻底删除 session_ref,同步补齐/核对 cancelled 等实际 reconciliation states;让 canonical smoke 解析示例 key set 并与 active schema/normalizer 做真实负向回归,而不是只搜索 prose phrase。

  2. [P1] child_capacity_exceeded fixture 固定了一个当前 reducer 不会产生的 reconciliation 结果,canonical smoke 因此仍是 false green。 触发条件是 otherwise_aligned_negative_cases.child_capacity_exceeded_onlymax_children=1,却计划并观察两条 otherwise-aligned lanes。RFC :213-240 要求 reconciliation 返回 child_capacity_exceeded,fixture 与 smoke也 exact-assert这个唯一 reason;但 #3668 的 topology builder 在 len(child_operations) > max_children 时于 plan construction 直接抛 ChildExecutionTopologyError(reason_code="child_capacity_exceeded"),不会生成该非法 topology。若手工把两条 lanes 塞进 topology,当前 reconcile_multi_agent_execution 完全不读取 execution_envelope.max_children,实测返回 status=reconciled、两条 lane 都无 reason;若计划一条但 host 多报一条,则 reason 是 unadmitted_child_spawn + orphaned_worker_result,不是 child_capacity_exceeded。当前 smoke只比较手写 fixture与手写期望,没有调用真实 builder/reducer,所以绿色不能证明公共 contract。最低修复有两条合法路线:要么把 RFC/fixture改成现行机器语义——capacity在 topology construction fail closed,额外 observed child按 unadmitted/orphaned分类;要么先让 runtime reducer真正拥有该 reason,再 rebase本 PR。无论选择哪条,回归都必须执行 active builder/reconciler,而不是从 implementation-independent JSON 自我证明。

动机

本 PR 要解决的核心问题是真实且通用的:host 能显示多个 child card、启动多个进程或分配多个 worktree,并不等于 LoopX 已经建立多个合规 Todo lanes、admission、effect authority和可结算证据。修订后的 owner定位也正确:subagent只并行加速同一 registered agent lane 内多个已 admission Todo;多个 registered LoopX peers 继续由独立的 identity、Todo ownership、liveness、activation 与 session owners管理。

这比新增领域专用 coordinator更小、更可复用。before状态是“一个 aggregate Todo + 多个 host workers”可以被误认为多 agent控制面;目标 after状态是每个 child都可追溯到 current v2 admission、Todo、source state、workspace、effect boundary与compact receipt,parent再保留 durable effects和最终 settlement。问题不在方向,而在公共 schema/characterization必须与已经出现的第一个真实 consumer保持同一机器语义,否则设计文档会成为第二套权威。

改动思路

正向路径表达为:aggregate work先物化为同一 registered agent lane 下的普通 Todo;task_orchestration_contract_v2 admission child lanes;parent在 typed envelope内选择 serialephemeral_children;host返回public-safe receipt与held evidence/local work;reconciliation比较Todo lineage、source state、workspace、effect与evidence;最后由既有Turn/Todo settlement owner执行durable writeback、remote effects与quota spend。registered peer orchestration不进入这条 child topology。

负向路径则要求无 admission、aggregate Todo未拆分、stale lineage、workspace/effect越界、missing/orphan receipt或aggregate settlement无lane evidence时 fail closed。有用结果可以独立readback后保留,但不能倒推原执行拓扑合规。这条架构主线合理;当前两个 findings集中在“文档声明的 exact v0 shape/reason”与“active builder/reducer实际接受和产生的 shape/reason”不一致。

具体改动

  • docs/architecture/rfcs/generic-multi-agent-execution-topology-v0.md 新增 373 行 Draft RFC,定义 same-agent-lane topologies、execution envelope、topology/receipt/reconciliation read models、owner map、failure repair、implementation slices与acceptance;latest rebase又把 observation owner从旧路径更新到 turn_driver/child_execution_topology.py,因此 schema对账已成为当前范围的一部分。
  • docs/integrations/codex-subagent-orchestration.md 增加 98 行并修改 4 行,把 RFC接回 adaptive child admission,明确subagent不是peer agent、worktree不证明admission、durable remote effects仍由registered parent执行,并记录enable/disable与peer coordination分界。
  • examples/fixtures/multi-agent-execution-topology-drift.public.json 新增 163 行公共合成fixture,包含四worker综合drift与capacity-only/effect-only两个单变量负例。
  • examples/codex-subagent-orchestration-contract-smoke.py 增加 135 行,检查RFC/集成文档phrase、fixture字段、reason exact set与public/private boundary;它当前没有调用真实topology builder、receipt schema或reducer,这是第二个finding能false-green的直接原因。
  • skills/loopx-self-repair/references/repair-patterns.md 增加一条 host_worker_control_plane_drift 通用修复模式,方向上正确地把Todo materialization、admission、capacity/effect boundary、parent durable effects与peer分界沉淀为durable pattern。

关键内容讲解

  1. topology decision把host execution capacity与LoopX authority分开,这是整个设计最重要的边界。
  2. execution envelope将max_childrenallowed_effect_classes视为两个独立不变量,避免一种drift掩盖另一种;但每个reason由builder还是reducer拥有,必须与runtime统一。
  3. child receipt应该只是opaque host observation,不得承诺peer identity/session/lease;因此nullable session_ref也不应留在exact public schema里。
  4. owner map正确复用v2 admission、Turn driver、Todo/workspace/continuation与typed settlement,没有创建第二个task store或scheduler。
  5. fixture/smoke的durable价值取决于它是否守护真实consumer;仅断言手写expected JSON和文档phrase不能替代对active builder/reducer的characterization。

对主干的风险

本 PR 不直接改变runtime,所以即时权限与writeback风险低;主要blast radius是它要成为 #3668 observation slice与未来 settlement enforcement的公共规范。若按现状合并,adapter作者会看到一个 runtime拒绝的session_ref字段与不同topology identity,后续实现者还会得到一个reducer无法产生的capacity-only期望。最危险的结果是canonical smoke持续绿色,让reviewer误以为docs/fixture/runtime已经一致。

独立验证 exact head:Codex orchestration contract smoke、现有 task-orchestration smoke、admission tests 18/18、docs-governance smoke、Ruff、compile、git diff --check均通过;loopx check为0 error且5个变更文件public boundary clean,3个warnings均为无关既有goal/runtime状态。GitHub exact-head在复核时仅展示SonarCloud success,未把旧head的checks冒充当前证据。对#3668 reducer的独立readback稳定复现:两条planned lanes under max_children=1被reconciled;一条planned lane加一条extra receipt只产生unadmitted/orphaned reasons。

existing-coverage scan显示新schema/reasons目前只出现在本PR的RFC、integration doc、fixture与smoke;同作者#3668是第一个真实runtime consumer,不是重复same-shape smoke farming。因而这不是贡献批量化问题,而是canonical smoke尚未绑定consumer的问题。770行净增主要由373行RFC、163行fixture和135行smoke构成,主题统一但partly avoidable:修复后应优先用实际schema/builder/reducer测试替代部分phrase与自描述fixture断言。

我的整体评价

same-agent subagent与registered peer的分界、parent持有durable effects、Todo先物化再admission、observation与settlement分阶段落地,这些核心判断都正确;上一轮capacity/effect两个conceptual blocker在文档内部也已修复。但latest head已经把active Turn-driver module列为owner,却没有完成最关键的schema与reason对账,导致公共example和canonical smoke对真实consumer给出错误结论。请把v0 field set、capacity ownership和runtime regression统一后再复审;当前整个PR结论为 REQUEST_CHANGES

English verdict: REQUEST_CHANGES on exact head 8ae9858e3d1f27f85c73195a232c94fc10d79da6. The same-agent-lane topology direction is sound, but the canonical v0 example still uses agent_id and nullable session_ref while the active Turn-driver contract uses coordinator_agent_id and rejects peer/session fields. The capacity-only fixture also expects a reconciliation reason the active reducer never emits: construction fails before such a topology exists, while extra observed children are classified as unadmitted/orphaned. All local doc/smoke/boundary checks pass, but the smoke is self-referential; bind it to the real schema/builder/reducer and align the public contract before merge.

@cocolord

Copy link
Copy Markdown
Contributor Author

@huangruiteng 收到 exact head 8ae9858e3d1f27f85c73195a232c94fc10d79da6 的两项新 blocker。结论同意:canonical v0 示例应使用 coordinator_agent_id 并彻底删除 child receipt 的 session_ref;capacity 应按 active runtime 的 construction-time typed failure 表达,extra receipt 则是 unadmitted/orphaned,而不是让手写 fixture 自证 reducer reason。

当前正确依赖顺序是先合入已获批且全绿的 runtime PR #3668 (93f068e8d);否则本 PR 无法在 CI 中执行 active child_execution_topology builder/schema/reducer,又不应复制一份 runtime 代码制造第二 owner。我已请求 maintainer 合入 #3668;合入后会立即 rebase 本 PR,更新 JSON examples/fixture,并让 canonical smoke 直接调用真实 schema、builder 和 reducer完成负向回归。

@cocolord
cocolord force-pushed the codex/generic-multi-agent-topology-20260826 branch from 8ae9858 to 2a0211f Compare August 27, 2026 04:56
@cocolord

Copy link
Copy Markdown
Contributor Author

@huangruiteng 请复审 exact head 2a0211faae0e3b0bf98b13436f2dc69d2415e5a9

已按本轮 Child Execution Guard 方向完成:不完整任务包在 launch 前拒绝;receipt 绑定 task packet digest;漂移 child 的 evidence 仅局部 quarantine;parent_blocked=false,parent 可 retry/replace/serial takeover/ignore optional result。canonical smoke 现在直接调用 #3668 的真实 builder/schema/normalizer/reconciler,修复了上一轮 schema 与 capacity semantics 两个 P1 blocker。

本 PR 临时叠加 #3668 exact head f8fc0578ba586064516184fb6226673eba80df37。两个 PR 都来自 fork,GitHub base 仍显示 main;请用 git diff f8fc0578ba586064516184fb6226673eba80df37...2a0211faae0e3b0bf98b13436f2dc69d2415e5a9 审阅 #3660 自身五个文件。#3668 合入后会再 rebase 到当前 main。

验证:canonical Guard smoke、docs governance、focused Ruff/compile/JSON/diff 全过;Guard 相关测试 121 passed;标准 premerge 4 direct + 7 catalog + 8 risk-profile + public boundary 全过,0 failure/warning/manual hold。

@cocolord
cocolord force-pushed the codex/generic-multi-agent-topology-20260826 branch 3 times, most recently from a36effe to 0027080 Compare August 27, 2026 07:59
@cocolord

Copy link
Copy Markdown
Contributor Author

@huangruiteng 请复审 exact head 0027080881b06a05b544fed16af6dfd5562d0983

RFC 已同步 clean-subagent 最终边界:LoopX 签名 context policy/native args,Codex host 创建上下文;默认 fresh -> spawn_agent(fork_context=false),parent snapshot 仅经 subagent_context_fork 显式开放。invalid/capacity child 只产生 pre-spawn rejection,不阻断 parent 或合法 sibling;receipt 以 context_mode 检测意外继承。

同时修正了 guidance-vs-obligation:pre-spawn qualification 是 enforced;receipt/context/workspace/effect 属于 validated observation;quarantined 当前是 reconciliation classification,evidence acceptance、live interception 和 automatic termination 尚未实现。

本 PR 临时叠加 #3668 exact head 5db21865cc42cd4b40115982e4295e80b4c6a252,请用 git diff 5db21865cc42cd4b40115982e4295e80b4c6a252...0027080881b06a05b544fed16af6dfd5562d0983 审阅五个 RFC/smoke 文件。canonical smoke、docs governance 与 standard premerge 均通过。

@cocolord cocolord changed the title docs(orchestration): define generic multi-agent execution topology docs(orchestration): define agent-lane subagent execution topology Aug 27, 2026
@cocolord

Copy link
Copy Markdown
Contributor Author

Final exact-head readback: 0027080881b06a05b544fed16af6dfd5562d0983 is mergeable and all GitHub checks are green. The #3660-specific review range remains 5db21865cc42cd4b40115982e4295e80b4c6a252...0027080881b06a05b544fed16af6dfd5562d0983; prior CHANGES_REQUESTED belongs to the superseded head and needs maintainer re-review. No self-merge attempted.

huangruiteng
huangruiteng previously approved these changes Aug 27, 2026

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:APPROVE(保留依赖合并门禁)

复核 exact head 0027080881b06a05b544fed16af6dfd5562d0983。此前关于 public schema、capacity ownership、真实 runtime 绑定、clean context 和 guidance-vs-obligation 的 blocker 已全部修复;本轮未发现新的 actionable blocker。这个批准只覆盖当前 exact head 的代码与合同质量,不代表可以越过依赖顺序:PR #3660 仍临时叠加 open PR #3668 exact head 5db21865cc42cd4b40115982e4295e80b4c6a252,应先合入并复核 #3668,再把 #3660 rebase 到最新 main,确认五文件 scope 与 head 未漂移后再进入 merge gate。

动机

LoopX 已经能够从同一 registered agent lane 中 admission 多个 child Todo,也能让 Codex host 启动临时 worker;但此前缺少一条从 admission、完整 task packet、真实 host context、compact receipt 到 parent reconciliation 的统一公共合同。结果是 UI 中多个 child card、多个进程或独立 worktree 容易被误读成多个 LoopX peer,甚至让未拆分 aggregate Todo、隐式继承 parent conversation、越界 effect 或陈旧 evidence 在 aggregate settlement 中失去可追溯性。

本 PR 将目标严格收窄为“同一注册 agent lane 内多个真实 Todo 的并行加速”。registered peers 仍由 task_orchestration_contract_v1、各自 identity/Todo/lease/session owner 管理;ephemeral child 只拥有当前 packet 内的执行能力,durable remote effect、evidence acceptance 与最终 settlement 仍归 registered parent 及现有 typed owner。这个边界解决了真实 drift,同时避免新增领域专用 coordinator 或第二套 task store。

改动思路

正向路径是:当前 task_orchestration_contract_v2 先 admission 多个普通 Todo;Turn driver 为每条 lane 编译 child_execution_task_packet_v0,签入 objective、acceptance、authority/state refs、scope/effect/workspace、budget、context mode 和 host native args;默认 clean Codex child 使用 spawn_agent(fork_context=false),只有观察到 subagent_context_fork 才允许 forked_snapshot。host 回传 exact packet digest、实际 context mode、workspace/effect 和 public-safe evidence refs,reconciler 将 aligned output 标记为 candidate_for_parent_acceptance,由 parent 决定是否接受。

负向路径是 prevention-first、fail-local:不完整 packet 或超出 max_children 的 lane 在 pre-spawn 阶段被拒绝且不生成 host operation;host 额外启动的 worker 被分类为 unadmitted_child_spawn + orphaned_worker_result;packet/context/workspace/effect 漂移只 quarantine 对应 child evidence,并给 parent retry_freshreplace_childserial_takeoverignore_optional_result,不阻断 parent 或合法 sibling。文档也准确区分了当前机器边界:pre-spawn qualification 已 enforced;receipt binding 是 validated observation;evidence acceptance、live tool interception 和 automatic termination 尚未实现。

具体改动

  • docs/architecture/rfcs/generic-multi-agent-execution-topology-v0.md 定义 agent-lane serial / ephemeral_children 拓扑、typed envelope、task packet、host receipt、reconciliation reason、owner map、分阶段实现和 acceptance。canonical JSON 已使用 coordinator_agent_id,receipt 明确不含 agent_id、lease 或 session_ref
  • docs/integrations/codex-subagent-orchestration.md 把 RFC 接回现行 admission/Turn driver,解释 adaptive admission、fresh/fork/resume 映射、claim/lease/worktree 边界、启停命令和 registered-peer opt-in;它明确说明 worktree 只证明文件隔离,不授予控制面或 external-effect authority。
  • examples/codex-subagent-orchestration-contract-smoke.py 不再让 prose 与手写 fixture 互相自证,而是直接调用 active builder/schema/normalizer/reconciler,覆盖 incomplete packet、capacity rejection、unadmitted worker、packet/context mismatch 和 effect exceed。
  • examples/fixtures/multi-agent-execution-topology-drift.public.json 将 pre-spawn 与 reconciliation 负例分开,并用 enforced_boundariesvalidated_observationsprojected_dispositionsunsupported_boundaries 准确表达当前实现层级。
  • skills/loopx-self-repair/references/repair-patterns.mdhost_worker_control_plane_drift 收敛成可复用修复模式:真实 Todo materialization、fresh-by-default、显式 fork capability、packet/context binding、child-local quarantine 与 parent fallback。

关键代码讲解

  1. build_multi_agent_execution_topology(...) 读取 v2 admission 和 max_children,逐 lane 调用 packet builder;无效 lane 写成 typed pre-spawn rejection,合法 lane 继续进入 topology。它让 capacity 或单条 brief 错误无法拖垮 parent/其他 sibling,也不会把非法 lane 送给 host。
  2. _child_task_packet(...) 把 objective、acceptance、authority/state refs、capability/write/effect boundary、workspace、budget、output、validation 和 context 合成一个 public-safe packet,并计算 task_packet_digest_child_context_contract(...) 对 Codex spawn_agent 强制显式 fork_context 与计划 mode 一致,消除“fresh”名称与实际继承行为不一致的空间。
  3. child_execution_receipts_json_schema()normalize_multi_agent_host_execution_receipts(...) 使用 exact field set、typed enum、数量上限、opaque ref 和 additionalProperties=false;receipt 中出现 peer/session/lease 字段会 fail closed,而不是被静默忽略。
  4. reconcile_multi_agent_execution(...) 将每条 planned lane 与 receipt 按 lane id 对账,_lane_reason_codes(...) 独立检查 lineage、execution kind、source state、packet digest、context、workspace、effect 和 evidence。漂移结果投影为 quarantined/candidate 与 fallback,但显式返回 observation_only=truesettlement_enforced=false,没有伪造 settlement authority。
  5. canonical smoke 的 main() 构造真实 operation/envelope/receipt 并执行上述 active symbols。尤其 capacity case 证明 builder 只 admission 一条 lane 并产生 child_capacity_exceeded rejection;extra receipt 则通过 reconciler 得到 unadmitted/orphaned,修复了上一轮 self-referential false green。

对主干的风险

本 PR 自身主要是公共合同、fixture 和 durable smoke,直接 runtime blast radius 低;最大的集成风险是它依赖尚未进入 main#3668 runtime。当前 GitHub PR 相对 main 仍显示 15 个文件、约 2992 行净变更,而 #3660 自身相对 stacked base 是五个文件、约 1136 行。因此合并前必须先解决依赖顺序并重新确认 final diff,不能把本次五文件复核当成允许将 open dependency 一并带入主干。

四个要求的 review lens 均通过:state/reason 使用 typed enum/schema 和 exact negative cases;kernel 文案保持 domain-neutral;文档明确披露当前 runtime behavior 与未实现边界;机器 enforced、validated observation、projection recommendation 与未来 obligation 已分层表达。scope-fit 也成立:canonical smoke 有 active consumer,不是 phrase-only 或实验性 walkthrough;528 行 RFC、164 行 fixture 和约 289 行 smoke 虽然体量不小,但分别承担 normative contract、public-safe negative data 和真实 runtime regression,主题统一且仍可独立回滚。future-facing pass 已通过复用现有 Turn-driver owner、删除 peer/session 混入和真实 consumer 绑定完成;没有必要再增加新 abstraction。

独立 exact-head 验证通过:canonical Codex contract smoke、现有 task-orchestration smoke、docs-governance smoke;focused admission/CLI/driver/executor tests 128 passed;Ruff、py_compile、PR-specific git diff --check 均通过;GitHub DCO、dependency review、Linux pytest、Windows PowerShell、build、Pages 和 SonarCloud completed checks 全绿。未独立执行 live host child lifecycle、自动 evidence rejection 或 settlement barrier,因为当前合同明确把它们列为 unsupported/non-enforced;这不是被绿色 smoke 掩盖的能力。

我的整体评价

当前 head 已把同一 agent lane 的 ephemeral child 与 durable LoopX peer 彻底分开,并把此前最危险的两个问题一起收住:公共 schema 不再偏离 runtime,canonical smoke 也不再用手写 expected output 证明自己。clean-context 默认、explicit fork capability、packet digest/context binding、fail-local rejection 和 parent fallback 形成了连贯的正负路径;quarantine 的当前含义也没有被包装成尚不存在的 enforcement。

因此对 exact head 0027080881b06a05b544fed16af6dfd5562d0983 的代码与合同结论为 APPROVE。残余门禁是依赖拓扑而非本 PR 新 blocker:先处理 #3668,再 rebase/readback #3660 的 final five-file diff,并重新确认 checks 与 exact head;scope/head 漂移时本批准不得沿用。

English verdict: APPROVE with a dependency merge hold on exact head 0027080881b06a05b544fed16af6dfd5562d0983. The previous schema, capacity, runtime-binding, clean-context, and guidance-vs-obligation blockers are resolved, and focused validation passes. Do not merge this head as-is while open PR #3668 remains stacked beneath it; land and verify #3668 first, then rebase #3660 onto current main and re-check the final five-file exact scope. Any scope or head drift requires fresh review.

@cocolord
cocolord force-pushed the codex/generic-multi-agent-topology-20260826 branch 2 times, most recently from 7e6bde3 to 4a35910 Compare August 27, 2026 14:14
cocolord and others added 2 commits August 27, 2026 22:17
Add a bounded, public-safe read model for admitted ephemeral child operations and their host receipts. Keep registered-peer identity outside this contract, fail closed when child operations exceed max_children, and preserve observation-only settlement semantics.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Require a complete typed task packet before child launch, bind receipts to that packet, and quarantine drifting child evidence while the parent agent remains runnable with explicit fallback choices.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
cocolord and others added 12 commits August 27, 2026 22:17
Make fresh child context explicit, gate parent-context inheritance on a host capability, and reject invalid child lanes without blocking the parent Turn.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Verify explicit fork_context mapping, context-mode receipts, and fail-local pre-spawn rejection with parent and sibling continuation.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Keep LoopX child task packets provider-neutral and move Codex/Claude context-operation arguments into a separate Harness adapter projection.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Cover Codex adapter arguments, capability-gated fork modes, unsupported hosts, and task-packet digest stability across host implementations.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Keep Todo completion validation with the registered parent, project only a public-safe validation authority marker, and stop advertising Codex child resume until a provider-owned child-session binding exists. Return isolated host adapter arguments and cover the negative paths.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Define topology selection, materialized task lanes, host execution receipts, reconciliation, and a durable self-repair pattern without adding domain-specific coordinators.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Add a public-safe four-lane fixture that distinguishes host child activity from admitted LoopX lanes and durable peer sessions.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Define subagents as parallel executors for multiple admitted Todos inside one registered agent lane. Keep registered LoopX peer orchestration on its existing identity, ownership, liveness, and activation contract, and keep durable remote effects with the parent agent.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Record capacity and side-effect envelope violations as independent typed reconciliation reasons. Add otherwise-aligned public negative cases so unrelated drift cannot mask either invariant.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Make prevention-first delegation, child-local evidence quarantine, and parent continuation the canonical subagent contract.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Run the canonical public smoke against the shipped task-packet and reconciliation implementation instead of restating expected output.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
Keep Todo completion validation with the registered parent, document that child packets expose only a public-safe marker, and stop claiming Codex child resume before a provider-owned session binding exists.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>
@cocolord
cocolord force-pushed the codex/generic-multi-agent-topology-20260826 branch from 4a35910 to 68804b6 Compare August 27, 2026 14:23

@cocolord cocolord left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Exact head: 3660@68804b62877822d531d1cdaadcd92daa3706b210

结论:APPROVE(保留依赖合并门禁)

本轮重新审查了 #3660 的五文件专属 diff,并将公共 RFC/集成文档/canonical smoke 与 #3668 最新 runtime exact head 对齐。之前关于 Host/Core 耦合、validation owner 和无 session binding 的 resume 语义均已修复;未发现新的 actionable blocker。该批准不解除依赖顺序:#3660 当前仍叠加在 open PR #3668 之上,应先合入 #3668,再将 #3660 rebase 到最新 main 并重新确认五文件 scope。

动机

该 PR 解决的是通用 multi-agent 控制面边界,而不是 Auto Research 或 Deep Research 专用编排:host 可以启动多个 worker、显示多张卡片或分配多个 worktree,但这些事实不等于 LoopX 已经创建多个 peer identity、Todo ownership、lease、session 或 durable effect authority。真正需要的是同一 registered agent lane 内多个已 admission Todo 的可追溯 child 执行协议。

设计目标是让主 agent 在派活时给出足够清晰、可哈希、可校验的 task packet;child 漂移只影响自己及其 evidence,不获得阻断 parent 的权力。registered peer orchestration 继续由现有 v1 identity/ownership/liveness/session owner 管理,不与 ephemeral child 混合。

改动思路

RFC 只定义 provider-neutral 语义:serial / ephemeral_children、execution envelope、task packet、receipt 与 reconciliation。Goal/用户策略决定可用边界;registered parent 在边界内决定此刻是否值得并行、拆几条 lane、使用 fresh 或显式 parent snapshot。LoopX 不把 spawn_agentfork_context、Claude Task 或 native args 写入 task packet。

Harness/Host adapter 独立把语义 mode 映射为原生操作。当前 Codex 支持 fresh 和 capability-gated forked snapshot;由于没有 provider-owned child-session id,本 slice 不暴露 resume。Todo completion validation 同样留给 registered parent:child packet 只携带 public-safe validation-required marker、Todo-derived authority ref 和 command_disclosed=false,不会复制可能包含本地路径或私有细节的命令。

正向路径由 admission → packet → Host adapter → receipt → reconciliation 串起。负向路径在 launch 前拒绝 incomplete/context/capacity lane;运行后 packet/context/workspace/effect/evidence mismatch 只 quarantine 对应 child,并保持 parent continuation。

具体改动

  • docs/architecture/rfcs/generic-multi-agent-execution-topology-v0.md 定义 agent-lane child topology、完整 packet 字段、provider-neutral context/inheritance、parent validation authority、typed drift、owner map、分阶段实现与 non-goals。
  • docs/integrations/codex-subagent-orchestration.md 将 RFC 接回现行 admission/Turn driver,明确 LoopX/Harness 分工、fresh 默认、fork capability、当前 resume fail-closed、worktree/claim/lease 边界和 registered-peer 分界。
  • examples/codex-subagent-orchestration-contract-smoke.py 直接调用 active builder/schema/normalizer/reconciler 和 Host adapter,验证 packet digest 跨 Codex/Claude 稳定、native args 不进入 packet、Codex resume 当前不可用、validation owner 在 parent、capacity/packet/context/effect drift 与 parent continuation。
  • examples/fixtures/multi-agent-execution-topology-drift.public.json 保留 public-safe pre-spawn/reconciliation 负例,不包含真实 prompt、transcript、凭证、私链或本地路径。
  • skills/loopx-self-repair/references/repair-patterns.md 将 host-worker/control-plane drift 修复沉淀为通用模式,而非产品特化策略。

关键内容讲解

  1. RFC 的 Boundary Versus Strategy 保持“人/Goal 决定允许边界,主 agent 决定执行策略”,没有把自适应决策硬编码成全局 runtime。
  2. Child Execution Guard 把重点放在派活前:objective、acceptance、authority/state refs、scope/effect/workspace/budget/context/validation owner 不完整时不启动。
  3. Harness adapter mapping 明确 Host 原语不属于 LoopX packet;不同 Host 可映射不同 native operation,而 packet digest 保持一致。
  4. validation contract 明确 parent 运行 Todo completion gate,child 只报告相关 evidence,解决“声明验证但 child 仍需猜命令”的歧义。
  5. canonical smoke 不用 fixture 自证,而是执行 #3668 的真实 owner,避免 RFC 与 runtime 漂成两套权威。

对主干的风险

#3660 自身是五文件、约 1.3K 行文档/fixture/smoke变更,直接 runtime blast radius 低;主要风险是它依赖尚未进入 main#3668。GitHub 相对 main 会展示完整 stacked diff,因此当前 head 不应直接合并。正确顺序是先由 maintainer 处理 #3668,再 rebase #3660,并重新检查专属五文件 diff 与 exact-head checks。

四个 review lens 均通过:state/reason 使用 typed schema;generic 文案无 Auto Research/Deep Research 特化;runtime 已实现与未实现边界明确披露;enforced、validated observation、projected disposition、unsupported boundary 分层表达。resume 不再把“存在语义”写成“当前可执行能力”,validation marker 也不泄露命令。

独立验证:

  • canonical contract smoke、docs governance、Ruff、Python compile、JSON parse、git diff --check:通过;
  • stacked standard premerge:3 direct + 7 catalog + 8 risk-profile + public boundary,全部通过;
  • runtime focused suite:182 passed
  • GitHub exact-head checks:以发布时 readback 为准;
  • 未执行 live child process、自动 evidence removal 或 child termination,因为 RFC 明确把它们留给后续 consuming adapter。

我的整体评价

当前设计已符合“LoopX 管语义与硬边界,Harness 管 spawn/fork”的架构;fresh 是默认,fork 显式、resume fail-closed;Child Execution Guard 在主 agent 派活阶段保证 packet 完整,并将后续漂移限制在 child/evidence 范围内,而不是阻断 parent。它复用现有 admission、Turn、Todo、workspace 和 settlement owner,没有建立第二套 scheduler 或 peer control plane。

因此对 #3660 专属 exact range 222e8fa27d5004195ac8823f95a4883e61092bf6...68804b62877822d531d1cdaadcd92daa3706b210 的结论为 APPROVE,同时保留依赖合并门禁。当前账号是 PR 作者,GitHub 不允许 formal self-approval,所以此 COMMENTED review 记录等价结论;#3668 合并后的 rebase/head 变化仍需 fresh review。

English verdict: APPROVE with a dependency merge hold for the five-file exact range ending at 68804b62877822d531d1cdaadcd92daa3706b210. LoopX owns provider-neutral task/context/authority semantics, Harness adapters own native spawn/fork operations, fresh remains the default, resume is not advertised without a child-session binding, and Todo completion validation stays with the registered parent. Canonical runtime-bound smoke and stacked premerge pass. Land #3668 first, then rebase and re-review #3660 before merge.

Lead the RFC with the current same-lane scope, LoopX-versus-Harness ownership, fresh/fork/resume policy, parent validation authority, fail-local drift handling, and enforced-versus-projected boundaries.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <noreply@bytedance.com>

@cocolord cocolord left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Exact head: 3660@341149c72687f8676b1e2fa910bfffe40acf0a3c

结论:APPROVE(保留依赖合并门禁)

本轮增量只更新 RFC 首屏 TL;DR,并同步 canonical smoke。TL;DR 现在先给出六个当前结论:same-agent-lane scope、prevention-first delegation、LoopX/Harness 分工、registered parent 保留 authority、child-local drift、以及 enforced/validated/projected/unsupported 的实现边界。它没有改变此前已评审的 runtime contract,也没有新增 Auto Research、Deep Research 或其他领域专用编排。

动机

原 RFC 的核心结论散落在 Decision、Child Execution Guard、Owner Map 和 implementation slices 中,读者需要先阅读较长正文才能确认最重要的边界。新的 TL;DR 把已实现且已验证的当前真相放到首屏,减少对 “subagent 是否是 peer”、“LoopX 是否负责 fork”、“resume 是否已可用” 和 “quarantine 是否已强制执行” 的误读。

改动思路

TL;DR 只压缩现有合同,不创造新概念:LoopX 负责 provider-neutral packet/context/authority 和 receipt reconciliation;Harness 负责 native spawn/fork/resume;fresh 默认、fork capability-gated、无 provider child-session binding 时 resume 不可用;Todo completion validation、evidence acceptance、durable effects、writeback、quota 和 settlement 仍属于 registered parent。

具体改动

  • RFC 顶部新增六项 TL;DR,并将 Decision 收敛为一句规范性结论。
  • canonical smoke 新增首屏关键边界断言,确保后续编辑不能悄悄删掉 same-lane scope、LoopX/Harness ownership、parent validation authority、parent continuation 或 unsupported evidence enforcement。
  • 正文其余 schema、owner map、negative paths 和 implementation slices 均未改变。

对主干的风险

这是文档与 durable smoke 的窄增量,无 runtime behavior change。主要风险是摘要与正文漂移;canonical smoke、docs governance、public-boundary 和 standard premerge 已覆盖该风险。#3660 仍叠加在 open PR #3668 上,所以 dependency merge hold 不变:先合 #3668,再 rebase #3660 并做 fresh exact-head review。

验证:canonical contract smoke、docs governance、Ruff、Python compile、git diff --check 和 public-boundary 通过;standard premerge 的 3 direct checks、7 catalog canaries、8 risk-profile smokes及 public-boundary 全部通过。GitHub exact-head checks 以发布时 readback 为准。

我的整体评价

新的 TL;DR 更符合结论先行的 RFC 阅读方式,并准确反映当前代码能力,不夸大 live containment、automatic termination 或 evidence-acceptance enforcement。因此对 exact head 341149c72687f8676b1e2fa910bfffe40acf0a3c 的文档增量结论为 APPROVE;maintainer authority 和 #3668 依赖顺序保持不变。

English verdict: APPROVE with the existing dependency merge hold for exact head 341149c72687f8676b1e2fa910bfffe40acf0a3c. The new first-screen TL;DR accurately compresses the already-reviewed same-lane scope, LoopX/Harness ownership, context policy, parent authority, fail-local drift handling, and current enforcement limits. No runtime behavior changes; land #3668 first, then rebase and re-review #3660.

@cocolord

Copy link
Copy Markdown
Contributor Author

Dependency status update: #3668 has been refreshed to exact head e882b75b756f382554a4cf1e7a3b10bf0908e16b on current main. This PR #3660 is still stacked on the superseded #3668 head 222e8fa27d5004195ac8823f95a4883e61092bf6; do not merge the current head. The #3660-specific scope remains the same five RFC/docs/smoke/fixture/self-repair files. Correct next step is: merge #3668 first, then rebase #3660 onto latest main, resolve the repair-patterns.md overlap, rerun canonical smoke/premerge, and perform a fresh exact-head review. No #3660 branch update or merge was performed in this pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants