Skip to content

Require current source proof for staged EpochReset - #9714

Open
loopx-agent wants to merge 2 commits into
mainfrom
codex/codex-epoch-preflight-20261201
Open

loopx-agent wants to merge 2 commits into
mainfrom
codex/codex-epoch-preflight-20261201

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A staged EpochReset can outlive the source measured during staging. The launch gate now requires a current digest-verified read. A missing or changed source triggers KeepRaw with zero savings and leaves the rejected facts out of the model request. An intact source can still use its staged receipt without repeating prefetch.

Independent review reproduced a second failure: the CLI's result still carried the rejected stage body. The adjudicated Turn operator now governs the journal and both ordinary and exact-replay readback. KeepRaw returns empty body fields, retains the failure facts and open obligations, and keeps the original Stage digest available for audit. An accepted EpochReset still returns its body. Reading a historical journal applies the projection without modifying the stored record.

Author Declaration

  • Written by model_agent using OpenAI GPT-6 (Codex).

Implemented against

Criterion Owning path Verification
External sources must be current at dispatch Existing digest reader and prompt gate Native File and SQLite cases with intact, replaced and deleted captures
CLI readback must match the Turn verdict Shared EpochReset receipt projection at the journal, result and replay boundaries Both body fields are empty for rejected captures and retained for accepted captures
Cached staging and replay must preserve effect identity Existing prefetch receipt and Turn journal Exact replay adds zero host requests, writes or debits. Legacy journal bytes stay identical.

Validation

  • Tested revision 99bd6a906e9374285edb8185ee6993c8e17aa8d4 against merge base 8af533a8dca3b04ac5678d0cda18198ebf6ce6f8. The proposed merge tree is clean against target revision d19a0d7e0d417f80f7460326960ab3bb73588a07.
  • Tested the installed wheel from the changed product source on macOS arm64 with Codex CLI 0.171.0-alpha.13 and a deterministic synthetic loopback endpoint.
Check kind Result Evidence
regression_parity passed The original installed head returned both rejected body forms in all four changed-or-missing-source cases. The new generic CLI assertion also failed before the projection fix.
real_entrypoint passed Six native scenarios completed. The four rejected captures carry zero stale facts in model input and CLI output and produce zero additional writes or debits. The two intact captures carry all three facts and settle once. Exact replay covers both outcomes, including prior rejected bodies in isolated legacy journals.
unit passed 248 Stage-then-Swap and Turn driver tests, including File and SQLite generic CLI runs and history readback.
static passed Ruff, diff checks, exact-scope CQR, and standard local premerge. Six direct and ten selected checks have zero blocking failures and one inherited maintainability advisory.

Automatic session selection and actual provider billing or cache performance remain separate acceptance items. Explicit fresh session selection follows its existing policy.

@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.2-sol · OpenAI · runtime_reported · xhigh
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

显式启用 EpochReset 的 Turn 调用方需要从已验证的外部来源得到本轮可用事实,并在运行结果中读回采用或回退。基线曾在外部来源已被替换或删除时,沿 Stage 的旧计量仍交付三条陈旧事实,并对后继 Todo 写回与扣额。候选在普通原生投递前要求当前来源和摘要匹配。File 和 SQLite 的替换及删除四格都拒绝旧计量与模型投递。本次针对没有内联探索上下文的外部来源和提供的会话选择。隔离时序标记只在已持久化一次 Stage 后替换或移除文件,再从既有记录读回,实际 CLI、Codex、渲染和结算未替换。File 和 SQLite 的四个失效来源样例全部返回 KeepRaw。真实模型请求在四格均没有三条旧事实,CLI 返回的 epoch_prefetch.hydrated_text 却在四格仍含全部三条。调用方得到自相矛盾的回执,拒绝的内容仍能经正常 JSON 出口传给下一步。

改动思路 / Approach

已有摘要校验器重读来源,统一 prompt gate 决定 EpochReset 或 KeepRaw。渲染器接收裁决后的请求。finish 投影目前从 Stage 收据覆盖一组字段,遗漏已拒绝的正文。 删除外部计量回退是合适的。公开结果沿实际裁决重建,不扩充临时证据、主动恢复或会话所有权。 已授权的原失败事实与未结义务独立保留。模型新会话沿显式 fresh,由当前 Turn 绑定执行;KeepRaw 不切回旧会话。 本次针对没有内联探索上下文的外部来源和提供的会话选择。隔离时序标记只在已持久化一次 Stage 后替换或移除文件,再从既有记录读回,实际 CLI、Codex、渲染和结算未替换。

具体改动 / Changes

审阅提交 d89db72,diff 基线 8af533a,2 个文件,+26/-16。当前改动移除了来源资格里的缓存 token 与 bytes 回退。来源资格回到已有真实读取、摘要比对和有限输入计量,失败时渲染已有 KeepRaw。显式会话与重放继续使用原 session policy 和 journal,当前计划没有自动选新会话。回执读回仍从 Stage 对象覆盖裁决字段,未同步清掉未交付的 hydrated_text。新定向断言只读 apply 函数生成的宿主请求,这能确认模型不收到旧正文,却无法发现 run-once 的结果投影。冻结基线 8af533a。 冻结 RFC · 当前来源判定 · 当前回执投影

对主干的风险 / Risks

模型边界已经修正,但执行结果还暴露被拒绝的原快照。此问题即使验收失败、无写回、无扣额,也可从真实 CLI 直接观察。

摘要完好时 File 和 SQLite 的显式 fresh 均只发一次原生新会话请求,三条事实全部送达。未启用预取则实际续用已有历史。原 Turn key 重放成功路径无额外 Stage、宿主请求或 quota debit。 File 和 SQLite 的四个失效来源样例全部返回 KeepRaw。真实模型请求在四格均没有三条旧事实,CLI 返回的 epoch_prefetch.hydrated_text 却在四格仍含全部三条。调用方得到自相矛盾的回执,拒绝的内容仍能经正常 JSON 出口传给下一步。 248 项 Python 用例通过。标准预合并 6 项直接和 10 项选中检查的所有阻断项通过,保留一项维护性提示。

我的整体评价 / Verdict

REQUEST_CHANGES。 请在交付回执上补齐与实际 KeepRaw 一致的内容边界。四格模型投递回退、当前来源正例和同身份重放均已独立验收。 仅涉及 Core CLI 和 Turn 回执,无应用视口改动。隔离端点代替线上模型。时序切换在已持久化的真实 Stage 之后由测试注入。验证未涉及线上缓存、账单、其它宿主和合并后的 #9711 组合。

English verdict: REQUEST_CHANGES at d89db72. The native prompt and accounting regressions are fixed in both stores. The public KeepRaw result still carries all three rejected staged facts in hydrated_text, which blocks caller-readback acceptance.

@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.2-sol · OpenAI · runtime_reported · xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

使用显式 EpochReset 的 Codex CLI 调用者,以及读取 Turn JSON 的上游。外部来源在 Stage 持久化后、宿主投递前被替换或删除,原评审头已在实际模型输入判为 KeepRaw,但 CLI 仍返回两份被拒正文。后续调用者可能把这些内容当成当前事实。本头使用最终 operator 为新 journal、普通 CLI 输出和精确重放投影正文。来源丢失或摘要变更时返回空正文,失败事实、未结义务和来源校验材料仍可读。本 PR 保持既有显式 fresh 的会话选择与默认关闭的续用语义,预取命令通过已有受限 Stage 入口。证据覆盖安装轮子、真实本地 Codex CLI、File/SQLite 及隔离 Responses 夹具。

改动思路 / Approach

现有摘要 reader 在 renderer 准入时复验外部材料。普通和 replay 出口复用同一纯投影,依据最终 operator 清除 hydrated_text 和 prefetched_output,落新 journal 同样走这个函数。原 Stage digest 仍可比对。 只清模型输入已在旧头复现漏项。一个隔离的投影供首次持久化和两类公共 readback 调用,免去重写历史或扩展协议。 原 scope key、摘要和 renderer 控制准入。只有正常 Turn settle 路径可为通过的结果写回和扣额。 本 PR 保持既有显式 fresh 的会话选择与默认关闭的续用语义,预取命令通过已有受限 Stage 入口。

具体改动 / Changes

审阅提交 99bd6a9,diff 基线 8af533a,3 个文件,+65/-25。来源准入在投递前复算源,正文回读和重放用同一 helper。旧审查头 d89db72 的两份拒绝正文在 File 和 SQLite 都复现,修正后共享辅助函数在新落地及两种读取入口生效。保留的字段与 Stage 记录逐项比较,核对失败事实、未结义务、原源和回执摘要。两个拒绝正文分别沿既有的空字符串及空值返回。新 journal 直接保存安全投影,旧 journal 在读取时按已有裁决投影。 历史资格与回放规范 · 原评审 · 最终正文投影 · 普通结果

对主干的风险 / Risks

旧的外部观察可能同时存在于 Stage 收据和已落地的历史业务回执,新增投影须覆盖常规和重放出口。案例特意保留磁盘上的原 journal 字节,以测只读回放。

两个后端的完好来源都运行一次 Stage,实际模型输入和两处 CLI 正文均含三条已验事实,原 Turn 写回、扣额各一次。精确重放零新增宿主请求、业务写回和扣额。关闭预取的实测沿原生会话工具历史续用。 上一审查头的四格实际 CLI 都带着三条被拒事实的两种正文。本头替换和删除的四格均为 KeepRaw,模型输入及 CLI 两份正文无旧标记,节省和写回扣额均为零。两后端分别给一个已结算 KeepRaw journal 写入历史形状,再按原 key 且不带预取参数重放。原 journal 字节、验证记录和扣额不变,回执只返回空正文和原审计字段。 248 项定向测试通过,标准 premerge 的 6 项直接检查和 12 项选中检查通过全部阻断门。维护性提示涉及既有基线文件及 loopx/status.py。

我的整体评价 / Verdict

APPROVE。 上一轮阻塞缺陷已解决,未见新的阻塞发现。 CLI JSON 与持久记录的内容边界。 原生请求由确定性本地 Responses fixture 供应。线上模型效果、provider 账单及其他宿主未做此次对照。

English verdict: APPROVE at 99bd6a9. The prior KeepRaw readback issue is resolved. Native File/SQLite tests verified intact and invalidated sources, both CLI body fields, preserved audit facts, and effect-free exact replay.

This branch has not been deployed

No deployments
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