Repository navigation
fix(checkpoint): bind native guard to explicit envelope mode - #6673
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.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewer: model_agent — gpt-6.1-sol / OpenAI; runtime_reported; reasoning_effort=max.
完整评审 head 2166d54a5b9176b3c3cdef9a7671fac45b556e91,不可变 merge base 05a59910cd29e640234158466201d87ed088c2a0。没有阻塞性代码发现,结论 APPROVE。 非阻塞 P2:README 的英文说明仍写该路径使用 captured TurnEnvelope;建议与实际普通关闭模式及新中文说明同步(见下文)。
动机
受影响的是已显式声明 checkpoint、需要在下一次复盘决策前保留研究现场的 benchmark 操作者。此前普通运行未打开 TurnEnvelope(单次交互封套),但原生历史校验仍要求命令带该开关,因而拒绝已经正确停在原 guard 的捕获;源会话虽继续,却得不到可重建的 checkpoint。已在隔离 Linux 的真实 Codex 路径验证:基线仍因模式校验拒绝普通 guard,当前头完成捕获、独立 fork、原会话继续和重复 guard 处理,关闭捕获及缺 controller 的完整状态请求也保持原行为。本次只修复原生历史传输的模式绑定,不启用 TurnEnvelope、不授予恢复后的执行或评测权,也不证明完整研究状态、科学收益或安装后的前端恢复旅程。外部 controller 联合资格和本隔离配置中的 sandbox 工具执行仍未通过,不能用局部捕获成功关闭这些边界。
先读变更前的 benchmark/README.md(spec_revision 05a59910cd29e640234158466201d87ed088c2a0)及其链接的研究 RFC §7.7。按原文段落标注验收:mid-wake quota response 要求 handoff 不自动启用封套;interrupted cursor 要求原 packet、完整历史、唯一未释放命令和来源身份仍一致;complete research checkpoint 明确完整研究状态、controller 和新执行准入另验。本 PR 交付前两项的模式修复,不重新定义最后一项。平台能力、研究采用与分数也不能由“有 checkpoint 文件”推断。
改动思路
实际开关由已有 Execution 及执行 receipt 决定,provider 只把该事实封存并校验;保留同一验证器处理捕获和 fork,避免删除模式约束或新建平行开关 owner。这是既有 Codex provider 与 benchmark caller 的一致性修复;它让普通关闭模式走通已有捕获/重建链路,完整 controller、研究点与通用前端验收仍保留原 owner。
两种缺省值有不同来源:当前执行 receipt 没有显式标志,表示原有的 False;旧封存 interrupted guard 缺字段,表示历史有效捕获必须满足的 True。后者只解码旧数据,不设置当前 CLI 或运行开关。若直接删掉模式比较,恢复将无法发现模式被换;若强制打开封套,又改变普通执行。把已有事实传入现有验证器是更小且完整的修复,没有新服务、开关、schema 分支或平行决策 owner。Python 留在既有 Codex provider I/O 边界,通用准入及 artifact owner 继续保持原归属。
| 封存 guard | 实际原生命令 | 当前结果 |
|---|---|---|
| 显式 False | 普通关闭 | 接受同一未释放 guard |
| 显式 True/旧产物缺字段 | 显式开启 | 保留原兼容行为 |
| 开关相反或非布尔值 | 任意 | 拒绝,不补开开关 |
具体改动
CheckpointWake._capture从既有执行 receipt 取得实际turn_envelope,只写入已显式选择的原生捕获 metadata。worker、Execution、session、普通 renderer 和 deadline owner 与基线逐 blob 相同,未改执行默认值。_verify_interrupted_guard仍检查工作目录和 command identity,并通过 CLI parser 比较 Goal、Agent、Turn、registry/runtime 及 socket;新增布尔类型检查并复用原比较表。输出已暴露、后续 item、第二个匹配 guard、错误 native call 等原有拒绝不放宽。_complete_history、native_session_checkpoint与fork_native_checkpoint仍读取和校验完整 prefix;metadata 通过既有封存/恢复路径保留,所以捕获与 fork 使用同一模式规则。原会话继续使用原 packet、原时限,重试不制造第二份 guard 或 fork。- 原 guard 测试扩为 legacy/ordinary/envelope 三种,并新增相反模式及 null、0、1、字符串拒绝;实际 worker 测试直接检查封存 False。README 增补旧字段兼容边界。没有前端、Lark 或新 CLI 入口;这是已有传输的缺陷修复,不能当作通用恢复产品已交付。
对主干的风险
独立验证使用真实 Codex 进程与本地静态 Responses 服务,没有付费推理或实验任务。普通未 opt-in 套件为 34 passed / 23 skipped;Darwin 实际原生套件为 54 passed / 3 skipped,其 native 捕获仍按原规则在信号前拒绝并继续源工具,不能算 Linux 捕获资格。
Linux arm64 使用 Codex 0.162.0-alpha.2、Python 3.11.2、Node 22.23.3,只读准确源码、无外网、隔离 Home。原实际 worker 的 files/native/full/off 检查:基线 3 passed / 1 native-mode failure / 1 controller skip;当前 4 passed / 1 controller skip。当前普通关闭模式实际完成封存、完整 prefix 重建、不同 session 的 fork 和源继续;重复 guard 只释放原义务;full-without-controller 拒绝,off 不创建 listener/decision/封套字段。这是跨真实 producer/consumer 的反例,不只在 mock 中改一个标签。
所有失败均保留:最初 /tmp 原生 Home 被 Host 明确拒绝创建 helper aliases,两头完整组均有 7 个失败,且 head 的历史边界错误与 base 的模式错误不同,未把它们伪称同一根因。仅将测试原生目录移出临时目录、保持源码/断言/权限/超时后,上述关键链路成立。更宽的其余测试仍为 base 42 passed / 6 failed / 2 skipped、head 44 passed / 6 failed / 2 skipped:逐项核对了两个未到工具等待点、三个 completed-session 工具输出缺失,以及一个隔离依赖缺失;对应三个测试函数 AST 和相关 Host/session owner 与基线相同,这些失败不在本次 interrupted-mode 比较分支。原生 namespace 独立 probe 也明确拒绝非特权 namespace;没有放宽 sandbox 来刷绿。补齐 requests 后,joint 单项在两头都因缺少指定 native checkpoint API source pin 明确跳过,仍未记通过;因此不能宣称整个 Linux profile 已通过。
四个改动代码/测试路径 Ruff、空白检查、diff advisory 后完整 semantic drift smoke 通过。advisory 仅覆盖一个支持的改动产品路径,未发现 carrier 并不证明动态语义;本次依据仍是实际 bool producer、完整历史和双向拒绝。
非阻塞 P2:同一 README 英文段落 L257–260仍有“this path also uses … captured TurnEnvelope”,容易让英文读者以为 handoff 会开启/需要封套。建议同步为“绑定实际显式模式,旧缺字段只保留历史校验”,与新中文段落一致。这是原有相邻说明的校正,不否定实际 off 路径已验证的代码修复。
我的整体评价
APPROVE。实际开关由已有 Execution 及执行 receipt 决定,provider 只把该事实封存并校验;保留同一验证器处理捕获和 fork,避免删除模式约束或新建平行开关 owner。这是既有 Codex provider 与 benchmark caller 的一致性修复;它让普通关闭模式走通已有捕获/重建链路,完整 controller、研究点与通用前端验收仍保留原 owner。 本次有界整理已复用已有 receipt 与唯一验证器,无需再加迁移框架;旧封存数据兼容有真实持久化理由。更宽 sandbox/controller、持续增长 checkpoint、科学收益和前端采用继续保持未验证,既不由绿色个数抵销,也不强加为本次小型 provider 修复的全部前提。评审没有继承作者结论、发起正式研究、变更运行中的 Goal 或执行合并。
English verdict: APPROVE - 2166d54; the real Linux ordinary Envelope-off path now captures, forks verified full history and continues its source, while wrong/invalid modes and off/full-state boundaries remain enforced. Legacy missing-field compatibility is data-only. Broader baseline-equivalent sandbox/dependency failures and controller gaps remain explicit; align the adjacent English README wording (nonblocking P2).
Interrupted native checkpoint validation still requires
--turn-envelope, although ordinary checkpoint wakes no longer enable it. On Linux, a real mid-wake ordinary guard is rejected during capture while the source correctly continues. This prevents a usable checkpoint; it is not a failed research wake.Bind the native guard to the execution receipt's actual boolean mode and compare it on capture and restore. Ordinary guards can now capture without activating TurnEnvelope; explicit envelope guards remain supported. A missing field in an older sealed artifact retains its historical envelope-on validation semantics. Non-boolean fields and mismatched modes are rejected.
Validation:
/tmp, Codex refused helper aliases; a corrected-home rerun reached bwrap but the VM denied uid-map/loopback setup. These sandboxed paths are not qualified here and remain a review limitation. The benchmark danger-full-access native capture/fork path above passes; no sandbox settings were weakened to make tests green. No scientific outcome claim.Owner/scope: existing Codex native-history transport adapter plus its benchmark caller, under the long-horizon checkpoint/recovery acceptance. This is a provider-specific Python binding, not a new control-plane decision owner or configuration switch. CLI/frontend/Lark entrypoints and opt-in authority are unchanged. The bounded future-facing pass reuses the existing execution receipt and guard validator, preserving legacy artifacts without another mode owner.