Skip to content

docs: design ordinary agent loop - #532

Draft
kachofugetsu09 wants to merge 1 commit into
mainfrom
codex/plugin-design
Draft

docs: design ordinary agent loop#532
kachofugetsu09 wants to merge 1 commit into
mainfrom
codex/plugin-design

Conversation

@kachofugetsu09

Copy link
Copy Markdown
Owner

结论

把默认被动回复的 AgentLoop 从 bootstrap/Core 固定链路迁成普通 pure-v3 插件。Core 只保留 Turn admission、exact snapshot、Session/delivery finality、terminal 和 plugin publication。

唯一新增选择点是 REACT = ServiceKey[TurnExecutor]

  • ConversationRuntime 先绑定 exact snapshot,再从该 Root 选择 REACT
  • REACT 返回现有 ControlExecutionResult;terminal TurnResult 仍只由 Core 生成。
  • REACT 是按 ServiceKey 检查的 required service;Core 不认识默认插件 ID。
  • candidate child 在 capability 消费时按 snapshot ID 取得 exact lease,绝不 fallback stable。

插件自更新同时收紧为维护者确认的规则:install candidate 默认晋升;parent 封口前调用 plugin-revert 才丢弃。Core 不再用 child/parent terminal status 替 Agent 判断业务结果。

现状与目标

规格记录了当前真实链:

ConversationRuntime → bootstrap closure → execute_control_turn → AgentLoop → PassiveTurnPipeline

目标是:

ConversationRuntime → exact snapshot → REACT → ordinary agent-loop plugin

Tool search 的名字/文本解析、host 提示、人格与 Skill catalog 等特殊规则先迁到普通 Tool 或公开 typed event,再切换整个 loop。最终不保留旧链、deprecated alias、wrapper、shadow 或 gray 路径。

详细规格:docs/design/ordinary-agent-loop.md

Stacked PR

  1. 回退规则:删除 child_checked 和 terminal status Gate。
  2. 服务边界:复用/公开最窄 Service 与现有 typed event,升级共享 contract checker。
  3. 工具和提示:迁出 Tool search 与 system prompt 特判,删除零 consumer 状态。
  4. Agent Loop:普通插件提供 REACT,同 PR 删除 bootstrap 全局 loop 和旧被动链。
  5. 外部插件:从 hua-home production artifact commits 迁移真实消费者。
  6. 最终删除:清零 deprecated、私有 import、legacy host 和旧测试入口。

每批只运行一条生产路径;能力等价由 base/candidate 隔离差分证明,不运行 runtime shadow。

研究与评审

  • 参考 DeepSeek Harness dd6322d604e00eec1ba5e0c8541159906a21094a:agent-loop 是普通 Service 插件,Cordis 不认识 loop phase。
  • ADHD 发散后淘汰 Turn PlanReact KitTurn Capsule 和 legacy wrapper 等重复模型。
  • 两轮独立 Terra xhigh 最终均 PASS:P0=0、P1=0、P2=0;重点验证正交性、非特权、snapshot 链路、terminal owner、命名和跨文档一致性。

外部消费者

只读审查确认 hua-home 16 个启用 external 插件中,9 个可达插件仍有 18 个私有 Core import;本机 16/16 checkout HEAD 与 production artifact commit 不同。后续迁移必须从生产 artifact identity 开始,并升级已有、被 21 个 CI 使用的 plugin-contract checker,不创建第二个 checker。

本 PR 不修改外部插件、cache、正式 workspace 或 hua-home。

验证

  • changed Markdown relative links:通过
  • git diff --check:通过
  • Change Gate:27/27 通过
  • report:docker/debug/reports/change-gate/20260902-171758-94967913
  • Terra architecture:PASS,P0/P1/P2=0
  • Terra simplicity/naming:PASS,P0/P1/P2=0

状态

这是设计 PR:0055 为 proposed;0056 的 no-revert 语义已接受但尚未实现。运行时代码仍是 PR #527 baseline,不能把目标文档当作已部署证据。

@kachofugetsu09
kachofugetsu09 marked this pull request as ready for review September 3, 2026 03:15
@kachofugetsu09
kachofugetsu09 marked this pull request as draft September 3, 2026 03:15
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.

1 participant