fix(release): qualify source transfer, Windows writes and CI baselines - #5010
Conversation
…nsfers Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
…er work Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
…ource adapter Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
The native Windows lane fails in `test_atomic_writers_skip_unsupported_windows_directory_fsync[lark-private-json]` because `loopx/extensions/lark/private_json.py` calls `os.fchmod`, which does not exist on Windows. The AttributeError then leaves the mkstemp descriptor open, so the cleanup unlink fails too and masks the original error with `PermissionError: [WinError 32]`. Guard the POSIX-only permission call in the four atomic writers that still used it unguarded (lark private JSON, botmux binding, benchmark native isolation copy, decision-context spool), matching the existing `hasattr(os, "fchmod")` pattern already used by codex_cli, agent_turn_recall, reward_memory and external_connector_runtime. mkstemp/os.open already created each file with the requested mode, so the POSIX behavior is unchanged. The Windows shim in the atomic-writes test now reports `fchmod` as missing the way native Windows does, and the parametrization covers the botmux binding and native isolation writers. Without the guards those two entries fail with `AttributeError: fchmod` on the POSIX lane, and the lark entry reproduces the native CI failure; with the guards all six entries pass. Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
…cles Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
…aries Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> (cherry picked from commit 8fd23f3c452a52a15e12a4625ced7de15075aa1b)
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> (cherry picked from commit 4edce72c529956c43519874b657cdcb9bd174960)
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewed exact head: a4a54aa5cac37a60f1e74ffe9c21b19e64d52b45 against merged main 46280da6e0cf1dd5a044cc26dab7a9d4bf53dbc5.
动机
v1.2.0 候选中的完整 Goal 源在超过通用 Effect RPC 的 2 MiB 上限时,会在现有 authority 准入之前失败;Windows 上四处私有文件写入调用了不存在的 os.fchmod。两份原始修复(#5006、#5008)及其 CI 基线需要在同一提交上验证,才适合作为发布前的完整修复批次。此 PR 没有宣布完成整个 authority 默认切换或版本发布;它让真实的大源链路和 Windows 写入可用,并恢复可信的 CI 负路径。
改动思路
Python 在原有 source projection 适配层写入私有临时请求;只有注册的 source-bearing TypeScript handler 接受精确 schema 的文件传输,校验方法、目录权限、普通文件身份、字节数与 SHA-256 后再调用原业务 handler。结果按同样的身份与摘要读回,现有内联调用继续走原 handler。业务准入、锁、持久 operation receipt 和 provider 晋升仍由原 TypeScript owner 决定;RPC 的通用 2 MiB 上限没有扩大。Windows 修复沿用仓库已有的 hasattr(os, "fchmod") 写法。
具体改动
- 生成的协调合同新增仅用于源传输的 request/result schema 和每方向 16 MiB 上限;
source_transfer.ts只包裹 source projection、shadow 管理与晋升审查等现有入口。 - Python adapter 核对返回文件的 inode、大小和摘要。超限请求在执行前拒绝;执行后响应丢失仍按原 operation receipt 恢复,不偷偷重试。Effect runtime 对断开 socket 的监督避免一个客户端把共享进程带崩。
- 四个私有写入点在 Windows 跳过 POSIX-only
fchmod,POSIX 权限路径保持;Turn 的 cadence 与错误渲染从热文件移到相邻 owner 模块。测试修复包括冻结变异 oracle 真正调用的 Python launcher,并使公开 smoke/fixture 对齐已交付的 CLI 与前端合同。 - 双语 RFC 撤销过时的“剩余 PR 数”估算,区分已实现代码、开放 PR、D1–D3 证据和默认切换。#4978 合入后,生成合同检查及源传输测试已在整合提交上重新运行;浏览器 smoke 的中英文断言也已跟随新的「已验收的团队报告」空状态,避免等待已移除的通用文案。
关键代码讲解
local_authority_shadow_projection.py::source_effect_runtime_result:完整 JSON 写入受限私有目录,返回值必须与请求方法、摘要、文件身份和长度一致,才能交给原 CLI 消费者。source_transfer.ts::withCoordinationSourceTransfer:仅在精确源传输 envelope 上读取私有普通文件并独占预留输出;验证在业务 handler 前完成,避免伪造目录或覆盖文件引发副作用。effect_runtime_handlers.ts::createEffectRuntimeHandlers:只给明确的 source-bearing 方法加传输包装,其他 RPC 和内联协议不变。private_json.py::write_private_json_atomic及同类三处写入:平台特定权限调用有条件执行;文件写入、fsync 和原子替换仍由原 writer 管理。mutants.py:冻结scripts/test-python.mjs和它实际调用的scripts/loopx-python.sh;control 必须成功,mutant 必须由断言杀死,不能把缺失脚本误判为测试发现缺陷。
对主干的风险
最值得防的是“文件传输成功,但使用了错误源”或“业务已提交,却因回包失败而重复执行”。当前负路径覆盖篡改 digest、方法、长度、symlink、非私有目录和占用输出文件;真实合成 Goal 的 CLI 旅程把 160 条完整原始 Todo 带过 bootstrap、写入、inspect、qualify、预览与显式晋升,再读回 161 条。无效 envelope 在业务 handler 前拒绝;执行后的不确定性保留给既有 receipt。新协议名只声称本机源字节传输,不声称新 Agent 生命周期或 authority。
范围偏大(40 文件、876+/253−),但代码落在原 source/Effect/Windows writer owner,额外行数主要是负路径测试、双语 RFC 和必须修复的 CI fixture;没有复制一套 authority 决策。默认 provider、Goal 设置和自动晋升未改变。16 MiB 仍需在内存中解析完整对象,Windows 超时后系统可能暂留临时输出;RFC 明确了边界。独立 PostgreSQL 真服务已在前一产品等价提交的 CI 通过;当前 head 的完整 CI 聚合与发布专用全量测试仍是合并/发布门槛,不能用局部 mock 代替。
我的整体评价
没有发现当前 diff 的阻断性设计或权限问题。聚焦验证已覆盖 79 个 Python、56 个 TypeScript,以及 #4978 整合后的 20 个 Python 用例;类型、lint、生成合同和前一精确提交的 54 个变异对照通过。通用 RPC、现有内联源调用和 Goal authority 默认值保持原语义;大源与 Windows 修复是经过验证的预期变化。当前 head 的浏览器中英文场景通过;风险驱动 premerge 的 19 项选中检查全部通过,末尾只留下仓库策略要求的人工评审。当前 head 的完整 CI 与真实 PostgreSQL 结果仍须满足保护规则;此自审记录不代替 GitHub 要求的独立批准,也不构成 bypass 授权。
English verdict: APPROVE - exact head a4a54aa5cac37a60f1e74ffe9c21b19e64d52b45; complete-source transport and Windows writes are scoped to existing owners, with negative-path and real CLI evidence. The exact-head browser smoke and 19 selected premerge checks pass; merge remains subject to green protected checks and independent branch approval.
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewed exact head: 2eef2b5e6b79a3f598c7a66ba4c9cdff50672e66 against merged main 6d298821e8960ff71d2fac9dcbdffb3deb5ac6d3.
动机
v1.2.0 候选中的完整 Goal 源在超过通用 Effect RPC 的 2 MiB 上限时,会在现有 authority 准入之前失败;Windows 上四处私有文件写入调用了不存在的 os.fchmod。两份原始修复(#5006、#5008)及其 CI 基线需要在同一提交上验证,才适合作为发布前的完整修复批次。此 PR 没有宣布完成整个 authority 默认切换或版本发布;它让真实的大源链路和 Windows 写入可用,并恢复可信的 CI 负路径。
改动思路
Python 在原有 source projection 适配层写入私有临时请求;只有注册的 source-bearing TypeScript handler 接受精确 schema 的文件传输,校验方法、目录权限、普通文件身份、字节数与 SHA-256 后再调用原业务 handler。结果按同样的身份与摘要读回,现有内联调用继续走原 handler。业务准入、锁、持久 operation receipt 和 provider 晋升仍由原 TypeScript owner 决定;RPC 的通用 2 MiB 上限没有扩大。Windows 修复沿用仓库已有的 hasattr(os, "fchmod") 写法。
具体改动
- 生成的协调合同新增仅用于源传输的 request/result schema 和每方向 16 MiB 上限;
source_transfer.ts只包裹 source projection、shadow 管理与晋升审查等现有入口。 - Python adapter 核对返回文件的 inode、大小和摘要。超限请求在执行前拒绝;执行后响应丢失仍按原 operation receipt 恢复,不偷偷重试。Effect runtime 对断开 socket 的监督避免一个客户端把共享进程带崩。
- 四个私有写入点在 Windows 跳过 POSIX-only
fchmod,POSIX 权限路径保持;Turn 的 cadence 与错误渲染从热文件移到相邻 owner 模块。测试修复包括冻结变异 oracle 真正调用的 Python launcher,并使公开 smoke/fixture 对齐已交付的 CLI 与前端合同。 - 双语 RFC 撤销过时的“剩余 PR 数”估算,区分已实现代码、开放 PR、D1–D3 证据和默认切换。#4978 合入后,生成合同检查及源传输测试已在整合提交上重新运行;浏览器 smoke 的中英文断言也已跟随新的「已验收的团队报告」空状态,避免等待已移除的通用文案。
关键代码讲解
local_authority_shadow_projection.py::source_effect_runtime_result:完整 JSON 写入受限私有目录,返回值必须与请求方法、摘要、文件身份和长度一致,才能交给原 CLI 消费者。source_transfer.ts::withCoordinationSourceTransfer:仅在精确源传输 envelope 上读取私有普通文件并独占预留输出;验证在业务 handler 前完成,避免伪造目录或覆盖文件引发副作用。effect_runtime_handlers.ts::createEffectRuntimeHandlers:只给明确的 source-bearing 方法加传输包装,其他 RPC 和内联协议不变。private_json.py::write_private_json_atomic及同类三处写入:平台特定权限调用有条件执行;文件写入、fsync 和原子替换仍由原 writer 管理。mutants.py:冻结scripts/test-python.mjs和它实际调用的scripts/loopx-python.sh;control 必须成功,mutant 必须由断言杀死,不能把缺失脚本误判为测试发现缺陷。
对主干的风险
最值得防的是“文件传输成功,但使用了错误源”或“业务已提交,却因回包失败而重复执行”。当前负路径覆盖篡改 digest、方法、长度、symlink、非私有目录和占用输出文件;真实合成 Goal 的 CLI 旅程把 160 条完整原始 Todo 带过 bootstrap、写入、inspect、qualify、预览与显式晋升,再读回 161 条。无效 envelope 在业务 handler 前拒绝;执行后的不确定性保留给既有 receipt。新协议名只声称本机源字节传输,不声称新 Agent 生命周期或 authority。
范围偏大(40 文件、876+/253−),但代码落在原 source/Effect/Windows writer owner,额外行数主要是负路径测试、双语 RFC 和必须修复的 CI fixture;没有复制一套 authority 决策。默认 provider、Goal 设置和自动晋升未改变。16 MiB 仍需在内存中解析完整对象,Windows 超时后系统可能暂留临时输出;RFC 明确了边界。独立 PostgreSQL 真服务已在前一产品等价提交的 CI 通过;当前 head 的完整 CI 聚合与发布专用全量测试仍是合并/发布门槛,不能用局部 mock 代替。
我的整体评价
没有发现当前 diff 的阻断性设计或权限问题。聚焦验证已覆盖 79 个 Python、56 个 TypeScript,以及 #4978 整合后的 20 个 Python 用例;类型、lint、生成合同和前一精确提交的 54 个变异对照通过。通用 RPC、现有内联源调用和 Goal authority 默认值保持原语义;大源与 Windows 修复是经过验证的预期变化。主干合入前产品等价 head 的浏览器中英文场景通过;合入 #4954 后仓库卫生检查也通过。本 head 的风险驱动 premerge 的 19 项选中检查全部通过,末尾只留下仓库策略要求的人工评审。当前 head 的完整 CI 与真实 PostgreSQL 结果仍须满足保护规则;此自审记录不代替 GitHub 要求的独立批准,也不构成 bypass 授权。
English verdict: APPROVE - exact head 2eef2b5e6b79a3f598c7a66ba4c9cdff50672e66; complete-source transport and Windows writes are scoped to existing owners, with negative-path and real CLI evidence. The browser smoke passed on the product-equivalent parent and all 19 selected premerge checks pass on this head; merge remains subject to green protected checks and independent branch approval.
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Problem and result
The v1.2.0 candidate cannot pass the current public checks: complete Goal source projections can exceed the bounded RPC envelope; Windows private writers call POSIX-only
os.fchmod; and several release smokes/fixtures no longer match the shipped runtime boundaries. This branch combines the original signed heads of #5006 and #5008 with narrow qualification repairs. Complete source operations use a bounded private transfer while keeping typed owner validation; Windows atomic writes stay available; the public checks exercise current behavior.This is a joint release-qualification candidate. The source and Windows fixes retain their original commits and authors. #5006 and #5008 remain open until this exact head passes review and CI; their independent heads are blocked by the coupled baseline failures.
Boundaries
Validation on this head
cqr_9f44809ca05e9ba017efis valid. The first risk-based premerge ran all 19 selected checks: 18 passed and the local install smoke timed out at the default 120-second per-check budget. The same install smoke passed standalone in 239.86 seconds. A complete exact-head premerge rerun with a 360-second per-check budget is in progress; this is a validation hold until it finishes. Independent protected-branch review and green GitHub checks remain merge gates.Review focus
Please inspect the transport boundary (directory ownership, file identity, byte budgets, result readback), mutation ambiguity, default-off/inline parity, Windows private writer semantics, and whether fixture corrections reflect current contracts rather than weakening them. The related refactor reuses the existing Turn CLI boundary; no new authority path is intended.