Skip to content

feat(context): share whole-packet deltas and capture recovery - #7196

Merged
loopx-agent merged 31 commits into
mainfrom
codex/context-subtree-delivery-20261024
Oct 24, 2026
Merged

loopx-agent merged 31 commits into
mainfrom
codex/context-subtree-delivery-20261024

Conversation

@loopx-agent

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

Copy link
Copy Markdown
Collaborator

Repeated full quota and Turn packets consume solver input and cause extra reads after output truncation. This PR shares one TypeScript subtree transport, with immutable full-capture recovery. The experimental transport is disabled by default and now has one --context-delivery {off,on} switch.

本 PR 共享 quota / Turn 的整包子树差分和原捕获恢复,默认关闭。显式开启但跑法不支持、缺失、矛盾或无法确认时会报错;支持场景内基线失效仍自动全量恢复。开启时复用已有宿主与 worker 声明,仅支持当前两条接入;不通过进程名或原生 session 环境猜宿主,不新增准入、问询、预算或执行权限。

Activation and supported scope

Entry Explicit opt-in and existing run declaration
Codex benchmark heartbeat worker context_delivery: "on" in heartbeat kwargs, or EdgeBench/SForge --context-delivery on. Existing Execution.mode must be heartbeat; the worker retains generic_cli and propagates its explicit heartbeat/transport settings to native tools.
Codex App heartbeat, same-session resume and recovery --context-delivery on --codex-app with the existing context/capture locations. --codex-app is the shortcut for --runtime-profile codex_app_heartbeat; its complete explicit host tuple is equivalent.

The switch does not introduce a second runtime-profile selector. With on, missing, incomplete, conflicting or unsupported run-mode declarations are configuration errors: the command exits nonzero with a clear reason before admission or transport writes, including native hooks. Correct the declaration or use off. In a supported run mode, missing or invalid retained-input evidence still automatically recovers the same original full capture. A context directory or host release alone cannot enable reuse. Ambient CODEX_THREAD_ID is not activation evidence. These are caller declarations, not host authentication or retention proof.

off installs no benchmark hooks/trust/traces and performs no native reuse. Default-off configuration is inert; saved full captures remain readable. Bootstrap and selection/reentry preserve the binary setting. Interrupted native guards bind that same setting and reject a changed presentation mode.

For App setup, quota context-config --context-delivery on --codex-app renders the existing native hooks and persistent recovery instructions. It installs nothing and changes no trust. Rollback removes only those generated entries/instructions and their owned diagnostics, preserving unrelated settings. Activation, readback and rollback, benchmark runtime.

Transport behavior

  • One shared typed owner projects whole quota packets and Turn envelopes. Fresh control/authority fields remain inline; exact unchanged registered subtrees can be reused. The wire is selected only when smaller and exactly reconstructable.
  • Native current-input observation must prove complete baseline bytes and exact session/Turn/tool or code-cell binding. A journal, hook event, saved file or successful setup is not that proof. Missing/uncertain/compacted/foreign input keeps full delivery.
  • Capture the immutable original before display or checkpoint release. quota context-project presents that same saved decision; quota context-read pages and verifies its original digest. Neither reruns admission, renews authority or spends quota. Lost/killed hooks retain an independent persistent recovery route.
  • Native hook identity discovery disables unrelated plugin startup only in its temporary discovery process. Solver configuration remains unchanged. The codec avoids discarded deep clones and equal-string encoding without changing emitted bytes.

Validation

Latest source: 6176a290dbc2e6d05bc2ea5089061d4080db1bce.

  • Broad source regression: 274 passed, 340 optional cases skipped. Current focused activation/lifecycle/CLI/heartbeat regression: 139 passed. Invalid on covers missing/incomplete/unsupported declarations across config, hook, saved projection and guard; no guard receipt, spend or native/capture writes. Counts overlap and are not added.
  • Real native Codex with deterministic loopback inference: 41 passed across capture, App/code-mode, worker, warm/resume and compaction/recovery paths. Both App/code-mode and actual benchmark saved-preflight cases passed on the current source again (2 passed), preserving original receipts and full recovery. The earlier 41-case sweep belongs to the preceding source; it is not relabeled as a full exact-head rerun.
  • Final interrupted-cursor switch binding: 9 passed. TypeScript shared codec: 17 passed; typecheck:control-plane passed.
  • Standard premerge: 6 direct + 19 selected checks passed, including bilingual RFC and the full-PR public-boundary scan. The overall quality gate remains non-passing; required mypy is not waived. All 11 current changed publication paths also passed with zero warnings. Native-adapter switch/scenario labels remain local presentation vocabulary and reuse scheduler-owned host types. No new vocabulary was added by this correction; dead unsupported-success output and repeated activation reads were removed at the existing IO boundary.
  • Required Python typecheck remains failed: 5,226 errors. The current run has identical normalized diagnostics to the preceding 5,226-error source (no additions or removals); the earlier source had removed one optional-Path diagnostic from its 5,227-error baseline. This does not waive the required failure; the quality assessment remains non-passing. Earlier broader native primitive sweeps also retain six xfails; they are not relabeled by this focused pass.

Evidence limits and remaining work

Existing generated-worker loopback comparisons measured about 36.17% less input-token proxy with delta versus default-off; trace IO, elapsed time and total resource cost did not establish a net improvement. The separate 31-capture codec comparison reduced projector elapsed time about 12.74% with byte-identical deliveries; it is not another packet/token reduction. These prior measurements are source/workload scoped, not a new measurement of this switch refinement.

Normal installed Codex App activation, Harbor/container adoption, autonomous solver outcomes and complete cost qualification remain open. Transport tests and configuration generation do not certify those journeys. Prior CI/browser failures, negative measurements and qualification limits remain retained. This author proposal grants no merge, install, release, campaign/scorer change or paid-run authority.

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 changed the title feat(context): share subtree delivery and same-capture recovery feat(context): share whole-packet deltas and capture recovery Oct 24, 2026
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>
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>
…kers

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>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent marked this pull request as ready for review October 24, 2026 06:15
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

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

两个已验证的阻塞项:P2 维护性检查新增三项债务;P2 旧字段越过唯一所有者,语义检查失败。下面保留正向验证与证据边界,功能测试通过不能替代原检查。

动机

长程 Agent 在持续读取同一份任务要求时,需要减少重复传输,同时在压缩、截断或恢复后仍能取回完整原文。 原来每次传输完整控制与上下文;现在显式启用的调用者可在确认当前输入完整保留基线后接收更小的差异,丢失时从原始捕获分页恢复。 共享编码器和真实原生调用已证明完整冷读、较小暖差异及同捕获恢复,不重复准入或扣额;当前分支仍被两个仓库原生检查阻塞。 本次不完成已安装 Codex App、自治求解器、跨宿主或净成本验收,不授权运行试验、安装、发布或合并。 阶段一的宿主最终分发边界、已安装产品、自治恢复后的有效工作与匹配完整成本仍未验收;确定性模型提供者证明传输能力,不证明模型遵从。

改动思路

应保留共享类型层编码器与提供者 IO 的分工,但 Core 反向导入 CLI 以及两个新超预算决策函数必须在当前分支内局部收敛。 当前 PR 可独立交付显式启用的上下文传输与恢复原语;修复层间依赖和旧字段所有权后再评审,原有阶段一与净收益验收继续保持开放。 原始准入只生成一次完整结果与不可变捕获,类型层负责精确差异和同捕获还原,Python 只观察提供者的私有输入/生命周期并分页读取。它观察的是产生当前活跃工具调用的模型输入,不能证明未来分发前的输入边界;保存的候选、文件或一次 hook 成功也不是保留证明。这里采用文字说明,未把来源流程图当成执行证据。

具体改动

发布前发现 head 更新,旧评审未发表;已重新读取全部39文件范围、18个新增差异路径与作者当前说明。新增 quota context-config 由 CLI 与 worker 复用同一个原生配置生成器;--codex-context-root 以 native session 的摘要隔离私有子目录,只读恢复不创建未知会话目录。bootstrap 保留根/捕获选项,仍绑定当前唤醒的 LOOPX_TURN;配置生成不安装、不赋予 hook 信任、不替代宿主输入诊断。

先验规范:docs/architecture/rfcs/agent-loop-effect-interpreter-v0.md,修订 e3fa61956b6e374b4475162039b7bf9f4282be01。exact-source-and-control 在已测传输范围实现:完整要求、来源事实、未知字段、数组顺序/重复项、空值与精确同目标重建受到保护。original-effects-and-authority 实现为同一捕获的只读恢复,不额外准入或扣额。host-final-input-boundary 与 matched-total-cost-and-both-consumers 仍 deferred:该 PR 新增的架构精化是待评审方案,不能反过来作为此前最终分发保证、已安装 App、自治求解器或收益已经达成的独立来源。

关键代码讲解

  • freshPaths / shared codec:控制事实强制进入差异树,结构复用按确切基线重建;坏基线、超深链、身份不符或更昂贵差异自动选择全文。未知根字段不因名字猜测而复用。
  • project_codex_context:私有锁保护捕获和恢复引用;候选只有在当前真实输入包含完整原文时才可复用。但这里从 Core 导入 CLI,违反现有层间约束。
  • codex_context_in_active_input:区分实际模型可见页面与未转发子工具结果,核验工具/代码单元、字节范围、原文摘要及已结束调用;当前函数 89 个决策点,超出现有 60 限制。
  • quota context-read 在原 CLI 下提供完整摘要绑定的 UTF-8 分页,拒绝坏偏移、替换或最终符号链接;EOF 仅是文件末尾,不能证明模型已经消费或允许复用。现有准入、权限与结算所有者不变。

对主干的风险

P2:修复新增反向依赖和决策函数债务

codex_context.py:254 引入 Core → CLI 依赖;同模块第194行还导入 CLI 的读取指导。原样执行维护性检查,基线通过且未评审债务为 0,当前 head 新增三项:这条层边、handle_quota_command 的 122 个语句、65 个决策点超过 90,以及输入观察器的 89 个决策点超过 60。将共用捕获 IO/指导放在更低层或从现有适配器注入,并在当前两个函数边界局部分解;保持完整原生恢复测试,不应通过提高限制掩盖问题。

P2:旧字段必须继续经过既有唯一所有者

context_delivery.ts:140 把 heartbeat_recommendation 复制到新模块,现有语义检查实际报“2 个 TS 模块,预算 1”。独立核对不可变源码:此前只有 turn_envelope.ts,现在多了 context_delivery.ts。通过既有投影所有者导出确切处理,或在这里让该旧根字段保持 fresh,保留冷/暖语义。不要绕过字符串检查或扩大预算。基线全量语义检查另有旧 registry-IO 分类失败,我保留该失败,没有把基线整体写成通过;上述 1→2 的新增字段扩散已独立确认。

语义与 CI 对齐

复跑命令为 python examples/control_plane/control-plane-maintainability-ratchet-smoke.py --format json 和 python examples/semantic-vocabulary-drift-smoke.py。两者属于当前源代码义务,失败继续阻塞;当前质量收据 cqr_19179f350ba6a8ab5cde 正确记录 fail。标准预合并实际执行 6 项直接检查均通过,19 项选择检查中 17 通过、上述 2 项失败;39 文件公开边界扫描干净。另有 benchmark-sensitive 维护者门,不产生本 Agent 的合并权限。未查询或等待远端 CI。

正向证据是当前 head 的 216 个 Python、33 个类型层及类型检查通过;新增的两个真实原生共享配置案例也通过。它们在实际 code-mode / SQLite / loopback Responses 路径上执行配置生成与动态 guard,对 quota 和 Turn 分别验证跨进程恢复、整 hook 丢失后的完整同捕获读回、两次原始 guard 捕获、原状态不变和零扣额。当前初次 367 个 skip 包括 42 个原生与 325 个可选依赖案例;随后只启用上述 2 个,其余 40 个未在新 head 启用重跑。旧 head 9c5ed65dca2a920860e7bd3be07fae5a89b1cc47 的 20 个 exec/app-server/worker/code-mode 原生案例全部通过,作为历史证据保留,未冒充当前 20 个通过。

作者当前说明还保留了一次原生串行分页到达30秒 fixture 截止的失败,改为现有默认页大小和有限批次后自报12例复跑通过;我没有把这段作者结果、四臂序列化 token 代理比较或两项 wheel 安装测试当作本人独立验证,也不将一次后续绿色运行当作全部间歇性已消除。

我的整体评价

REQUEST_CHANGES,交付判断为 justified_increment,但当前需要 simplify_now;两个源代码阻塞必须先修。long_horizon 与 user_experience 在已测原路径上保留,没有新增用户确认或重复准入。只有完整原文等同才省略标题,正文与停机条件仍在。对新恢复顺序的指导和完整读取要求进行了逐条核对;模型是否遵循该指导及净收益保持未知。完整 ordinary CLI 的独立基线/head 关闭态矩阵也未完成,因此不宣称所有共享表面均已证明 default-off 等价。

Inspected CLI, heartbeat and benchmark transport changes; no rendered frontend source/layout changes. Packaged or installed App adoption is not established by these fixtures. 阶段一的宿主最终分发边界、已安装产品、自治恢复后的有效工作与匹配完整成本仍未验收;确定性模型提供者证明传输能力,不证明模型遵从。 本次代码量不以行数直接否决,现有 ratchet 指出的局部结构问题才是当前修复依据。保留全文回退和原始 receipt,修复依赖/函数与旧字段所有权后,针对不变原检查及真实恢复路径重新评审。所有结论绑定 956626d3333a7f702013511dcb9bd2b8cdf454d1;没有合并、安装或试验执行。

English verdict: REQUEST_CHANGES at 956626d3333a7f702013511dcb9bd2b8cdf454d1. The required maintainability check regresses from a passing base to three new debts, and the semantic ratchet rejects the new second owner of heartbeat_recommendation. Functional/native transport tests pass, but do not waive those failures or establish final-dispatch, installed-host, autonomous-recovery or net-cost qualification.

Comment thread loopx/control_plane/turn_driver/codex_context.py Outdated
Comment thread loopx/control_plane/quota/context_delivery.ts Outdated
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 | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

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

动机

长程 Agent 在反复读取相同任务要求、原生会话恢复或压缩时,需要减少重复传输并保留完整原文。 此前完整包重复投递;现在显式启用的调用者在当前输入含完整基线时接收差异,丢失后从原捕获恢复,并可与既有 checkpoint 持有/释放组合。 本次真实原生组合验证通过,原始捕获、准入和扣额语义保留;但两个必需源码检查仍失败,当前不能批准。 本次不资格化已安装 App、自治求解器、跨宿主或完整成本收益,也不授予试验、安装、发布或合并权限。 宿主最终分发、已安装消费、自治恢复后的有效工作及匹配完整成本仍开放;本次的确定性 provider 只证明传输。

改动思路

共享 typed codec 和原 checkpoint owner 的组合有实际消费者,但 Core→CLI 反向依赖及两个超预算函数需要在本分支局部收敛。 当前边界是显式启用的传输、原捕获恢复与 checkpoint 组合;先修复两项源码门禁,原最终分发、安装采用和净收益验收继续开放。 原 guard 只生成一次不可变完整捕获;checkpoint 先持有、核验和释放它,之后 native 或普通 host 只有一个投影所有者。共享 TypeScript codec 负责精确差异,Python 负责原生文件和输入观察。失败、无保留证明或中断仍走原失败/全量路径,不把 saved file、session ID、hook 成功当作模型已经保留全文。

与不改动相比,这一组合避免放弃已有 checkpoint;与另造快照/账户/runner 相比,它复用现有 owner。其价值是可独立验证的传输增量,不能以包体或 token 代理下降替代最终有用成果。流程采用文字说明;没有把来源示意图当成执行证据。

具体改动

本次完整43文件范围、远端/本地所有补丁内容均核对。相对上次9566评审,27个路径的完整 blob 未变,16个变化路径全部重读,包括 worker/checkpoint 组合、context 路由校验及续跑 fixture。没有继承上次结论。

规范先于实现读取:docs/architecture/rfcs/agent-loop-effect-interpreter-v0.md,固定修订 e3fa61956b6e374b4475162039b7bf9f4282be01。exact-source-and-control 在已测原路径实现,保护完整要求、控制事实、未知字段、数组顺序/重复与空值。original-effects-and-authority 在同捕获恢复及 handoff 中实现,不额外准入或扣额。host-final-input-boundary 和 matched-total-cost-and-both-consumers 继续 deferred:最终分发、已安装 App/自治求解器和匹配完整成本仍是原验收缺口;本 PR 新改的架构段落是被评审的提案,不能反过来证明这些旧要求已经实现。

关键代码讲解

  • _emit_quota_result 在原始 handoff 释放之后投影;显式 native 分支阻止再套一层普通 host 差异,即使 native 观察失败也保留原包。
  • project_codex_context 绑定私有 session/capture 与当前输入的完整字节证明;这里仍从 Core 导入 CLI,是下面的阻塞之一。
  • codex_context_in_active_input 检查实际活跃工具输入、code-mode 输出转发与完整页覆盖。它证明产生当前工具调用的输入,不能认证尚未分发的未来模型输入。
  • _verify_interrupted_guard 现在连同 Goal/Agent/Turn、capture、socket 一起校验 context 目录/root。换路由不能冒充被持有的原 guard。worker 在后续 wake 读取最新 guard,并先经原 CLI 结算前次独立验证的读回。

原有 context-config、动态 bootstrap、共享 root 的 session 隔离、UTF-8 原捕获分页、Explore/hook 来源与完整 fallback 仍是本 PR 的组成部分。配置生成不安装、不赋予 hook 信任;开关仅对新显式 trial 生效,未改变冻结 trial、scorer、预算或 operator 安装。

对主干的风险

P2:仍需修复反向依赖与两个超预算函数

不可变基线的同一维护性检查通过,0项未评审债务;当前 8991f7accd93364e0aa22490a18e64d377fcd078 仍新增3项:Core→CLI 的 capture 导入;handle_quota_command 122条语句/65个决策点;输入观察器89个决策点。现有限制为90条语句/60个决策点。共享 capture IO/指导应放到较低层或注入现有适配器,两函数沿现有职责局部分解。不要提高限制或扩大例外来掩盖失败。已有行内讨论仍对应当前代码,无需再制造同一内容的重复 thread。

P2:旧字段仍越过唯一所有者

context_delivery.ts:140 仍将 heartbeat_recommendation 放入第二个 TS 模块。原样语义检查实际报2个模块、预算1;基线只有既有 turn_envelope.ts。通过原 owner 处理,或让这个旧根字段保持 fresh,保留精确冷/暖重建;不要隐藏字符串或放宽预算。基线全量语义扫描另有旧 registry-IO 分类失败,不能写成全量基线绿色;1→2扩散有独立源码证据。

语义与 CI 对齐

当前标准 premerge 的6项直接检查通过、19项选中检查17过,上述2项失败;精确质量收据 cqr_7b2bc58d3145bfbe65ac 为 fail。复跑:python examples/control_plane/control-plane-maintainability-ratchet-smoke.py --format json、python examples/semantic-vocabulary-drift-smoke.py。公开边界扫描43个路径干净。未查询、轮询或等待远端 CI。

正向验证为当前270项 Python、33项 TypeScript、类型检查通过;另在真实 Codex 0.163.0-alpha.11.1、隔离 SQLite 和确定性 loopback provider 上执行4项 context/handoff 组合及8项真实 worker 中途捕获案例,均通过。2项外部 controller 情况明确 skipped。初始400项 skip 含未启用的 native 和可选 Harbor/SForge;不将它们记成通过。当前原生用例覆盖 quota/Turn、持有释放、无 native 证明、完整 hook 丢失与 compaction 恢复、原始字节不变、前次合法结算及后续新 wake;它们不启动实际 benchmark 作业。

旧9c5e的20项与9566的2项 native 保留其原修订;作者报告的序列化 token 比较、wheel 资格及一次30秒 fixture 超时/后续复跑仍保留为作者证据,不冒充本人当前独立资格,也不宣称间歇性已全面消除。

我的整体评价

REQUEST_CHANGES,交付判断仍是 justified_increment,当前架构决定为 simplify_now。共享 typed codec 和原 checkpoint owner 的组合有实际消费者,但 Core→CLI 反向依赖及两个超预算函数需要在本分支局部收敛。 当前边界是显式启用的传输、原捕获恢复与 checkpoint 组合;先修复两项源码门禁,原最终分发、安装采用和净收益验收继续开放。 full/delta、原 handoff 和恢复指导逐条区分了范围、顺序、证据和停止;没有新的机器授权或 read ACK。

已检查 CLI、heartbeat、benchmark 传输及完整43文件差异,没有渲染页面、控件或布局变更。 未验证范围:宿主最终分发、已安装消费、自治恢复后的有效工作及匹配完整成本仍开放;本次的确定性 provider 只证明传输。 全 ordinary CLI 的独立基线/head 关闭态矩阵尚未完成,因此不宣称所有默认共享表面均已资格化。历史失败与未知保留;批准、安装、合并和净收益均未被推导。

English verdict: REQUEST_CHANGES at 8991f7accd93364e0aa22490a18e64d377fcd078. Current native checkpoint/context composition passes, but the unchanged required ratchets still reject three new maintainability debts and a second legacy-field owner. Repair those bounded ownership/factoring issues; final-dispatch, installed-host, autonomous adoption and complete-cost qualification 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>

@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

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

动机

长程 Agent 在反复读取相同任务要求、原生会话恢复或压缩时,需要减少重复传输并保留完整原文。 此前宿主先完整读取已捕获决定;现在显式启用的原生工具可从同一捕获选择全量或已验证差异,失败仍读原包,不再次准入。 两项真实原生保存包读取通过,完整原文、恢复和原结算边界保留;三个维护债务和旧字段扩散仍使必需源码检查失败。 本次不资格化已安装 App、自治求解器、跨宿主或完整成本收益,也不授予试验、安装、发布或合并权限。 最终分发、已安装 App、自治 solver 成果与匹配完整成本仍未资格化;本次原生测试使用确定性 loopback provider。

改动思路

保存包投影复用原 typed owner 且有真实 worker 调用,但 Core→CLI 依赖与两个超预算函数仍须在当前分支局部修复。 本 PR 的当前边界是显式启用的完整传输与原包恢复;先修复源码门禁,安装采用、自治成果和完整成本继续沿原验收。 原 guard 和 checkpoint owner 保存、核验并释放完整决定;新增工具只改变同一决定的呈现。共享 TypeScript codec 负责完整子树和差异重建,Python 读取原生输入与物理文件,不接管语义。若没有完整保留证明,回到全量;若来源错误,则拒绝,不靠重新 guard 生成另一份“恢复”包。

与不改动相比,这个新增实际 caller 解决宿主过早全读的问题;与新建快照账本或 read ACK 相比,它复用原 capture 和 projector。该传输增量有独立用途,但增加一次工具调用和缓存 IO,其成本须进入完整比较。当前仍要求修复具体源码债务,不以测试数量或代理 token 下降抵消架构门禁。

具体改动

完整45文件及远端/本地 base-to-head 补丁一致;相对8991,35个路径 blob 未变,10个变化路径完整重读。测试执行于 abf599;随后仅两份 RFC 增加匹配诊断报告,全部生产、测试、依赖和构建 blob 与本次 08449d43cac5573f2c9ecdf02cf4856d88a38896 相同,并重跑最终 head 的标准 premerge。

先验规范为 docs/architecture/rfcs/agent-loop-effect-interpreter-v0.md,固定修订 e3fa61956b6e374b4475162039b7bf9f4282be01。exact-source-and-control 在已测完整传输/重建实现;original-effects-and-authority 在同捕获恢复、原 guard 与结算保留中实现。host-final-input-boundary 和 matched-total-cost-and-both-consumers 继续 deferred:最终分发、已安装用户、自治求解结果及完整匹配成本仍开放。当前 RFC 增补是被评审的提案与作者报告,不能反过来充当先验验收。

关键代码讲解

  • project_saved_context_capture 先复用物理文件、完整 SHA256 和 JSON 校验,再绑定原 Goal/Agent/Turn;在没有 registry 的情况下也可读取。合法私有 cache 和原生上下文可用时调用已有 projector;cache/原生状态不确定就返回原包全文引用,错误来源则不发布命令。
  • preflight_context_instruction 固定原 CLI、原文件、摘要及 Turn,生成投影与原包回退两条命令;要求读完每页并重建后再工作,明确不续期原授权或新鲜度。关闭开关仍使用旧全量预读说明。
  • capture_before_replan 仍先执行一次原 guard 并保存其完整 stdout,再在明确 context 开关和目录存在时延迟呈现。实际 resumed worker 测试在下一 wake 前结算前次独立读回,不拿旧历史代替新 guard。
  • project_codex_context 与实际输入 observer、typed full/delta codec 继续共享恢复语义;这里仍反向导入 CLI capture 模块,是未解决的源码债务。

原 context-config、session 隔离、动态 bootstrap、UTF8 分页、完整 hook 丢失恢复、checkpoint release 与 benchmark 可选传输均仍在整份 PR 范围内。配置生成不安装、不赋予 hook 信任;没有修改实际 benchmark、冻结 trial、scorer 或用户配置。

对主干的风险

P2:三个维护债务与旧字段扩散仍未修复

当前必需维护性扫描仍报 Core→CLI capture 依赖、handle_quota_command 126条语句/67个决策点、输入 observer 89个决策点;现有限制是90条语句/60个决策点。实际不可变基线 worktree 跟踪3610个 Python 文件,扫描通过且0项未评审债务。请沿现有职责下移/注入共享 capture IO 和指导、局部拆分两个函数,不提高限额或增加豁免。

context_delivery.ts:140 仍把 heartbeat_recommendation 扩散到第二个 TS 模块,原预算为1;原 owner 是 turn_envelope.ts。通过原 owner 处理或保持该旧根字段 fresh,并重验精确重建。既有两条 inline 仍对应当前代码,不重复制造相同讨论。

语义与 CI 对齐

最终 head 标准 premerge:6项直接检查通过,19项选中检查17过,维护性和语义检查仍失败;质量收据 cqr_54f95795692c32ba9f3e 为 fail。复跑 python examples/control_plane/control-plane-maintainability-ratchet-smoke.py --format json 与 python examples/semantic-vocabulary-drift-smoke.py。完整45路径公开边界扫描干净。未查询、轮询或等待远端 CI。

当前独立验证281项 Python、33项 TypeScript、类型检查通过;另两项真实 Codex 0.163.0-alpha.11.1/隔离 SQLite/确定性 loopback 的 app-server 与实际 checkpoint worker 用例通过,逐字重建暖包、保留原捕获并核验零额外 guard/扣额。初始402个 skip 含可选 native、Harbor/SForge,只将随后明确执行的2项记为当前原生通过。旧8991的12项 native 是历史记录,未冒充本次全矩阵。

证据更正:此前源码归档目录中的维护性“通过”会因缺少 Git 跟踪清单而漏扫,撤回其作为基线判据。本次改用实际 clean worktree,核验 root、不可变 commit 和完整跟踪清单;原始失败记录保留,当前检查结果重新建立。原基线全量语义的旧 registry-IO 失败仍保留,未声称全量基线绿色。

作者新增两种不同负载的 native 成本报告:真实捕获回放与合成 worker preflight,后者报告35.83%序列化输入估算下降、冷启动约增加11%、耗时区间重叠。它们没有被作为本人独立成本资格;两侧均开诊断,不证明相对无诊断的追踪成本、自主成果、精确账单或普遍延迟改善。

我的整体评价

REQUEST_CHANGES;交付判断为 justified_increment,当前架构决定为 simplify_now。保存包投影复用原 typed owner 且有真实 worker 调用,但 Core→CLI 依赖与两个超预算函数仍须在当前分支局部修复。 本 PR 的当前边界是显式启用的完整传输与原包恢复;先修复源码门禁,安装采用、自治成果和完整成本继续沿原验收。 长程效果与用户体验在已测传输范围保留,但全 ordinary CLI 关闭态矩阵、安装采用与完整成本仍不作已证实声明。协议继续表示投影/恢复,没有新的 peer 生命周期或执行授权;机器义务仍归原契约,恢复文字不是 read ACK。

已检查完整45文件及 CLI、heartbeat、benchmark 读取路径,没有渲染页面、控件或布局变更。 未验证范围:最终分发、已安装 App、自治 solver 成果与匹配完整成本仍未资格化;本次原生测试使用确定性 loopback provider。 本次没有合并、安装、付费模型或真实 benchmark 作业权限扩张。

English verdict: REQUEST_CHANGES at 08449d43cac5573f2c9ecdf02cf4856d88a38896. The saved-capture CLI and two real native consumers preserve exact source and original accounting; all production/test/build blobs match the tested abf599 revision. Three maintainability debts and the second legacy-field owner still fail unchanged required gates. Repair those bounded issues; keep final-dispatch, installed/autonomous adoption and total-cost claims 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>

@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)

动机

长程 Agent 在重复读取任务要求、原生会话恢复或压缩后,需要取得完整当前输入并继续已授权工作。 此前宿主先全读保存包;现在显式启用的原生工具在当前输入确实含完整基线时读取较小差异,失去证明则读同一原包,不能再次准入或扣额。 当前真实 Codex 的 App-server 与 checkpoint worker 均完成冷包、暖差异及原文重建,原始捕获保持不变;独立配置查询不启动推理、不改变 solver 配置或信任无关 hook。 本次不资格化已安装 App、自治 solver 成果、宿主最终分发保证或匹配完整成本收益,不授权安装、付费试验、发布或合并。 最终分发、已安装 App 真实采用、自治恢复后的有效成果及匹配完整成本仍是原阶段一验收缺口。

不改动会保留重复传输和宿主过早全读,丢失上下文后又可能回到不可靠的摘要。单纯缩短正文、把保存文件当已送达或新增 read ACK 都无法满足原要求;当前实现保留完整来源,并把优化放在已有实际消费者上。这里批准的是有用的传输增量,未将代理 token 比较当作最终成果。

改动思路

当前共享 capture IO 已回到既有 Core owner,CLI 分派和输入观察器按真实职责拆分,旧字段绑定归原 adapter;修复了此前具体层间与函数债务,没有新增例外或平行决定 owner。 本 PR 的可评审边界是显式启用的完整传输、差异复用与同捕获恢复及实际 checkpoint 组合;原阶段一和净收益验收继续保持开放。 完整 guard 仍先生成不可变捕获,checkpoint 负责持有、核验和释放;之后由一个 TypeScript codec 呈现 full/delta,Python 只处理物理文件、原生输入和生命周期 IO。当前身份、准入、claim/lease、取消、结算与 scheduler 事实保持 fresh;未知字段不能由 request JSON 自行声明可复用。

与新增快照/runner/权威存储相比,复用原 capture、typed owner 和原 writer 更容易撤销与审查。失去 hook、输入截断、会话变化或证明不足时回到同捕获完整读取;来源错误则拒绝,不靠再次 guard 制造另一份“恢复”输入。临时 native hook 查询只关闭该查询进程的插件启动,不改真实 solver 的配置、默认行为或无关 hook 信任。

具体改动

完整差异为 46 个文件 +4948/-129。相对上次 08449d43cac5573f2c9ecdf02cf4856d88a38896,32 个当前路径 blob 完全未变;14 个变化路径已重读,包括 Core capture 提取、CLI 分派/事件顺序、native observer 分解、旧字段绑定、配置查询和成对 RFC 报告。旧路径证据按原修订保留,当前新增验证覆盖重构的真实消费者,没有继承旧批准。所有远端文件名与本地完整差异清单相同;commit-patch 历史另行保留。发布前发现新 head 后,停止旧头发表并读取新精确包。新 c535 相对实测 48b6 仅四个文件 +52/-6:codec、其测试和成对 RFC;完整新增差异逐条核对。

先验规范为 docs/architecture/rfcs/agent-loop-effect-interpreter-v0.md,spec_revision e3fa61956b6e374b4475162039b7bf9f4282be01。exact-source-and-control 在已测完整重建与 fresh controls 上实现;original-effects-and-authority 在同捕获、一次 guard 和原结算中实现。host-final-input-boundary、matched-total-cost-and-both-consumers 继续 deferred,理由是最终分发、安装版、自治有效工作和完整成本尚未资格化。当前修改的 RFC 精化及作者成本报告属于被评审内容,不能反过来充当先验验收证明。

关键代码讲解

  • project_captured_context:118 与读取指导移回既有 Core capture owner;明确 native observation 只能收窄保留声明,错误或可选 codec 不可用返回原完整 payload。Core 不再反向导入 CLI。

  • handle_quota_command:596 在 authority IO 前分派 context 工具。事件提取仍依次记录 rollout、附结算读回、处理可选 memory ingest;189 项相关结算/传输回归通过,原顺序没有由拆函数变成新策略。

  • codex_context_in_active_input:120 保留 manifest、当前未结束调用、code-mode 父子关系、实际模型可见输出及完整字节页覆盖校验,只将解析、绑定和页核验沿职责拆开。它证明发出当前工具调用的输入,不能证明尚未发出的下一次模型请求。

  • evaluateTurnEnvelope:1001 从原 legacy adapter 取得自己的字段绑定,并传给编码与恢复两侧;调用方 JSON 的同名属性不能扩大复用范围。原 heartbeat_recommendation TS owner 仍为唯一模块,未知控制仍 fresh。

  • prepare_context_delivery:40 仅在临时 hooks/list 进程关闭三个插件功能,以原生哈希识别自有 hook;新真实原生用例重复查询并读回实际配置,确认零推理请求和 solver 配置字节不变。

  • changeTree:243 延迟复制到真正选中的 replacement;尺寸比较只读取对象。equal 只在两个完全相同的 string 上短路,其余值继续原类型敏感规范化。独立 40 组旧/新 owner 对照包含重排、插入、删除、空值、类型差异及长 Unicode 文本,full/delta/recovery 输出逐字节相同,消费重建结果不修改两份原始 capture。

对主干的风险

此前三个维护性债务及旧字段扩散已通过未放宽的原检查:当前真实 clean Git root 和完整 tracked Python 清单上 ratchet 为 0 项未审债务;语义扫描通过、旧 TS 字段为 1/1。最终标准 premerge 的 6 项直接检查和全部 19 项选中检查通过,整体仍为 manual_review_required,保留 benchmark 维护者门。首次未安装本 worktree 的 npm 开发依赖时类型检查缺 tsc、标准语义检查失败,准备仓库规定依赖后同源码重跑通过;原始失败保留,未解释成产品修复。

新 c535 实际重跑 98 项相关 Python、17 项 codec TypeScript 和 3 项真实 Codex App-server/worker/配置查询用例,全部通过;另 3 项初始 native skip 与随后显式启用的真实用例分别保留。当前标准 premerge 的 6 项直接和 19 项选中检查也重跑通过,整体仍为 benchmark manual_review_required。独立 40 组旧/新 codec 输出与重建/值隔离对照通过。当前原生版本为 0.163.0-alpha.11.1,隔离 SQLite 与确定性 loopback,不启动真实 benchmark 作业、付费模型或用户安装。

此前在 48b6 实测的 273 项 Python、189 项结算/传输回归、16 项 TS 和类型检查、12 组关闭态对照及 3 项原生用例保留原修订,不冒称全量在 c535 重跑。四文件差异没有 Python、配置、CLI、宿主或结算源码变化;新 codec 变化由当前正负用例、40 组输出对照和真实消费者覆盖。原 104 项 optional/native/platform skip 仍为历史 skipped,不概括为全平台通过。

48b6 的关闭态另做 12 组同一 canonical fixture 对照:File/SQLite × 普通/缺能力/待选择 × 完整 quota/Turn。每组从同一字节快照恢复,CLI 参数和状态相同;完整响应中只有实际观察时钟、由此生成的签名/压缩 scheduler facts/字节诊断变化,解码全部压缩事实后仅 generated_at 不同。无语义字段、准入、义务、用户指导、scheduler 策略、native journal 或扣额变化。该代表矩阵不是“所有可能参数均已证明”的声明;冷态精确去重仅删除完全相同的 title,完整任务正文和停止条件保留。

语义与 CI 对齐

必需失败没有改成绿色:test_bound_replan_reaches_actual_host_with_original_evidence 的 File/SQLite 两例在 48b6 与不可变 base 7c48375df5aa4824c8d6fba0baef1f96de6cc87e 均得到相同 blocked 路由,完整失败文本仅规范化 pytest 临时序号/对象地址/耗时后完全相同,签名见独立原记录;测试与 host_candidate 的 blob 未变。mypy 在 base/head 分别为 5228/5227 个错误,完整 normalized error-detail multiset 没有新增项,只移除一个 generic dict 错误;全局文档 note 的首次显示路径变化单独保留。这些失败继续 failed,新精确 scope 质量收据 cqr_18cd81c417b7bdc348d4 为 fail;Python 错误和 host-route 失败沿用 48b6 原实测,所有相关源码和配置至 c535 未变,本次未重跑它们,合并资格仍 hold。代码评审依据已归因的旧失败与独立当前不变量覆盖分开判断,不要求本 PR 重写不相关错误。

历史原生超时、旧模型输入/成本报告及未执行范围按原来源保留;本轮三个当前 native 用例只资格选中的 app-server/worker/配置查询,不把一次通过称为所有间歇性消失。新增成对 RFC 的 codec 性能报告声称 31 份 capture、四组交叉进程对照、每进程 12 次测量,347.30→303.06 ms(12.74%);我仅独立验证语义/值隔离与实际消费者,没有复测该性能收益。报告明确排除启动、CLI/backend、宿主、模型及完整 Turn 成本。此前三臂成本报告明确 native trace 每双唤醒约 5.77 MB、CPU/IO/延迟及精确计费未知,我未独立重复该成本实验,也不把作者报告当净收益。未查询、轮询或等待远端 CI。

我的整体评价

APPROVE,交付判断为 justified_increment;当前共享 capture IO 已回到既有 Core owner,CLI 分派和输入观察器按真实职责拆分,旧字段绑定归原 adapter;修复了此前具体层间与函数债务,没有新增例外或平行决定 owner。 本 PR 的可评审边界是显式启用的完整传输、差异复用与同捕获恢复及实际 checkpoint 组合;原阶段一和净收益验收继续保持开放。 long_horizon 与 user_experience 在已测 transport 路径上 preserved:完整来源、一次准入/结算及自动原包恢复保留,没有增加 owner 问题或手动确认。配置存在、session ID、磁盘文件和一次 hook 成功均不被当作已送达或新权限。剩余最终分发、安装采用、自治成果和净成本由原消费者/实验 owner 继续资格,不以此新增泛化用户前置。

检查了 CLI、heartbeat、benchmark、恢复指导和完整 46 文件范围,没有渲染前端或布局变更。未验证范围:已安装 App 的真实使用、最终模型分发、自治 solver 成果及完整成本收益。新传输 vocabulary 是本地 presentation/lifecycle IO;既有业务状态与结算仍归原 typed owner。修复旧源码 blocker 后的批准不解除 CQR 必需失败、benchmark 维护者门或合并权限。结论仅绑定 c5353ed19d73f78654faa7583242370dc41bb065。

English verdict: APPROVE — c5353ed19d73f78654faa7583242370dc41bb065. Current Core capture ownership,factoring and legacy binding resolve the previous source blockers without relaxing ratchets. At c535, 98 Python, 17 TS, 3 real native cases, 40 byte/detachment pairs and 6 direct/19 selected checks pass. Prior 48b6 broad, settlement and disabled evidence stays source-bound; unchanged Python failures were not rerun. Two host-fixture failures match immutable base; mypy adds no error. Both remain failed in CQR,with separate merge holds. Final-dispatch,installed/autonomous adoption and complete-cost benefit remain unqualified.

… switch

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 merged commit c68f63b into main Oct 24, 2026
32 of 45 checks passed
@loopx-agent
loopx-agent deleted the codex/context-subtree-delivery-20261024 branch October 24, 2026 12:32
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