Repository navigation
Fix paging and numeric fidelity for saved native quota context - #8319
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> (cherry picked from commit 92b39554354775484effdbbe33ea3156b6ec9882)
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> (cherry picked from commit a56f1962af5017e759df0fc0b641345503ad109a)
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent, gpt-6.1-sol, OpenAI, runtime_reported, reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
已经保存准入结果的 checkpoint worker 会用有限的工具输出读回上下文,再在同一个 Turn 选择 Todo。它需要保留原数值和按窗口续读。 用同一已保存决策运行原生首读与选择,并在 File 和 SQLite 比较热态以及压缩后的返回。 显式窗口可随游标续读。两种存储的正常选择恢复了热态差分,压缩后可从当前完整文件恢复原值。 评审涵盖六条变更路径和真实 Codex CLI 的隔离回环。数值修复也覆盖共享展示入口中的真实 replan。 本次覆盖原生 saved-context 的入口和恢复。旧 replan-view 的数值输出与 Turn plan 增长是两项已复现的现有问题。实际部署、模型采用和成本未在此验证。
改动思路 / Approach
先验证原 capture 的身份和窗口,按原 reader 投递。保存选择后,普通路径保留同一 payload,有 replan 路径则应用 typed 编辑。现有完整或差分选择继续依据可验证的文件前驱。 普通入口跳过一次空投影,真实 replan 仍由原 TypeScript owner 决定展示,Python 只应用现有编辑协议。窗口参数交给相同的 UTF-8 reader。这一范围足以修复当前消费者两条路径。 仅修复原生分页和已保存入口展示,不扩大准入、写回或任何新能力。
具体改动 / Changes
基线为 8a4d4f9dab17b01d6fe3546936155b4d718fc20d。原生首读规范要求整个响应遵守字节预算并从同一 capture 续读。数值与来源身份、前驱失效回退另有独立约束。 基线规范
- 显式页窗。 同一组 CLI 用例在主干有三项分页失败。目标提交接受显式内容窗口,并按实际序列化 UTF-8 字节、偏移和 EOF 复核附带页与续页。显式选读经 PreCompact 后继续,回放仍得到同一份内容。
- 原始值和不同来源。 独立的 replan 样本中,当前入口保留 1.0、-0.0 和 9007199254740993。值确实相同的两份验收仍共用读回。只有数值类型或精度不同的两份在当前入口各自保留,基线把它们折叠。
- 差分及失效回退。 File 和 SQLite 的原 guard 与选中后的原始捕获都写出 1.0。基线投递变成 1,两种后端都走 full。目标提交保留 1.0,热态使用绑定原捕获的 delta。PreCompact 后改走当前 full,仍读回 1.0。
- 同轮边界。 无效窗口、非原生显式覆盖和身份或摘要不匹配均拒绝。压缩后的续读和回放保留原捕获与 journal,两个后端的选择对照均为一次原 guard 加一次同轮选择、零扣额。关闭投递仍得到原 should-run 结果。
关键代码讲解
原普通已捕获路径也把 payload 整体送进 JavaScript 做空投影,JSON 返回会把 1.0 变成 1。修正后普通路径沿用原值,只有真实 replan 请求现有 TS owner 返回编辑。分页沿用当前 reader 的同一窗口验证。 页窗入口 · 普通捕获分支 · Python 编辑应用 · TS replan dispatch
对主干的风险 / Risks
原生生命周期、明确关闭及错误窗口都跑过。共享展示入口的真实 replan 在关闭原生投递时也使用原始数值。原准入和选择回执独立读回,实际选读不引入新的扣额。旧读端的数值归一化和 Turn plan 预算单列。 数值来源规范 差分回退规范
108 项入口测试与 83 项 TypeScript 测试通过,控制面 typecheck 通过。匹配子集从主干的 5 失败、5 通过变为 10 通过。 Quick premerge 的 6 项直接检查和 3 项选中检查通过。 合并树和两个提交的 DCO trailer 已核验。 独立的旧 quota replan-view 读端在两个 revision 都把示例值输出为 [1,0,9007199254740992]。原 SHA 绑定的 context-read 在两边均返回 [1.0,-0.0,9007199254740993]。 Turn plan 增长检查在两边都观察到 11,432 字符,超过 9,300 + 60 × 35 = 11,400 的现有门槛。 远端 CI 未取样。
语义与 CI 对齐
变更沿用现有窗口、数字表示和摘要身份规则。已启用的实际入口覆盖指定字节、压缩续读、原数值及热态前驱。现有 Turn plan 增长门保留。
我的整体评价 / Verdict
同意此提交的 saved-context 修复。实际入口同时验证了受限续读、同轮数值保真和 full/delta 两条路径。现有 Turn plan 标准检查仍是独立合并门。 本次覆盖原生 saved-context 的入口和恢复。旧 replan-view 的数值输出与 Turn plan 增长是两项已复现的现有问题。实际部署、模型采用和成本未在此验证。
English verdict: APPROVE. At 5f1a5ff, explicit paging resumes through compaction, and File/SQLite retain 1.0 with a warm delta and a full fallback after invalidation. The existing Turn plan growth check still fails on main and this head.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent, gpt-6.1-sol, OpenAI, runtime_reported, reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
阅读拥挤 replan 计划并准备 Vision 写回的 Agent 需要在同一 Turn 保留完整现有意图。 比较同一实际 CLI 的小型与拥挤计划,逐条复核自动重规划写回指令和已发布的原捕获验证。 同一小/拥挤夹具下,main 和旧头均增长 11,432 字符;当前增长 11,364,低于未改的 11,400 上限。小计划仍为 10,553,拥挤计划从 21,985 降至 21,917。 本轮增加的提交只改 autonomous Vision 文字;此前 native 页面窗口和保存 replan 数值修复仍在同一 PR,原独立证据已发布。 独立旧 quota replan-view 的数值缺口仍在原范围之外;安装采用和模型理解未评估。
改动思路 / Approach
已发布的页窗和数字保留路径延用。新增改动只影响已有自主重规划说明的呈现,不改变 ordinary authoring。 把当前包的复制、缺失读回、编辑约束分别直接写出;精简重复语句,不修改 typed schema、校验、字段、门槛或恢复入口。 本轮增加的提交只改 autonomous Vision 文字;此前 native 页面窗口和保存 replan 数值修复仍在同一 PR,原独立证据已发布。
具体改动 / Changes
基线为 8a4d4f9dab17b01d6fe3546936155b4d718fc20d。Required work context 及既有 Vision 协议保留完整工作指令、原写回身份和明确恢复边界。 基线规范
- 原窗口与数字。 此前两提交未改;原独立核对。现有 170 项入口套件重新通过。
- 增长门。 同一小/拥挤夹具下,main 和旧头均增长 11,432 字符;当前增长 11,364,低于未改的 11,400 上限。小计划仍为 10,553,拥挤计划从 21,985 降至 21,917。
- 指令条件。 保持全量替换。已有 Vision 时应从当前 Agent 的完整包及完整 vision_patch 开始,仅编辑已复核字段并给新的 path_delta;缺材料先读 canonical status/history。保留 state 及其余字段,retained 描述不会补齐漏项。原写回后的 checkpoint-context 仍只能恢复同一 Turn。
关键代码讲解
缩短说明由现有 owner 渲染;原读回和 writer与恢复协议仍决定行为。稀疏示例只表示语法,原状态和其余字段仍需带上。
对主干的风险 / Risks
体积收益集中在自主重规划。两次旧失败均用当前相同环境复现。实际模型的理解与已安装采用仍是独立问题;旧 reader 结果不阻塞此次同源入口。
当前头 170 项 Python 通过、15 项跳过;104 项 TypeScript 通过;原 CLI 增长检查复验通过。 Quick premerge 的 6 项直接检查和 3 项选中检查通过。 DCO 与合并树通过。 这次新增提交只改自主 Vision 提示。当前真实 File/SQLite writer 用例验证原摘要、settlement identity 及错误来源拒绝。 远端 CI 未取样。
我的整体评价 / Verdict
代码评审批准。新提交恢复原计划增长门,保留已发布的窗口与数值修复,以及可核验的 Vision 写回和同轮恢复义务。 独立旧 quota replan-view 的数值缺口仍在原范围之外;安装采用和模型理解未评估。
English verdict: APPROVE. Approve the new head. The same CLI fixture drops growth from 11,432 to 11,364 against the unchanged 11,400 ceiling, while the emitted Vision replacement, canonical readback and same-Turn recovery obligations remain intact.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent, gpt-6.1-sol, OpenAI, runtime_reported, reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
当前 checkpoint worker 和 App 读者依据原保存决定进行同轮选择和恢复。 当前 base 与 head 运行相同实际 CLI、File/SQLite 案例和 loopback Codex,再核对上一审定头到当前的注解改动。 实际附带页和后续游标采用同一显式窗口,压缩后还能从原捕获连续读完。File/SQLite 热态选择恢复 delta。真实 Codex CLI 的 benchmark 和 benchmark_progressive 两组都由主干 full 回退变为候选 delta。 本轮全量检查 8 条变更路径。上一审定头之后只增加选择 renderer 的返回注解。 旧 quota replan-view 的单独阶段读仍复现数字归一化,已由 #8324 单独评审。当前复验未涵盖安装后采用、真实模型理解和整轮净成本。
改动思路 / Approach
typed owner 选择输出字段,原始 JSON 值留在源。上下文 continuity 维持自己的文件前驱,原准入和结算继续由既有 owner 管理。 保留既有分页和原身份校验,数值字段继续由原 Python JSON 来源提供。新增注解与三项实际返回值类型一致。 当前改动范围属于现有 reader/投影。旧阶段读改动已分立成 #8324,其与当前 Turn envelope 的集成边界另有精确验证。
具体改动 / Changes
基线为 8a4d4f9dab17b01d6fe3546936155b4d718fc20d。Required work context 规范原字节窗口和当前捕获。Vision 协议规定完整提交和原 Turn 恢复。 基线规范
- 保存页和原值。 实际附带页和后续游标采用同一显式窗口,压缩后还能从原捕获连续读完。File/SQLite 热态选择恢复 delta。真实 Codex CLI 的 benchmark 和 benchmark_progressive 两组都由主干 full 回退变为候选 delta。 非法窗口、非原生显式覆盖、错 Goal/Turn 或不匹配摘要由既有 reader 拒绝。失效前驱恢复原 full。真实读取保留 1.0、-0.0 和 9007199254740993,原始值不同的两个来源分别交付。
- 当前注解。 上一审定头在原函数缺注解,当前 3 文件和项目 17 文件通过。
- 既有增长门。 同夹具主干拥挤增长 11,432,已审头和当前头均为 11,364,原上限 11,400。当前注解未改变读回或预算。
关键代码讲解
普通 saved selection 经过无改动的 JS 回传时把 1.0 变成 1,原观测前驱和当前源无法复用。普通路径现在直接沿原值,真实 replan 使用原 typed 源编辑。显式分页走既有 validator。 窗口 · 源编辑 · 返回注解
对主干的风险 / Risks
主干的四项旧 flag 测试此前假定一律使用 decision-output-root。现头的测试沿实际原生准备读回,并断言原字节、quota 和 receipt。单独的旧阶段读取在两端均会归一化数值。 相邻修复
候选 243 项 Python 通过、14 跳过。另跑两组真实 Codex CLI loopback 均通过,123 项 TypeScript 通过。 Quick premerge 的 6 项直接检查和 3 项选中检查通过。 DCO、合并树、Ruff、仓库 17 文件与定向 3 文件 mypy 已通过。 主干配对组 234 通过、9 失败、14 跳过。两项 warm File/SQLite、三项显式窗口用例仍失败。四项旧预检测试的 flag 假设改接实际原 capture 并追加相同 quota/receipt 断言。独立的旧阶段数值限制仍可复现。 远端 CI 未取样。
语义与 CI 对齐
先前独立评审的增长缺口仍由原 oracle 复验,上一审批头和当前均保持 11,364。当前对照把本次注解和原行为修复分开。 此前评审
我的整体评价 / Verdict
同意当前提交的保存上下文修复与新增注解。 两条真实本地 benchmark 调用通过,范围为隔离的已保存决策和原生恢复。生产安装、模型采用和完整成本仍待验证。
English verdict: APPROVE. The exact head preserves captured values and explicit paging, restores the expected delta in both native loopback callers, and fixes the renderer's strict return-type check. The separate legacy staged reader remains scoped to #8324.
Goal And Delivered Outcome
Saved native quota context has two regressions. The saved reader rejects a valid explicit page window. A normal Todo selection can also turn the source value
1.0into1by running a no-op replan projection through JSON. Native continuity then falls back to the full capture.Accept explicit native page windows through the existing reader validation. Skip replan presentation for ordinary decisions and apply typed edits to the original source values when a saved replan actually needs presentation. The selection uses the existing capture and admission rules.
The review reproduced a third issue on both main and the first proposal. The ordinary
turn planfixture exceeded its growth limit. State the current Vision packet requirement once and preserve the full writeback instructions. Previous reviewThe strict Python check also caught the captured selection renderer's untyped return. Declare the rendered bytes, digest and displayed field list on the existing renderer.
Related to #8259 and #8273. The target main revision is
8a4d4f9dab17b01d6fe3546936155b4d718fc20d.Author Declaration
Implemented against
Required work context at the target revision.
loopx/cli_commands/quota_capture.pyloopx/control_plane/quota/turn_envelope.tsloopx/cli_commands/quota_presentation.pyloopx/control_plane/goals/vision_checkpoint.tsScope And Continuation
The page validation also appears in the release integration. #8273 retains ownership of release qualification. The separate staged number preservation for
quota replan-viewis under review in #8324. Integrate it on the updated main branch after this PR because both touch the Turn envelope. Installed adoption, model comprehension and cost are still open.Validation
da6d79a4cc6336b15a7bb194da54afeeecbcc3d0regression_paritypassedreal_entrypointpassedbenchmarkandbenchmark_progressivecallers. Both show an unintended full fallback on main and the expected delta on this revision.real_backendpassedunitpassedoutput_budgetpassedvision_readbackpassedstaticpassedThe prior independent approval covers
bc9074b3. Review ofda6d79a4is pending. Previous approvalFrontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Core control plane hardening. Saved capture fidelity and native recovery.
Shared-authority RFC fixture impact
N/A. Presentation repair.
Boundary Checklist