Skip to content

Read current Host dispatch from the complete work contract - #8827

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/c1-native-host-source-20261115
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/c1-native-host-source-20261115

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Motivation / 动机

An admitted v1 Turn already carries the complete work contract. Native dispatch inspection, model input preparation, and session lookup rebuilt a legacy executor projection before selecting the few facts they need. Each operation could copy scope and work-context data that the complete source already carries.

Changes / 改动

  • Check the complete contract and its original capture header directly on v1 Host dispatch and session reads. Reuse the TypeScript rules for selection consistency, the primary action, replan state, and checkpointed write approval.
  • Carry the original v1 header through Python to Codex and the structured Host model inputs. Transitional v0/v1 pairs continue through their signed projection check, and original captures remain available for recovery.
  • Assert model payloads against the captured task source and verify the original material references. The bilingual C1 contract records the remaining plan and effect consumers.

Verification / 验证

  • 66 TypeScript tests plus the control-plane typecheck. File and SQLite source checks include 206 passing cases in the combined suite and two re-run capture cases after correcting their inherited model-input assertions. The same stale assertions reproduced on the main baseline.
  • 10 checks on an isolated Core package, including native preparation, independent validation, replay, and one debit. Subprocess Host fixtures exercise the actual CLI with deterministic outputs.
  • One 36,743-byte signed synthetic source produced identical outputs in each of the three TypeScript operations. Each operation executed three fewer deep copies. This measures the TypeScript projection alone. Installed Host adoption and single-session outcome and total-cost evidence remain open.

C1 integration reference: #8266.

@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

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

动机

影响准备派发、生成模型入参和恢复会话的 Codex 与结构化 Host。以前 Host v1 重建执行器投影。现头直接从原工作契约读取所需事实。两版的 36 个结果一致。样例的三个读取每项少两次 structuredClone。评审覆盖读取、校验与 CLI 恢复。整次会话的实际成本由 C1 继续验证。

改动思路

直接由 TypeScript 已有契约取派发和会话事实,历史请求在原签名边界继续验证投影。当前边界是三个 Host 读取和原捕获 header 的传递。负责写回和扣额的原执行器依旧消费验证过的事实。把主行动和 checkpoint 规则提取到其已有 TypeScript owner,避免 Context、实际派发准备与会话查找各次重建整个 v0 视图。完整源读取

具体改动

  • source-header 已实现。Python 将原 v1 header 和 capture reference 交给 TypeScript。对调摘要或 Turn key 时返回原契约拒绝,正确输入保持原主行动与线程标识。原捕获校验 · Python 传输
  • same-host-invariants 已实现。主行动保留已有重规划优先级及原 capture 指向,checkpoint 使用已批准的写范围。缺少必须的 Goal 读取或资格需重新绑定时,仍在对应守卫拒绝。主行动与派发约束
  • historical-pair 已验证。旧 v0/v1 配对继续检查 action signature 和原工作。现实入口的 221 项源测试、38 项隔离 Core 安装测试通过,覆盖原输入继续读回、原会话恢复与回放。历史配对检查

关键代码讲解

completeHostDecision 验证原工作读取资格与原 header。turnPrimaryAction 在两个版本中复用已有选择规则,保留原可执行命令。captured_turn_host_input 将原 reader 的 provenance 带给 Codex 和结构化 Host。主持入参生成

语义与 CI 对齐

36 个输入组合在两个提交上结果和拒绝一致,其中 22 个接受、14 个拒绝。保留原主要行动、已批准写范围、绑定和作用域。TypeScript 107 项、类型检查、双语 RFC 和 diff 检查通过。评审对照 docs/architecture/rfcs/controller-executor-unified-contract-v0/contract-and-context.md 的 8ade78cddeb6bdcd947c0a81507393c4599c7652 版本。基线契约

对主干的风险

旧配对仍需完整签名和原工作比较。当前 v1 仍需有效头和完整输入,避免直接消费来源时绕开真正的派发守卫。隔离 Core 测试通过本地安装入口,模型传输为可观察的脚本,生产安装态采用与 C1 成果及完整成本仍待对应验证。计数只覆盖样例的 TypeScript 读取次数,跨进程成本由后续配对验证。

我的整体评价

当前提交 2decad4e4fc57a0ea9056b5772bb984439ed81bf 通过代码评审。三个已存在的 Host 读取都减少了重复投影,同一签名源、续跑会话和拒绝条件已对照。旧配对在包内和源检出均有验证。

English verdict: APPROVE | Exact head 2decad4e4fc57a0ea9056b5772bb984439ed81bf. Original capture, action, and session semantics match the base across all 36 comparisons. The isolated Core CLI and historical request checks pass.

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.

1 participant