Skip to content

Reuse the committed quota capture in native benchmark preflight - #8259

Merged
loopx-agent merged 3 commits into
mainfrom
codex/edgebench-main-native-capture-20261107
Nov 7, 2026
Merged

loopx-agent merged 3 commits into
mainfrom
codex/edgebench-main-native-capture-20261107

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Native benchmark preflight used to send the complete quota CLI view over stdout and then save it for SessionStart. The prepared-capture route now returns a reference to the committed original decision. The preflight verifies its digest before handing off the same Turn.

Ordinary native work reads that capture directly. An admitted replan with staged readers uses the existing typed replan projection for its private presentation. Its review and writeback commands stay bound to the original capture path and hash. Context-off preflight keeps the existing full view.

This is the standalone mainline proposal for #8251. The quota prepared-capture route already ships in #8100.

Verification

  • Current head 1907268 passed four focused cases on the real CLI, including a Todo-less SQLite replan, ordinary capture reuse, digest refusal and the feature-off path. The replan case follows the emitted context-project reader and executes the staged review on the original obligation.
  • An independent comparison of the previous head reproduced the missing replan commands, while ordinary Todo and context-off readbacks held the original Turn. The new regression covers the failing caller. Previous exact-head review
  • The previous-head related suites passed 95 cases with 11 optional or platform skips. The fix passed Ruff, the RFC diff gate and the changed-path public scan. Live model cost and benchmark outcomes require separate qualification.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…view-fix-8259-20261107

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 · OpenAI · gpt-6.1-sol · runtime_reported · max

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

[P1] 对已有 replan 复用 replan_cli_view 并保留原 path/hash,普通决策仍直接交付原捕获。。原实现通过 stdout 保存完整 CLI 视图。用同一个 Todo-less 自主 replan 重放时,基线仍交付原决策上的两条 staged 命令。。同一真实 SQLite preflight 和 context-project,基线读到 review/writeback 且 review 可执行。head 读到原 obligation,却缺少这两条命令。。对已有 replan 复用 replan_cli_view 并保留原 path/hash,普通决策仍直接交付原捕获。。

动机 / Motivation

启用 native context 的 benchmark heartbeat 会在模型开始前交付同一 Turn 的保存决策。 原实现通过 stdout 保存完整 CLI 视图。用同一个 Todo-less 自主 replan 重放时,基线仍交付原决策上的两条 staged 命令。 普通 Todo 在 head 能直接读原 decision.json。自主 replan 的实际读回缺少原来可执行的后续命令。 本次验证覆盖原始 capture、原身份和可执行路径。没有进行模型调用或推断端到端收益。

改动思路 / Approach

搜索 prepared-capture-reference、replan_cli_view 和 context-project 两修订的定义与消费处。已有 #8100 可避免重复 guard,但原始事实与派生 CLI 命令各有 owner,不能仅用相同原始哈希证明等价。 对已有 replan 复用 replan_cli_view 并保留原 path/hash,普通决策仍直接交付原捕获。 搜索 prepared-capture-reference、replan_cli_view 和 context-project 两修订的定义与消费处。已有 #8100 可避免重复 guard,但原始事实与派生 CLI 命令各有 owner,不能仅用相同原始哈希证明等价。 对已有 replan 复用 replan_cli_view 并保留原 path/hash,普通决策仍直接交付原捕获。

具体改动 / Changes

按 docs/reference/protocols/turn-envelope-v0.md 在 b9faf8d 的边界逐项核对。 docs/reference/protocols/turn-envelope-v0.md

  • staged-replan · not_met。同一捕获需保留已准入 replan 的 review 与 writeback 及其顺序。
  • same-capture · implemented。继续保留原 Turn 和原始来源,读取不重新准入。

关键代码讲解

相关 95 个测试通过,11 个平台跳过。独立 on/off 普通 Todo 通过。Todo-less replan 的配对测试基线通过、head 失败。 本地 lint 与 diff 检查通过。复查了所有改动的运行时、文档与测试,以及未改的实际入口。

对主干的风险 / Risks

相关 95 个测试通过,11 个平台跳过。独立 on/off 普通 Todo 通过。Todo-less replan 的配对测试基线通过、head 失败。 同一真实 SQLite preflight 和 context-project,基线读到 review/writeback 且 review 可执行。head 读到原 obligation,却缺少这两条命令。 显式 off 在 base/head 均保留完整旧视图、原 Turn 和唯一 guard。普通 Todo 的 on 路线也通过。 本次验证覆盖原始 capture、原身份和可执行路径。没有进行模型调用或推断端到端收益。

语义与 CI 对齐

同一捕获需保留已准入 replan 的 review 与 writeback 及其顺序 现有类型化捕获或结果对象仍是来源。缺陷发生在派生视图的适用范围。 CI 未查询。复核命令为 uv run --extra test python -m pytest -q tests/control_plane/test_research_checkpoint_capture.py。

我的整体评价 / Verdict

有阻塞发现。 同一真实 SQLite preflight 和 context-project,基线读到 review/writeback 且 review 可执行。head 读到原 obligation,却缺少这两条命令。 对已有 replan 复用 replan_cli_view 并保留原 path/hash,普通决策仍直接交付原捕获。 检查范围为机器可读 CLI、捕获读取及其消费命令,未改渲染页面。 同一真实 SQLite preflight 和 context-project,基线读到 review/writeback 且 review 可执行。head 读到原 obligation,却缺少这两条命令。

English verdict: REQUEST_CHANGES. Head 0dd38d7. The real SQLite capture replay loses both staged replan commands.

Comment thread benchmark/runtime/checkpoint.py Resolved

@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 | gpt-6-astra | OpenAI | runtime_reported | reasoning_effort=xhigh

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

启用 native context 的 benchmark worker 在模型开始前读取已保存的本轮决策。
普通工作现在直接读原决策;重规划仍交付可执行的 review/writeback,且两条命令指向原始捕获。
真实 SQLite CLI 验证原 Turn、唯一 guard、原哈希与可执行 review;错误来源哈希被拒绝。
不改变准入、扣额、评分次数或实验策略;未证明真实模型采用和端到端费用、分数收益。

本次对完整 head 19072680f61682f5b95415941a027d2944f01713 复审,包含先前指出的 P1:直接交付原始决策虽然让普通任务通过,却漏了自主重规划所需的两条分阶段命令。当前修复已经补回,旧失败证据仍保留。

改动思路 / Approach

Provider 只选择来源并做 IO,重规划语义继续由现有 TypeScript owner 推导。
本 PR 交付捕获复用及可执行重规划读取,不新增调度或评分策略。

普通工作直接沿用 quota 保存的文件和哈希。重规划先调用已有 replan_cli_view,把展示视图写成私有文件;视图中的后续命令仍绑定原始决策。checkpoint 资格判断始终使用完整原件。保留旧 stdout 路线无法去除重复渲染,而一律改读 raw source 已被反例证明会丢掉动作;当前分支保留必要语义,没有再造 Python 调度规则。

具体改动 / Changes

依据固定到 b9faf8da06edea8d770d406b765ebcdc31149801 的 docs/reference/protocols/turn-envelope-v0.md,核对 staged-replan(review 后 writeback)与 same-capture(原身份、原来源、读取不重新准入)。两项在当前 head 均达成。实际 GitHub 差分已与本地 merge base 核对为五个文件,范围不含研究集成分支的其他历史。

关键代码讲解

  1. capture_before_replan 在显式 native context 路线请求 --prepared-capture-reference,验证保存文件的 SHA-256 与返回值一致。普通 Todo 直接交付该原件;有 typed replan_read_path 时复用既有投影及私有原子 writer,保留 staged 命令和原 capture 绑定。不同来源哈希在发布 guard 副本前拒绝。
  2. preflight_context_instruction 是未改动的共享读取入口:保留 Goal/Agent/Turn、原哈希、按需读取和失败时同源恢复。新来源没有取得新的准入权或 freshness,也不允许再次运行初始 guard。
  3. test_native_preflight_uses_the_committed_capture 使用真实 SQLite CLI,覆盖普通工作、伪造 prepared hash 和 Todo-less replan。后者不仅检查字段存在,还实际执行 review,核对原 obligation;每种情况只有一条 heartbeat receipt。另两份 fixture 调整按显式参数和当前 settlement owner 消费回执,未取消原有身份、预算和恢复断言。

对主干的风险 / Risks

最重要的风险正是优化投影时漏掉可执行义务。历史 probe 在基线能读到并执行重规划动作,初版 raw-only 提案失败;当前同类实际调用及专门回归通过。独立 reviewer 另运行普通 on/off SQLite 读回,核对原 Turn 和结算身份、唯一 guard、零扣额,并修改源文件验证哈希拒绝。关闭 native context 仍保留原完整 CLI 视图;没有 checkpoint 请求时不发生 IO。

PASS:根 reviewer 在精确 head 完整运行 checkpoint 文件,50 passed、11 个 Linux-only 分支显式跳过;另外独立读取 probe 2 passed。当前作者定向 4 项、premerge 5 个直接检查和 9 个选择检查均通过;benchmark 的 manual review hold 保留为单独合并门,不记作测试失败或自动授权。按 Goal 策略未查询 CI。测试没有调用模型;不把这些结果换算成 token、费用或得分收益。

语义与 CI 对齐

使用既有 prepared-capture、private writer、typed replan projection 和 reader vocabulary,无新增权威状态或核心策略。原始历史捕获没有被改写;展示变动已写入 RUNTIME 文档。native 与 off 是实际调用模式,不是待删除的重复版本兼容层。

我的整体评价 / Verdict

这是一段可独立交付的捕获复用优化:长程继续工作的动作和结算身份得到保留,先前 P1 已解决;已有用户配置不增加人工步骤。只修改 benchmark CLI 捕获传递及文档、测试,没有页面布局变化。真实模型采用和端到端性能收益未测。

同领域收敛已经落在现有 TypeScript projector 与 private writer,避免维护第二套重规划命令拼装规则。可以批准当前完整 head;合并前仍须由有权限的执行方核对 unchanged head、讨论关闭和 readiness,不能把此批准当作取消主干门槛。

English verdict: APPROVE — 19072680f61682f5b95415941a027d2944f01713 reuses the committed capture while preserving staged replan actions and original identity. Real SQLite positive, off-path and digest-failure checks passed; model adoption and benchmark gains remain unmeasured.

@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 | gpt-6-astra | OpenAI | runtime_reported | reasoning_effort=xhigh

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

启用 native context 的 benchmark worker 在模型开始前读取已保存的本轮决策。
普通工作现在直接读原决策;重规划仍交付可执行的 review/writeback,且两条命令指向原始捕获。
真实 SQLite CLI 验证原 Turn、唯一 guard、原哈希与可执行 review;错误来源哈希被拒绝。
不改变准入、扣额、评分次数或实验策略;未证明真实模型采用和端到端费用、分数收益。

本次对完整 head 19072680f61682f5b95415941a027d2944f01713 复审,包含先前指出的 P1:直接交付原始决策虽然让普通任务通过,却漏了自主重规划所需的两条分阶段命令。当前修复已经补回,旧失败证据仍保留。

改动思路 / Approach

Provider 只选择来源并做 IO,重规划语义继续由现有 TypeScript owner 推导。
本 PR 交付捕获复用及可执行重规划读取,不新增调度或评分策略。

普通工作直接沿用 quota 保存的文件和哈希。重规划先调用已有 replan_cli_view,把展示视图写成私有文件;视图中的后续命令仍绑定原始决策。checkpoint 资格判断始终使用完整原件。保留旧 stdout 路线无法去除重复渲染,而一律改读 raw source 已被反例证明会丢掉动作;当前分支保留必要语义,没有再造 Python 调度规则。

具体改动 / Changes

依据固定到 b9faf8da06edea8d770d406b765ebcdc31149801 的 docs/reference/protocols/turn-envelope-v0.md,核对 staged-replan(review 后 writeback)与 same-capture(原身份、原来源、读取不重新准入)。两项在当前 head 均达成。实际 GitHub 差分已与本地 merge base 核对为五个文件,范围不含研究集成分支的其他历史。

关键代码讲解

  1. capture_before_replan 在显式 native context 路线请求 --prepared-capture-reference,验证保存文件的 SHA-256 与返回值一致。普通 Todo 直接交付该原件;有 typed replan_read_path 时复用既有投影及私有原子 writer,保留 staged 命令和原 capture 绑定。不同来源哈希在发布 guard 副本前拒绝。
  2. preflight_context_instruction 是未改动的共享读取入口:保留 Goal/Agent/Turn、原哈希、按需读取和失败时同源恢复。新来源没有取得新的准入权或 freshness,也不允许再次运行初始 guard。
  3. test_native_preflight_uses_the_committed_capture 使用真实 SQLite CLI,覆盖普通工作、伪造 prepared hash 和 Todo-less replan。后者不仅检查字段存在,还实际执行 review,核对原 obligation;每种情况只有一条 heartbeat receipt。另两份 fixture 调整按显式参数和当前 settlement owner 消费回执,未取消原有身份、预算和恢复断言。

对主干的风险 / Risks

最重要的风险正是优化投影时漏掉可执行义务。历史 probe 在基线能读到并执行重规划动作,初版 raw-only 提案失败;当前同类实际调用及专门回归通过。独立 reviewer 另运行普通 on/off SQLite 读回,核对原 Turn 和结算身份、唯一 guard、零扣额,并修改源文件验证哈希拒绝。关闭 native context 仍保留原完整 CLI 视图;没有 checkpoint 请求时不发生 IO。

PASS:根 reviewer 在精确 head 完整运行 checkpoint 文件,50 passed、11 个 Linux-only 分支显式跳过;另外独立读取 probe 2 passed。当前作者定向 4 项、premerge 5 个直接检查和 9 个选择检查均通过;benchmark 的 manual review hold 保留为单独合并门,不记作测试失败或自动授权。按 Goal 策略未查询 CI。测试没有调用模型;不把这些结果换算成 token、费用或得分收益。

语义与 CI 对齐

使用既有 prepared-capture、private writer、typed replan projection 和 reader vocabulary,无新增权威状态或核心策略。原始历史捕获没有被改写;展示变动已写入 RUNTIME 文档。native 与 off 是实际调用模式,不是待删除的重复版本兼容层。

我的整体评价 / Verdict

这是一段可独立交付的捕获复用优化:长程继续工作的动作和结算身份得到保留,先前 P1 已解决;已有用户配置不增加人工步骤。只修改 benchmark CLI 捕获传递及文档、测试,没有页面布局变化。真实模型采用和端到端性能收益未测。

同领域收敛已经落在现有 TypeScript projector 与 private writer,避免维护第二套重规划命令拼装规则。可以批准当前完整 head;合并前仍须由有权限的执行方核对 unchanged head、讨论关闭和 readiness,不能把此批准当作取消主干门槛。

English verdict: APPROVE — 19072680f61682f5b95415941a027d2944f01713 reuses the committed capture while preserving staged replan actions and original identity. Real SQLite positive, off-path and digest-failure checks passed; model adoption and benchmark gains remain unmeasured.

@loopx-agent
loopx-agent merged commit 22d8daf into main Nov 7, 2026
14 of 31 checks passed
@loopx-agent
loopx-agent deleted the codex/edgebench-main-native-capture-20261107 branch November 7, 2026 10:10
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