Skip to content

fix(turn): complete validated Codex Todos before accountable writeback - #8584

Merged
loopx-agent merged 7 commits into
loopx-project:mainfrom
xiaobaifly7:codex/turn-complete-before-writeback
Nov 16, 2026
Merged

loopx-agent merged 7 commits into
loopx-project:mainfrom
xiaobaifly7:codex/turn-complete-before-writeback

Conversation

@xiaobaifly7

@xiaobaifly7 xiaobaifly7 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

The built-in Codex host can now report validated_completion for a selected Todo. Controller validation and Todo completion precede accountable writeback. The terminal checkpoint uses the original completion receipt after the debit and commits the same Turn. Native terminal Turns keep the existing order of writeback, debit and completion.

  • Intended base: main at 8ade78cddeb6bdcd947c0a81507393c4599c7652.
  • Before this revision, the native adapter completed the Todo during writeback and released its lease. The closeout then asked for that active lease again and the journal remained in progress even after the debit. Two independent reviews reproduced the failure. First review, review of the previous head.

Author Declaration

  • Written by: model_agent, OpenAI Codex (GPT-6). Original commits by xiaobaifly7. The integration and review fixes are in 3b5a48e938391c879a8ee7a8d192fe67b73a64c4.
  • Specification: LoopX Turn protocol at the intended base.
Criterion Disposition Evidence
Explicit completion and partial progress Implemented The built-in CLI distinguishes the two results. An accepted partial result leaves its Todo open.
Declared validation and launch lease Implemented Failed independent and declared validation, and a changed lease generation, each prevent writeback and debit.
Native terminal closeout Implemented The original terminal path keeps the lease through the one completion and commits the journal.
Recovery and replay Implemented An interruption after debit and a lost completion receipt resume the original journal with a single completion and debit.

Scope And Continuation

The adapter uses the existing kernel work contract for the launch lease and the existing completion receipt reader for terminal closeout. The change covers the built-in CLI and preserves the in-process native adapter. Independent review of this revision remains pending.

Validation

  • Tested revision: 3b5a48e938391c879a8ee7a8d192fe67b73a64c4.
  • Input class: synthetic. Host outputs are deterministic fixtures. The CLI, independent validator process, promoted File and SQLite authorities, lease checks and journals are real.
Check kind Result Public-safe evidence
Real entrypoint and backend Passed 19 tests in tests/test_codex_turn_completion.py. Includes explicit and terminal completion, progress, both validation failures, lease renewal, interruption after debit, lost terminal receipt and exact replay.
Regression parity Passed The native regression fails on 769391d44553737b3f778eb4b33cc6e6d06939cb in both stores with completion and debit present and the journal still in progress. The same native oracle passes for this revision.
Related Turn tests Passed 35 selected tests across the driver, executor, Codex CLI and settlement recovery, including cancellation, original-Turn recovery and quota receipt repair.
Static and boundary Passed Six direct premerge checks including bilingual pairing, Ruff, public boundary, eight risk profile checks and the full semantic vocabulary smoke after installing the locked development dependencies.
CLI output budget Passed The standard runner timed out. The standalone budget smoke passed on the same head with the intended base pinned.
Change quality Pending The current diff packet is prepared. Its passing review receipt is pending.

Installed Desktop behavior, live model execution, a standalone PostgreSQL run and the full hosted CI suite remain open.

Hosted CI follow-up

  • CLI output. The workflow pinned the PR event base 775c7033. The frozen 98-row CLI fixture in Python 3.11 reports 60,336 characters for the affected guided command-pack row at that base, 61,007 on the actual main parent 8ade78cd, and 61,007 on 3b5a48e9. The old-base comparisons fail for both the main parent and the PR. All 98 comparisons from the main parent to the PR pass. The added JSON shape is the Goal requirement declaration and linking document templates introduced in the intervening main history. Kernel job · Template change
  • Browser. Isolated wheels built from the main parent and PR both reproduce the same two installed-page timeouts. typed-actions waits for the create-and-start confirmation button after workspace selection. goal-workspace-selection waits for the new Goal link after confirmation. The checked-out browser scenarios are identical across both revisions. The build summary fails because the browser partitions failed. Browser partition 1 · Browser partition 2

Frontend / Visual Evidence

UI impact: none. The change is in Turn adapter and settlement behavior.

Type of Change

  • Bug fix
  • Test update
  • Documentation update

LoopX Area

  • Control plane
  • Host or runtime integration

Installed CLI verification

  • Built-in Codex. The isolated wheel at 3b5a48e9 passed ten cases through the installed loopx turn run-once entry point on File and SQLite. Verified completion, no-follow-up closeout, progress, validator rejection, and replay against the original Turn. In the matching wheel at 8ade78cd, ordinary progress still commits on both providers. Forcing the terminal completion result on that baseline fails before any completion, writeback, or debit. The Todo stays open.
  • Native host. The same candidate wheel passed six native-driver cases across File and SQLite, plus the built-in result schema check. Recovery after debit or loss of the completion receipt closes the original journal, with one completion and one debit. This verification used deterministic host output.
  • Review. The review on the current head records an approval conclusion. GitHub subsequently marked it dismissed and gives the reason “The merge-base changed after approval.” The comparison against actual main shows the five touched files. The readiness check reports an invalid current review and two unresolved threads under the existing CI policy.

Author validation on current main

The branch head aab95a3587d9b62e65351ce1a0421d3d4b0f7475 integrates the original fix with main f3bdad2387397e078fbc887e7cb7ed80adaf7510, including the work-identity recheck in #8828. Refreshing the existing main target moved the PR file list to that revision. The file list and the server comparison show the same five changed paths. Main-to-head comparison

  • The production CLI command ran with deterministic host responses on File and SQLite. Current main committed ordinary progress and refused declared terminal completion before writeback or debit. The integrated head passed all 10 subprocess CLI cases. The wheel passed 17 cases, including native after-debit recovery and lost completion receipt. The additional 15 Turn-driver recovery and validation cases passed.
  • The two open review discussions concern the same post-debit lease observation. The native path retains its original validation and completion order. The built-in path completes with the original lease and reads its terminal receipt after debit. Validation replays retained one Todo completion and one quota debit. Original native review · Second review
  • The broader source run reported 245 passes and one existing failure in stopped_after_model, reproduced at both exact revisions. That fixture hooks the ordinary Chat method and never issues its intended stop on the managed task route. The matched reproduction used the managed task method and real goal-lifecycle stop on File and SQLite. A verified stop after the model response left the Todo open, without result writeback or quota debit, on both revisions. The checked-in fixture still needs its hook updated.

Quick premerge's direct and selected checks passed. The exact change-quality receipt and independent review remain pending.

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>

@songoow songoow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · GPT-6 Astra Pro · OpenAI · self_reported

评审提交:4160d3cb56bd9f1be28a03d7b48271751f7966ad,exact base 775c7033e8eb7eebcede52fe3aef542cbacc36e8。已读完整 5 文件(+174/-4)、作者自评、Turn 协议、实际 executor/lease/Todo/refresh 调用链及共享 native App caller。本轮发现 1 个已在两种 canonical backend 复现的 P2,需要修改。

动机 / Motivation

通过内置 Codex Turn 交付选定 Todo 的调用者,需要把独立验证通过的完整成果写入持久 Todo 生命周期后,再刷新并核算本轮。 原 Codex 输出 schema 只有 progress,完整成果仍会因缺少 durable completion 被 accountable refresh 拒绝;本 PR 暴露显式 completion、保存启动租约代次,并提前调用现有完成 owner。 实际 builtin adapter 的 File/SQLite 对照已证明完成、刷新、单次扣额和无效果重放成立,但同一个新增分派也改变 App native 调用:Todo 完成并扣额后再次索取已释放的租约,返回错误且 journal 留在未提交状态。 这次不应隐式提升 partial progress、不应放松原租约代次或 Goal 验收;本轮使用实际 Core 与确定性模型替身,未声称安装版 Codex/App 或真实模型采用已验证。

改动思路 / Approach

复用原 Todo、验证与 settlement owner 是正确方向,但前置完成分派无条件进入共享 host 入口,破坏了现有 native caller 动态租约证明的生命周期。 当前应把这次 builtin 桥接限定在已验证的 Codex CLI 边界,或让共享后置 closeout 从同一 Turn 的已提交完成回执恢复;不能在完成释放租约后再次要求 active lease,也不能放松代次校验。

正常 builtin 路径现在由显式 validated_completion 驱动:独立 task validator 通过后,现有 Todo lifecycle 继续运行其 controller 声明的完成验证,生成 durable continuation,再由原 accountable refresh 和 quota owner 结算。启动时的 lease key/version 写入原 Turn journal,恢复复用原值;同 Agent 的新代次不能授权旧结果。这些机制解决了真实缺口,也保持了 progress 与 completion 的不同含义。

问题出在共享 callback 边界:executor 对 predeclared no-followup 仍需要 post-spend terminal closeout,而新增 wrapper 提前完成后释放了 native caller 的执行租约。builtin 使用保存的静态证明,所以新增用例能通过;App 使用当前 active lease 的生产 resolver,第二次调用时已不满足该前提。

具体改动 / Changes

关键代码讲解

  • CODEX_CLI_RESULT_KINDS 与 prompt 增加已有共享语义 validated_completion,明确完整 Todo 要求、独立/声明验证、partial progress 不自动完成,以及 Todo 完成不等于 Goal closure。没有新增核心结果种类。
  • 原租约证明保存 只在 execute 的 builtin Codex 路径上观察当前 selected Todo 的原 lease;已有 journal 必须复用其原证明。该逻辑不在恢复时重新 acquire,维持同一代次的执行资格。
  • 完成 owner 与回执恢复 继续复用现有 write_turn_validated_completion、精确 completion readback 和 refresh,避免丢响应后重复完成或重新授权;controller validator、捕获的 Todo 内容与 continuation owner 未被替换。
  • 新增 shared writeback 分派 对所有 validated_completion 都前置完成,并在 调用 executor 时替代原 writeback。这里超出了已验证的 builtin 静态租约路径,是本次 P2 的落点。
  • 新增测试 通过真实 canonical File/SQLite 验证常规完成、预声明终态、独立验证失败、声明验证失败、原 lease 更新后的拒绝及 cached-result/replay;模型 callback 为合成。文档对应说明代次保持和 progress 边界,fixture helper 只增加 handoff_mode 参数。

依据 原 Turn lifecycle 协议:explicit_completion implemented,host 必须显式选择完整结果;lifecycle_before_accounting implemented 于 builtin Codex 路线;original_lease_generation implemented,旧结果不能借新租约代次继续;shared_terminal_recovery deferred,当前 native 动态 resolver 的后置 closeout 已复现回归,须在本 PR 修复;installed_model_adoption out_of_scope,本轮没有真实安装版模型采纳证明。

对主干的风险 / Risks

P2:native closeout 在已完成、已扣额后误判租约失效

触发条件是共享 native host 的 validated_completion、预声明 no_followup 和实际硬租约。现有 StewardTurnHost._task_lease_proof 逐次读当前 lease,要求 active 且 owner/key/epoch/version 与原值一致。前置完成正确释放了它,但 terminal_closeout → todo_completion 在扣额后再调用同一个 resolver,于是把本次完成产生的正常 released 状态当作外部代次变化。

我分别在 exact base/head 的真实 native handle_turn_command、生产 Steward resolver、真实独立产物 validator 及 canonical File/SQLite 上执行同一语义 fixture。基准两臂都 committed,事件为 refresh_state → quota_spend → todo_complete,resolver 一次观察 active。候选两臂都变为 todo_complete → refresh_state → quota_spend 后报 the original task execution lease changed;第二次 proof 观察 released,Todo 已 done,journal 的 completed_phases 到 quota_spend 且 status=in_progress。错误响应中的 effects=None 是未知,不是“没有副作用”。这里实际 Core/账本都执行了;native 模型返回是合成,未运行安装版 App 界面。

最小修复是限定 builtin 前置桥接的调用范围,或让后置终态恢复消费同一 Turn 的精确已提交完成证据。请保留对陌生主体、更新代次和缺失回执的拒绝,不能通过取消 active/代次检查来掩盖错误。回归应覆盖这个动态 resolver、no_followup、第一次结算和原 journal 恢复,确认一次完成、一次扣额且最终 committed。

已执行验证与边界

PASS 新增 11 项测试;PASS 现有 driver/executor/Codex 中 completion、terminal、successor、builtin writeback、schema/prompt 的 36 项定向回归。另做 10 臂真实 python -m loopx.entrypoint → builtin Codex adapter → 确定性子进程 → canonical backend 对照,子进程读取实际输出 schema 并写真实产物:base 未提供 completion,accountable refresh 拒绝;head 的 File/SQLite 普通与 terminal 都按完成→刷新→扣额结算,原 journal 重放不再启动 host、不产生效果。显式 progress 在两边都不被提升为 Todo completion。

FAIL(PR 回归) 上述 native resolver 的 base/head 四臂对照。PASS premerge 的 6 项直接检查、maintainability、语义检查和 public boundary;output-budget 项初次被默认 Python 缺少 pytest 阻断,我仅用兼容 Python、同一 pinned base 重新执行该 smoke,最终通过。初次失败记录保留;作者自评的 40,019/40,000 超额在本轮兼容环境未复现,不宣称所有环境都已修复。远端还有等待/排队检查,不作全绿声明。

本改动没有渲染界面,视觉检查不适用。未运行真实模型、安装版 TUI/App、PostgreSQL 或整个仓库测试;本次 RC 来自可重复的生产调用链回归,非上述未测试范围本身。

我的整体评价 / Verdict

builtin 完成链路的局部目标已证实,但整体交付为 not_yet_proven:同一共享入口的 native 调用发生了可观察回归。长程连续性与用户体验均为 regression,一次正常工作已经完成并扣额,却向调用者返回失败且未结束原 journal。代码量本身与修复目标相称,必要修复集中在新增 callback 的 host/receipt 边界。

请求修复这一处后按新 SHA 重新验证;继续保留已验证的 builtin 原 lease 代次、声明验证、progress 区分与单次核算,不需引入新的全局 owner 或放宽租约权威。

English verdict: REQUEST_CHANGES at 4160d3cb56bd9f1be28a03d7b48271751f7966ad. Builtin Codex completion works, but the shared early-completion callback releases the native caller's lease before post-spend closeout invokes its active-lease resolver again. Preserve the original Turn/lease proof and complete closeout without re-authorizing already completed work.

Comment thread loopx/cli_commands/turn_run_once.py Resolved
Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

评审提交:769391d44553737b3f778eb4b33cc6e6d06939cb。结论:REQUEST_CHANGES。

P2:原生终态在完成和扣额后仍会报失败。 候选在真实 File 和 SQLite 上均先完成 Todo、再写回和扣额一次,随后第二次索取已释放的租约,返回失败且原日志停在 quota_spend。 把前置完成分派限制在已验证的 builtin 调用边界,或让原生后置关闭消费同一 Turn 的精确完成回执;不能放宽 owner、epoch、version 和首次执行租约校验。

动机 / Motivation

使用原生或内置 Codex Turn 交付已选 Todo 的调用者。 内置 Codex 不能显式返回已验证完成;原生终态则可结算并关闭同一日志。 内置 Codex 可以完成并扣额一次;原生预声明终态应同样返回已提交。 作者声称完成验证、原租约证明与扣额仍由既有 owner 决定。 本变更不放宽租约授权,不关闭整个 Goal,不替代声明验证或把部分进展自动判为完成。 完整成果应沿用原验证与完成规则;调用者需要看到这一轮已经结算,才不会把已提交的结果当失败重试。

改动思路 / Approach

新增 validated_completion 是正确的内置 Codex 桥接。独立验证、controller 验证、原租约代次和现有完成回执仍应由 Core 决定。现有 native callback 已能完成预声明终态;共用早完成分派使其在后置收尾前失去执行租约。当前边界是 builtin explicit completion with preserved native closeout。把前置完成分派限制在已验证的 builtin 调用边界,或让原生后置关闭消费同一 Turn 的精确完成回执;不能放宽 owner、epoch、version 和首次执行租约校验。

具体改动 / Changes

  • 内置结果格式 允许完整成果与部分进展分别返回。候选 11 项 builtin completion 用例及 8 项相邻定向回归通过;包括显式完成、独立/声明验证失败、旧租约代次、原日志重放。
  • 共享写回 先调用完成,而 原生 proof 仍核对活跃状态和原 owner/key/epoch/version。后置 closeout 再次使用该 proof。最新提交只移除了一个形状检查,三个调用点的顺序没有改。
  • 依据现有 Turn 协议:EXPLICIT-COMPLETION 已由真实内置入口证明;NATIVE-CLOSEOUT 在真实共享入口失败。这里复用既有 result vocabulary,不需另造状态或放宽校验。

对主干的风险 / Risks

同夹具的精确基线在 File 和 SQLite 均按写回→扣额→完成返回 committed;租约解析器只观察一次 active。 候选在真实 File 和 SQLite 上均先完成 Todo、再写回和扣额一次,随后第二次索取已释放的租约,返回失败且原日志停在 quota_spend。 同一个隔离 fixture 调用真实 handle_turn_command、StewardTurnHost._task_lease_proof、独立产物子进程和 File/SQLite authority;仅模型结果是确定性替身。 两个候选日志都已经记录了一次扣额;错误不能当作无副作用,也不能改用新租约重跑。以同一真实原生 resolver 和两个 canonical backend 跑预声明 no_followup、首次结算和原日志恢复;断言一次完成、一次扣额、最终 committed。 未运行安装版 App、真实模型或托管 CI;作者披露的输出预算与其他全量诊断未在本轮重跑,不替代已复现的原生缺陷。

我的整体评价 / Verdict

内置完成链路解决了真实缺口,代码和文档范围也基本相称;原生现有用户却会收到错误并留下未关闭的日志。长程连续性与用户体验均回归。请修正这一个共享边界,保留既有代次、回执和部分进展行为,再按新提交复验。没有界面变化,本次未作视觉检查。

English verdict: REQUEST_CHANGES at 769391d44553737b3f778eb4b33cc6e6d06939cb. Native terminal completion and debit succeed, but post-spend closeout re-reads the now released original lease and leaves the journal in progress. Preserve the original receipt and settle the same Turn once.

Comment thread loopx/cli_commands/turn_run_once.py Resolved
@mergify

mergify Bot commented Nov 12, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @xiaobaifly7.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 12, 2026
The built-in Codex result supports explicit Todo completion with controller validation. Native terminal Turns keep their existing order. For a built-in terminal Turn, verify its original completion receipt at closeout after the debit. This preserves the current kernel lease proof and prevents a second completion.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 15, 2026
loopx-agent
loopx-agent previously approved these changes Nov 15, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

评审提交 3b5a48e938391c879a8ee7a8d192fe67b73a64c4。GitHub 的目标分支提交为 775c703,实际已核主干 8ade78c 是候选的直接祖先。合并树检查通过。 最后一笔整合提交与评审共用服务账号,本评审未参与实现。

动机 / Motivation

使用内置 Codex CLI 和原生 Codex App 完成已准入 Todo 的维护者。 当前主干内置 Codex 仅能报告部分进展。前版尝试复用完成能力,却让原生调用在扣额后重新索取已经释放的租约。 让内置 Codex 提交经验证的完整成果,并让原生和内置终态各自从同一 Turn 完成、扣额和关闭。

有硬租约、无需后续工作的 Todo 已通过验证。旧候选完成 Todo、扣额后报原租约变化。新版本在 File 和 SQLite 上关闭同一日志。 内置路线完成、写回、扣额各一次,核对原收尾回执后 committed。原生路线先写回和扣额,再验证活跃原租约完成 Todo;丢写回、扣额或完成回执从原日志恢复。 真实 Core、确定性宿主输出及实际 File/SQLite。模型采用、已安装产品和托管 CI 未验证。

改动思路 / Approach

宿主只报告完整或部分结果,现有 Todo 生命周期负责验证原租约和完成;终态阶段仅消费同一 Turn 的完成证据。 内置 Codex 对完整 Todo 的既有验证与终态结算,以及受共享调用点影响的原生回归。

内置路线完成、写回、扣额各一次,核对原收尾回执后 committed。原生路线先写回和扣额,再验证活跃原租约完成 Todo;丢写回、扣额或完成回执从原日志恢复。 主干普通进展仍通过,内置模型 schema 不支持显式完成;前版原生回归在两种 provider 上报告原租约已变化。 现有合同

具体改动 / Changes

Codex CLI schema 增加已有 validated_completion。只在内置宿主的完成分支调用原 Todo 完成及写回,终态关闭用精确已提交完成回执。原生入口沿用现有独立验证、控制器验证、原租约 proof 与结算 owner。 该变更复用现有 Turn 结果种类和 effect identity;内置宿主首次完成时仍校验启动的原租约。扣额后确认既有回执不会再次调用 Todo completion。两类宿主的先后顺序可由实际日志直接核验,Store 和进程宿主都没有获得新的授权。

GitHub 以较早 base 显示 748 文件。这个 base 和实际主干均为 head 的祖先;相对已核主干,净改动为两个运行时文件、两个测试文件和一份文档。

依据 docs/reference/protocols/loopx-turn-v0.md 在 8ade78cddeb6bdcd947c0a81507393c4599c7652 的约束核对。

  • 显式完整交付。让内置 Codex 提交经验证的完整成果,并让原生和内置终态各自从同一 Turn 完成、扣额和关闭。 内置路线完成、写回、扣额各一次,核对原收尾回执后 committed。原生路线先写回和扣额,再验证活跃原租约完成 Todo;丢写回、扣额或完成回执从原日志恢复。
  • 原租约与验证。校验失败或租约变更不得改变 Todo 或扣额。 非终态部分进展保留 open,独立验证失败、声明验证失败和变更租约均无写回或扣额。
  • 原 Turn 结算恢复。同一 Turn 关闭及中断回收,不重复执行或记账。 内置路线完成、写回、扣额各一次,核对原收尾回执后 committed。原生路线先写回和扣额,再验证活跃原租约完成 Todo;丢写回、扣额或完成回执从原日志恢复。

对主干的风险 / Risks

非终态部分进展保留 open,独立验证失败、声明验证失败和变更租约均无写回或扣额。

实际源码套件 336 项通过,quick premerge 完整通过。首次隔离校验缺少仓库 TypeScript 开发依赖,补齐后整轮通过。旧提交的原生终态在 File 和 SQLite 各失败一次,新提交的内置扣额回执丢失对照在两个 provider 均恢复。CLI 原本对预声明终态部分进展提示需完成验证,两端复现相同的拒绝。 内置宿主和原生宿主均通过真实控制面调用;模型输出使用确定性替身。

我的整体评价 / Verdict

APPROVE。 当前修改满足这次 Todo 完成与结算目标。上述预声明终态的部分进展限制是对照中保留的边界。 真实 Core、确定性宿主输出及实际 File/SQLite。模型采用、已安装产品和托管 CI 未验证。

English verdict: APPROVE at 3b5a48e. The builtin and native paths commit the original Turn once. File and SQLite recover lost completion or debit receipts without rerunning the host. Terminal partial-progress blocking matches current main.

@xiaobaifly7
xiaobaifly7 dismissed loopx-agent’s stale review November 15, 2026 14:31

The merge-base changed after approval.

Preserve the original PR history and bring its completion adapter onto the main revision that rechecks captured work before dispatch. The resulting diff to main retains the same five scoped files.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
loopx-agent previously approved these changes Nov 15, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

评审提交 aab95a3587d9b62e65351ce1a0421d3d4b0f7475。原差异基点 f3bdad2387397e078fbc887e7cb7ed80adaf7510。

动机 / Motivation

内置 Codex 完成 Todo 的操作者,以及在原生对话中恢复结算的操作者,依赖同一个 Turn 表明交付已经结束。 主干的内置 Codex JSON schema 缺少显式完成。与本次改动关联的终态完成,即使由脚本发出,也会被入口拒绝,Todo 仍然打开。 当持有租约的 Todo 完成交付并声明无后续工作时,内置入口应完成验证、写回和扣额。原生会话在扣额后中断时,需要从原 Turn 补齐剩余步骤。 同一实际 CLI 在 File 和 SQLite 上均从终态零效果拒绝变为完成 Todo、写回、扣额一次并提交原 journal。重放没有再次启动模型或改变 journal,错误 Agent 被拒绝。 这批测试使用实际 CLI 和本地存储,模型及 app-server 采用脚本回复。已安装应用、现场模型和 PostgreSQL 仍待验证。

改动思路 / Approach

本次交付覆盖内置明确完成和原生终态恢复两条入口,共用已有验证、写回和回执解析。 内置路径先执行已有完成生命周期,随后读取原回执。原生路径沿用写回、扣额、完成的顺序,并将恢复绑定到原租约。 结算身份约定

具体改动 / Changes

差异共 5 文件,新增 520 行、删除 2 行。两处运行时接线及一处操作指引定义了行为,其余新增代码用于验证实际状态和恢复。

  • validated-completion。内置 JSON schema 暴露现有 Core 完成结果。仅内置适配器进入完成优先分支,经原验证器和租约调用普通 Todo 完成,再写回及扣额。 结果 schema 写回分派
  • native-terminal-recovery。已有原生路径按相同 lease 结算。对于扣额后丢失回复的情况,续跑读取原身份的效果,补齐尚欠的步骤。 终态分派
  • progress-and-negative-fence。无完成验证器的部分进展正常提交,Todo 保持打开。两版都拒绝完成验证失败和带完成验证器的部分进展,均无写回和扣额。

对主干的风险 / Risks

旧头在原生终态扣额后再次读取已释放的 lease,导致原 journal 无法提交。当前分派使原生宿主继续拥有原租约证明。 旧问题

基线与候选各跑 10 组实际 CLI。原生正常、扣额后中断和丢完成回执的 6 组 File/SQLite 定向用例通过。集成源码 301 例通过。标准 premerge 的 6 项直接检查和 13 项选定检查通过,输出预算在 runner 中超时后以同一基点单独通过。

我的整体评价 / Verdict

APPROVE。 两种本地存储都通过同轮终态、拒绝错误身份及重复结算的对照。调用点沿用 Core 的完成与回执接口,覆盖了原生中断恢复的已知问题。

English verdict: APPROVE at aab95a3. Built-in validated completion commits the original Turn with one debit on File and SQLite. Native closeout and recovery reuse the original lease and receipts.

…oduct-turn8584-current-main-20261115

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

评审提交 76b826cd4ba95f24d6c074d11a63fac80aa30d61,分叉基线 f38fae05bb9a1c2cc54a2641359224cc253d32ac。无新增阻断发现。

动机 / Motivation

用内置 Codex 交付 Todo 的操作者需要看到任务完成、额度和本轮日志一致。 原内置入口未暴露明确完成结果。候选让成功交付走原 Todo 完成流程,也让独立验证期间收到的 Goal 停止指令在结算前生效。 File 和 SQLite 上,停止都保留验证记录且零业务写回、零扣额。Owner 恢复后可续原轮,模型只启动一次。 本轮使用真实 CLI、验证子进程和本地权威存储。模型和 App Server 返回为合成输入,安装态宿主、真实模型及 PostgreSQL 仍待验证。

改动思路 / Approach

复用原 Todo 完成流程和原硬租约。内置宿主先完成,再写回和扣额,终态收尾只需要同一 Turn 的已有回执。原生宿主依然按写回、扣额、完成的次序,可以从已提交处续跑。最新提交在独立验证结束后重查原 Goal 的运行权限。 Turn 协议 · 此前原生回归 · 主干停止恢复

具体改动 / Changes

在分叉基线的 docs/reference/protocols/loopx-turn-v0.md 上核对四项。 explicit-completion 对应内置完成,native-original-closeout 对应原生终态,authority-recovery 对应停止后原轮恢复。installed-adoption 需要安装态实证,留在宿主验收。完整比较共五个文件。相较上次评审的 aab95a3,本头接入主干的停止恢复,加上验证期间停止的检查和回归。

  • 内置结果格式暴露 validated_completion。声明完整交付才走完成分支,普通进展仍保留开放的 Todo。 内置 schema
  • 内置调用先经过独立和声明校验,使用原租约完成 Todo,扣额后凭原回执收尾。原生路径沿原顺序执行和恢复。 写回分派 · 终态读回
  • 独立验证结束后检查原 Goal。文档同步说明停止边界,新增测试将硬租约、真实存储、原日志和回执放在同一用例里。 停止检查 · 测试 · 双语说明

对主干的风险 / Risks

用实际 CLI 和独立验证子进程复现停止。分叉基线在两种存储都先落下一次写回,随后拒绝扣额。候选四组独立验证期间停止均返回 goal_stopped,没有业务写回或扣额。Owner 恢复后,四组均提交原 Turn,模型只启动一次、额度只扣一次。另两组在 Todo 声明校验期间停止,真实存储也无完成、写回或扣额。

原生正常收尾、扣额后中断和丢完成回执分别在两库验证。六组均提交原日志,重放无新增扣额。集成源码 496 项通过。标准预合检查 6 项直接、14 项选定通过。首次缺少本地 TypeScript 开发依赖,按锁定依赖补齐后通过。当前托管 CI 未查询。

语义与 CI 对齐

分派依据结构化结果和原 Goal 权威。执行、验证和扣额仍由已有 Core 处理,完整交付只关闭原 Todo 的义务。当前证据包含本地写回、恢复及实际用例,安装态或真实模型采用需另验。 完成与原身份

我的整体评价 / Verdict

APPROVE。现有内置 CLI 的明确完成、结算前执行权检查及原生终态兼容。 内置明确完成先经原 Todo 验证器。原生原次序恢复通过,停止后合法恢复只补原轮。当前入口是 CLI 与原生处理器,无页面变化。此前的审核和讨论仍由合并资格读回处理。

English verdict: APPROVE at 76b826cd4ba95f24d6c074d11a63fac80aa30d61. Built-in completion and native recovery pass on File and SQLite. An owner stop during validation prevents writeback and debit, and resuming settles the original Turn once.

@loopx-agent
loopx-agent dismissed songoow’s stale review November 16, 2026 08:33

Resolved on current head: native no_followup closeout now reuses the exact completed Turn receipt without requiring a released lease; File and SQLite recovery coverage passes.

@loopx-agent
loopx-agent merged commit cac86bb into loopx-project:main Nov 16, 2026
42 of 54 checks passed
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.

3 participants