Repository navigation
Test C1 first-read recovery after a native journal write failure - #9107
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
[P2] 恢复命令漏掉写入范围时,新增回归仍会通过
把返回的恢复命令换成同一捕获下仅选择 /schema_version 的有效读取后,原测试仍在 File 和 SQLite 通过。完整范围断言走的是另一次 read_initial(current)。 直接断言 recovered_values[scope_path] 等于完整范围,并在同一故障用例保留原捕获摘要和三个结算回执的断言。 相关代码
动机 / Motivation
维护原生 context-read 和结算的开发者需要验证失效发生在分页中途时的真实行为。 主干的宽范围用例只从 PostCompact 进入失效和恢复。候选增加 PostToolUse 写日志失败后续读的路径。 实际 CLI 在 File 和 SQLite 上都拒绝旧偏移,返回的恢复命令能读回 270 项原写入范围及原 effect ID。组合结算的三张回执重试时逐字一致,计数只增加一槽。 改动限定在既有测试模块和这条恢复路径。 失败通过真实 Host hook 入口注入 ENOSPC。已安装 Codex App 的生命周期事件和模型实际保留仍待验证。
改动思路 / Approach
用原 fixture 先让完整观察生效,再把首个暖读页交给真实 PostToolUse hook,将 ENOSPC 注入保存动作。之后继续调用正常 CLI,核对失效、同一捕获和结算。生产 reader 以及 File 和 SQLite 的写回入口都参与验证。
具体改动 / Changes
精确 head 3a9a519d6f97ab11e03a2f46f207defeb932d327,base 8e9a28a866da06cc6fd63e78709910fe35dad564。一个测试文件 +54/−12。逐项复核 日志失效与原游标拒绝、原捕获恢复和完整范围、原回执与扣额。 验收约定
- 现有 PostCompact 分支继续验证观察失效后恢复。新分支把日志保存失败放在已生成的继续游标与下一页读取之间。 源码
- 恢复命令的原真实输出在两种存储均包含完整写入范围及原 effect ID。缩成同捕获单字段的反例区分了完整性断言。 源码
- 原结算重复请求返回相同的 validation、durable_writeback 和 quota_spend 回执,外层独立计数验证扣额。 源码
对主干的风险 / Risks
12 项聚焦 Python 检查、File/SQLite 各一项完整范围补充对照和本地 5 项直接预合并检查通过。 删除恢复命令后,File 和 SQLite 都在拒绝检查处失败。用有效单字段选择替换后仍通过,定位到现有测试的完整性断言。实际磁盘容量波动导致的运行失败经保留原日志并串行复跑后排除。
我的整体评价 / Verdict
保留现有集成用例。将完整范围的断言放到失败响应实际给出的恢复命令上,再保留原捕获与扣额读回,便可覆盖原操作员必须执行的恢复路径。
English verdict: REQUEST_CHANGES. Real CLI recovery and idempotent settlement work in both stores. The regression still passes when the advertised recovery command omits the write scope, because completeness is checked using a separate read.
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. 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 HEADFor a same-repository clone whose Keep the DCO |
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
3a9a519 to
422c821
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
维护原生读取及结算的开发者,需要验证已准入任务在分页中途失去日志后仍能恢复。 以前即使失败响应返回的恢复命令只读一个无关字段,测试仍能凭另一次读取通过。当前测试执行失败响应实际提供的命令,并在该响应中验证完整范围和原捕获。 File 和 SQLite 都在真实 CLI 路径上恢复 270 项写入范围。原范围读回缺失的反例在两种存储均失败,同轮结算重试保留原三份回执并仅扣一次。 这是既有测试的扩展,故障通过合成日志写入失败注入。
改动思路 / Approach
同一集成用例保留既有 PostCompact 分支,并加入原生日志保存失败分支。测试使用真实 CLI 读者,先让续页被拒,再读回返回的命令。 复用既有 PostCompact 夹具、子进程读者和原结算入口。若只新增锁内 helper 断言,会漏掉传给操作者的恢复命令。
具体改动 / Changes
评审提交 422c821dbf2a774dcfba1ff0923504efcc70f215,比较基线 ca0ab3b0adbd4d1faf9168825205d319d890a8d0。一个现有测试文件,+60/−16,复用同一 setup 和断言链。 验收依据
关键代码讲解
journal-invalidation在真正的 PostToolUse 流程内注入一次 ENOSPC,断言日志退役及旧续页拒绝。故障边界original-capture在返回的恢复输出上逐项断言 scope、原路径和摘要,随后用正常首读交叉验证。恢复断言original-settlement核对原轮三种回执、重放响应和独立扣额计数。结算断言
对主干的风险 / Risks
PASS,178 项首读测试全部通过,包括两个后端的四种组合。合法的同捕获单字段变异在 File 和 SQLite 都按预期失败。Ruff、diff 检查以及五项直接预合并检查通过。本地 managed premerge 的直接检查通过。当前检查读取到严格 change-quality 回执缺失,合并资格仍待验证。 未查询远端 CI。
我的整体评价 / Verdict
当前提交通过,未发现阻断项。原先缺少的恢复输出断言已补齐,继续保留原 PostCompact 对照,合并资格单独保留。 原准入、原 effect ID 和重放扣额都由现有 owner 处理,这次回归验证维持了跨轮次恢复的因果链。 操作者可继续使用故障响应提供的恢复命令,测试直接核对可恢复的范围。 变更只涉及测试,未改变页面呈现。 实际磁盘写满、安装版 Host hook 和模型实际保留仍未验证。
English verdict: APPROVE at 422c821. The returned same-capture recovery now proves the full scope in both stores, and replay preserves the original three receipts and single debit. 178 tests passed. The local merge receipt remains missing.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Goal and outcome
Exercise a ready C1 Turn when saving the native observation journal fails with
ENOSPCbetween its first and next page. The test keeps the existing compaction path and the current mainline lease fencing.The rejected continuation returns a recovery command. The test executes that command and checks that its own response restores the full write scope and carries the original capture path and digest. It also checks the original validation, durable writeback, and spend receipts. Retrying settlement returns those same receipts with one admission and one debit for the recovered Turn.
Validation
/schema_versionfrom the same digest-bound capture failed at the new full-scope assertion on both providers.