Repository navigation
Preserve Todo claim arguments and recover reviewed updates - #8718
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Use the same targeted readback when execution proof is omitted or the original managed claim has expired. Render the new claim reference and the reconciled provider revision in the retry command. 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)
评审提交 7262b1330a4ab95ee66dbe3c5237c0a30d0bbbac,对照基线 78e936f9d1f1a00505c4026ee0a5857de95cee27。
动机 / Motivation
通过 CLI 认领待办、复核修改并处理拒绝回执的操作者。 一次已审阅的更新遗漏执行证明。操作者照恢复指引认领,期间另一写入者修正同一 Todo,原操作随后必须读取指定 Todo 并复核新内容。 基线生成的 claim 预览把 --thin 带成含值参数,argparse 返回 2。以旧 revision 发起受保护的更新时,基线建议认领后重试,却仍给出旧 revision,实际写入返回 provider_revision_mismatch。 操作员按基线给出的命令执行仍会遇到拒绝,必须手工重建调用或复核基线后再继续。 候选的生成命令可直接执行。File 和 SQLite 都在读取后再次发生并发修改时拒绝旧 revision,重新复核后接受原操作并保留并发修改,回放未改变状态。 范围为源码 CLI、本机 File/SQLite 与隔离 PostgreSQL 16.15 存储套件。现场 PostgreSQL CLI、已安装 App、飞书与托管 CI 未核验。
改动思路 / Approach
TS 的 Todo 更新、Task Lease 和 provider CAS 继续裁定权限与提交。Python CLI 负责参数、路由、Markdown 和 JSON 投影。 原先若只修 shell 引号,仍会把失效 revision 带回下一次调用。共用现有 argv helper 和一份 Core 指令已覆盖两个入口,省去各适配层的判断。 由同一个 Core 分支说明认领、指定 Todo 读取与带两项新引用重试,由 CLI 把解析后的原参数和占位值编成可执行 argv。 调用者仍要显式认领、检查并复核,写入时由原有事务重验 CAS。
具体改动 / Changes
关键代码讲解
TodoClaimArgumentError.recovery保留--thin的开关语义、显式空值与租约版本零。handle_todo_command用相同的选项编码把以连字符开头的 claim ID 送到后续 CLI。 错误参数恢复 认领后的继续命令reviewedTodoUpdateClaimRetry供过期与遗漏证明两条路径复用。认领之后以todo list --todo-id取得指定 Todo,_route_native_recovery在原参数中填入新 claim 和复核后的 revision 占位。 Core 恢复契约 遗漏证明分支 CLI 重试渲染
按 docs/project-agent-todo-contract.md 在 78e936f9d1f1a00505c4026ee0a5857de95cee27 的合同,认领参数保真、审阅修订绑定、陈旧提案与回放均通过本地双 provider 对照。 已审阅的更新和恢复
对主干的风险 / Risks
调用者在读取后再遇到并发写入,旧 revision 仍被拒绝。最新读取后的重试保留原 operation ID 和改动内容,回放未重复写入。两种 provider 上,预览不改变快照,语法修复也保留非法空 ID 供权威层拒绝。所选 CLI 路径含空格、说明文字与选项同名、重复传入 revision 时最后一个值被解析,这些情况都经实际命令验证。
语义与 CI 对齐
精确 head 的 189 项聚焦测试和 18 项本地 standard premerge 检查通过。真实 PostgreSQL 16.15 的 397 项隔离存储测试通过。 范围为源码 CLI、本机 File/SQLite 与隔离 PostgreSQL 16.15 存储套件。现场 PostgreSQL CLI、已安装 App、飞书与托管 CI 未核验。
我的整体评价 / Verdict
批准这次精确 head。生成的恢复命令已经过实际执行与回读,并保持原有权限、审阅基线和并发修正。遇到写入冲突时,按指引读取同一 Todo 后可以带原操作 ID 继续。
English verdict: APPROVE at 7262b13. Generated claim and reviewed update commands preserve the original intent and reject stale CAS on File and SQLite.
What changed
The CLI's generated recovery commands could turn the
--thinswitch into--thin Falseor lose the distinction between a missing and an explicitly empty value. Claim recovery now formats each option as the intended argument and keeps the selected installation, the original operation identity and lease version zero.A reviewed Todo update could also recommend retrying with the old provider revision after a new claim had changed it. The recovery now reads back that Todo before resubmitting the original operation against the current revision. The command retains the original edit arguments and the normal concurrency check.
Validation
207 Python tests and nine quick premerge checks passed. The File and SQLite cases execute the generated commands, preserve explicit values and the operation identity, reject stale or unauthorized retries, and read back the original result after replay.