Skip to content

perf(context): reuse full recovery for native presentation - #7687

Merged
loopx-agent merged 14 commits into
mainfrom
codex/native-context-full-capture-io-20261030
Oct 30, 2026
Merged

loopx-agent merged 14 commits into
mainfrom
codex/native-context-full-capture-io-20261030

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

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 / --select retain 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.py owner 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 main a36e01c32. If the dependency or base changes, requalify the resulting exact head before merge.

Matched public quota context-project / context-read replay pins the changed capture module to immutable main a36e01c32 for the baseline and uses the same final harness and frozen synthetic sources for both arms:

Case Baseline → candidate capture publication (writes / bytes) Complete reader
Full, 107,289-byte source 2 / 216,718 → 1 / 107,289 107,289 bytes in both
Warm delta, 107,302-byte source 2 / 111,167 → 2 / 111,167 3,865 bytes in both
Compaction/full, 107,302-byte source 2 / 216,744 → 1 / 107,302 107,302 bytes in both

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:

  • Affected source coverage: 307 context + 175 scanner cases passed (482 total), 31 optional native-profile skips. File/SQLite recovery, selection, refusal, cold/warm/compaction, source-sensitive scanner counterexamples and both original 4 KB CLI cases are covered. The original output ceilings and fixtures remain unchanged; skipped native profiles remain unqualified.
  • Final isolated Python 3.11.17 wheel: 1,898 delivered product files byte-match source, and changed-module hashes match. Four actual native App variants (app-server, machine configuration, code mode, progressive reads), both original 4 KB CLI cases and full no-copy regression: 7 passed, zero skips. Parent and CLI child imports resolve to the installed wheel, with no foreign product origins. Codex 0.163.0-alpha.11.1 uses static local loopback responses and disposable homes/runtimes. Wheel SHA-256: 86242fffacb13b15003260e53d42597ca0460647bc33286f9e4c2ee015994082.
  • Standard local premerge: all 6 direct and 19 selected checks passed, zero failures, warnings, timeouts or tracked side effects. Semantic-vocabulary: 63.842 s; CLI-output-budget: 106.673 s, both under the unchanged 120 s limit. Ruff, configured and explicit-target mypy, full documentation governance, paired RFC, diff-scoped semantic advisory and public-boundary checks also pass. The advisory reports no supported new vocabulary carriers; its documented analysis limits still apply.
  • Exact-scope author change-quality receipt: valid/pass, cqr_eba451377dc1cd57682d, fingerprint eba451377dc1cd57682d5cd7d21c3b99c891cdb981f38273eaaa610189bb91bb. This is author qualification; independent review and merge readiness remain separate.

Historical failures are retained: f327d9d79 timed 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.

Current-Head Native Fixture Repair

Exact head: ef711e625fd8bae72a229d48ba603a5962c82347, based on current main 5b224f0947faf34b54cb0e7e02477df50da8e62e. The final diff is seven files because current main already contains the shared scanner prerequisite.

The prior REQUEST_CHANGES fixture issue is fixed: the native harness now starts from descriptor.command and follows each actual next_command until eof, rather than pre-scheduling speculative 4096-byte offsets with overlapping reads. The original deadline, complete content, digest, Stop, lifecycle, continuity and no-replay assertions are unchanged.

  • Source native profiles: 6/6 passed.
  • Isolated Python 3.11.17 wheel native profiles: 6/6 passed, including the former app_server and app_machine timeouts. The wheel contains the exact changed quota_capture.py bytes.
  • Progressive native context: 21 passed.
  • Latest-main capture registry independence: 11 passed.
  • Final standard premerge: 6 direct and 19 selected checks passed, zero failures, CQR failures or manual holds.
  • Exact-scope CQR cqr_c087bfdebd9d5bbe0d70 is valid for fingerprint c087bfdebd9d5bbe0d7096811a2d2eb4a59cd4d667ed8f2d74d69a63cc7f4525.

Installed adoption, model understanding, sustained latency and the remote CI merge gate remain separate qualifications.

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 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; 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 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; 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>

@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; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

[P2] 先修正原生 fixture 的分页,再补齐当前 wheel 验收。 当前 native queue 每隔 4096 bytes 预排一次 context-read,却未设置对应 page budget;默认大页会反复读取重叠内容。本 PR 的 full reference 改指完整 raw recovery 后,这条路径比原 compact wire 需要更多无效往返。相同隔离 harness、普通 wheel、Codex 版本与原始 30s deadline 下,不可变 base 四项均通过;当前首次四项超时,串行复核仍为 app_server / app_machine 两项超时、code_mode / progressive 两项通过。

最小修复是让 fixture 使用 descriptor.command,按实际返回的 next_command / next_offset 继续至 EOF,保留完整内容、digest、Stop、lifecycle 与不重跑 guard/spend 的断言及原 deadline。仅在私有复制 fixture 中做这一分页替换,两项当前失败场景均通过(测试时长 9.501s / 13.095s),assert AST 全部相同,产品 wheel 未变。这是可复现的 fixture 缺口与修复方向,没有把诊断用例算作原测试通过,也未证明产品本身丢失上下文。

复验应在普通 wheel 的隔离安装 harness 中保留 LOOPX_NATIVE_CHECKPOINT_BIN,运行 python -m pytest -q 加 tests/control_plane/test_saved_context_project.py::test_native_saved_preflight_uses_lifecycle_without_guard_replay[app_server] 与 [app_machine] 两个原 node;同时补齐其余原 native profiles,不能只运行私有诊断副本。

当前 head 的独立整项重审:446ca9d3f627932a5ee539c28feb0ede0080ce22;不可变 base:a36e01c32b0a290a96466c766629a0b01850f823。前次 8ed 的 REQUEST_CHANGES 及 f327 的 APPROVE 都只作历史,不自动沿用。

动机 / Motivation

已开启 native file-context 的 Agent,需要从当前捕获中读全要求与停止条件,并在 compaction 或输出过小之后继续同一项工作。

过去 cold/reset 已经提交完整 recovery,展示阶段仍重复写入一份没有被读取的 full wire;较小输出预算下,warm 导航元数据也可能溢出。当前直接复用完整 recovery,并允许从保留的 recovery.command 派生目录与精确字段读取。

本次可验证的结果是:cold/compaction 各减少一次重复 capture publication,完整 reader 仍恢复相同原始字节、digest 和尾部 Stop;小预算仍可沿原捕获读取。

本 PR 只处理既有 native 展示、恢复导航和支撑当前验证的静态 scanner,不改变 context-delivery 默认值、准入、canonical state、原 Turn 或一次结算 owner。

剩余缺口是 C1 统一 producer/consumer 切换、真实模型采用与完整成本净收益;这些继续沿已有 #7430 保持开放,不能由少写文件或较快的静态检查推定完成。

改动思路 / Approach

复用已经提交的完整 recovery 与现有静态分析 owner,避免第二份文件或并行词法/缓存状态;两处机制分别解决实际 native 读取与既有验证成本,不扩大 C1 交付口径。当前 PR 的边界是完整 native-presentation prerequisite 加同一验证链路的 AST 事实复用,完整 C1 与长期收益仍由既有后续 owner 验收。

最强的反对理由是:重复文件只占总成本一部分,另带 scanner 改动也增加审查面。这里的收益必须限定为实际 caller 的 IO 与恢复,并审查整个组合。仅放宽输出上限保留了重复 IO;新增 context cache 会重复已有 owner。scanner 使用解析后的字段集合排除不可能命中的查询,复用现有 AST;不能改成原始字符串的子串过滤,否则会漏掉转义 key、规范化 identifier 或未提及字段的语法错误。

两处都没有新配置或决策账本。共享 scanner 文件与 #7699 的同域工作重叠;本次重新验证当前组合的完整输出和必需检查,不以另一 PR 的批准代替当前 head 资格。

具体改动 / Changes

完整读取 11 个路径,+176/-47。生产变化为 quota_capture 的 +13/-6、Python production scanner 的 +43/-27 与 inventory 的返回类型收窄;其余是现有验证、双语 RFC、required-context reference 与 repair pattern。CLI modularization smoke 跟随已有 quota_presentation owner,仍保留 dispatcher 约束。

关键代码讲解

  • native_context_capture_view:仅 full context_delivery_v1 使用已提交 recovery 的 path/hash。delta 与 unwrapped 仍写自己的 immutable wire,small-output 分支只移除可派生 shortcut,最终放不下仍返回原恢复错误。
  • project_saved_context_capture:实际 public CLI 先验证原 digest、Goal/Agent/Turn,才进入可选展示。读取与损坏恢复不能重跑 guard、准入或 spend。
  • _field_mentions:解析后收集 Name、Attribute、字符串常量与 keyword,先解析再判定缺席,保留 SyntaxError。memo key 为完整 frozen SourceFile,hash 碰撞或同路径内容变化不能复用错误 AST,literal 查询不会写 AST。

规范依据为 docs/reference/required-work-context.md,spec_revision:a36e01c32b0a290a96466c766629a0b01850f823。逐项映射:Machine default 的默认、启用范围与无权限含义保持;Opt-in native reuse 保持同一原捕获及完整当前要求;captured_file 保持 session/epoch、compaction 与失效恢复;7900 序列化字节及显式更小 ceiling 保持。新增 shortcut 说明用修改前这些要求作 oracle,不能自证完整读取。

语义与 CI 对齐

scanner 另按 docs/architecture/rfcs/semantic-vocabulary-convergence-v0.md 同一 spec_revision 核验:I1 的单一 owner、I2 的 closed sets、I7 的 tracked/public-safe 检查、I8 的覆盖下限、I11 的角色区分、I12 的 kernel production 证据与 I13 的未注册值拒绝、unresolved 保留不因预过滤缩水。静态语法证据仍不是动态可达性证明。

对主干的风险 / Risks

除开头的原生 fixture 验收阻塞,功能对比支持以下有边界的结果。真实 public context-project/context-read 在 base/head 上使用同一冻结 104,708-byte capture,各运行 24 例。cold 与 compaction 的 publication 从 2次/211,620B 变为 1次/104,708B;warm 两边均为 2次/108,636B。全部完整 reader 恢复相同字节与 SHA,选读保留尾部 Stop。计数只覆盖真实 capture writer,不能代表全部文件系统 IO、模型输入或端到端收益。

相同 public CLI 核验错误 Agent/Turn/digest 的写前拒绝、recovery 损坏后恢复、4000-byte 导航及关闭前后隔离;关闭后 journal 不变,原始 source 不变,也不创建 Core registry/runtime。独立冻结的 no-copy 断言在 base 明确触发旧重复写,当前通过。生命周期事件由合成 fixture 提供,writer 与 reader 是实际实现。

共享 scanner 在同一冻结公开语料上重新对比当前 base/head:1,769 个 source,204 条完整 production 记录,包括 59 条 unknown,结果逐项完全相同;未将空 literal 查询视为正例。现有实际 grammar、转义、identifier 规范化、SyntaxError、hash collision 与 AST 不变性测试同时通过。该对比不作 CPU、wall time 或内存收益资格。

12 个完整 context/scanner 模块为 541 PASS/53 SKIP,skip 为显式 native-bin opt-in。普通 wheel 包含 1,898 个产品 member,修改的 Python 源码与当前 head 字节一致;严格检查确认加载的 LoopX module 均来自隔离 wheel,未借用源码产品。实际 Codex 0.163.0-alpha.11.1 通过 loopback 固定响应运行:原始四项首次 4 FAIL;同 wheel 串行原例复核 2 FAIL/2 PASS。相同 harness 的不可变 base wheel 四项均 PASS;当前两个 4000-byte reference 和 no-copy 共三项另行 PASS。上述分页诊断两项 PASS 独立记账,不能合并成原始七项全绿。没有付费推理或 live 安装。

当前完整 standard 首轮为 19 selected 中 17 PASS、2 TIMEOUT:semantic 121.562s、CLI budget 124.073s,均保持原 120s 限制。同限制独立控制为 base semantic 93.709s PASS、base CLI 120.574s TIMEOUT;当前分别为 semantic 58.003s PASS、CLI 94.962s PASS。这些完成证据只资格化各自检查;未声称当前 B 完整 standard 重新全绿。源码 app_progressive 同一冻结例为 base 21.64s PASS、当前 18.63s PASS,也不能代替安装场景。focused Ruff 通过。九个普通提交均有 DCO trailer;8ed 集成 merge 的精确双 parent 与 GitHub verified web-flow 身份独立核验,适用 CONTRIBUTING 已有豁免,不是缺失 sign-off 问题。

历史失败保留:8ed 的两个 120s 检查超时、首次 native deadline 失败与 f327 更早超时均不改写为成功。当前头部新增共享 scanner 机制后,重新核验了整个组合;当前原生 fixture 仍有失败,不能因功能与个别验证通过而称整体验收完成,也未证明历史超时根因或长期稳定性。首轮测试选择路径错误导致未收集测试,以及 wheel harness 缺少 test-only imports、按源树定位 TS fixture 的失败,也分别保留;修复仅限隔离 harness,未改产品、deadline 或断言。

决策文字逐条比较了读取 actor、当前事实来源、delta/base 关系、完整覆盖、scope、Stop、原 Turn 与结算身份。变化仅将可派生快捷命令改为完整 recovery.command,并在实际小预算分支验证追加 --list/--select;没有删除继续读全或同捕获恢复的要求。模型是否理解、采用这些指令仍未验证。repair-patterns 新行会经既有 loopx-self-repair 按需查找路径读取,增加的是静态扫描诊断指导:要求完整观察、原预算、内存说明并保留失败;没有新自动加载或 native 激活开关。它并非“无指令变化”,也不替代原测试验收。未新增 Enum 或 prose 分类;native feature-off 的输入、输出与状态隔离仍通过。按配置未查询、轮询或等待 CI。

我的整体评价 / Verdict

REQUEST_CHANGES。方案是有实际 caller 与可验证 IO 改善的 justified_increment,long_horizon 的完整要求、Stop、当前 source、epoch 失效与原结算身份在 CLI/源码验证中保持;但 user_experience 仍为 not_yet_proven:当前安装后的两条原生测试不能完成,必须先修复上面有反例支持的 fixture 分页并重新验收。无需为这个边界完成全部 C1,也不要求本 PR 修复不相关旧预算问题。

视觉审阅不适用:本次不修改网页或 App 视口。完整 C1、真实模型采用、其余 native profiles、持续性能及全成本净收益仍由既有 #7430 / 对应 owner 验收;不因本次局部 IO 或静态观察通过而关闭。未合并,也未授予合并权限。

English verdict: REQUEST_CHANGES — 446ca9d. Fix the native fixture pagination and rerun the original installed-wheel cases without relaxing deadlines or recovery assertions. Functional recovery and scanner parity are supported; full C1 adoption and net benefit remain open.

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>

# Conflicts:
#	docs/architecture/rfcs/controller-executor-unified-contract-v0.md
#	docs/architecture/rfcs/controller-executor-unified-contract-v0.zh-CN.md

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | OpenAI | owner-delegated exact-head approval

动机 / Motivation

Native file-context delivery must let an Agent recover the complete current requirement after cold, compaction or a small output limit. The product change reuses the already committed full recovery instead of publishing an unused second full wire, while delta and unwrapped inputs retain their own immutable reader targets. The only blocking review issue was in the native fixture: it guessed overlapping 4096-byte offsets and timed out after the full reference changed.

改动思路 / Approach

Keep the product boundary in the existing quota_capture native presenter, recovery command and digest-bound public reader. The final fixture repair starts from descriptor.command and follows the actual returned next_command until eof; it no longer schedules offsets from an assumed page size. Source validation still covers full recovery, small-reference navigation, compaction, Stop, digest and no-replay behavior, and the App/CLI lifecycle owner is unchanged.

具体改动 / Changes

Exact head ef711e625fd8bae72a229d48ba603a5962c82347 is based on current main 5b224f0947faf34b54cb0e7e02477df50da8e62e. Current main already contains the shared scanner prerequisite, so the final exact diff is seven files. The prior fixture blocker is addressed in tests/control_plane/test_saved_context_project.py; no product deadline, recovery assertion, authority check or lifecycle rule was relaxed.

The final submission's native profiles now pass through both source and an isolated Python 3.11.17 wheel. The wheel contains the exact changed quota_capture.py bytes, and the six profiles include the former app_server and app_machine timeouts.

对主干的风险 / Risks

No blocking finding remains. The strongest risks are an invalid recovery target, duplicated capture publication, or a test harness that appears green by skipping to EOF. The final evidence preserves full reader bytes/digest/Stop, validates actual cursor monotonicity, checks lifecycle no-replay, and rejects damaged recovery. The product change remains reversible and adds no persistent state, option, cache or second decision owner.

Final validation passed: source native profiles 6/6; installed-wheel native profiles 6/6; progressive native context 21/21; latest-main registry independence 11/11; focused Ruff/compile/smoke checks; and standard premerge with 6 direct checks, 19 selected checks and CQR, all with zero failures or manual holds. Exact-scope CQR cqr_c087bfdebd9d5bbe0d70 is valid for fingerprint c087bfdebd9d5bbe0d7096811a2d2eb4a59cd4d667ed8f2d74d69a63cc7f4525. Installed adoption, sustained performance and complete C1 net benefit remain separate qualifications.

我的整体评价 / Verdict

APPROVE. The blocking fixture defect is repaired at the real native cursor boundary, and both source and installed-wheel profiles now complete under the original deadline. The product slice retains complete recovery, identity and lifecycle semantics while removing only the unused duplicate full publication.

English verdict: APPROVE — ef711e625fd8bae72a229d48ba603a5962c82347 follows actual native page cursors and passes all six source and installed-wheel profiles without weakening recovery or lifecycle assertions.

@loopx-agent
loopx-agent merged commit e8f4c6f into main Oct 30, 2026
5 of 6 checks passed
@loopx-agent
loopx-agent deleted the codex/native-context-full-capture-io-20261030 branch October 30, 2026 04:45
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.

2 participants