Skip to content

fix(replan): carry complete lifecycle facts through private snapshots - #6615

Merged
huangruiteng merged 2 commits into
mainfrom
codex/replan-large-snapshot-20261016
Oct 16, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/replan-large-snapshot-20261016

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Receipt-bound replan recovery could fail before dispatch when complete canonical Todo facts exceeded the 2 MiB RPC budget. Route the existing replan semantic method through the existing private, same-UID, digest-bound snapshot channel for both requests and responses; keep the 2 MiB ordinary wire limit, 64 MiB snapshot limit, complete source facts, and the TypeScript decision owner.

All eight current callers share one narrow transport codec. The lifecycle regression now covers small/large histories on File and SQLite, original receipt recovery, independent later work and user gates, durable refresh/replay, and exactly one quota debit. Its terminal-reentry fixture now uses --reason and verifies that the original note remains unchanged, matching the existing immutable-note contract.

Validation:

  • 162 focused Python tests and 65 TypeScript tests passed; control-plane typecheck, Ruff and full semantic vocabulary check passed.
  • Chat bundle and normal wheel build passed; changed production files are included unchanged in the wheel, and an isolated wheel installation round-trips a complete 2.2 MB request/result.
  • Premerge ran 5 direct checks and 19 selected checks. The semantic twin-name failure was repaired by making the Python file an explicit codec; the original 43-owner budget is retained. Two unchanged baseline issues were reproduced at 6f2e388bf with the same Python 3.11.17: DSH maintainability debt (advisory) and a missing fixture script in catalog-run-e2e-smoke.py. The aggregate premerge gate remains held for the latter.

This is the bounded S2/T3 and S7/R7 complete-source transport repair. No public CLI option, configuration switch, frontend/Lark interaction, permission grant, or semantic obligation changes. The shared transport codec is the related refactor; installed-host adoption and distributed/constant-memory qualification remain open. CI was not polled and no global installation was changed.

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 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.1-sol | OpenAI | runtime_reported | reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Exact head: e1332fad0c2f47bda163cadf8bdeb4fd9d42252e

动机

长期维护同一个 Goal、需要恢复先前一次执行并继续工作的 CLI 调用者。
完整任务历史超过 2 MiB 时,原先在发送前报错,已完成的复盘无法写回;现在完整事实和结果通过私有文件传递,仍由原规则判定并恢复原执行。
File/SQLite 的大历史恢复、持久写回、重复写回和仅一次扣账已通过真实 CLI;独立 wheel 的 2.2 MB 参数与结果也完整往返。
本次只修复本地复盘传输;不改变验收、调度、配额或授权规则,也不宣称运行中的宿主已经升级。
当前运行中的旧版本仍待合入及部署;主干既有 canary fixture 缺失和 DSH 维护性问题仍保留。

改动思路

复用现有私有快照协议与唯一 TypeScript 判定,比提高所有 RPC 上限或截断事实更小且能保留原执行身份。
只接入完整复盘事实的本地传输和八个当前消费者,不新增能力、配置、持久状态或 Python 决策规则。
CLI 的 quota/refresh 仍读取完整权威 Todo,并让原 TypeScript reducer 判断原始执行能否恢复。codec 只选择既有传输通道,两个运行时白名单共同允许该方法;小参数仍内联,大参数使用同用户私有文件和摘要校验。调用结果也可走同一通道,避免只解决输入后又在返回时失败。单独放大所有 socket 请求或裁剪历史都不符合这里的完整源事实要求。

触发条件 当前行为
普通小请求 保留原内联与语义结果
复盘完整事实超过 2 MiB 通过既有私有快照传递,仍受 64 MiB 约束
未 opt-in 的超大请求、篡改或不安全快照 原有拒绝边界继续生效

具体改动

评审依据是 docs/architecture/rfcs/typescript-control-plane-migration-v0.md 在 6f2e388bffedb236e490ada15e3a45907009b9ef 的 Long-history transport boundary,先于本次 checkpoint 修改;没有用新文档倒推验收。映射:完整源事实 已实现,八个消费者传递原完整参数;私有快照完整性 已实现,复用原认证、摘要、权限和清理路径;有界资格 已实现,明确保留安装、分布式与常量内存边界。

关键代码讲解

  1. project_replan_semantics 是 15 行 IO 桥接,合并八处传输选择,不含状态判定。
  2. receipt_bound_lifecycle_candidate 的两个生命周期请求都接入 codec;原 obligation digest 比对和原 guard 身份保持。
  3. _request_with_info 的普通 2 MiB、私有 64 MiB、请求鉴权、文件权限/摘要及响应歧义处理没有放宽;只在客户端和服务端注册既有复盘方法。
  4. progress_observation、quota should_run_prepare、vision ACK 的现有消费者一并迁移。测试覆盖完整大输入与大输出、失败后私有文件清理,以及 File/SQLite 的小/大历史、后来任务和用户门禁。terminal-reentry fixture 改用原合同允许的 --reason,并读回验证原 note 未改;没有删除断言。
  5. 仅更新已有 RFC 的资格 checkpoint。全 PR 为 11 文件、+106/-15;无新配置、CLI 开关、权限或持久格式。原 TS 语义实现与快照校验器保持不变。已有经验中的“首个有用结果”建议在这里用于检验真实 CLI 恢复链;这不证明记忆建议有因果收益。

对主干的风险

最强反例是“大调用看似成功,却丢掉旧任务、把原执行绑定到后来任务,或重复扣账”。真实 File/SQLite CLI 已验证隐藏旧来源、后来独立任务和 user gate、Vision 写回、重复写回及一次 debit;纯传输测试还完整保留 2.2 MB 返回值。普通 API 未 opt-in 的超大参数仍被拒绝;快照摘要、尺寸、权限、symlink 和 64 MiB 引用越界反例通过。错误不会因文件通道获得新授权。

语义与 CI 对齐

162 项 Python(158 个相关恢复/策略测试加 4 个边界反例)、65 项 TS、control-plane typecheck、Ruff、最终完整语义检查均通过。正常 Chat bundle、wheel 构建及独立 wheel 2.2 MB 往返通过;初始旧 bundle 失败由正常重建解决,未绕过打包检查。语义白名单复用既有方法,43-pair 预算保持;codec 没有第二份 Python 规则,原 TS owner 未改。
premerge 的 5 个直接检查通过,19 个选定检查中仍保留既有 catalog fixture 缺失失败与 DSH advisory。相同 Python 3.11.17、相同命令在不可变 6f2e388bffedb236e490ada15e3a45907009b9ef 重现相同缺失脚本和 DSH finding;这些因果路径不在 diff 中。先前语义命名失败与最终通过都保留,不提高任何预算。aggregate premerge 仍 held;依配置未抓取或等待 GitHub CI。

我的整体评价

APPROVE,评价限于这个完整、可回退的本地传输增量。long_horizon 在大历史恢复、重放与后来任务独立性上 improved;user_experience 在原 CLI 无需额外用户确认或重输历史即可恢复上 improved。复用现有私有快照协议与唯一 TypeScript 判定,比提高所有 RPC 上限或截断事实更小且能保留原执行身份。 只接入完整复盘事实的本地传输和八个当前消费者,不新增能力、配置、持久状态或 Python 决策规则。
已应用有界相关重构,集中八处传输选择;没有新增语义 vocabulary 或兼容分支。每次私有文件 IO 与完整解析仍有成本,未宣称常量内存、吞吐或长期 soak。当前运行中的旧版本仍待合入及部署;主干既有 canary fixture 缺失和 DSH 维护性问题仍保留。 本评审不授予合并、安装或配额权限。

English verdict: APPROVE - e1332fa; complete local replan facts reuse bounded authenticated snapshots, with 162 Python/65 TS checks and isolated wheel round-trip passing; unchanged baseline canary holds and running-host adoption remain separate.

@huangruiteng
huangruiteng merged commit b543d07 into main Oct 16, 2026
25 of 37 checks passed
@huangruiteng
huangruiteng deleted the codex/replan-large-snapshot-20261016 branch October 16, 2026 06:47
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.

2 participants