Retire the legacy workflow executor and switch squad steps to agent-native (Q3 WP2) #100

Merged
weichen merged 1 commits from feature/q3-wp2-retire into main 2026-10-08 03:25:44 +00:00
Owner

Why

Q3 WP2:退役「压成 SpawnSubagent」执行路径——WorkflowDef 全部经 wfcompile 编译图执行;小队步骤后端从 agent-system 切到 agent-native 内核。

What

  • 删除:runtime/workflow.go + workflow_script.go(legacy 步循环/critic/脚本宿主)及其测试;squadadapter stepBackend "agent-system" + profileForRole
  • run_workflow 三分支改投编译图:注册分支(RunOptions{})、规划分支(DynamicLimits+RequireConfirm,规划子代理→ParseWorkflowDef)、脚本分支(ModelScript 单确认门,legacy 同款不叠加计划确认)
  • 默认执行后端:BuildBackends 只注册 agent-native(工厂缺席 fail-closed,不静默降级);Orchestrate DefaultBackend→agent-native;内置四角色声明 agent-native + 白名单补 write_file + writer run_shell→run_command(内核实名)
  • runmgr:默认工作流执行器 → CompiledWorkflowRunner;mock #workflow 演示走编译图(纯宿主步)
  • judgeStreamFor:轻量模型路由封装(legacy judgeStep 回退同款;未配置=nil→验证器不可用 fail-closed)

Evidence(P4 行为一致,逐项测试)

  • runtime 级:注册分支查找/错误面、规划分支确认门+动态 8 步上限(拒绝发生在任何 HITL 之前)、脚本开关默认关、缺失槽位 HITL 收齐+编译期渲染、验收模型路由(SELF)
  • adapter 级:TestOrchestrateRunsOnKernelStub 四阶段骨架经内核桩端到端(write_file 落盘/种子技能/exec 白名单)(SELF)
  • server 级:TestSquadOrchestration 重构——内核步骤进程内执行,不再派生任务树子 Run(SELF)
  • backend 全套绿;wfcompile/squadadapter/runmgr -race 绿;llm_test 既有桩 race 为 main 上已存在的欠账(CI 不跑 -race),已记录任务卡(SELF);PR HEAD CI 权威(GATE)

Refs

  • Q3 计划:Dev 仓 modules/documents docs/proposals/2026-10-07-agent-stack-q2q3-plans.md WP2
  • Dev 任务卡:.task/feature-agent-stack-q3.md
## Why Q3 WP2:退役「压成 SpawnSubagent」执行路径——WorkflowDef 全部经 wfcompile 编译图执行;小队步骤后端从 agent-system 切到 agent-native 内核。 ## What - **删除**:runtime/workflow.go + workflow_script.go(legacy 步循环/critic/脚本宿主)及其测试;squadadapter stepBackend "agent-system" + profileForRole - **run_workflow 三分支改投编译图**:注册分支(RunOptions{})、规划分支(DynamicLimits+RequireConfirm,规划子代理→ParseWorkflowDef)、脚本分支(ModelScript 单确认门,legacy 同款不叠加计划确认) - **默认执行后端**:BuildBackends 只注册 agent-native(工厂缺席 fail-closed,不静默降级);Orchestrate DefaultBackend→agent-native;内置四角色声明 agent-native + 白名单补 write_file + writer run_shell→run_command(内核实名) - **runmgr**:默认工作流执行器 → CompiledWorkflowRunner;mock #workflow 演示走编译图(纯宿主步) - judgeStreamFor:轻量模型路由封装(legacy judgeStep 回退同款;未配置=nil→验证器不可用 fail-closed) ## Evidence(P4 行为一致,逐项测试) - runtime 级:注册分支查找/错误面、规划分支确认门+动态 8 步上限(拒绝发生在任何 HITL 之前)、脚本开关默认关、缺失槽位 HITL 收齐+编译期渲染、验收模型路由(SELF) - adapter 级:TestOrchestrateRunsOnKernelStub 四阶段骨架经内核桩端到端(write_file 落盘/种子技能/exec 白名单)(SELF) - server 级:TestSquadOrchestration 重构——内核步骤进程内执行,不再派生任务树子 Run(SELF) - backend 全套绿;wfcompile/squadadapter/runmgr -race 绿;llm_test 既有桩 race 为 main 上已存在的欠账(CI 不跑 -race),已记录任务卡(SELF);PR HEAD CI 权威(GATE) ## Refs - Q3 计划:Dev 仓 modules/documents docs/proposals/2026-10-07-agent-stack-q2q3-plans.md WP2 - Dev 任务卡:.task/feature-agent-stack-q3.md
weichen added 1 commit 2026-10-08 03:24:31 +00:00
Why: Q3 WP2 retires the SpawnSubagent-compression execution path: all
WorkflowDef execution now goes through the wfcompile compiled graph, and
squad steps run on the agent-native kernel backend instead of the
agent-system step backend.

Evidence: runtime-level P4 parity tests (workflow_compiled_test.go):
registered branch lookup/errors, planned branch confirmation gate +
dynamic 8-step cap fail-closed before any HITL, model script switch
default-off, missing-slot HITL collection with compile-time rendering,
judge stream routed to the configured lightweight model (nil = fail-closed
verifier-unavailable). squadadapter TestOrchestrateRunsOnKernelStub:
four-phase skeleton runs end-to-end on the kernel stub (write_file
materialization, seeded skills, exec allowlist). server TestSquadOrchestration
reworked: kernel steps run in-process (no subagent child runs). Full
backend suite green; wfcompile/squadadapter/runmgr green with -race
(pre-existing llm_test fake race on main recorded as debt, CI does not
gate -race).

Impact: DELETED runtime/workflow.go + workflow_script.go (legacy step loop,
critic, script host) and their tests; squadadapter stepBackend
'agent-system' + profileForRole deleted; BuildBackends exported and
registers only agent-native; Orchestrate DefaultBackend -> agent-native;
builtin roles declare agent-native with write_file added to allowlists and
writer run_shell -> run_command (kernel tool name); runmgr default workflow
runner -> CompiledWorkflowRunner; mock #workflow demo runs compiled
(host-only steps). Model script branch keeps the single script-level
confirmation (no extra plan confirmation), matching legacy.

Refs: Q3 plan WP2 (2026-10-07-agent-stack-q2q3-plans.md); task card
.task/feature-agent-stack-q3.md
weichen merged commit 76b9cf36a8 into main 2026-10-08 03:25:44 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#100