Repository navigation
perf(context): reuse full recovery for native presentation - #7687
loopx-agent wants to merge 10 commits into
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
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
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
独立审查整项 PR:f327d9d799080ce9f76c2097a8fd359334bd8ce1;不可变 base:2e928fefe422d62dbec3a443c0c61e79a8f38752。
动机 / Motivation
已启用 native file-context 的 Agent 通过原生工具读取完整当前要求,cold/reset 不应为同一完整内容再写一份未使用文件。 full mode 已有 committed recovery,却再次发布 delivery.json;小输出上限下 warm manifest 也可能在准入后溢出,使原任务需要恢复。
既有 presenter 直接复用完整 recovery;小 manifest 保留原 digest-bound recovery.command,并可从该命令派生 list/select。 这交付独立可用的 native presentation prerequisite;C1 统一生产者/消费者切换、实际模型采用和完整成本净收益仍沿既有 #7430 保持开放。
仅既有 quota_capture 原生展示与恢复导航,未切换 context-delivery 默认值、准入、canonical state、原 Turn 或一次结算 owner。
改动思路 / Approach
最强的反对理由是:重复文件只是完整成本中的一小部分,单凭少写文件不能证明 Agent 更有效。这里可接受的交付边界是当前 native caller 的实际展示修复:复用已经存在的完整 recovery,保留原读取、身份和恢复语义;不引入 cache、新配置或第二个状态 owner。仅既有 quota_capture 原生展示与恢复导航,未切换 context-delivery 默认值、准入、canonical state、原 Turn 或一次结算 owner。
机制集中在原生 capture presenter,复用现有 recovery/reader,删除重复 full publication;无需新 cache、配置或状态 owner。
不改会留下已复现的重复 IO 和小 manifest 溢出;只放宽上限不能去掉重复写;新缓存反而重复已有事实。本切片的相邻简化已体现在删除未使用 full wire,而非继续包装它。
具体改动 / Changes
完整读取七个路径,+96/-19。唯一生产文件 quota_capture.py 为+13/-6;其余为三处 Python 验证、英文/中文 RFC 与 owning reference。旧 modularization smoke 的源码断言跟随既有 quota_presentation owner,同时保留 dispatcher 导入验证,不通过删除边界断言使其变绿。
关键代码讲解
- native_context_capture_view 只在
context_delivery_v1的 full mode 复用原recovery.path/sha256。delta 与 unwrapped 输入仍发布自己的完整 wire;已有 native view 注册未移到另一层。 - 小上限分支 允许省略可派生的 index shortcut,明确说明从完整
recovery.command追加--list或--select。最终超过原上限仍明确拒绝,不截断当前事实,也不重跑准入。 - project_saved_context_capture 是实际 public CLI caller;先验证原 digest、Goal/Agent/Turn,再做可选原生展示。错误恢复仍指向原始 capture,不能通过另一次 guard 替代。
规范依据为 docs/reference/required-work-context.md,spec_revision:2e928fefe422d62dbec3a443c0c61e79a8f38752。逐项判断:Machine default 的 on/off 与无权限含义保持;context-project 的完整持久化与同一身份恢复保持;7900 serialized bytes 及显式更小 ceiling 保持,省略的只是可派生快捷命令;captured_file 的会话/epoch 与 compaction 边界保持。对本 PR 修改的规范文字,使用修改前要求作 oracle,没有将新增说明当自证。C1 prerequisite 的可独立采用边界来自原 RFC;完整切换仍 deferred 于既有 #7430。
对主干的风险 / Risks
未发现当前阻塞性问题。 真实 public context-project/context-read 使用同一冻结 104,708-byte capture,在独立 base/head 文件和 native journal 上比较:cold 与 compaction 后 capture publication 从 2次/211,558B 降至 1次/104,708B;warm 仍为 2次/108,512B。两边完整 reader 都恢复原104,708字节与相同 SHA、尾部 Stop。测量仅覆盖 capture publication,不能推成全部 IO、模型输入或端到端净收益。
负例经同一 public CLI:错误 Agent/Turn/digest 在写前拒绝;损坏 recovery 拒绝,恢复原字节后可直接继续读;off-before/off-after-warm 都零 capture 写且 journal 字节未变。原 source 不变,未创建 Core registry/runtime,也没有 guard、admission 或 spend。生命周期事件由合成 fixture 提供,真实生产 writer 没有被假实现替换;最早 harness 的 /var 与 /private/var 路径别名断言在两边同失败,修正 fixture 后重新跑两边,未归咎产品。
原未修改的 test_saved_native_projection_recovers_the_required_view[4000-None] 在 base 的 warm metadata 第153行失败;当前完整模块通过,保留原 ceiling/断言,并验证从 recovery 派生 list/Stop。自建4000 fixture 两边也都通过,未把它冒充必然失败的回归样本。
五个完整模块 227 PASS /53 SKIP;skip 来自显式 native-bin opt-in。另用实际 codex-cli 0.163.0-alpha.11.1 和隔离本地静态协议响应跑过四个相关 native App profiles,4 PASS;其余49个可选 profiles 仍未验证。没有实时模型推理、安装或生产采用结论。focused Ruff PASS。双语差异、完整 semantic、公开边界等当前 standard premerge 6 direct +19 selected PASS。
必须保留超时历史:首次 standard premerge 的 CLI budget 在 122.988s/120s TIMEOUT,其余18个 selected 与6个 direct通过;作者更早报告的两项120s超时也不改写。相同120s script 的独立 base/head controls 分别46.068s/80.076s通过;自身并行重测试结束后,完整 standard 复测全部通过,其中 CLI63.918s、semantic67.447s。未改上限、fixture或断言;当前判断还结合完整 public CLI、实际 native profiles 和反例,不只选最后一次绿灯。未证明历史根因或持续时延稳定,也不宣称该性能问题已修复。
语义与 CI 对齐
没有新增 Enum/状态、权限或 actor lifecycle;使用现有 full/delta、recovery 和 reader 参数,不根据 prose 猜测义务。导航文字改变逐项检查了 actor、读取顺序、当前 source、scope、Stop、原 Turn 和结算身份;model理解仍未验证。开启成功之外,也验证 off-after-warm 隔离。exact-scope change-quality 回执有效,保留历史超时和 bounded-IO 风险;它不是独立验证真值或合并许可。按配置没有查询、轮询或等待 CI。
我的整体评价 / Verdict
APPROVE 这个 justified_increment。long_horizon 为 preserved:完整要求、停止条件、同 capture 和原一次结算保持;user_experience 为 improved:沿现有 native caller 即可避免重复 full publication,并在小 manifest 下继续读取同一完整事实,无新增配置或确认回合。复用和删除发生在原 owner,机制与实际问题相称。
视觉审阅不适用:修改 CLI file-reference 元数据、恢复指令和测试,没有网页、App 视口或图像变化。 未验证真实模型理解、已安装 App/Lark 交互、其余49个可选原生 profile、全部文件系统 IO、持续延迟或长程净收益。 这交付独立可用的 native presentation prerequisite;C1 统一生产者/消费者切换、实际模型采用和完整成本净收益仍沿既有 #7430 保持开放。
English verdict: APPROVE — f327d9d. The complete native-presentation slice preserves full recovery and authority, removes one redundant cold/reset capture publication, and passes matched public CLI/negative recovery checks, current local risk checks and four real native protocol profiles. Historical timeouts, untested profiles and unproved C1/model/net-benefit claims remain explicit.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
新 head 的独立整项重审(前次评审 5703253307 仅绑定 f327,不自动延用):8ed809fe0981ec31917d8183cb98d8cbb0b30d33;不可变 base:a36e01c32b0a290a96466c766629a0b01850f823。
动机 / Motivation
已启用 native file-context 的 Agent 通过原生工具读取完整当前要求,cold/reset 不应为同一完整内容再写一份未使用文件。 full mode 已有 committed recovery,却再次发布 delivery.json;小输出上限下 warm manifest 也可能在准入后溢出,使原任务需要恢复。
既有 presenter 直接复用完整 recovery;小 manifest 保留原 digest-bound recovery.command,并可从该命令派生 list/select。 这交付独立可用的 native presentation prerequisite;C1 统一生产者/消费者切换、实际模型采用和完整成本净收益仍沿既有 #7430 保持开放。
仅既有 quota_capture 原生展示与恢复导航,未切换 context-delivery 默认值、准入、canonical state、原 Turn 或一次结算 owner。
合入 main 后的七文件 diff 与前版逐字相同,patch SHA 为 6dc2654f5ff47f403fa25d1a88908d00bdab4541208369f3522f3bd32d0916e9。main 改过共享 CLI lazy dispatch 与 interaction wait caller,因此重新执行当前 base/head 的生产入口;没有仅凭 patch 相同或旧 APPROVE 继承结论。
改动思路 / Approach
最强的反对理由是:重复文件只是完整成本中的一小部分,单凭少写文件不能证明 Agent 更有效。这里可接受的交付边界是当前 native caller 的实际展示修复:复用已经存在的完整 recovery,保留原读取、身份和恢复语义;不引入 cache、新配置或第二个状态 owner。仅既有 quota_capture 原生展示与恢复导航,未切换 context-delivery 默认值、准入、canonical state、原 Turn 或一次结算 owner。
机制集中在原生 capture presenter,复用现有 recovery/reader,删除重复 full publication;无需新 cache、配置或状态 owner。
不改会留下已复现的重复 IO 和小 manifest 溢出;只放宽上限不能去掉重复写;新缓存反而重复已有事实。本切片的相邻简化已体现在删除未使用 full wire,而非继续包装它。
具体改动 / Changes
完整读取七个路径,+96/-19。唯一生产文件 quota_capture.py 为+13/-6;其余为三处 Python 验证、英文/中文 RFC 与 owning reference。旧 modularization smoke 的源码断言跟随既有 quota_presentation owner,同时保留 dispatcher 导入验证,不通过删除边界断言使其变绿。
关键代码讲解
- native_context_capture_view 只在
context_delivery_v1的 full mode 复用原recovery.path/sha256。delta 与 unwrapped 输入仍发布自己的完整 wire;已有 native view 注册未移到另一层。 - 小上限分支 允许省略可派生的 index shortcut,明确说明从完整
recovery.command追加--list或--select。最终超过原上限仍明确拒绝,不截断当前事实,也不重跑准入。 - project_saved_context_capture 是实际 public CLI caller;先验证原 digest、Goal/Agent/Turn,再做可选原生展示。错误恢复仍指向原始 capture,不能通过另一次 guard 替代。
规范依据为 docs/reference/required-work-context.md,spec_revision:a36e01c32b0a290a96466c766629a0b01850f823。逐项判断:Machine default 的 on/off 与无权限含义保持;context-project 的完整持久化与同一身份恢复保持;7900 serialized bytes 及显式更小 ceiling 保持,省略的只是可派生快捷命令;captured_file 的会话/epoch 与 compaction 边界保持。对本 PR 修改的规范文字,使用修改前要求作 oracle,没有将新增说明当自证。C1 prerequisite 的可独立采用边界来自原 RFC;完整切换仍 deferred 于既有 #7430。
对主干的风险 / Risks
[P2] 当前必需验证尚未完成资格。 本节区分已通过的功能路径与未通过的仓库检查;没有证据认定第223行的 recovery 复用本身造成超时。 当前 a36/8ed 重新执行的真实 public context-project/context-read 使用同一冻结 104,708-byte capture,在独立 base/head 文件和 native journal 上比较:cold 与 compaction 后 capture publication 从 2次/211,558B 降至 1次/104,708B;warm 仍为 2次/108,512B。两边完整 reader 都恢复原104,708字节与相同 SHA、尾部 Stop。测量仅覆盖 capture publication,不能推成全部 IO、模型输入或端到端净收益。
负例经同一 public CLI:错误 Agent/Turn/digest 在写前拒绝;损坏 recovery 拒绝,恢复原字节后可直接继续读;off-before/off-after-warm 都零 capture 写且 journal 字节未变。原 source 不变,未创建 Core registry/runtime,也没有 guard、admission 或 spend。生命周期事件由合成 fixture 提供,真实生产 writer 没有被假实现替换;最早 harness 的 /var 与 /private/var 路径别名断言在两边同失败,修正 fixture 后重新跑两边,未归咎产品。
原未修改的 test_saved_native_projection_recovers_the_required_view[4000-None] 在 base 的 warm metadata 第153行失败;当前完整模块通过,保留原 ceiling/断言,并验证从 recovery 派生 list/Stop。自建4000 fixture 两边也都通过,未把它冒充必然失败的回归样本。
五个完整模块 227 PASS /53 SKIP;skip 来自显式 native-bin opt-in。当前实际 codex-cli 0.163.0-alpha.11.1 与隔离本地静态协议响应的四个相关 native App profiles 最终 4 PASS /39 deselected,82.91s;其余49个可选 profiles 仍未验证。没有实时模型推理、安装或生产采用结论。focused Ruff PASS。当前 standard premerge 的 6 direct PASS、19 selected 中17 PASS;完整 semantic 与真实 CLI budget 两项在原120s限制下超时,不能写为通过。双语差异和公开边界通过。
历史失败与当前资格分别报告。前版 f327 的首次 standard CLI budget 在122.988s/120s超时,其后同条件 base/head controls 与完整复测通过;作者更早两项超时也保留,不能写成8ed的成功记录。
当前8ed的首次 native 补测是 3 FAIL /1 PASS,165.10s:app_server、app_machine、app_code_mode 都在原30s限制内没有完成。当时自身五模块与 IO 重测试并行,五模块耗时325.87s;这描述执行条件,不是已证实的根因。待自身重测试结束后,a36 的三个共同 profiles 在原限制下 3 PASS,57.17s,随后8ed相同限制的四 profiles 4 PASS,82.91s,没有修改 timeout、fixture 或断言。当前完整 standard premerge 的 semantic/CLI budget 分别在121.152s/121.527s超时。功能判断结合新 base/head 的24例 public CLI、完整原始内容、关闭后隔离、拒绝与恢复及这些 native controls;不是只挑最后一次绿灯。首次失败仍保留,不归因为“基线旧失败”或外部故障,也不宣称已修复根因、重负载下稳定性或持续时延问题。
对照在不可变 base a36e01c32b0a290a96466c766629a0b01850f823 上用同样两个 full-public scripts 和原120s限制顺序执行:python3 examples/control_plane/cli-output-budget-regression-smoke.py: timed_out / 126.979s;python3 examples/semantic-vocabulary-drift-smoke.py: timed_out / 120.539s。这是保留的实际观察,不把相同 timeout 次数当作完整失败身份或无关性证明;本轮仍缺当前失败的充分因果归因与必需检查完成证据。
最小修复是保留原预算和断言,给出同条件 base/head 完整结果、受影响不变量与恢复 owner,并使必需验证在原条件内完成。当前 focused/native 成功、diff advisory 0 或前次 f327 的批准均不能替代这一步。本评审报告证据缺口,不先要求本 PR 修复尚未证明相关的源代码。
语义与 CI 对齐
没有新增 Enum/状态、权限或 actor lifecycle;使用现有 full/delta、recovery 和 reader 参数,不根据 prose 猜测义务。导航文字改变逐项检查了 actor、读取顺序、当前 source、scope、Stop、原 Turn 和结算身份;model理解仍未验证。开启成功之外,也验证 off-after-warm 隔离。当前 exact-scope change-quality 保持 hold(scope a54f1a59c533335e99fa8529f2cc875b4279bcf328e71286f39511d7c5797841),保留历史 timeout、native deadline 和 bounded-IO 风险;它不是独立验证真值或合并许可。按配置没有查询、轮询或等待 CI。
我的整体评价 / Verdict
REQUEST_CHANGES 当前 head 的验证资格;其设计和已验证功能仍构成 justified_increment。long_horizon 为 preserved:完整要求、停止条件、同 capture 和原一次结算保持;user_experience 为 improved:沿现有 native caller 即可避免重复 full publication,并在小 manifest 下继续读取同一完整事实,无新增配置或确认回合。复用和删除发生在原 owner,机制与实际问题相称。
视觉审阅不适用:修改 CLI file-reference 元数据、恢复指令和测试,没有网页、App 视口或图像变化。 未验证真实模型理解、已安装 App/Lark 交互、其余49个可选原生 profile、全部文件系统 IO、持续延迟或长程净收益。 这交付独立可用的 native presentation prerequisite;C1 统一生产者/消费者切换、实际模型采用和完整成本净收益仍沿既有 #7430 保持开放。
English verdict: REQUEST_CHANGES — 8ed809f. The bounded design and functional paths are supported, but two required current120s validators timed out and remain insufficiently attributed; preserve the failures and original limits, complete qualification, and retain the prior-head review as history only.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Native full context presentation wrote an unused second copy after publishing its complete recovery. Warm delivery could also reject the existing 4,000-byte reference budget by repeating a directory command already available through recovery. This reuses the full recovery file and omits optional shortcut commands only when necessary;
recovery.command --list/--selectretain exact current-field access. Task text, acceptance, Stop, capture identities, lifecycle and settlement rules are unchanged.Written by: OpenAI Codex (model agent). Basis: the existing native context delivery and recovery contract.
This is a complete, reversible native-presentation slice of #7430. It adds no schema, option, cache or decision owner. Delta and unwrapped inputs still publish immutable files. The CLI smoke follows the existing
quota_presentation.pyowner while preserving public help/error checks. Both controller RFC mirrors and the reader documentation describe this boundary. Reverting restores the extra publication and prior metadata handling without a stored-state migration. Full C1 writer/consumer cutover, historical-reader retirement and actual long-horizon qualification remain open in the parent.The branch preserves the maintainer's merge of current main (
8ed809fe0) and integrates the exact shared scanner prerequisite from #7699,1dc6cb85d, using the same commits. Review #7699 first for the bounded parsed-facts reuse; no second scanner implementation is introduced here. This is an 11-file diff against maina36e01c32. If the dependency or base changes, requalify the resulting exact head before merge.Matched public
quota context-project/context-readreplay pins the changed capture module to immutable maina36e01c32for the baseline and uses the same final harness and frozen synthetic sources for both arms:The full path avoids one serialization/atomic publication/fsync. Complete recovery, unknown fields, original numbers and tail constraints remain available. Damaged source/recovery is rejected, and restored reads pass. The independent no-copy oracle rejects the baseline and passes the candidate. These measurements qualify capture publication IO only; they do not establish total filesystem, latency, memory, model-cost or long-horizon benefit. Timing was excluded from this replay because other validation was running. Earlier warm-reader counts belong to their older pinned harness paths; the equal current-arm result is not a new compression gain.
Validation for 446ca9d against a36e01c, using public synthetic fixtures:
86242fffacb13b15003260e53d42597ca0460647bc33286f9e4c2ee015994082.cqr_eba451377dc1cd57682d, fingerprinteba451377dc1cd57682d5cd7d21c3b99c891cdb981f38273eaaa610189bb91bb. This is author qualification; independent review and merge readiness remain separate.Historical failures are retained:
f327d9d79timed out on the semantic-vocabulary and CLI-output-budget checks at their original 120-second limits, and its final quality receipt was non-passing. Earlier CLI ownership and stale generated Chat-bundle build failures were recorded; the ownership correction and normal owning asset build resolve those respective failures. Current passing evidence applies to the exact integrated head above and does not relabel older runs. No validator budget, fixture or gate was relaxed.Changed surface: native App/CLI context transport and its shared validation prerequisite. UI/first-viewport source impact: none. No PostgreSQL authority/store behavior changes. No CI query/trigger, live-model or benchmark campaign, live installation, release or merge was performed. Maintainer review and merge authorization remain required.