Repository navigation
Fix stale workspace guards after replan routing - #6393
Conversation
Signed-off-by: huangruiteng <huangrt01@163.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=xhigh
动机
运行自动任务的贡献者与维护者。 重规划与到期监控同时出现时,旧包要求为未选中的写入任务切换仓库,挡住当前重规划;当前包保留重规划动作,不再挂上那份 workspace 守卫。
已用真实 packet builder 重现基线矛盾,并验证当前版本恢复重规划;普通写入守卫与普通监控的完整选定投影保持一致。 不改变写入权限、监控周期或合并授权,也不声明安装态与长期执行已验收。 没有发现本次 workspace 修复的阻塞问题;下面另列一个不影响重规划执行的相邻说明缺口。
改动思路
已有路由允许自主重规划、但尚未选择交付 Todo 时,停止调用会回退到第一项写入工作的 workspace 守卫。选择到实际写 Todo 后仍走原守卫。现有 typed quota owner 决定重规划;Python 继续处理本地 Git/路径观察,不新增重规划状态、协议或权限 owner。当前两文件边界可独立验证和回退。
无这项具体矛盾的书面验收,采用独立复现的错误包与原 owner 的“绑定精确投影 Todo”约束;并先读了 docs/quota-allocation.md 及 S7 roadmap,固定参考版本 3dd3c550afecfa0c525a34e8744a3cf06774ac94。这些一般文档不被当成本次新增验收编号。
具体改动
完整 head:c584af55436cc6852850617ce2dc1d9b105c053d;真实 main 分叉点:3dd3c550afecfa0c525a34e8744a3cf06774ac94;全 PR 两文件 +96/-1。
_apply_selected_todo_guards新增selected_todo is None && replan_decision_allowed的调用隔离;inbox 优先级与其余 guard 顺序保持。build_agent_workspace_guard保持原真实 Git、仓库身份与独立 worktree 检查;本次没有弱化它。test_replan_route_does_not_leak_an_unselected_workspace_guard_to_monitor补双 Agent、到期 P0 监控、外部 P1 写入和重规划同时存在的回归。
对主干的风险
最强反例是误放行仍被选中的写入任务。当前 48 项选题/契约/配额测试,以及 46 项完整 workspace/cadence/replan 测试通过,零跳过。相同实际 packet builder 输入在不可变 base 产生指向 product 写 Todo 的 workspace 守卫,却选择 benchmark monitor,回归断言失败;head 恢复 autonomous_replan_required。五输入 base/head 配对中,普通写入、普通监控和单 Agent 重规划的完整选定投影逐项相同;写入仍会拒绝非独立工作区。
原生 canary 5 direct/16 selected 全通过,无人工 hold;Ruff、diff check、两路径公私边界扫描、语义 advisory 后的完整 semantic smoke 通过。实际源码与 native Effect/Git 路径得到验证,合成输入没有访问活动 Goal;实际安装的 App/Lark、模型理解、长期公平性与 fleet 成本仍未测。当前 no-CI 策略遵守,未读取或等待 CI。
[P2,非阻塞] 相邻 boundary 说明仍可能指向未选 Todo。 同样的重规划输入,把 Goal scope 改为 docs/**、未选写 Todo 保持 src/** 时,head 已可执行重规划,但 reason、blocked_action_scope 和 boundary_projection_gap 仍来自那项未选工作。相邻 build_boundary_projection_repair_hint 与 base 字节相同,本次没有消除这份说明债务;实际 agent_channel 仍允许重规划,CLI 动作也是重规划,因此不把它当作本修复继续阻塞。建议下一次同 owner 的有界整理把 hint 同样绑定选定路由,并保留真实选中写任务的缺 scope 拒绝反例。
我的整体评价
APPROVE 当前有界 workspace 修复。持续工作和当前用户操作路径得到保留:重规划不再要求为另一任务搬仓库,实际写入仍有原隔离门。相关重构已采用最小的 caller 隔离;相邻 boundary hint 整理可安全后续处理,没有必要扩大为新框架或语言迁移。PR body 的 Tested revision 与实际 head 字符串不一致,建议更正;本评审全部证据独立绑定上述真实 head。源资格不等于安装采用、整个 Goal 完成或合并授权。
English verdict: APPROVE - c584af5; fixes stale unselected workspace guards. 94 related tests and immutable base/head counterexamples pass; ordinary write refusal preserved. Nonblocking adjacent boundary-hint explanation remains; installed/long-horizon adoption unverified.
Goal And Delivered Outcome
main.Author Declaration
Implemented against
_apply_selected_todo_guardstest_replan_route_does_not_leak_an_unselected_workspace_guard_to_monitortest_workspace_guard_keeps_alternative_todo_selection_availableand related focused suiteScope And Continuation
Validation
c584af5548b0b8496ff86b0288398c71c76b09bdstaticpassedunitpassedreal_entrypointpassedstaticpassedloopx checkreported a clean public-boundary scan for the two changed files; unrelated registry warnings were unchanged.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).none.Signed-off-bytrailer (git commit -s).