Skip to content

Retire unbound native execution preparation - #8436

Merged
huangruiteng merged 3 commits into
mainfrom
codex/native-preparation-bound-capture-20261109
Nov 10, 2026
Merged

huangruiteng merged 3 commits into
mainfrom
codex/native-preparation-bound-capture-20261109

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Active Legacy Recovery At 303a965b8c4c

Integrated main d6173433ddad. The File/SQLite native-hook matrix now includes an old unbound capture with an active original lease: repeated hooks issue no claim or ready guard, and preserve that lease exactly. Released captures remain inactive. Historical readability does not authorize execution; existing readers stay supported.

This exact source passes 28 executor/native-hook tests, Ruff, the public-boundary and bilingual checks, and standard premerge (6 direct plus 19 selected checks, no failures or manual holds). The exact-scope change-quality receipt is valid. While validation ran, the tracking main advanced; its merge-base diff is byte-identical to this frozen target. The older 609c source/wheel results below retain their original revision and scope. No new installed-desktop, Windows, model-cost or latency qualification is claimed.

Goal And Delivered Outcome

The native context hook is the only production caller of automatic execution preparation. It already receives a live-bound capture and a Turn, while its executor still accepts a second branch with neither capture nor Turn and requests full quota output.

Remove that unused branch. Automatic preparation now requires the source and original claim digests, Turn and paired capture/context destinations before a claim runs. The ready guard returns its existing compact capture reference. The caller records and presents that same source.

Author Declaration

Written by an OpenAI GPT-6 coding agent.

Implemented against the captured native preparation/recovery contract in docs/reference/required-work-context.md at base 8f6e88c.

Criterion Disposition Consumer and evidence
Automatic preparation belongs to a bound captured Turn implemented context-hook caller and executor; unbound/missing-source/Turn/readback-only requests reject before subprocess
Claim and readiness keep original identity implemented existing managed-claim helper, same-Todo/Turn readiness and writer digest
Interrupted and historical recovery implemented original receipt/lease/ready-capture readback; real timeout and legacy cases

Scope And Continuation

This completes retirement of the native executor's unbound branch. The shared request selector remains consumed by the native steward's own claim lifecycle. Caller discovery covered the source tree, scripts, distribution packages, versioned protocols and SDK declarations. The direct executor has no other production caller in that inventory.

The broader C1 consumer migration continues in #8266. This slice can be reviewed and reverted independently.

Validation

Tested revision 609c749. Run state finished. Inputs synthetic and public fixtures.

Check kind Result Evidence
static passed Ruff on the touched Python files and git diff --check
unit / real_entrypoint / real_backend passed 287 passed across test_codex_execution_preparation.py, test_quota_execution_preparation.py, test_codex_context_lifecycle.py and test_quota_decision_capture.py with explicit source import
regression_parity passed Base 8f6e88c and this exact wheel each pass the same 20 real File/SQLite native hook tests, including App/SSH, explicit off, interrupted claim, released lease and legacy readback
static / integration passed Standard premerge, six direct and nineteen selected checks
environment diagnosis failed then passed Initial ambient safe-path mode prevented a smoke from importing its adjacent fixture. Repeated with explicit source PYTHONPATH and safe-path unset. The first failure remains recorded

The source and packaged matrices exercise claims through real disposable File and SQLite authorities on Node 24.21.0 / SQLite 3.53.4. No PostgreSQL store implementation changed. Windows execution and installed desktop adoption remain untested in this slice. Deleting an unused branch has no measured model-cost or latency claim.

UI impact none. This changes the existing native lifecycle adapter and its reference text.

Boundary checks completed for public-safe source/description, synthetic fixtures, bilingual reference text and DCO-signed commit.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…in-native-capture-lifecycle-20261109

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 — gpt-6.1-sol / OpenAI; runtime_reported; reasoning_effort=max.

动机 / Motivation

原生 Codex Hook 在恢复已捕获的任务时,需要领取同一个 Todo 的租约。

旧 executor 还接受没有 capture 和 Turn 的直接调用;删除这条无生产调用者的分支后,自动准备只使用已绑定的原 capture,历史快照仍可读。

这次交付把自动领取、同 Turn readiness 和原快照呈现收束到既有原生入口,重复 Hook 只返回恢复读路。

不改变任务选择、TS 准入规则、普通手动 claim、steward 租约生命周期或结算,也不宣称安装采用与成本收益。

改动思路 / Approach

保留 TS 对领取资格和就绪的决定权,Python 只执行普通 CLI 和投递已校验的 capture;删除无消费者的备用执行分支比新增兼容状态更合适。

当前 PR 只退役 native executor 的无绑定分支,保留原 receipt、历史 reader 和失败后的同身份恢复。

先挑战这个改动:如果旧无绑定入口仍有真实调用者,直接删掉会破坏恢复。完整调用者搜索只找到 context-hook 调用 executor,且它已经传入 capture 与 Turn。steward_turn 仍使用 compact selector 并管理自己的租约,因此 selector 被保留。没有新 schema、配置或同步账本,也没有把历史文件读取变成领取权限。TS 判资格,Python 执行受管 claim 和呈现结果,reader 只读已保存的字节。

具体改动 / Changes

审阅完整 head 303a965,merge-base d617343。全部 diff 为5文件 +117/-84,其中生产代码净减16行;测试和双语说明补齐删除边界。

关键代码讲解

  1. execute_codex_execution_preparation 在 subprocess 前拒绝缺 source、缺 Turn、缺配对目录或 readback-only 请求;使用原 capture 派生的 operation id,然后只接受同 Goal/Agent/Todo/Turn 的 ready 与完整 writer digest。没有另建 Python 资格规则。
  2. handle_native_context_command 对 legacy/no-Turn 源只给恢复指引;有效路径固定生成 ready capture,记录后呈现同一份文件。ready 文件损坏时保留原 claim 并返回原摘要恢复命令,而非再次领取。
  3. _native_claim_operation_id 保留原 digest 与当前呈现/ready digest 的区别。重复 Hook、丢失输出或读取旧快照不会由此取得新一代租约。

规范为 docs/reference/required-work-context.md,spec_revision d617343,采用改动前的 native preparation/recovery 条款。bound-native-preparation、original-claim-turn、read-only-historical-recovery 三项均 implemented:分别由执行前拒绝、真实同 Turn 请求和 original receipt/lease 回读验证;新说明没有反过来充当独立规范。

对主干的风险 / Risks

没有发现本 diff 引入的阻塞代码问题。最强风险是“Hook 表面恢复成功,却对另一个 Turn 发 ready 请求或重复领取”。独立运行的当前4文件共289 PASS、0 skip,涵盖真实 File/SQLite、App/SSH、explicit off、跨工作目录、长 Goal/任务正文、timeout、丢失 Hook 输出、原始回执更新、复制源与 ready 文件替换。相同22个公开入口用例在不可变 base 与 head 都通过,完整已有行为断言保留。另在进程内只把 readiness Turn 改成不同值,两个 provider 都在 guards == [turn] 的原身份断言失败;正常 head 同例通过。这不是 fake runner 给出 ready 的证明。

Changed-file Ruff、MyPy17、diff 检查及标准 premerge 的6 direct、19 selected 源码检查通过。完整 required Ruff 仍 FAIL: base 与 head 同样在未改的 tests/test_steward_interrupted_answer.py 第32、68行报两项 F811,完整失败输出逐字相同。该 fixture 不在本 PR 因果路径,改变的不变量有独立通过证据,所以代码结论可 APPROVE;required lint 不能据此改记通过。严格 CQR 已记录 FAIL,verify 为 invalid_receipt,整体 Goal-aware premerge 因 quality_invalid_receipt 退出1。应整合独立 lint 修复后对新 head 重新资格。未查询、轮询或等待 CI。

语义与 CI 对齐

复用现有 execution_preparation_v0、managed claim 与 journal vocabulary;不新增共享分类或默认开关。binding 是机器强制条件,legacy 文字只是恢复说明。explicit off 的 Hook 仍无 effect,普通 claim 与 steward 原生命周期保持。新旧捕获可读、退休租约不得复活的兼容义务保留;没有把测试层证明写成模型采用或 installed-host 资格。

我的整体评价 / Verdict

此内部退役目标已达到,代码结论 APPROVE。long_horizon preserved:原 claim、同 Turn 后续工作和重复恢复仍由原 owner 承接;user_experience preserved:沿既有入口读取/恢复,不增加确认或复制已知信息的轮次。保留历史 reader 比维护没有生产调用者的无绑定执行模式更合适,当前有界简化已经足够。

视觉检查不适用:已检查 native Hook JSON、CLI reader 与恢复文字,没有渲染 UI 或布局改动。未执行 installed desktop、Windows、真实模型或完整长期成本试验;这些保持 UNVERIFIED,也没有宣称时延或 token 收益。队列经验讨论恢复 RFC 的产品分期,本切片有真实内部 caller 和独立可回滚结果,不据此增加无关门或继承历史 verdict。

Required Ruff、strict CQR 与整体 premerge 的 FAIL 是独立合并 hold,当前评审不授予 merge、安装或 bypass。

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

当前作者账号只能以 COMMENTED 承载代码批准结论。

English verdict: APPROVE 303a965. Bound native preparation preserves original identity and recovery; pre-existing required Ruff failures, strict CQR and overall premerge still hold merge qualification.

@huangruiteng
huangruiteng merged commit 1981c04 into main Nov 10, 2026
28 of 34 checks passed
@huangruiteng
huangruiteng deleted the codex/native-preparation-bound-capture-20261109 branch November 10, 2026 05:16
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