Skip to content

fix(turn): record fresh checkpoints without replanning successful work - #8687

Merged
cocolord merged 1 commit into
mainfrom
codex/rfc-r1-real-20261113t111035
Nov 13, 2026
Merged

cocolord merged 1 commit into
mainfrom
codex/rfc-r1-real-20261113t111035

Conversation

@cocolord

@cocolord cocolord commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

A successful managed task could not carry a fresh Vision checkpoint while retaining its route. The Host normalizer forced every fresh packet into material_replan / replan_required, so ordinary completion needed a separate checkpoint or an invalid replan declaration.

Explicit path_delta_mode: unchanged now accepts a fresh evidence-linked packet with path_delta.outcome: continue or no_change. Existing reasons, omitted-mode inference, packet limits, stop/refusal paths and TypeScript effect ownership remain in force. Generic and Codex instructions describe the same choice; the RFC checkpoint is updated in both languages.

Validation at e61aba76dfba1129e1b55822a25899e84a13a61b:

  • Executor/driver: 332 passed; Codex/dsh: 499 passed.
  • Python 3.11 standalone core: 28 existing checks passed, and all six legacy/fresh-checkpoint File/SQLite execution/replay cases passed after the fixture switched an oversized inline command to the existing script-path route. The original four fixture failures and targeted failed replay are retained.
  • One existing isolated inventory task used the current model's tools through stdio, producing revised quantities22/10/5 and185.25 versus172.25. Independent validation checked the13.00 difference, exclusions, reusable generator and five unchanged originals. After confirmed-result SIGKILL, the same Turn resumed at validation with zero Host dispatch, completed and spent once; terminal replay added no effects. Two Host dispatches include the original rejected reply; three resume setup refusals remain failures.
  • The same legal completion/checkpoint is rejected on the base and accepted on this head. Thirteen ordinary CLI cases preserve complete stdout/stderr/exit bytes. All1887 wheel runtime files match this source; Ruff, diff hygiene and staged bilingual validation pass.
  • Repository premerge passes six direct and eleven selected checks after declared npm environment preparation; the initial missing-typescript failure is retained in the exact-head review.

The delivered boundary is success/checkpoint transport and its recovery. Full R1, model-context retention, minimal dependency closure, progressive product control, comparable complete costs, split-package delivery and original-Goal regression remain open. This change introduces no new capability, preset, state owner or installed-host upgrade. Reverting this commit restores the old acceptance rule while retaining task evidence.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

@cocolord cocolord left a comment

Copy link
Copy Markdown
Member Author

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; OpenAI; self_reported (runtime observation unavailable: session_not_bound).

Approval conclusion (author-owned PR; GitHub blocks formal self-approval): APPROVE — e61aba76dfba1129e1b55822a25899e84a13a61b。未发现阻塞性缺陷;最大的风险是把停止/改路线包装成成功检查点,或在恢复时再次执行已确认工作。本轮精确源码、独立安装和真实模型恢复反例覆盖了这两个边界。

动机 / Motivation

从模型宿主执行受管理任务的使用者会遇到这个问题。库存输入更正后,报告已经生成,但旧协议把新的成果检查点强制当成改路线,导致成功完成被拒绝;修复后同一路线可以直接携带新证据,再由外部验证器核验和结算。这里的检查点是模型对目标路线及新证据的有界记录;它不代替任务验收,也不能授予权限。可观察结果是成功报告与新检查点在同一个 Turn 内提交,确认结果后的恢复不会再次执行模型工作或重复结算。本轮只修复成功结果的检查点传输,不新增能力、配置、状态 owner、模型服务或产品安装。完整 R1、模型上下文保持、渐进产品控制、最小依赖闭包、可比完整成本和原目标回归仍待验收。

“不修改协议”会保留已经复现的拒绝;额外手工刷新会把一次成功工作拆成多次控制操作。当前任务最初确实返回了非法 completion/material_replan 组合,这次拒绝是正确的,不能放宽该组合来掩盖缺口。因此需要让保留原路线的成功工作有一个合法、可验证的证据入口。

改动思路 / Approach

新分支属于既有 Host wire 校验:复用原 Vision packet 和 TypeScript 状态 owner,比新增进展标签、额外刷新命令或放宽 material replan 更直接。当前 PR 完整覆盖 Host 结果校验、generic/Codex 指令、旧消息与新检查点的源码及真实安装回放,并同步双语 RFC;不把这个切片当成完整最小内核交付。Python 负责现有 Host wire 的类型、长度和组合兼容校验,TypeScript 仍规范化 Vision,并决定 Goal、Todo、lease 和结算效果。这次没有引入新的进展状态或手工同步账本。

正常路径是已有 Host 读取原始 Goal/Todo,完成工作,返回显式 unchanged 与新 continue/no_change packet;executor 先校验,再由独立 validator 核验成果,最后交给既有 refresh/settlement。没有 packet 的旧消息仍需有效 reason;material replan 仍必须用 replan_required。Stop 和非法/矛盾声明继续拒绝。Packet、receipt、测试数与生成文件本身不作为完整 R1 完成证明。

具体改动 / Changes

规范依据为 docs/architecture/rfcs/monorepo-distribution-split-v0.md,接受前修订 e94c549e8d5384938f5e695371731417ea914dce,并对照第5、9、11节。V2、V3、V4 在本轮所触及 Host transport 和恢复路径上 implemented:File/SQLite 的合法旧消息、新 continue/no_change completion 和拒绝路径继续由同一 owner 处理;原 Turn 确认后恢复与终态回放各保持原身份和单次结算。V1、V5、V10 与完整 R1 deferred:闭包、完整模型上下文、可比成本和其他 R1 出口仍未具备全量证据;现有 RFC 验收承接缺口。V4 的本轮证据不自动关闭完整 V1–V5/V10。

关键代码讲解

  • _normalize_host_path_delta:Accept explicit unchanged + fresh continue/no_change; retain reason-only legacy path and reject conflicting/stop/replan packets.
  • validate_loopx_turn_host_result:Caller still requires exact result/phase binding, completion adapter and material_replan/replan_required; normalizes packet before effects.
  • render_prompt:Generic/dsh producers learn reason reuse versus fresh evidence, with stop and authority obligations preserved.
  • _render_prompt:Codex producer exposes the same fresh checkpoint alternative and explicit replan result kind.

八个文件增加220行、删除11行,主要是既有源码和 installed 回归以及双语检查点说明。生产变化仅复用三个现有文件,无新增模块、CLI、状态字段或 owner。测试复用原 fixture/recovery helpers:成功工作与 cached Vision 组合覆盖8类,停止/replan outcome、矛盾 reason、缺失 path、旧推断和 completion/replan 非法组合拒绝;旧 confirmed-result interruption test 扩展到新 packet。安装测试用普通脚本路径传输结果,保留既有 command 长度限制。

对主干的风险 / Risks

最强反例不是 serializer 接受 JSON,而是同一报告通过外层真实 CLI 后仍不能完成,或 process loss 让已确认模型工作再次执行。旧 Python3.11 core 在相同 installed harness 下,legacy case 通过、fresh unchanged completion 被明确拒绝;最终 core 的 File/SQLite 六类 legacy/fresh completion/replay 全部通过。十三类 ordinary CLI 完整 stdout/stderr/exit 字节相同,不做语义归一化;1887个 wheel runtime 文件与本 head 一致。

真实库存更正使用当前模型工具与原隔离 Goal/Agent,输入为 synthetic CSV。量22/10/5、价值185.25对照原172.25,独立 verifier 核验13.00差额、六条排除、generator 重算和五份原文件 SHA。Result 已规范化并写入 journal 后,SIGKILL 杀死 driver 与 validator;原 key 从 validation 恢复,host_invoked=false,Todo done、quota spend仅一次。终态 replay 没有 Host、writeback 或 spend。两次 dispatch 包含首次被拒绝的 reply;三次 resume setup 拒绝保留,不能说整个任务只 dispatch 一次。

源码 executor/driver 332项、Codex/dsh 499项、既有安装 checks28项及修复夹具后六类 installed cases 通过。首次四个新安装 case 因 inline command 超过已有边界而失败,改用既有脚本路径后同类检查全部通过;没有提高上限或删除断言。Premerge 的首次 semantic 检查因本 worktree 缺 typescript npm dependency 失败,按声明的环境 npm ci --ignore-scripts 恢复;最终 gate 的六项 direct 和十一项 selected 检查均 PASS。CI 的最初快照仍 queued,原因/结果未推断,保留为 required=false 的诊断;merge readiness 和 maintainer authority 另行执行。

语义与 CI 对齐

本轮 candidate_decision 为 reuse_existing:使用现有 unchanged、continue/no_change 与 Vision packet,不新增 vocabulary。对 generic/Codex prose 逐条比较了 actor、trigger、顺序、证据来源、scope、continuation 与 Stop;有意新增成功证据选项,并显式重述既有 replan result kind。没有移除读取、验收或权限义务。Codex/dsh source contract 回归通过,当前模型 generic packet 已实际采用;新 Codex 文本的真实模型采用和全上下文保持仍 UNVERIFIED。既有 state/lease/budget 规则与默认 owner 保持;此前冻结失败不能由本 PR 改判。

我的整体评价 / Verdict

这是 justified_increment。Long_horizon 在所触及恢复路径上 improved:新的成果证据可以进入同一结算,确认后的恢复和后续 replay 不重复 Host 或 spend;该结论不等于完整长程效率收益。User_experience 在该成功报告路径上 improved:减少一次不必要的检查点操作,不新增用户问题、配置或确认。已检查 turn CLI、Host adapter 和既有报告返回路径;没有改变渲染页面,本轮无需新增截图。 未验证展示范围为 none;完整渐进产品旅程仍另行验收。

新分支属于既有 Host wire 校验:复用原 Vision packet 和 TypeScript 状态 owner,比新增进展标签、额外刷新命令或放宽 material replan 更直接。当前 PR 完整覆盖 Host 结果校验、generic/Codex 指令、旧消息与新检查点的源码及真实安装回放,并同步双语 RFC;不把这个切片当成完整最小内核交付。 兼容保留对应现有独立 Host 和持久 journal,理由可核验;不存在需要本轮建立的新机制或大规模迁移。当前范围 proportionate,typed-state、domain-neutrality 与 authority 语义 aligned;没有 default-off 新能力声明,已明确披露自动加载指导的有意变化。上述必要本地验证、完整正文检查和远端 unchanged head 是发表与合入条件;作者身份使用 COMMENTED approval conclusion,不冒充 GitHub formal approval。

English verdict: APPROVE — e61aba76dfba1129e1b55822a25899e84a13a61b. Successful unchanged-route work carries a fresh validated checkpoint through existing owners; baseline refusal, File/SQLite completion/replay and real confirmed-result recovery qualify the scoped change. Full R1/model-context/cost acceptance and pending CI/readiness remain separate.

@cocolord
cocolord merged commit 5890cec into main Nov 13, 2026
15 of 23 checks passed
@cocolord
cocolord deleted the codex/rfc-r1-real-20261113t111035 branch November 13, 2026 12:06
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.

1 participant