Skip to content

fix(turn): keep executor commands out of the Worker task context - #9045

Open
cocolord wants to merge 7 commits into
mainfrom
codex/minimal-worker-context-20261119
Open

cocolord wants to merge 7 commits into
mainfrom
codex/minimal-worker-context-20261119

Conversation

@cocolord

@cocolord cocolord commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Goal And Delivered Outcome

The complete C1 source gives the outer executor the instructions and observations it needs to run and settle a Turn. Built-in Worker presentation now keeps the original task, scope and required reads while leaving Todo authoring and routine debit instructions with their effect owner. A known unconfigured memory readback shows its Goal, Agent and disabled status. Known empty pre-turn observations show the hook, capability and current status. Their full records remain in the signed capture and adapter wire. Newly assembled work context omits the field-name dictionary for both registered Todo read schemas. The canonical Todo reader still returns it, and the original digest-bound captures remain readable. Matching ready lease preparations stay with the launcher and settlement reader once ordinary task admission is complete. The model still receives the task, permitted scope, required reads and validation conditions. Runtime release-readiness and completed-Todo archive warnings remain available to operators through quota and status. The built-in task view omits those maintenance directions.

Related to #5072. This updates the paired small-kernel RFC and Turn request reference. Intended base is main@5cfd6ae7d571.

Author Declaration

Written by model_agent, OpenAI Codex.

Existing contract Disposition Evidence at the model boundary
Todo creation, user action or gates, and ordinary delivery debit Outer executor retains its instructions File and SQLite installed Codex runs settle once. The original capture retains the commands and the Worker sees the original task and required validation.
Memory and pre-turn observations The Worker gets the exact identity and status of known idle records Explicit disabled and empty states remain visible for fresh-context interpretation. Synthetic active, failed and extended records retain their complete data.
Required reads, work, repair, stop and continuity Complete task fields and original source provenance remain available Short and long authorized materials, scope, selected Todo and execution conditions match across both installations. Other heartbeat modes retain their spend-policy text.
Todo field dictionary The selected task and current read proof remain visible The known schemas preserve task data, gates and provenance. Unknown schemas and malformed field lists pass through.
Ready launch preparation The launcher retains its matching lease transaction record The Worker receives the admitted task. Unready states, disagreements and extended records retain their data.
Release readiness and completed-work archive warnings Existing operator readback retains both warnings Installed Codex and structured task prompts omit them. Direct quota readback and the immutable capture retain the same messages and commands.
Signed source and replay Existing owners retain the original input and receipts Tests compare original source bytes and verify exact replay on two backends.

Current validation

Candidate 9944eaa8c130eaefada45d73349f50e774c74f7e on main@5cfd6ae7d571. All 1,910 product files in the standalone Core wheel match committed source. Validation uses macOS arm64, Python 3.12.9, Node 26, real File and SQLite storage, and deterministic local host responses.

Check Result
Same signed source at the model boundary Compared the source-built installed previous and current proposals using four independent File and SQLite captures, each with a short or long authored task. The Codex and structured renderers each remove exactly 1,026 UTF-8 bytes per prompt. Installed Codex inputs drop from 29,296–40,118 bytes to 28,270–39,092. The prompts differ only by the two maintenance records. All remaining model content, instructions, result schemas, adapter requests and source digests match.
Real entrypoints and replay The previous installed proposal fails the warning-absence regression on both backends. The new Core passes nine installed identity, admission, independent verification and process-loss recovery checks. The original readback retains both operator warnings on the archival-pressure fixture.
Combined Core The local composition at dca6482b72eff3f34ea0a5af4907319cdd1f8962 includes the current scoped Codex first task, optional package boundaries, shorter Todo summaries and on-demand Yardstick. Six installed checks cover bounded read and write, fresh admission and original-result replay on File and SQLite.
Source and premerge 163 focused Python and 104 TypeScript tests passed. TypeScript typecheck, Ruff, semantic advisory, paired RFC diff and quick premerge passed. Quick premerge has zero blocking failures and retains the inherited maintainability advisory. An initial baseline build exhausted temporary storage. The standard rebuild and exact measured comparison completed after reclaiming generated test space.

Previous validation for ready lease preparation

Candidate 59b09dbc2bc4112c8b6f669795a2bbfc494764b6 on main@5cfd6ae7d571. All 1,910 packaged product files matched the committed source byte for byte. These runs used a deterministic local host and real File and SQLite storage on macOS arm64, Python 3.12.9 and Node 26.

Check Result
Matched prompt and schema Each renderer read the same digest-bound source. File dropped from 24,436 to 23,680 UTF-8 bytes and SQLite from 24,462 to 23,706. Each saved exactly 756 bytes, the two ready preparation records. All other prompt content and the result schema matched.
Standalone install and replay Five installed tests passed for installation identity, admitted checked execution and process-loss recovery. Both prior-wheel captures replayed with identical bytes and one original debit. The fake host remained at one invocation. The prior wheel reaches the new preparation-absence assertion and fails it on both backends.
Combined local wheelhouse 16 checks passed on local combination 113b922709f199bf3f2f216f38802c89818838ce, including the current Worker projection, #9060, #9059 and the companion wheels. On both backends the run checks the ordinary Worker, unused evaluator, Standard install/removal, Workspace readback and Benchmark ledger. The other checks cover first-Goal execution, corrected retries and Research install, existing ledger and removal. An initial Benchmark setup exhausted temporary disk. Separate reruns with a shared offline build cache completed the same assertions.
Source, types and premerge 113 focused TypeScript and 18 focused Python checks passed. Typecheck, Ruff, paired RFC checks and Git diff checks passed. Quick premerge ran five direct and four selected checks with zero blocking failures and one inherited maintainability advisory.

Previous validation for the Todo read shape

Tested 96f772b8cf4e325e2e20b7017221088652774faa on main@5cfd6ae7d571 using public synthetic task fixtures. The changed TypeScript sources in the installed Core wheel match this revision.

Check Result
Installed Worker request The canonical Todo read included 70 field names in the prior wheel. File decreased from 21,728 to 20,405 UTF-8 bytes. SQLite decreased from 21,754 to 20,431. Restoring the dictionary alone adds exactly 1,323 bytes on either backend. The request retains the selected task, User Todo rows and read digest. The scoped Todo CLI still returns the field list.
Installed execution and recovery Four exact-wheel cases cover admitted execution, independent validation, process-loss recovery and replay on File and SQLite. Both saved prior-wheel captures replayed through the new wheel with the original bytes and digest, one original debit and no new host invocation or state write.
Source and architecture 103 focused TypeScript checks and 37 architecture checks passed. TypeScript typecheck, focused mypy, Ruff, bilingual RFC diff and Git diff checks passed.
Quick premerge Five direct and four selected checks ran with zero blocking failures and one maintainability advisory.
Broader acceptance-context suite 14 passed and 12 failed. All 12 failures reproduce on the prior branch with the same main integration. Four assertions compare a scoped outcome projection with an unscoped read, and eight fixtures still index the previous top-level work-context path.

Trial merges with the pending first-Goal, companion-wheel composition, Todo-lane, Yardstick and scheduler proposals produce no Git conflicts. This checks source integration. The installed evidence above covers this proposal by itself.

Prior validation

Tested a4bdd6fb52bb4a70662137b94b27817ad5cd1f77 against 41ea75e89892ed88d0ae543e97e31aad0a181c47 using public synthetic fixtures.

Check Result Evidence
Matched installed Codex prompt rendering passed Identical signed input renders at 29,968 / 29,362 / 26,889 UTF-8 bytes on the main renderer, previous proposal and current proposal for the short SQLite case. The long File case renders at 40,688 / 40,082 / 37,609 bytes. Changed runtime source bytes were verified in each installed environment.
Core and ordinary installed CLI passed Fifteen selected Core cases and eight ordinary-wheel cases cover admitted Codex execution, independent validation, recovery and replay on File and SQLite.
Candidate integration passed Thirteen cases pass in a locally combined Core wheel with the pending package, first-task and settlement-recovery changes, including #9053.
Focused source and TypeScript passed Twenty-six focused source tests and eighty-three TypeScript tests. Control-plane typecheck, changed-file Ruff, vocabulary advisory, paired RFC and diff checks passed.
Quick premerge passed All blocking checks passed on the rerun. One inherited maintainability advisory remains. An initial broad run exhausted temporary storage during validation. The focused and installed reruns completed after cleanup.

Scope And Continuation

The matched measurements cover rendered UTF-8 bytes with deterministic inputs. Model token accounting, task outcomes under matched model budgets, real host onboarding, and full minimal/Standard qualification retain their existing acceptance scopes.

Signed-off-by: cicolord <cicolord@outlook.com>

@loopx-agent loopx-agent 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.2-sol · OpenAI (runtime_reported, max)

动机 / Motivation

内置 Host 的 Worker 需要读到完整任务要求,并把结果交给外层执行器验证和记账。
过去 Worker 在任务输入中也看得到三条 Todo 写入模板和普通扣额说明。现在这些说明由外层持有,实际安装的 Core 仍能启动和验证工作。
两种存储的实际 Worker 输入都失去了外层模板,同时遗漏了普通工作段的范围说明。
本切片只改内置 Host 的 Worker 输入。原始捕获、交易写入与历史 carrier 沿现有路径处理。

改动思路 / Approach

按整个字段删除,把仅供执行器的扣额条款和 Worker 需要的工作规模说明一起删掉。
在原内置 Host 视图中调整两类说明,继续用同一已签名来源和原有验证、结算 owner。

完整来源继续由 Core 校验。Host 从同一份数据生成任务视图,保留任务、必读和停止,并把持久写入放回外层。已装测试让真实进程收到工作输入,接着运行独立验证、读回和原轮重放。

具体改动 / Changes

依据 docs/architecture/rfcs/monorepo-distribution-split-v0.md,基线 29c3129。V2 的原身份、事务及一次结算通过安装测试。V5 的普通完整请求少了一条工作范围说明。R1 的完整装配、实际宿主和模型资格仍需进一步验收。

关键代码讲解

  • 默认规则在同一句中给出扣额条款与普通工作模式的范围说明。两种存储生成的原捕获都保有这些内容。_default_rule
  • 投影从已验证原文复制,删去已知 Todo 模板,且在普通模式删去整个 spend_policy。其他模式的读写与等待规则沿原视图。hostModelContextChanges
  • 新测试分别覆盖普通与监控输入;实际安装用例同时读取 Worker 进程实际收到的正文以及旧原始捕获。源码回归 安装 Core 回归

两份 RFC 记录外层与 Worker 的职责。除了外层效果,也有必要按原任务要求说明 Worker 要交付多大的一段。

对主干的风险 / Risks

[P2] 保留普通模式的工作范围说明。 内置 Host 用已验证的完整 v1 来源启动普通 steering_audit_then_one_step 工作段。 原 capture 保留模式及范围说明。当前 Worker 收到同一个模式名,但用于区分工作段和一次操作的说明消失。 在两个实际安装版本上,File 和 SQLite 观察结果一致。候选视图去掉了三个外层模板,同时不再解释 one_step 的范围。原 capture 的字段和必读、profile 保持。模型是否真的因此提前结束仍待验证。

47 项已装 Core 用例通过,覆盖真实准入、独立验证、恢复和一次结算。270 项源码 Host 与捕获测试也通过。旧 wheel 同一 Worker 用例的两个 provider 都在新增的模板过滤断言失败,证明能区分旧行为。

语义与 CI 对齐

把工作规模说明交给现有 Worker 执行指导,外层继续持有扣额规则。沿当前已签名任务和 execution_profile 确定规模,复用现有来源。 在 File 和 SQLite 中捕获已装 Core 实际发给 Worker 的普通输入,同时检查扣额规则与三条写命令退到外层、工作规模说明仍可见、原 capture 和一次结算完整。 TypeScript 检查、双语 RFC 与 quick canary 直接检查通过。受管合并收执仍缺,远端 CI 未采集。

我的整体评价 / Verdict

执行器指令从 Worker 输入中移除,角色容易辨认。普通工作仍需要明确按已准入的成果与任务范围定规模。本版保留外层验证与一次结算,但工作说明出现可复核的遗漏。真实模型采用、完整费用与装配仍需验证。

English verdict: REQUEST_CHANGES at 16a8d82. Preserve ordinary work sizing in the Worker input while keeping debit and Todo effects with the outer executor.

if (decision.normal_delivery_allowed === true &&
heartbeat.recommended_mode === "steering_audit_then_one_step" &&
typeof heartbeat.spend_policy === "string") {
delete heartbeat.spend_policy;

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.

[P2] 保留普通工作段的范围说明

内置 Host 用已验证的完整 v1 来源启动普通 steering_audit_then_one_step 工作段。 原 capture 保留模式及范围说明。当前 Worker 收到同一个模式名,但用于区分工作段和一次操作的说明消失。 把工作规模说明交给现有 Worker 执行指导,外层继续持有扣额规则。沿当前已签名任务和 execution_profile 确定规模,复用现有来源。 在 File 和 SQLite 中捕获已装 Core 实际发给 Worker 的普通输入,同时检查扣额规则与三条写命令退到外层、工作规模说明仍可见、原 capture 和一次结算完整。

…nimal-worker-context-20261119

Signed-off-by: cicolord <cicolord@outlook.com>
Signed-off-by: cicolord <cicolord@outlook.com>

@loopx-agent loopx-agent 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.2-sol · OpenAI · runtime_reported · max

Exact head a4bdd6fb52bb4a70662137b94b27817ad5cd1f77

动机 / Motivation

从已装 Core 启动内置 Codex Worker 的人依赖任务上下文交付完整的工作段。外层执行器负责验证、写回和结算。

主干把外层写入模板、结算规则和工作范围说明一并交给 Worker。当前版缩小任务视图,也压缩了空观察和未配置的记忆回执。

配对的 File 和 SQLite 实验中,当前 Worker 保留原任务、执行配置和必读列表。三条外层模板移除,解释普通工作段规模的句子也从两组输入消失。

本 PR 交付内置 Worker 任务呈现。实际模型的行动选择、总成本和更多宿主的安装资格继续单独验证。

改动思路 / Approach

从已验证来源一次生成角色视图。先划分句子的消费者,再省略外层效果说明。

在既有内置 Worker 投影交付范围,保持原始捕获和外层执行器的效果职责。

已有的完整捕获仍然适合外层校验与重放。内置 Host 已有共享的任务投影,可以及时解析现有读回指针。把工作范围表达放回同一个视图,即可保持压缩后的输入和普通工作语义。

具体改动 / Changes

九个文件新增 265 行、删除 28 行。按 docs/architecture/rfcs/monorepo-distribution-split-v0.md 在 41ea75e89892ed88d0ae543e97e31aad0a181c47 的 V2、V5 与 R1 审查。V2 的安装态验证与一次结算通过。V5 的普通范围说明仍缺。R1 的模型成果、完整成本和发布装配未在此切片验收。小内核 RFC

  • 默认模式在同时包含扣额与工作范围的字段内明确写出 one_step 的含义。普通模式条款
  • 候选先剔除 Todo 写入模板,普通模式随后删除整个 spend_policy。其他模式保留该字段。Worker 任务视图
  • 已知全空 hook 回执保留钩子、能力和状态。精确未配置的 recall 保留 Goal、Agent 和停用状态。已检查 active、failed 和新增字段的对应对照。原始回执继续供外层使用。空回执投影 停用的记忆回执
  • 双语 RFC、Turn 协议和测试说明本次呈现范围。安装回归从实际进程读回同一个 Worker 输入,并验证合法工作与结算重放。安装回归

对主干的风险 / Risks

[P2] 保留普通 Worker 的工作范围说明。 已签名的普通 Turn 使用 steering_audit_then_one_step,原始来源同时带有外层扣额和内层工作规模说明。 两套已装 Core 的原始 capture 都包含范围解释。主干 Worker 也能看到它,候选 Worker 只保留模式名和通用任务字段。 同一工作仍能完成并结算,丢失的是执行前对工作规模的明确指导。实际模型会怎样解释该模式仍未测。

两项精确安装测试通过。原始来源、任务、失败后重放及一次结算继续可验。163 项源码测试通过,覆盖短长任务、已知空形态、活跃、失败、扩展与 monitor。 主干两个 Worker 看得到 one_step 的大小解释,候选两个都缺。对基线刻意启用候选专属的去模板断言,该断言预期失败于 todo_write_hint。

语义与 CI 对齐

现有普通模式和任务范围仍由原契约提供。在同一来源上按职责交付普通工作段的规模说明,外层保留扣额政策与 Todo 写入。用已有任务和执行范围 owner 提供 Worker 指导。 同一 File 和 SQLite 的实际内置 Worker 回归同时断言工作范围仍可见、三条写命令移除、原来源完整和结算重放一次。 本地 quick premerge 通过,5 项直接检查,4 项选中执行。另有 1 项报告提示。按当前 Goal 的设置,远端 CI 未查询。

我的整体评价 / Verdict

将执行器命令移出 Worker 视图,以及压缩已知空回执,符合现有职责边界。当前两个 provider 的普通模型输入仍丢失工作段范围说明,所以上一轮求改保留在当前提交。任务范围、源绑定和一次结算通过独立复验,实际模型表现和使用成本待验。

English verdict: REQUEST_CHANGES at a4bdd6f. Preserve ordinary work sizing in the Worker input while keeping debit and Todo effects with the outer executor.

if (decision.normal_delivery_allowed === true &&
heartbeat.recommended_mode === "steering_audit_then_one_step" &&
typeof heartbeat.spend_policy === "string") {
delete heartbeat.spend_policy;

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.

[P2] 保留普通 Worker 的工作范围说明。两套已装 Core 的原始 capture 都包含范围解释。主干 Worker 也能看到它,候选 Worker 只保留模式名和通用任务字段。 在同一来源上按职责交付普通工作段的规模说明,外层保留扣额政策与 Todo 写入。用已有任务和执行范围 owner 提供 Worker 指导。

…codex/minimal-worker-context-20261119

Signed-off-by: cicolord <cicolord@outlook.com>
Signed-off-by: cicolord <cicolord@outlook.com>
Signed-off-by: cicolord <cicolord@outlook.com>

@loopx-agent loopx-agent 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.2-sol · OpenAI · runtime_reported · reasoning_effort=max

独立复核 59b09db。

[P2] 保留普通 Worker 的工作段范围说明

在普通 steering_audit_then_one_step 工作段中,已签名的输入包含 one_step 的范围说明。内置 Codex Worker 收到的实际输入只保留模式名和类型化规模下限,少了这句指导。File 和 SQLite 的表现一致。 用现有的 Worker 执行指导表达普通工作段的范围。将这句说明与外层扣额和 Todo 写入模板分开交付。 对实装 File 和 SQLite 发起普通 Turn,从实际 Worker 输入验证范围说明、必读和任务引用仍可见。再验证三条外层模板与扣额说明留在完整来源中,重放仍只有一次派发和结算。 hostModelContextChanges

动机 / Motivation

用 LoopX 调用内置宿主执行 Goal 的人,需要 Worker 理解这一轮应交付多大的一段工作。 当前提交移除了三条外层 Todo 写入模板,也删去了普通模式中说明 one_step 含义的文字。File 和 SQLite 上都观察到了这两种变化。 普通 Worker 仍收到任务与工作规模下限,但看不到解释 one_step 只标识工作模式、允许多次操作的说明。保留的类型化规则仍要求完成一段可验证成果。 本轮验证使用隔离、确定性的内置 Codex Worker。真实模型对说明的采用、总成本和其他宿主的安装资格仍缺验证。

改动思路 / Approach

完整来源继续由原执行器校验和结算。现有 Worker 投影适合承接与工作范围相关的指导。 复用一份已验证来源和现有的 Worker 视图,在现有边界保留范围指导。

本 PR 交付内置 Host 的 Worker 任务呈现,以及新组装工作上下文中的 Todo 读回精简。 已签名来源与真实 Turn 生命周期归原控制面,Worker 视图继续是受限的派生呈现。

具体改动 / Changes

GitHub 报告的目标基线为 5cfd6ae。 4 个运行时文件 +136/-16,6 个测试文件 +240/-20,3 个协议或 RFC 文件 +48/-1。 docs/architecture/rfcs/monorepo-distribution-split-v0.md 的 V2 已通过独立验收与一次结算验证。V5 的 Worker 指导在普通模式仍缺一项。 主干规范

  • 在完整来源验证后生成 Worker 视图。普通工作段删除整个 spend_policy,其他模式保留现有指导。 hostModelContextChanges
  • 已知空观察保留钩子、能力和状态。带必读、错误、效果或未知结构的回执走完整表示。 projectEmptyTurnStartObservations
  • 仅对匹配已知未配置形态的回执保留 Goal、Agent 与停用状态。 disabledRewardMemoryView
  • 两种已登记 Todo 读回只去字段表,继续交付记录、版本和摘要。 compactTodoContextSource
  • 同一 Agent 和 Todo 的就绪租约经三处等值检查后留给外层。未就绪、有差异和扩展形态仍交付 Worker。 isKnownReadyLeasePreparation

对主干的风险 / Risks

这一版新增了完全一致的就绪租约精简。它和两种 Todo 字段表精简均通过复核。上一轮指出的普通工作范围说明仍缺。 上一轮评审

实装 File 和 SQLite Worker 均收到原任务引用、规模下限、来源摘要和 User Todo 读回摘要。原 Todo 读取仍有字段表。完全一致的就绪租约移出 Worker 视图,原来源保留,同一 Turn 中断后按原租约恢复。两组合法任务各执行、独立验收、结算一次,重放无新增效果。

163 项源码捕获与 Host 测试、104 项 TypeScript 测试和 10 项实装 Core 测试通过。快速预合并 5 项直接检查、4 项选中检查,零阻塞失败。维护性提示 1 项。首次构建遇到临时空间不足,回收本轮已用临时目录后重跑通过。 本轮按既定策略未查询 GitHub CI。相关 #9053 把首个受检任务送进同一个 Turn 执行器。外层接续的可达性属于该 PR 的独立边界。

我的整体评价 / Verdict

当前的 Todo 字段表精简通过了独立读回。补回普通工作段的指导后,可以沿两种实装后端复验。 来自模型可读工作规模说明的遗漏已经验证。项目目标、权限、验收和一次结算仍可读回。

English verdict: REQUEST_CHANGES. Preserve ordinary work sizing guidance in the Worker input while keeping debit and Todo write commands with the outer executor.

Signed-off-by: cicolord <cicolord@outlook.com>

@loopx-agent loopx-agent 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.2-sol · OpenAI · runtime_reported · reasoning_effort=max

独立复核 9944eaa。

[P2] 保留普通 Worker 的工作段范围说明

普通 Turn 删除整个 spend_policy 后,内置 Codex 只看到 steering_audit_then_one_step 和类型化规模下限。两种已安装发行包的 File 和 SQLite 用例都缺允许一段工作包含多次操作的说明。把这句范围说明留在现有 Worker 指导中,扣额、Todo 写入和维护警告仍由外层处理。回归测试应核对实际 Worker 入口、原来源、范围说明和一次结算。 删除分支

动机 / Motivation

用内置宿主推进 Goal 的操作者,需要 Worker 理解交付规模。 原 Worker 从完整 Turn 来源同时获得任务范围、外层调度和写入指令。当前将 Worker 所需输入提取为独立视图。 普通 Worker 仍须完成可验成果,输入却缺少解释模式名和操作范围的文字。

使用确定性的内置宿主夹具观察输入和效果。真实模型对指导的采用、长期成本和其他宿主仍待验证。

改动思路 / Approach

完整来源继续由原执行器校验和结算。现有 Worker 投影适合承接与工作范围相关的指导。 复用一份已验证来源和现有的 Worker 视图,在现有边界保留范围指导。

本 PR 交付内置 Host 的 Worker 任务呈现,以及新组装工作上下文中的 Todo 读回精简。 已签名来源与真实 Turn 生命周期归原控制面,Worker 视图继续是受限的派生呈现。 当前版本从 Worker 请求省去 promotion readiness 和已完成 Todo 归档提示。两项提示仍随原 quota 读回提供给操作者。

具体改动 / Changes

GitHub 报告的目标基线为 5cfd6ae。 14 个文件共 +460/-40。其中 4 个运行时文件 +138/-17,6 个验证文件 +263/-22,双语 RFC、协议与自修复说明 +59/-1。 docs/architecture/rfcs/monorepo-distribution-split-v0.md 的 V2 中受影响的独立验收与一次结算已验证。V5 的 Worker 指导在普通模式仍缺一项。 主干规范

关键代码讲解

  • 在完整来源校验后去掉给操作者的两条警告和三条写入模板。普通工作段还删除整个 spend_policy,其他模式继续携带原说明。 hostModelContextChanges
  • 已知空观察保留钩子、能力和状态。带必读、错误、效果或未知结构的回执走完整表示。 projectEmptyTurnStartObservations
  • 仅对匹配已知未配置形态的回执保留 Goal、Agent 与停用状态。 disabledRewardMemoryView
  • 两种已登记 Todo 读回只去字段表,继续交付记录、版本和摘要。 compactTodoContextSource
  • 同一 Agent 和 Todo 的就绪租约经三处等值检查后留给外层。未就绪、有差异和扩展形态仍交付 Worker。 isKnownReadyLeasePreparation

对主干的风险 / Risks

本轮验证覆盖两项维护提示均实际存在的情况。普通模式的交付说明缺口与上一轮一致。 上一轮评审

Core 和普通 wheel 均在 File 与 SQLite 读回真实 Worker 请求。四组保留任务和来源绑定、类型化规模下限、一次额度。原签名来源有维护提示,Worker 没有。源码另用超归档阈值的完成任务,验证归档与 promotion 两项提示留在原签名来源和普通 quota 读回,Codex 及结构化任务提示均省去它们。原 Todo reader 继续提供完整字段表。

270 项源码捕获与 Host 测试、104 项 TypeScript 测试和 5 项实装 Core 测试通过。快速预合并 5 项直接检查、4 项选中检查,零阻塞失败。另有 1 项非阻塞维护性提示。 GitHub CI 未纳入本次复审。相关 #9053 把首个受检任务送进同一个 Turn 执行器。外层接续的可达性属于该 PR 的独立边界。

我的整体评价 / Verdict

保留已有的完整来源验证和维护告警归属。发布前补齐执行指导,用两个实装发行包在 File 和 SQLite 上确认说明随任务送达,同时验证外层指令与一次扣额。

English verdict: REQUEST_CHANGES. On 9944eaa, both installed distributions omit the ordinary work sizing explanation on File and SQLite. Keep it in the Worker input. The operator warnings remain available through quota.

@loopx-agent loopx-agent 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 · Gemini · Google (self_reported)

独立审核提交 9944eaa8c130eaefada45d73349f50e774c74f7e(基准 5cfd6ae7d571f2f97da40982db23f76540723c89)。在安装版 loopx-core 与 TypeScript 控制面验证中,大部分外层指令隔离与未知字段保真逻辑成立,但内置 Worker 在普通 steering_audit_then_one_step 模式下丢失 one_step: mode, not an operation limit 语义澄清,构成明确回归。

动机 / Motivation

受影响的是通过内置 Codex Host 启动、以 Worker 身份读取模型任务上下文的 Agent,以及依赖 task_context 理解工作边界但无需自行操作 quota 或 todo 命令的受控执行流程。
改动前,内置 Worker 会收到完整 Turn 决策中的所有维护提醒、Todo 编写命令模板、空能力观察与就绪租约详情,使 Worker 容易误执行本属外层执行器或操作员的维护指令;改动后,维护警告、空观察、未配置记忆详情与标准就绪租约均保留在外层执行器,Worker 仅看到任务与边界信息,但 heartbeat_recommendation.spend_policy 被整段删除,导致 one_step: mode, not an operation limit 澄清一并从 Worker 输入中消失。
内置 Worker 上下文成功省略 Todo 编写命令、发布/归档维护警告、未配置召回冗余载荷、空观察及完全匹配的就绪租约,同时保留含未知字段、失败观察与非就绪租约;但在普通交付模式下 Worker 仍看到 recommended_mode: steering_audit_then_one_step 却不再收到 not an operation limit 边界说明。
本 PR 不改变外层执行器持有的原始已签名决策摘要、通用命令行适配器 stdin 契约、私有 journal 恢复或实际配额/租约/结算权限。

改动思路 / Approach

本 PR 在构建内置适配器请求时通过 hostModelContextChanges 从完整 v1 决策派生 task_context:删除操作员维护提醒(promotion_readiness_warning、completed_todo_archive_warning)和 todo_write_hint 模板,经 disabledRewardMemoryView 与 projectEmptyTurnStartObservations 压缩已知停用/空观察并仅在 hard_lease 且状态完全一致时隐去 execution_preparation,同时经 compactTodoContextSource 省略已登记格式的静态字段字典。将完整原始决策保留给外层执行器与独立验证,而在 turn_envelope.ts 中为内置 Worker 派生最小化视图 task_context 并统一收口裁剪规则是合理边界;但删除 spend_policy 时不能连带抹去解释 steering_audit_then_one_step 非操作次数上限的边界条件。当前切片边界如下:保留外层/Worker 职责拆分以及未知/失败分支的保守退回逻辑,补全对 spend_policy 边界澄清的保留或改用结构化扣额字段后再合入。

上下文载荷 完整原始决策 / 外层执行器 本 PR 内置 Worker task_context(实测) 非标准/失败/扩展态表现
维护警告与 Todo 写入模板 完整保留 省略维护警告与命令模板 非字符串/未知追加字段原样保留
未配置记忆召回 / 空观察 完整保留回执路径 仅保留 Goal/Agent/hook 状态或计数 含实际上下文、失败观察或扩展字段时完整保留
已登记 Todo 格式字段表 由 canonical 读取入口提供 省略 contract_fields(保留版本与摘要) 未知 schema_version 原样保留
hard_lease 就绪准备对象 启动与结算完整使用 仅在完全一致且无扩展字段时省略 未就绪/不一致/带扩展字段时完整保留
steering_audit_then_one_step 含 spend_policy(含 not an operation limit) 整字段删除,Worker prompt 缺失边界说明(P2) 仍暴露 recommended_mode 却无操作限制澄清

具体改动 / Changes

对照改前已接受基线规范 loopx-turn-v0.md(基线修订 5cfd6ae7d571f2f97da40982db23f76540723c89)评估交付条款(本 PR 在工作树中同步修改了该协议文档与 monorepo-distribution-split-v0,审查不把同 PR 文档自改当作独立依据):

  • C1-source-completeness(完整决策与摘要锚定):implemented —— 外层执行器与 source_decision_hash 仍绑定未裁剪的完整原始决策,通用 codex stdin 与 journal 恢复不受视图投影影响。
  • loopx_turn_model_context_v0-task-preservation(Worker 任务与边界信息保真):not_met —— turn_envelope.ts:1936-1941 在 steering_audit_then_one_step 模式下直接删除整个 heartbeat_recommendation.spend_policy 字符串,导致内置 Worker prompt 失去 one_step: mode, not an operation limit 说明,但仍保留 recommended_mode: steering_audit_then_one_step。
  • outer-executor-command-isolation(外层执行命令与保守回退):implemented —— 操作员维护警告、Todo 写入模板、停用记忆冗余详情、空前导观察与匹配就绪租约被移出标准 Worker 视图;未知/失败/非就绪分支均完整留给 Worker。
  • default-adapter-neutrality(通用执行器与原签章隔离):implemented —— turn_envelope.ts:2747 仅将 hostModelContextChanges 应用于内置模型上下文输出,独立验证与安装态 loopx-core 仍从原文件签名检查。

关键代码讲解

  • hostModelContextChanges(loopx/control_plane/quota/turn_envelope.ts:1913):构造 task_context 并裁剪外层调度字段、维护警告、todo_write_hint 命令模板、匹配就绪 execution_preparation 与 heartbeat_recommendation.spend_policy;在第 1936-1941 行对字符串型 spend_policy 做整字段删除,未区分“外层扣额指令”与“Worker 对 one_step 含义的约束澄清”。
  • disabledRewardMemoryView(loopx/control_plane/quota/turn_envelope.ts:1872):当记忆召回为未启用(status === "disabled")、无召回条数、无提示且仅含常规键时收窄为 goal_id / agent_id / status / schema_version,一旦存在有效配置、提示或未知键即原样返回完整对象。
  • projectEmptyTurnStartObservations(loopx/control_plane/capability_hooks.ts:661):仅在所有 pre-turn 观察全部为 empty 且无必需读取、失败或扩展字段时输出精简能力/钩子/状态视图,否则完整保留供 Worker 处置。
  • compactTodoContextSource(loopx/control_plane/quota/context_delivery.ts:31):除原有 todo_read_record(loopx_todo_canonical_read_record_v0)外,现对 todo_domain_record(loopx_todo_domain_read_record_v0)同样省略冗余 contract_fields 字段表,未知格式继续原样保留。
  • isKnownReadyLeasePreparation(loopx/control_plane/work_items/execution_preparation.ts:66):仅在硬租约(hard_lease)下校验准备对象仅含已知键、state === "ready"、准备与选中 Todo 和当前 Agent 一致且与决策顶层/cli_channel 严格相等时返回 True 允许省略,避免遮蔽未就绪或冲突准备态。

对主干的风险 / Risks

  1. [P2] 删除 heartbeat_recommendation.spend_policy 导致内置 Worker 丢失 one_step: mode, not an operation limit 边界说明
    • 触发条件与路径:当合格 Goal 走标准交付分支(normal_delivery_allowed === true 且 recommended_mode === "steering_audit_then_one_step")时,heartbeat_recommendation.py 生成 "append exactly one heartbeat spend only after scope-bounded work is validated and written back; one_step: mode, not an operation limit",而 loopx/control_plane/quota/turn_envelope.ts:1936-1941 对整条 spend_policy 字符串执行 delete heartbeat.spend_policy。
    • 实测证据:在独立构建并安装的 loopx-core==2.4.0 wheel 环境中分别对 sqlite 与 file 后端执行反事实探针,完整原始捕获中均含 recommended_mode: steering_audit_then_one_step 且 orig_has_one_step_expl=True,但传给内置 Codex Worker 的 task_context 保留了 recommended_mode: steering_audit_then_one_step 的同时将 spend_policy 彻底删除(tc_has_spend_policy=False),且 Worker 最终完整 prompt 中完全不再包含 not an operation limit(prompt_has_one_step_expl=False)。同时,对非标准自定义 spend_policy 文本缺少条款级校验也会无条件吞掉额外约束。
    • 最小修复:将外层执行器的单次扣额动作指令与给 Worker 的模式语义边界拆分为独立结构化字段(或在保留 Worker 所需 one_step: mode, not an operation limit 澄清文本后仅移除扣额操作指令,并在存在非预期附加条款时保守保留),同时补充针对内置 Worker prompt 中 not an operation limit 可见性的实装断言。
    • 复验命令:uv run --extra test python -m pytest -q tests/control_plane/test_turn_host_decision_capture.py tests/control_plane/test_work_context_host_delivery.py 与已安装 loopx-core wheel tests/test_core_distribution.py

语义与 CI 对齐

对照 loopx_turn_model_context_v0 与双语更新的 monorepo-distribution-split-v0.md 规范及 loopx-turn-v0.md:本 PR 复用既有协议与控制面 TypeScript 所有者(reuse_existing),但在删除内置 Worker 的 heartbeat_recommendation.spend_policy 时造成决策文本边界条款丢失(violated)。此外分支提交包含合并自上游的 monorepo-distribution-split-v0(.md 与 .zh-CN.md 同步)与 repair-patterns.md(+1 行)改动。本地验证全部按受管策略执行,未查询或等待远端 GitHub CI:

  • TypeScript 控制面:turn_envelope.test.ts + context_delivery.test.ts 104/104 PASS;capability_hooks.test.ts + execution_preparation.test.ts + turn_capability_context.test.ts 54/54 PASS;tsc --noEmit PASS。
  • Python 与边界扫描:双语 RFC 检查 PASS;ruff check PASS;loopx check --scan-path ok=True(0 errors, 3 warnings);canary premerge --tier quick 4/4 PASS;架构测试 37/37 PASS。
  • Host 交付与实装 wheel:tests/control_plane/test_turn_host_decision_capture.py + tests/control_plane/test_work_context_host_delivery.py 顺序全量 163/163 PASS;test_public_e2e_smoke_runs_n_transactions_on_one_session 独立运行 1/1 PASS(106 deselected,此前 4 套件 -n 3 并发叠加 wheel 编译运行为 270 passed / 41 skipped / 1 timeout-failed);独立构建并安装 loopx-core==2.4.0 wheel 后,4 个改动 .ts 文件与源码字节一致,test_core_distribution.py 定向装包用例 8/8 PASS(34 deselected);反事实探针在 SQLite 与 File 双后端上一致复现 spend_policy 抹除导致 Worker prompt 丢失 not an operation limit。

我的整体评价 / Verdict

长程工作影响(long_horizon):regression(steering_audit_then_one_step 模式下删除整个 spend_policy 导致内置 Worker prompt 失去 one_step: mode, not an operation limit 澄清,可能使 Worker 误将一步模式理解成单次操作限制;其余外层维护警告与空观察裁剪均保留原签章摘要与异常退回);用户体验(user_experience):improved(成功去除操作员维护警告、Todo 命令模板与冗余就绪对象噪音)。本 PR 仅涉及 TypeScript 控制面模型上下文投影、协议文档、自修复条目与测试,未修改前端页面或可视化渲染视图(已检查 loopx/control_plane/ 与 docs/)。未验证视觉部分:无新增或修改的前端 UI 渲染。在可观测语义(observable_semantics)与决策文本评估(decision_text_assessment)上,基线与 HEAD 之间对 todo_write_hint、维护提醒与 todo_domain_record 字典的简化有明确授权且非标准分支保真,但对 spend_policy 的文本裁剪产生非预期语义漂移;代码规模与兼容性(code_volume)保持外层/内置适配器边界(retain),默认不改变通用适配器或原文件捕获,但架构所有者需在 turn_envelope.ts 将 Worker 模式解释与外层扣额指令解耦后,再以当前精确提交重新验证。

English verdict: REQUEST_CHANGES at 9944eaa. Preserve the one_step: mode, not an operation limit semantic boundary in the built-in Worker task context when removing outer-executor quota debit instructions from heartbeat_recommendation.spend_policy.

This branch has not been deployed

No deployments
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