Repository navigation
Guide Todo completion to link known follow-up work - #8091
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.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=max.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval).
动机 / Motivation
按返回的结算计划完成任务、且已知后续验证任务的 Agent,会遇到“备注里写了后续工作,但没有建立任务关系”的问题。例如实现任务完成后已有一个等待到期的评估任务:只把它写入备注,后续守卫仍可能认为缺少 successor 并触发重规划;使用已有 completion 选项建立关系后,守卫能等待该任务的明确恢复条件。本次可验证的交付是:计划正文直接告诉调用方如何链接已存在的后续任务,真实 CLI 能持久化该关系并按原有规则等待、恢复。范围不包含自动猜测 successor、创建新任务、修改调度或额度授权,也不声称已经证明自然模型减少漏链。
改动思路 / Approach
提示放在既有 TypeScript 结算计划投影中,关系仍由普通 Todo completion 写入,后续路由仍归既有 typed succession/resume 所有者;无需新状态、新解析器或另一套决策。本次仅补齐已知后续任务的入口提示,不自动插入命令参数,也不改变 completion、lease、writeback 或 spend 的先后约束。现有关系表达调用方真实知道的后续意图,不能由备注里出现一个任务 ID 推导。最小方案是在原本阅读的计划里给出已有选项,避免另建 workflow 或要求用户再次提供已知信息。没有已知目标时,原有合法 completion 路径保持有效;有目标时仍须经同一个 canonical writer 做身份和目标校验。该边界能独立验证、回滚,也不会把提示文本提升为执行权限。
具体改动 / Changes
接受前规范:docs/reference/canonical-todo-completion-update.md,固定版本 be17d4ff30eb00ef739710961d223ce81fb1b5e9;同时检查该版本 docs/reference/todo-continuation-readback.md 的完整任务图与 deferred 语义。原文无条款编号,采用描述性名称:completion-links-existing-work → implemented,现有 CLI 显式链接已存在任务,并拒绝 self/missing 目标;original-completion-before-settlement → implemented,原任务验证、当前权限和先 completion 后 writeback/spend 的顺序都保留。整个 diff 为 2 文件 +3/-1,只有一条指导句和两条“正文有提示、argv 无自动参数”的断言。
关键代码讲解
turnScopedCliSettlementPlan仅在 Todo binding 的 validation precondition 加入Link known follow-up work with --successor-todo-id <existing-id>.。原来的 no-invention、无需强制 no-follow-up、未完任务保持开放、Todo done 不等于 Turn settled 等条款没有删改。build_turn_scoped_cli_settlement_plan是未改动但实际使用的命令生产者:原 Todo、Agent、Turn、claim/lease proof 和各命令模板继续照原样进入 typed plan。返回 argv 没有偷偷附加 successor,也没有从上下文猜测目标。handle_todo_command是实际写入入口,显式选项传给原 canonical completion owner;self/missing 目标仍被拒绝,正确目标才成为successor_todo_ids,供后续完整任务图读取。备注仍是备注。
对主干的风险 / Risks
主要风险是模型把新增祈使句理解成“每次都必须制造 successor”,或实现把它自动加进命令。逐条比较 actor、触发条件、时序、证据来源、known/existing 限定、继续/停止与结算约束后,12 个完整 base/head 计划分支(Todo/replan × 普通/in-flight/semantic × soft/hard lease)只有六个 Todo 分支多这一句,删去该句后整个计划对象完全相同。真实 CLI 的 self/missing 错误完整 payload 在两版一致,且 canonical Todos 不变。
同一冻结 fixture 在两版各跑四个真实 SQLite 情景:future + note-only → autonomous_replan;future + canonical edge → agent_scope_wait,明确指向同一个已有任务及其 resume_at;到期后,无论原先是否有 edge,都选择同一个已有 deferred 任务进入 successor_replan_required。这里是恢复/重开任务的路由,不能误写成已经获得普通执行权限。另四个 File/SQLite、soft/hard-lease 入口测试验证:重复不扣额、延期仍等待、重开原任务并按当前 lease 恢复后才允许 delivery,原 settlement identity 始终不变。
验证为 86 Python PASS(82 计划 + 4 恢复)、1 Windows rendering SKIP,11 TS PASS;配置 TypeScript typecheck、Ruff、双语 RFC/语法/diff 和 quick premerge 的 semantic/quota 检查通过。保留一个 inherited maintainability advisory:未改动的 _admitted_interaction_next_cli_actions 过大,完整诊断与不可变 base 相同。没有查询、轮询或等待 CI。以上证明正确入口与既有规则相容,不能证明自然模型一定采用提示,也不能推出无效重规划率已下降。
我的整体评价 / Verdict
该有界提示交付达成:long_horizon 的结构化承诺、等待与恢复语义 preserved;user_experience 因原计划直接暴露现有选项而 improved,不增加确认轮次。提示放在既有 TypeScript 结算计划投影中,关系仍由普通 Todo completion 写入,后续路由仍归既有 typed succession/resume 所有者;无需新状态、新解析器或另一套决策。本次仅补齐已知后续任务的入口提示,不自动插入命令参数,也不改变 completion、lease、writeback 或 spend 的先后约束。关系是原有 typed intent,未新增共享词汇、默认 gate 或 prose classifier,代码量和维护成本与发现入口缺口匹配;复用现有所有者已经足够,无需额外重构。
检查的是返回给 Agent 的 CLI 结算计划和执行/读回路径,没有渲染页面改动,因此不适用截图评审。未验证范围:自然模型采用、完整成本收益及 native Windows rendering。将来应在既有真实工作中单独观察采用和结果,不能凭本次提示或测试计数宣告该收益。结论只绑定 5a11cb288e72515f4626da82a6756233bf0e903d;头部变化需重新评审,GitHub 自评 COMMENTED、合并就绪与合并权限分别记录。
English verdict: APPROVE 5a11cb288e72515f4626da82a6756233bf0e903d — the existing-successor guidance is accurate, preserves full plan/command semantics, and is supported by real canonical link/wait/recovery checks; natural model adoption remains unmeasured.
Problem
An agent can complete an implementation Todo with evidence that names the existing evaluation Todo. If that relationship is recorded only as prose, the scheduler can later request a succession review while evaluation is waiting. The ordinary completion step already explains when to complete the Todo. It now shows the existing CLI argument for recording known follow-up work at that point.
Scope
The caller chooses the successor. The generated command remains an ordinary completion with its original identity and validation requirements. The change adds guidance to the shared settlement plan and a regression check for the distinction between guidance and generated arguments.
Verification
In an isolated SQLite fixture, create an implementation Todo and an evaluation Todo, complete implementation, then defer evaluation to a future time. Recording only a prose reference yielded a missing-successor replan. Passing the existing successor ID yielded a wait. Once the resume time passed, both fixtures surfaced the ready deferred task. This demonstrates the scheduling effect of recording the relationship. Natural agent adoption of the guidance remains to be measured.
The quota settlement Python suite passed 82 tests with one skip. All 11 TypeScript settlement-plan tests passed. Two real SQLite lifecycle reentry cases passed, covering a later runnable task and a later user gate.