Repository navigation
feat(runtime): establish persistent collaborator execution contracts - #964
Conversation
|
Current head 6389643 has completed all PR checks passing, including static checks, runtime, services, turn-core, CLI, online integration, terminal, and PTY lanes. The longest observed lanes are online integration 17m1s, online core-services 13m30s, dev-tty-reader macOS 13m26s, and default-reader macOS 13m9s.\n\nThe PR remains Draft intentionally: native delivery still has no production TUI/CLI installation caller, so this is a shared-contract foundation rather than a complete end-to-end collaborator journey. No full live-provider harness or 1,000 parked-parent claim is made. |
153c7f6 to
4688214
Compare
|
CI follow-up (0faa8bf):
Validation: targeted online subrun 1/1, CI contract tests 12/12, stack bootstrap contract, |
XuPeng-SH
left a comment
There was a problem hiding this comment.
审查结论:建议 Request changes,当前不宜合并。
审查基准:0faa8bfee383076c77e1b0f86b01f4e6c76d6c87。提交前核对 PR head 未变化。本轮未使用 subagent。由于提交身份就是 PR 作者,本次使用 COMMENT review;这不表示批准。
设计方向总体合理:复用 child-run、invocation ledger、Edge journal、mailbox、workspace observation 和进程 owner,比另建协作执行框架更合适。阶段推进同时检查 run 终态与未决 dispatch,也保留了必要的恢复边界。但不同适配器没有一致落实共同契约,且部分测试仍会给出错误的通过信号。
本轮确认的五项问题已附行内评论:
- P1:权限上限未完整执行。 Claude 的 allowedTools 不是白名单,既有用户许可可突破只读意图;OpenCode 没有消费 workspace write/network/read-only ceiling。通用 sandbox_command 无法补足隔离。
- P2:OpenCode 批准后仍不可执行。 运行时 read_paths 获批后未投影到本次调用的本地策略,普通受限项目配置仍被 validate_runtime_grant 拒绝。
- P2:首次发现失败后不能随普通后续 turn 恢复。 外部登录/网络恢复不会改变 executable snapshot,现有 supervisor 会继续等待显式 refresh。
- P2:stale-capability 测试仍可无回执通过。 Close/EOF/error 与收到 ToolResult 共用成功同步路径;PR 声称已解决的这项问题尚未闭环。
- P2:拒绝委派后的父工具 harness 被改弱。 查询移到失败前后,无法再证明失败后工具仍可调用。可以保留前置目录查询,但需恢复失败后的实际调用验证。
设计和工程质量还需要收敛:
- 运行时审批、授权投影和失败分类在三个适配器间重复实现,已经出现第 1、2 项行为分叉。共同检查应收敛到现有执行入口,适配器保留协议转换;不需要再建通用生命周期框架。
- Claude 用
contains("token"/"model"/"quota"…)分类错误,再设置会撤下共享能力的标志,属于生产控制决策,不只是展示文本。应按协议定义的错误类型决策,未知文本不能推导鉴权/模型失效。代码。 - PR 的范围说明仍称仅首个 Codex adapter、不声称生产 Claude/OpenCode;实际代码已自动发现并发布三种能力。Claude/OpenCode 发现只执行
--version,不能证明协议和认证就绪。应使发布范围与已证明的契约、验证范围一致。自动发布入口。 - 性能风险:阶段归属反查通过
JSON_EXTRACT(payload_json, '$.receipt.run_id')过滤会话历史事件,没有直接按目标 run 定位。需要核查历史增长后的查询成本及事务锁持有时间,尽量沿用可按 run 定位的既有事实。此项是静态风险,没有压测证据证明已经发生性能退化。查询。
对既有评论及“已修复”声明的核对:
| 声明 | 源码核对结果 |
|---|---|
| refresh 等待旧 owner;settlement 观察 shutdown | 已有对应处理 |
| Codex discovery 避免隐式 OAuth | 已有对应处理及协议 fixture |
| provider 不可用时仍恢复 receipt | 存在独立恢复分支 |
| 比较完整 PATH 候选快照 | 已实现 |
| stale-capability 测试必须收到匹配结果 | 未解决,见行内评论 |
| 最新 CI 评论中的 fixture、固定镜像、启动重试 | 最新提交有对应修改;未独立执行验证 |
审查时公开记录只有两条状态评论,没有行内 review thread。旧评论中 Draft / 无生产调用者的说明已经过时;最新 CI 评论中的通过结果是作者报告,不能当成本轮独立执行结果。
验证限制:当前没有可用 executor,本轮未运行 Rust 测试、数据库集成测试或真实 harness。完成的是源码调用链、公开评论、官方权限语义核对。作者报告的 Codex 两阶段 harness 可以支持部分 session/terminal/usage/cleanup 链路,不能覆盖上述授权、恢复和失败后继续工作的问题;OpenCode 使用 permissive 策略、只返回文本的 live 测试也不能证明只读隔离。
| "--permission-mode".into(), | ||
| if read_only { | ||
| "dontAsk".into() | ||
| } else { | ||
| "acceptEdits".into() | ||
| }, | ||
| "--allowedTools".into(), | ||
| allowed_tools.into(), |
There was a problem hiding this comment.
[P1] 将不可扩大的执行授权落实到原生适配器
只读阶段使用 dontAsk 和 --allowedTools Read,Glob,Grep,但 --allowedTools 是预批准列表,不是可用工具白名单;dontAsk 仍执行用户配置中已允许的操作。因此已有 Bash/Edit allow 规则可以突破这里期望的只读边界,网络和敏感路径限制也没有完整投影。sandbox_command 只设置 cwd、过滤环境,并不提供文件/网络隔离。官方语义:permissions、CLI reference。
同类缺口也存在于 OpenCode:启动 opencode acp 时没有消费 workspace_write_allowed、network_allowed 或本地只读状态。应在现有执行入口统一检查 grant,并要求每个适配器证明能够落实;不能依赖 provider 的用户配置或默认权限。验证必须包括预先允许 Bash/Edit 的用户配置、只读写文件、禁止网络和敏感路径访问。
| if native_codex::validate_runtime_grant( | ||
| &ceiling.runtime_read_paths, | ||
| &requirements, | ||
| policy.as_ref(), |
There was a problem hiding this comment.
[P2] 将获批的运行时依赖应用到本次调用的策略副本
上面的 runtime_approval 只验证 protocol/requirements/workspace,没有像 Codex/Claude 那样把批准的 read_paths 加入调用级策略副本。这里的 validate_runtime_grant 随后要求每个路径都通过 policy.is_path_allowed。默认 SandboxPolicy::for_project 不允许项目外可执行文件和 /usr 等依赖,因此用户 AllowOnce 后仍在 dispatch 前收到 runtime grant 错误。
复用已有调用级投影,不要写成全局持久授权。当前 OpenCode live 测试使用 permissive 策略,无法发现此问题;需要从普通项目策略和实际审批入口验证批准后的执行。
| if handle.executable_changed() { | ||
| // A PATH/launcher change is an explicit capability invalidation, | ||
| // not a reason to create a second owner. The current owner drains | ||
| // admitted work; its supervisor coalesces this request and probes | ||
| // the current environment before advertising again. | ||
| handle.request_refresh_if_environment_changed(); |
There was a problem hiding this comment.
[P2] 允许首次不可用的能力在后续用户 turn 重新发现
首次发现因未登录或临时网络问题失败、且没有待恢复 journal 时,supervisor 在 1416–1440 行等待 refresh。这里重用同一会话 handle,只在可执行文件快照变化时请求 refresh。因此用户随后完成外部登录或恢复网络,只要 PATH/二进制不变,普通 TUI 输入不会重新探测;目前只能手动刷新 Agent Monitor 或重建会话。这不符合 PR 描述承诺的后续 turn 恢复。
应由现有 supervisor 在后续 turn 对不可用状态执行有界重新探测,保留合并请求和退避。回归应保持可执行文件快照不变,仅改变认证/可用性,并经真实 turn 入口验证。
| Some(Ok(frame)) if frame.is_close() => break, | ||
| Some(Ok(_)) => {} | ||
| Some(Err(_)) | None => break, | ||
| } | ||
| } | ||
| let _ = result_tx.send(()); |
There was a problem hiding this comment.
[P2] 没有收到 ToolResult 时必须让 stale-capability 回归失败
Close、EOF、WebSocket 错误会和成功接收 ToolResult 一样跳出循环,随后仍执行 result_tx.send(())。所以实现如果撤下容量并断开连接、完全没有返回拒绝回执,此测试仍可能通过;循环内的 identity/is_error/metadata 断言根本不会执行。
只在收到且校验匹配 ToolResult 后发送成功同步信号,其他退出方式必须失败。这是 PR 正文声称已经解决的旧问题,但当前 head 仍未闭环。
| equals: chat | ||
| - type: execution_tool_sequence | ||
| tools: [agent, model_catalog] | ||
| tools: [model_catalog, agent] |
There was a problem hiding this comment.
[P2] 恢复委派失败后父工具仍可调用的验证
该改动把顺序从 [agent, model_catalog] 变为 [model_catalog, agent],prompt 也只要求失败后复用已有目录结果。即使委派失败后父工具已全部失效,用例仍可能通过;它不再验证名称和描述承诺的恢复能力。
如果模型选择需要前置 catalog,可以保留,但必须在 agent 拒绝后再要求并验证一次真实父工具调用。不要把前置查询成功当成失败后可继续工作的证据。
|
Validation update for 1c52259:
The live HTTP/socket tests cannot bind sockets in this local sandbox (EPERM); they are not reported as passed here. Fresh GitHub Actions checks are now running for this commit. |
1c52259 to
aad9658
Compare
|
Validation update for
The previous red checks were attached to the superseded |
Verification update —
|
|
Pushed a940653, merging latest main and fixing the native workspace self-deadlock. Delivery no longer acquires a second non-reentrant lease; the executor owns acquisition through settlement and revalidates policy, executable identity, cancellation and admission deadline after queueing. No new database state or retry fallback. Regression coverage now drives the authenticated production WebSocket/CLI entrypoint, including contention, cancellation, expiry, permission revocation and executable replacement; the production-supervisor test is wired into CI. Merged candidate: delivery 20/20; Codex protocol 49 passed, 1 live test intentionally ignored; formatting and diff checks passed. gpt-6.1-sol/xhigh reviewed both the repair and merge integration: ACCEPT. Prior ordinary-subagent harness results did not cover this native delivery boundary and must not be treated as equivalent evidence. Fresh same-revision CLI/Server live journey validation is still in progress, not yet claimed passed. |
|
Live journey follow-up: NOT accepted yet. Fresh clean a940653 CLI and isolated Server ran the natural-language Codex Luna request. The lease self-deadlock no longer occurred, but the advertised native model catalog was unavailable, the parent omitted the requested model, and the native stage failed after about 30 seconds; the parent disclosed a local Git fallback while root JSON still reported success=true. This is a failed requested-provider journey, regardless of process exit status. A direct installed Codex model/list probe does return gpt-6-luna. Reviewing the shared discovery/process lifetime and whole-stage versus command budget owners now; no model-specific fallback will be added. Regression and CI evidence from the prior comment remains scoped to the repaired lease boundary, not end-to-end delivery. |
|
Follow-up 5f09f75 repairs the native sparse-filesystem bootstrap and preserves native reasoning labels alongside canonical controls. No model-name/task matching, extra DB I/O, permission bypass, or fallback state machine was added. Permission projection removes ancestor-covered runtime-directory duplicates while retaining writable workspace literal denies and logical-alias sensitive masks. Reviewed with gpt-6.1-sol/xhigh; a cwd-deny regression raised in review was fixed and re-reviewed ACCEPT. Validation: native protocol suite 51/51 including both opt-in tests; real gpt-6-luna read of an undisclosed file token and second-stage recall in the same acknowledged native session passed (~10.2s / 6.2s, cached input ~59.5% / 65.5%); runtime directory projection test passed; CLI all-target Clippy and formatting passed. Earlier failed live samples are retained: a root successful exit with native failure/local substitution was NOT counted as fulfillment. Clean-commit CLI+Server build and full parent-to-native-to-final delivery rerun are still in progress; adapter success is not a claim that the full journey is closed. |
|
Clean-commit full journey now PASSED for 5f09f75: isolated Server health reports matching clean SHA with DB/Memoria connected; freshly built CLI+Server hashes recorded locally. Natural parent request selected native Codex gpt-6-luna/xhigh (confirmed by native turn_context), launched the native child, consumed its result, and returned the correct latest-commit hash/title/summary. Parent used only agent tools: 3 model rounds, 2 tool calls, inclusive input 37,603 / fresh 3,555 / cache-read 34,048 (~90.5%), output 598. The native child really executed Git: first command hit an ordinary denied system-config read, then recovered within the same readonly sandbox and returned the requested facts. No parent Bash replacement and no product Git-specific rule were used. This is focused end-to-end evidence, not a claim of 1000-session/load or all-interaction coverage. Earlier failed trials remain failures, rather than being relabeled passes. |
5f09f75 to
acb0c9b
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
结论:Request changes。审查 head:acb0c9bcd00a6a0d86ee26354d70b2beb524f6cb,base:2873a950f2c9fea00343757933e96070d1631596。当前连接身份是 PR 作者,因此使用 COMMENT 提交明确结论,不能对自己的 PR 提交 REQUEST_CHANGES。遵照要求,本轮没有开启 subagent。
确认了 3 项需要修复的问题,已附行内评论:
- P1 Codex 对工作目录根的敏感路径校验不完整,可以使 native profile 超过共享 never-readable 策略。
- P2 native 的 32 KiB 输入限制扩散到普通内部模型的 user-intent 提交与 durable poll。
- P2 admission 和 mailbox 消费校验的输入 envelope 不一致,上限附近的已接纳指导无法到达 active native turn。
设计判断:稳定 collaborator association 与每次 child run 分离是合理的;执行仍由既有 RunEngine、invocation ledger、Edge journal、mailbox 和进程所有者负责。前次 run terminal 后仍检查 prepared/dispatched/outcome_unknown,重放 receipt 不作为新执行授权,这些边界值得保留。原生协议翻译是必要分支;不应把其字节上限反向施加给所有 run,也不应另写一个比共享规则更窄的敏感路径判定。上述后两类边界错误,正说明“复用所有者”还需要落实到验证的对象和调用位置。
工程收敛仍不完整:生产 discovery 只发布 Codex,但 Claude/OpenCode 的模块、执行分支和专属测试仍在。本轮两个文件合计新增 1,967 行(按末尾 cfg(test) 模块边界分为测试前 1,546 行、测试区域 421 行,包含注释/空行)。这不是已交付的生产能力,不应当作复用收益;建议移出本 PR,并清理仅服务于这些未启用适配器的接线。共有的 provider contract 可以保留。该维护意见与以上三个可达缺陷区分,不把未启用适配器的旧漏洞重复当成当前 Codex 漏洞。
旧评论逐项核对:
| 旧问题 | 当前 head 的判断 |
|---|---|
| Claude/OpenCode 权限上限 | 生产发现限定为 Codex,控制了当前暴露范围;不代表两个适配器已经完成生产权限证明。 |
| OpenCode AllowOnce 未应用 runtime reads | 已补 invocation-local policy copy 的 read_paths;代码层面修正。该适配器仍未启用。 |
| 首次不可用后普通 turn 不重试 discovery | ensure_session_native_delivery 对 unavailable handle 请求有界 refresh,已修正。 |
| stale-capability 测试 EOF/Close 也成功 | 未收到匹配 ToolResult 的 Close/EOF/错误现在 panic,已修正。 |
| 委派拒绝后父工具未真正重试 | 已要求并校验 catalog → agent → catalog、最后成功且跨 settled 边界,已修正。 |
GitHub 上这五个旧线程仍显示 unresolved;没有把“线程状态”当作代码是否修复的证据。
测试与真实性判断:新增真实数据库事务/回滚测试、生产 supervisor 入口回归、断言 ToolResult 的失败路径,比只测构造器有价值。另一方面,compact-native-masks 回归只证明旧/新 glob 等价,不证明其等价于共享权限策略;公共 poll 的新大小测试反而把不必要的全局限制写死。应按上述可观察边界补回归,不通过改提示或放宽断言通过。
性能方面,stage→association 查询已删除历史 JSON payload fallback,改走 subject_run_id 索引,方向正确;输入通路仍有重复构造/序列化,且产生了实际不一致。复用 journal/process owner、限制帧和队列、保持 unknown fence 是合理代价;全 stage 工作区串行化、长时间运行和大量会话的吞吐不能由现有短 harness 推断。94 个 mask / 11,527 JSON 字节也不是 workload A/B 性能结论。
验证证据与限制:
- 读取了本 head 的 GitHub Actions 日志:CLI shared job 为 4,804 passed / 17 skipped,两个显式启用的 production-supervisor 回归各 1 passed。这些用受控 provider fixture 验证入口,不等同于真实模型质量。
- online core-services 为 459 passed / 1,823 skipped,包括 14 个 collaborator-stage DB 用例及原子 ACK-loss 恢复覆盖。
- Test Suite 当前 failure,失败 shard 是 online integration。该日志工具连续返回
Transport closed;没有证据将失败归因于 flaky/环境,也没有重跑或等待 CI。Static Checks 成功不能替代 Test Suite。 - 作者报告的 25.29s 公共 CLI→新 Server→Codex→终态→Introspect 旅程、两阶段原生会话和 OS 权限探针有参考价值,但本轮没有独立重跑;最新 guard 的验证与较早 live binary 也不能混为一谈。
- 选定 executor 仍处于 failed,错误是
failed to query executor configuration capabilities for environment ccarenv_b64_Y2NhcmVudl8yYTVmYjM5MzY4MWM4MTkxYWJiZmY2NGFiMjk0MTU2Mw。本轮以 GitHub 源码、base 对照、CI 日志和独立的 JSON/UTF-8 字节核算审查;没有本地编译、Rust 回归或真实 harness 执行声明。 - 全量 PR diff 超过 GitHub 20,000 行上限;已按文件和 blob 读取关键生产链路。部分 Files API 记录还缺失 patch,不能把 API 总表或 CI 通过冒充逐行完整覆盖。PR 元数据总量为 +30,272 / -2,077;本轮未作不可靠的全仓实现/测试净增减拆分,也没有修改代码。
| if cwd == "/" || astra_sandbox::is_sensitive_system_dir(std::path::Path::new(cwd)) { | ||
| return Err("native workspace boundary is not readable by policy"); | ||
| } | ||
| filesystem.insert(cwd.into(), json!(if write { "write" } else { "read" })); |
There was a problem hiding this comment.
[P1] 在授予 cwd 权限前使用完整的 never-readable 校验
这里仅调用 is_sensitive_system_dir(cwd),但共享的 is_never_readable_path 还禁止完整路径包含 .env、credentials.json 等敏感片段。例如从 /workspace/.env-secrets 启动 CLI 时,这个检查返回 false,随后直接给予该 cwd read/write;513–524 行生成的 deny 规则只匹配 cwd 下面的敏感名字,不能覆盖 cwd 本身已有的 .env。因此 /workspace/.env-secrets/plain.txt 被共享策略禁止,却在 native profile 中获得读取权限。
生产路径 ensure_session_native_delivery → ToolExecutor::new → execute_native_codex 没有对 cwd 调用完整的 never-readable 校验;validate_runtime_grant 只检查 runtime read_paths,sandbox_command 只设置 cwd/环境,也不会补上此限制。请由共享敏感路径判定拒绝不可读的 canonical cwd,再生成 profile,保持与普通工具相同的权限上限。补充敏感片段位于根目录或其祖先的回归,断言 canonical policy 的结果;目前 compact-mask 测试只比较旧/新 glob,无法证明二者符合 canonical policy。
此结论来自生产调用链和权限投影源码;本轮执行环境不可用,未宣称完成真实 OS 复现。
| let intent_id = input.intent_id.trim().to_string(); | ||
| if input.delivery == astra_turn_types::UserIntentDelivery::GuideCurrentRun { | ||
| let content = crate::turn::run_control::user_intent_content(&input.input) | ||
| .expect("actionable user intent was checked above"); | ||
| let provider_input = astra_turn_types::ProviderStageInput::Text { | ||
| input_id: intent_id.clone(), | ||
| content, | ||
| correlation_id: None, | ||
| expected_turn_id: None, | ||
| }; | ||
| if provider_input.validate().is_err() { |
There was a problem hiding this comment.
[P2] 将 provider 的 32 KiB 限制留在 native 路由边界
这段验证发生在 require_durable_run_for_user 和 native_collaborator_target 之前,对所有 GuideCurrentRun 请求应用 ProviderStageInput 的 32 KiB 序列化上限。普通内部模型也因此改变行为:例如 11,000 个汉字仍低于既有 MAX_USER_INTENT_CHARS = 20_000,但现在会收到 HTTP 413,尽管该 run 完全不走 provider 输入协议。run/engine.rs:4334–4349 又对公共 durable poll 重复实施同一限制,将这类事件视为 invalid input 并推进 cursor。
应先确定现有执行职责归属,仅在 native 输入转换/接纳时校验其 wire budget;普通 run 保持自身的用户消息契约。请通过实际 user-intent 提交入口覆盖普通内部 run 的 Unicode 长指导,以及 native run 的独立大小边界。不要用共同 poll 测试把适配器约束固化为所有执行路径的限制。
| content: content.clone(), | ||
| correlation_id: message.correlation_id.clone(), | ||
| expected_turn_id: None, | ||
| }; | ||
| input.validate().ok().map(|()| ProviderStageMessage { |
There was a problem hiding this comment.
[P2] 提交指导时校验最终的 provider envelope,避免已接收消息被静默停放
HTTP admission 在 18842 行构造 ProviderStageInput 时使用 correlation_id: None,但发送 mailbox 消息时在 19027 行补上 with_correlation(intent_id);这里复制该字段后再次执行同一个 serialized-byte 校验。两次校验的对象不同,存在提交成功、消费失败的窗口。
具体边界:intent_id = "intent-boundary",content 为 "界".repeat(10_903) + "xx"。它只有 10,905 字符,符合 20,000 字符限制;不含 correlation 的 envelope 是 32,768 UTF-8 字节,加入 correlation 后为 32,803 字节。前者通过 admission 并持久化,后者在这里返回 None;execute_native_stage 的 23609–23615 行把它当成不支持的非文本协议消息执行 lease.defer(true),所以 active native turn 没有收到用户已获接纳的指导。
请复用一个完整输入构造/校验入口,在 durable acceptance 之前验证实际要交付的字段;消费侧也应区分非法文本和非文本协议,不能把非法文本无声停放。回归应经过 submit → mailbox → provider ACK,覆盖序列化预算附近的 Unicode/转义内容并检查最终 applied/returned 状态。上述字节数已按源码字段用 JS 核算;未冒充 Rust/真实 provider 测试。
Latest corrective update —
|
|
Fixed the remaining runtime CI failure in The test skipped provider adoption between two waits. An unread completed-sibling result therefore correctly returned Validation: the complete CI-equivalent runtime inventory passed 5,937/5,937 across 60 binaries, with 173 opt-in tests skipped, in 117.616 seconds. Affected four-package all-target Clippy with The preceding remote run passed all checks except this test, including online integration, CLI, terminal lanes and lint. New-head remote CI will be pending after this update; it is not represented as passed. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
结论:Request changes,当前不建议合并。
审查 head:083303075ea0131a8b0a6ca94b976926e8b46e3c,base main:2873a950f2c9fea00343757933e96070d1631596。本轮直接审查源码、调用链、当前 GitHub 评论和 CI,没有开 subagent,也没有将历史外部模型 ACCEPT 当作本轮评审结论。当前认证身份是 PR 作者,因此提交 COMMENT review;COMMENT 不表示批准。
确认的问题
- P1:同一 user intent 的 HTTP 重试会再次向 native stage 投递指导。 Run store 已返回 Duplicate,调用层仍无条件创建新的随机 mailbox message ID 并发送;native adapter 的 clientUserMessageId 是关联字段,不是已完成输入的去重实现。普通丢响应/重试即可重复 turn/steer;applied 的数据库幂等发生在实际发送之后,不能防止重复指导。
- P1:默认 TUI 旅程仍将完整 native stage 限制在 300 秒。 正常 turn 没有 execution_time_budget;缺少 whole-stage deadline 时,transport 的普通工具默认值变成 Edge 的实际取消/杀进程期限,连审批、排队和回答问题也消耗这段时间。显式长预算路径已经改善,但不能据此宣称默认旅程支持几小时/一天的工作。新增测试直接断言 300,固定了实现选择,没有验证用户的长任务契约。
- P2:跨节点的 text-only 能力缺失会留下无法回答的 question obligation。 限制只保存在本地 registry;远端 directory 能解析地址,但发送端得到 None 后允许结构化 question 并登记回复约束。native 消费端只 defer 非文本消息;native stage 结束后没有再运行普通 agent loop,所以子任务完成并不能生成原 question ID 的回答。父任务可能一直等到预算/取消。
三个问题都有行内评论,包含触发条件、责任归属及验收建议。它们不是模型随机性,也不应通过任务文本特判、增加兜底状态或另一套消息账本修复。
设计合理性
基本抽象值得保留,不必整套推倒,但交付语义尚未闭合。 稳定 collaborator association 与每次 child Run 分离是合理的;RunEngine/现有 invocation ledger 拥有执行事实,Edge journal 拥有物理调用回执,mailbox 拥有消息,进程 owner 拥有清理,Codex adapter 翻译协议。这比另外造 background-agent 生命周期更好。
关键差距是事实在职责边界处丢失或被重新推导:Duplicate 被重新生成消息,远端地址丢失能力限制,无工作截止时间被替换成普通工具截止时间。应修正已有 owner 的契约,不继续叠加入口分支。保持 unknown 不冒充 success、只读 ceiling、租户/代次/物理工作区 fencing 和取消后的权威 settlement;不能为了收敛测试削弱它们。
性能另有需要验证的静态风险:interaction_superseding_intent_tx 每次从原始 dispatch control_epoch 开始、按 64 条串行读取完整 guidance payload,且在既有 Run 事务内运行。N 条指导需要约 floor(N/64)+1 次查询,并在注册、等待和答复等边界重复扫描。LIMIT 64 只约束单次分配,不约束整体数据库工作量和锁持有时间。应沿已有不可变事件和查询投影降低重复扫描;本轮没有压测,不把它说成已经实测的性能退化。stage→association 的 subject_run_id 索引替代 JSON 历史扫描则是正向改进。
最新 comment 对账
核对了当前全部 8 条行内意见:
- Claude/OpenCode 权限与 runtime reads 两项:适配器及相关执行面已退役删除,不再保留未证明的生产能力。
- 首次不可用后重试:ensure_session_native_delivery 已在普通后续 turn 对 unavailable owner 请求 refresh;但本轮没有找到保持 PATH 不变、只改变认证/可用性、经真实 turn 完成重新发现的完整回归。
- stale-capability 假通过:Close/EOF/error 现在失败,只有匹配且校验 ToolResult 后才成功同步。
- 委派拒绝后的父工具验证:已恢复 catalog → agent → catalog、last_ok 和 require_settled,而非用前置查询代替恢复证据。
- 敏感 cwd:已使用共享 never-readable 判定,覆盖根、祖先和 canonical symlink。
- 普通 run 被 native 32 KiB 限制误伤:限制已收回 native target 边界;公共 Unicode 提交/poll 测试保留普通契约。
- 最终 envelope 不一致:admission 和消费共享完整构造入口,相关边界测试已经经过实际 submit 和 mailbox;但尚未完整覆盖该意见要求的 submit → native dispatcher → provider ACK → applied/returned。
因此可说旧意见都有对应源码处理,不能说全部验收已闭环。GitHub 的 8 个线程仍为 unresolved;线程状态与代码是否修复分别判断。
工程与测试增量
全 PR 是 127 文件,+30,189 / −2,277,净增 27,912 物理行。按 Rust 测试文件/目录和内嵌 cfg(test) 模块边界粗分(不是 AST 精确统计):实现约 +14.2k,测试约 +13.5k,文档 +147,其他 +64。不能只展示最后一批净删,也不能因为接近一半是测试就免于复杂度审查。
部分 Edge main→lib 是职责移动,不是净删收益,也不能误称全新的执行引擎。真实进程 owner、取消、权限、数据库竞争测试有价值,不能按行数机械删除。应压缩重复 fixture,把同一 owner 的不变量集中验证,入口留真实参数/身份/预算传递验证。
目前最关键的测试断点:public_native_question_and_guidance_preserve_answer_authority_on_matrixone 在收到 mailbox 后手工构造 ACK,再直接调用 mark_user_intents_applied,并未驱动实际 execute_native_stage 的输入 pump。它能证明一部分数据库权威,不能证明物理去重和完整指导交付。单 router 的 question 测试也不能证明跨节点一致性;短 live 两阶段样本不能证明默认长任务超时行为。应增加少量完整职责链反例,而不是继续叠更多只测各自 helper 的测试。
验证范围
本次读到当前 head 的 39 个 checks:38 success、1 neutral,无 pending;已运行 git diff --check,通过。本轮没有重跑 Rust 测试、真实模型 harness、真实跨节点旅程或长任务压力测试,不把既有 CI/作者报告写成本轮独立通过。当前 CI 绿色与以上设计/正确性问题可以同时成立。
| @@ -18486,6 +18986,50 @@ impl RunLifecycleService for AgenticRunLifecycleService { | |||
| } | |||
| } | |||
| } | |||
| if let Some(target) = native_target { | |||
There was a problem hiding this comment.
[P1] 重复提交不能重新生成一条 native 指导消息
同一 intent_id 的首次提交成功、HTTP 响应丢失、客户端重试,是正常 unhappy path。admit_run_guidance 返回 Duplicate 时仅将 publish_live 设为 false;这里仍创建 AgentMessage::new(随机 UUID)并 send。因此同一个 durable intent 会得到两条不同 message_id,mailbox 的 ACK-only 去重无法识别它们。execute_native_stage 先 deliver_provider_stage_input,再 mark_user_intents_applied,所以后者的幂等不能防止第二次实际 turn/steer。native_codex 将 intent_id 放进 clientUserMessageId,但本地 Codex turn_input/input_queue 源码只是保留关联字段并 extend pending input,没有该字段的重复接纳保护;本 PR 的 adapter 也没有 conclusive ACK 后的去重。
应由已有 durable intent/mailbox owner 保持一个逻辑投递身份,重试对账已有接纳/投递事实。仅加 if !duplicate 仍会丢失“已提交但尚未发布 mailbox”的恢复窗口,不是完整修复。补回归:经过实际 submit→mailbox→native pump,丢首个 HTTP 响应再重试,断言仅一次 steer;同时覆盖提交后发布失败再恢复,以及 run terminal 后对账重复请求。
| plan.timeout_secs = timeout_secs_from_policy(binding).unwrap_or(Self::DEFAULT_TIMEOUT_SECS); | ||
| // A collaborator stage contains many commands. The command ceiling | ||
| // must not become its whole-stage lifetime when no run cutoff exists. | ||
| if !plan.requires_live_provider_interaction { |
There was a problem hiding this comment.
[P1] native stage 的默认 300 秒仍是整个任务的硬截止时间
这里避免了把 command policy cap 直接当成整个 stage 的预算,但未提供 work_deadline 时仍保留 DEFAULT_TIMEOUT_SECS=300。正常 TUI turn_stream_runner 传 execution_time_budget: None;RuntimeToolExecutor 也不会生成 whole-stage authority。Edge edge_execution_deadline(None,None) 用 timeout_secs 得到 300 秒,随后该 deadline 会取消 invocation、结束 native process,并同时限制 runtime approval、workspace 排队和用户答复。它不是只让一次 wait 返回。
所以默认请求中的健康长任务或超过五分钟的用户提问会被终止,与几小时/一天子任务的产品目标不符。显式长预算的路径正确,不能代替默认旅程;tool_transport/tests.rs:980 直接断言 300,只固定了当前 fallback。工作截止、单命令上限、运输/观察等待须由已有预算 owner 分清;不要简单换成另一个更大的魔数。通过真实预算/Edge 执行入口及虚拟时间验证:无显式短预算时健康 stage 能跨过普通工具 timeout,显式 work cutoff 和取消仍准时回收。
| /// `None` means the target was resolved by a remote transport without a | ||
| /// local capability record; callers must retain the transport's existing | ||
| /// behavior in that case. | ||
| pub async fn target_accepts_structured_requests(&self, target: &MessageTarget) -> Option<bool> { |
There was a problem hiding this comment.
[P2] text-only 能力不能在跨节点解析后变成允许 question
这里只查本地 address_registry。生产 DatabaseTransport::resolve_agent 可以从共享 agent_mailbox_directory 解析另一节点的地址,但该目录没有这份能力,返回 None。agent_tool.rs:804–808 仅 Some(false) 拒绝,因此允许发送结构化 question,并 reserve 回复约束。另一节点的 native stage 对非 Text 在 lifecycle/mod.rs:23627–23633 只 defer;执行分支在 :26169 结束 native stage 后并不运行普通 agent loop。最终没有按原 request_id 回答,子任务完成也不会解除该 obligation,父任务可能持续等待直至预算/取消。
请让能力事实跟随现有注册/目录解析职责,或由接收边界返回可由既有问答 owner 消费的确定拒绝;不要把未知能力当兼容性放行、也不要无限停放无法消费的请求。回归用两个 router/共享 transport 或真实跨节点入口:发送端没有接收者本地记录,native target 仍不得留下不能闭合的 question;普通内部 agent 的问答能力不能被一起削弱。
0833030 to
e49ece8
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
结论:Request changes,继续保持 draft。 本轮发现 2 个 P2,均为当前生产调用链中的失败路径缺口;CI 绿色不能关闭它们。
审查提交:bc81b2d57bd80e907457cad8f652e9133ca31fe6,base:2873a950f2c9fea00343757933e96070d1631596。提交前已再次核对 head。按本轮要求未使用 subagent;没有将 PR 正文中的 GPT-6.1-Sol/xhigh 历史评审当成本轮独立结论。当前 GitHub 身份是 PR 作者,因此提交 COMMENT review;这不表示批准。
确认的问题
- 会话绑定 INSERT 的 SQL 错误经共享 helper 转成 String,再进入
CollaboratorStoreError::Persistence,不在新增的可保留结果的分类中。物理执行及 invocation receipt 已完成后,短暂 INSERT 失败仍会从 native stage 返回 ToolBinding 错误,跳过正常结果、终态投影和取消判定。这不是只有“测试没覆盖”的担忧,而是明确的错误传播链。 - mailbox 指导的
may_have_reached_provider=true错误只关闭输入通道,没有设置guidance_disposition_unconfirmed。该分支正常返回,外层不会补记,durable user-intent pending 集合也不拥有这条 mailbox 消息,导致终态和 Trace/Explain 丢失交付未知事实。两个行内意见包含具体路径及回归要求。
设计判断
稳定 collaborator association 与每次 child Run 分开,继续复用 RunEngine、invocation ledger、Edge journal、mailbox 和物理进程 owner,方向合理。恢复与首次绑定合用一个事务 owner;恢复只记录旧 receipt,不续租、不清取消、不启动任务,这比新增后台 repair 状态机合理。将 conclusive rejection 放进现有输入 disposition owner,以及把 usage uncertainty 与执行健康分开,也都有明确收益。read-only native work 允许观察并发写入的 live workspace 是清楚的产品取舍,不能解释成快照隔离。
最近的修订确实删除了不支持的 Claude/OpenCode 执行面及无消费者的持久关联形式,普通 internal child 仍沿原路径运行;没有理由为了抽象统一再加一层执行框架。此次发现的 INSERT 问题恰好说明:最需要收敛的是已有 owner 之间的类型和事实传递,不是再加 fallback。修复应保留 SQL 错误类型,不能靠匹配错误文案或把所有 String 错误都视为可忽略持久化失败。
本轮检查的核心执行/选择路径未发现任务名或模型名特判。通用目录/委派提示可以解释正确协议,但“父代理不重复读取”的效率目标仍未达成;增加提示及字符串断言不能代替实际父子旅程验收。正文现在明确记录 Flash/GLM 仍会重复读取,这是正确的限制披露,不是已完成的性能修复。
旧评论对账与工程成本
当前 11 个行内线程仍为 unresolved。源码层面均已有针对性处理:退役两个未证明的 adapter;后续 turn refresh;stale-capability EOF/Close/error 必须失败;恢复拒绝后父工具调用;共享 never-readable 根目录判定;native 大小限制收回路由边界;统一最终 envelope;HTTP 只写 durable source;可选 whole-task deadline;跨节点目录携带 structured-request 能力,并拒绝未知能力。指导测试现在调用真实 pump,已经优于上轮的手工 apply。这里没有机械重复旧 finding,也没有代作者关闭线程;源码处理不等于每项完整旅程验收均已完成。
性能上的旧疑问仍存在:interaction_superseding_intent_tx 从原 dispatch epoch 分页读取并解析完整指导 payload,在交互注册、wait 和 resolve 的既有事务内重复扫描。全为有效 guidance 时每次约 floor(N/64)+1 次查询;64 只约束单页,不约束累计 I/O 或锁持有时间。这是可从源码确认的工作量问题,本轮没有压测,不能声称已测得延迟退化。不要因此新造可写状态;先沿现有不可变事件和查询投影收敛。只读 association snapshot、批量读取 association facts、共享 idle watcher 则是有依据的改进。
全分支当前是 149 文件,+35,553 / −2,919,净增 32,634。文档是 +248/−2;独立测试文件/用例目录至少 +10,049/−200,尚不包含大量内嵌测试。未完成全分支 AST 分项,不能把余数冒充“实现”净增;文件移动和测试增量都不能当作质量收益。当前 head 的最后一笔 +43/−10 确实仅修改测试:补 settlement fixture 并增加 otherwise-valid missing/false settlement 反例,没有放宽生产校验。
QA 与验证边界
- 已读取当前 head 对应的远端 CI 日志,实际 checkout 是合并结果
a30c8b107f890b3c40c6583f0c0abbe41c594252。截至最后一次查询 Test Suite 与 Static Checks 均 success;未等待、重跑或触发 CI。 - online services:463 passed、1823 skipped,包含 18 个 collaborator DB cases;online runtime:87 passed、5642 skipped,包含真实 DB 的 question → rejected A → accepted B → 原问题仍可回答。跳过项不是通过。
- store restart/租约换代/错误 predecessor、descriptor、grant hash、settlement 反例有价值;但它们没有经过
execute_native_stage的实际绑定 INSERT 失败传播。当前 pump DB 测试也不覆盖 native stage 的 mailbox unknown 分支。建议补少量完整入口故障注入,断言原结果/取消状态、指导不重发及持久化终态,而非继续堆各自 helper 的 is_ok 测试。 - PR 正文的 installed-Codex 5/5、TSan 240 等是作者提供的证据,本轮没有独立重跑。其中真实客户端、模拟 HTTP/WS peer、真实 Server/DB、完整父代理/TUI 是不同边界;5/5 不能推出全父代理旅程、千会话或日级 soak 合格。完整 association persistence 和 Returned commit-ACK-loss 故障注入仍未完成。
- 所选环境启动检查数分钟未返回可用结果,停止等待后仍无 executor 工具;没有切换环境。本轮完成了 GitHub 固定 revision 的源码、调用链、评论及日志审查,没有执行本地 Rust/DB/live harness,也未运行 git diff --check。检查了可取得的 144 个文件 patch 的新增尾空白(未发现);另 5 个大文件以源码/相关提交分段审查,不能把这项扫描说成完整 Git 检查或 149 文件逐行全覆盖。
没有修改源码、创建新 commit、推送、合并或部署。
| { | ||
| Some("persistence") | ||
| } | ||
| _ => None, |
There was a problem hiding this comment.
[P2] 保留绑定 INSERT 的 SQL 错误类型,避免覆盖已完成的执行结果
这份分类只识别 Store(Database { .. }) 和 CommitUnknown,但实际写绑定事件走 append_collaborator_events_tx (:16025) → insert_run_event_rows_tx,后者在 :14279 对 SQL 错误调用 .to_string()。这里的 ? 因而经 From<String> 变成 CollaboratorStoreError::Persistence,落到 None。
首次 native stage 已成功执行并完成 invocation receipt 后,如果绑定事件 INSERT 短暂断连/死锁失败,execute_native_stage (:24151–24153) 会直接返回 ToolBinding 错误;后面的原始 tool_record、终态投影及取消判断都未执行,而不是正文承诺的“保留已交付结果 + unconfirmed-binding advisory”。这也解释了为什么仅验证 store recovery 仍会漏过该行为。
应在现有持久化 helper/错误边界保留 typed SQL cause,让真实临时写入失败进入已有 advisory/recovery 路径,继续拒绝不一致 proof;不要匹配错误文本,也不要把全部 Persistence(String) 无条件放行。补完整 native-stage 回归:receipt 已提交后注入绑定 INSERT 失败,检查原结果/取消状态被保留、没有新物理执行,后续 continuation 从同一 receipt 修复绑定。本轮为源码调用链确认,未宣称执行了故障注入。
| guidance_enabled = false; | ||
| mailbox_enabled = false; | ||
| mailbox_retry_at = None; |
There was a problem hiding this comment.
[P2] 将 mailbox 指导的未知交付写入现有终态事实
这个 may_have_reached_provider=true 分支只关闭 guidance/mailbox,未设置 guidance_disposition_unconfirmed。例如输入已经排入 Edge 后,在外层五秒 timeout 前发生取消/连接关闭,或较短 work deadline 先到,pool 可以提前返回 unknown。该分支随后仍以 Ok(()) 结束 mailbox_delivery,:23978/:23985 不会补记;:24051 只检查 durable user-intent pending,这条普通 mailbox 消息不在其中。
因此终态 receipt、tool_call_end 及后续 Trace/Explain 会漏掉 guidance_disposition=unconfirmed,也不出现对应的指导交付告警;停止自动重发本身并未保存交付不确定性。任务自身的成功/失败/取消不能回答这条指导是否已经被 provider 接收。
请在此分支复用已有 unconfirmed 事实及终态投影,保留不盲目重发的行为,不增设消息账本。回归需经实际 native-stage mailbox pump,让 pool 在外层 timeout 前返回 unknown,再完成/取消 invocation,断言持久化终态保留指导未知且没有第二次 steer;现有 durable-guidance pump/adapter 单测未走此分支。
|
Published scoped reasoning-effort repair at 2f8c8af (normal fast-forward; PR remains draft). Explicit verified gateway protocol declarations now have accurate documentation, and the existing reasoning probe recognizes both nested and top-level positive integer reasoning-token counters without guessing capabilities for Unknown protocols. No new database reads, inference calls, model-name rules, or compatibility path. Current stage: implementation net +6, tests net +61, documentation net +34 physical lines. Validation: 121/121 owner tests; services/runtime all-target Clippy with warnings denied; actual TSan 131/131 with no race reports; clean current CLI/Server build; one real public model check with no probe error and active effort_only catalog projection. gpt-6.1-sol/xhigh source and delivery review approved this scoped stage. New-head CI is not yet established. Earlier 10-case GLM benchmark was 9/10 on ebd7fec, not a benchmark of this repair; its context-overflow failure remains unresolved. Remote-session cache presentation and verify-mode follow-ups are not claimed fixed. Private configuration, credentials, endpoints and raw traces are excluded. |
9e42c9d to
52063be
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
结论:暂不批准,建议继续保持 Draft。 上轮两个功能性 P2 已修复;仍有一项此前指出的数据库工作量问题未闭环,完整产品与规模验收也尚未完成。当前认证身份是 PR 作者,因此提交 COMMENT review;COMMENT 不表示 Approve。
审查范围:整个 PR,base 2873a950f2c9fea00343757933e96070d1631596 → head 529cf9ce822ec9b360b9b690b9a02ba0978c411b,不只最后一个 commit。提交前已再次核对 head 未变。本轮未使用 subagent;结论来自源码与调用链核对、当前讨论及当前 head 的 CI 日志。
仍需解决
[P2] native 交互从原始 dispatch epoch 重复扫描完整 guidance 历史。
interaction_superseding_intent_tx 每次将 cursor 初始化为原始 control_epoch,按 64 条串行读取完整 payload_json 并反序列化;注册、等待、答复等路径重复调用。调用时既有事务已取得 Run 行锁。若此前有 N 条有效 guidance、没有 superseding intent,每次约需 floor(N/64)+1 次查询并重新解析 N 条 payload。LIMIT 64 只限制单页分配,不限制累计读取量或锁持有时间。长时间运行且持续接收 guidance 的 stage 会不断增加每次交互的数据库工作量。
这是此前指出、当前仍存在的问题,不作为新发现重复计数。本轮没有压测,不能声称已测得具体延迟或吞吐退化。应沿现有不可变事件、索引或查询投影消除重复历史扫描,避免另建可写生命周期状态;验证应覆盖注册/等待/答复实际路径的查询数或读取字节随历史增长的行为。
已确认关闭的旧问题
- binding INSERT 错误类型丢失:事件 INSERT 现在保留 typed database error;持久化不确定会保留已交付结果和 receipt,并标记 unconfirmed binding。当前数据库测试实际驱动 child execution/ledger/terminal 路径,覆盖成功结果、失败结果、取消后收敛及后续绑定恢复。
- mailbox unknown 未进入终态:未知投递现在设置 guidance_disposition_unconfirmed,并写入 invocation receipt 与 terminal projection。当前测试覆盖正常未知分支、完成竞态和 receipt replay,且断言没有第二次 steer 或 native dispatch。
本轮在已核查路径中未确认新的 P0/P1。重点核对了执行绑定与前驱阶段约束、thread start/resume、输出与错误保留、ACK 不确定性、guidance settlement、取消及进程清理。物理 Edge 断线的当前契约是取消并收敛其进程,再重连回放结果;保留 native session 支持后续阶段,不等于当前任务跨物理断线继续执行。
验证证据及边界
当前 head 的 Static Checks 和 Test Suite 已通过。实际读取的任务日志包括:
- CLI:4,798 passed、20 skipped;另有通过真实 CLI native entrypoint 的认证 WebSocket 执行测试。
- Online runtime:90 passed、5,644 skipped,包含上述 binding failure、cancelled settlement、mailbox unknown/completion race/replay 测试。
- Online services:463 passed、1,824 skipped,包含 18 个 collaborator DB cases,覆盖并发下一阶段单一获胜、receipt 绑定恢复、旧阶段未收敛时拒绝新阶段及 question/guidance authority。
Skipped 不计为通过。本地完成源码审查与 git diff --check,未本地重跑 Rust、数据库或 live-provider 测试。CI 通过不能替代完整父任务、全 TUI、长时间和规模验收;PR 正文中的“新 head CI 尚未通过”已经过时。
资源成本、复杂度和合并边界
- consumed child result 的 Arc 共享与流式哈希确实减少复制和临时分配,但没有限制父任务累计保留的完整结果字节数,也没有消除全量哈希工作。这是已有债务,不重复列为本轮新增回归。
- 全 PR 为 169 文件,+37,850 / −3,115,净增 34,735 行;其中包含测试与代码搬运,不能直接视为新增生产逻辑,也不能用最后一个小补丁的验证代替全功能验收。维护重点仍应是复用 canonical Run/ledger/Edge owner,并收敛现有模块中的原生适配逻辑,而不是再增加平行状态机。
- 完整父任务效率、续跑历史加载、全 TUI、千会话及全天运行仍缺少充分证据。当前证据支持已列明的协议和所有权边界,不支持把整个 persistent collaborator 产品宣布为验收完成。
PR 正文要求保持 Draft,但当前 GitHub 元数据为非 Draft。建议恢复 Draft,并在上述数据库工作量和产品验收边界明确闭环后再决定批准。
| let mut cursor = control_epoch; | ||
| loop { | ||
| // Bound each allocation; the existing Run transaction protects | ||
| // immutable accepted source facts while the cursor advances. | ||
| let rows: Vec<(i64, String)> = sqlx::query_as( | ||
| "SELECT event_idx, payload_json FROM agent_run_events | ||
| WHERE user_id = ? AND session_id = ? AND run_id = ? AND event_type = 'user_intent' | ||
| AND event_idx > ? ORDER BY event_idx ASC LIMIT 64", |
There was a problem hiding this comment.
[P2] 避免每次 native 交互重扫 dispatch 以来的全部 guidance
这里每次从原始 control_epoch 重新开始;当 N 条历史 intent 都是有效 guide_current_run 时,必须读完并反序列化所有 payload 才能返回 None,每次约 floor(N/64)+1 次查询。注册、wait、resolve 会重复执行,且既有事务已持有 Run 行锁,因此同一长任务收到越来越多 guidance 后,每次后续交互的数据库工作量和锁持有时间都会增长。LIMIT 64 只限制单页分配。
这是此前指出但仍未解决的工作量问题;本轮没有压测,不声称具体延迟退化。请沿现有不可变事件/索引/查询投影消除反复历史扫描,并在实际交互入口验证读取量或查询数不会随已验证 guidance 历史反复增长,避免另建可写生命周期状态。
There was a problem hiding this comment.
Addressed in d18e7b2. The canonical event append owner derives the immutable scope projection; an existing admission grant anchors the single-column index. Invocation supersession is one parameterized lookup with residual type/original-epoch predicates and exact returned ownership checks, without loading valid-guidance payloads. Grant, duplicate and COMMIT-ACK recovery proofs verify the projection in their existing reads. No mutable cursor, extra event/query, scan fallback or migration was introduced. Index maintenance/storage and qualifying-event hashing are explicitly retained costs. Public MatrixOne registration/wait/answer histories of 0/64/1024 guides retain 3 late/4 early lookups; the 1024-guide no-superseder plan examines one index/base candidate and the positive row observer is calibrated. Current normal and TSan services 214/214, real DB 19/19, ACK-loss 1/1, CLI consumers/follow-up 95/95, and all-target Clippy passed. Actual gpt-6.1-sol/xhigh final review accepts scoped Draft delivery, not whole-product/scale readiness. PR body now records costs, limits and the unclassified earlier optional live discovery observation.
529cf9c to
d18e7b2
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-review of d18e7b28deca071a6568fc45591de19b00f06cc4.
结论:本轮未发现新的、可确认的代码缺陷;上轮 guidance 历史扫描的 P2(4257499010)在当前实现中已修复,可以关闭。接受本次修正作为 Draft 阶段的交付;整个 PR 仍不建议现在合并。
本轮重点复核:
- 写入与读取保持同一语义。
validated_user_intent_source复用了原 disposition 的校验规则;唯一的生产事件 INSERT 由 canonical builder 计算投影。合法 guidance 不进入候选集合,缺失 intent/content 或非 guidance 的 user intent 仍会 supersede,payload 中自报的投影值不参与判定。没有引入可变扫描游标或推进原 dispatch epoch。 - 授权、重放和恢复。 invocation 的注册、等待与回答仍先验证 live ledger / grant / binding;grant 的 scope key 在原有读取中校验,候选还要匹配完整 user/session/run 归属。重复 guidance 与 COMMIT-ACK 恢复会拒绝不一致投影。新增 nullable bind shape 和 fresh-schema 的列/索引要求与写入路径一致。
- 上轮性能问题的修复边界明确。 每次 supersession check 现在只有一次不带
payload_json的查询,不再按 64 条重复遍历 guidance。新增 DB 测试通过实际 append owner 和公开 registration/wait/answer 方法覆盖 0/64/1024 条 guidance、早答/晚答、重建 store、首个 superseder、错误归属和缺失 grant 投影;另有真实返回行校准 SQLx observer,以及 guidance ACK 恢复的冲突断言。EXPLAIN 使用 literal SQL,其物理计划证据不能扩大成生产 prepared statement 的完整容量证明。 - 成本没有被隐藏。 单列 scope 索引的工作量仍取决于该 scope 的 grants 和非 guidance/无效 intents;它不是任意历史下的 O(1) 查找。所有事件仍承担索引维护成本。本次净增 509 行,其中实现净增 127 行,其余主要是对应回归测试与说明;未发现新增平行生命周期或缓存。整个分支的 170 文件、净增 35,234 行,以及累计完整 child-result retention,仍不能凭这次局部改动视为已完成精简或规模验收。
当前合并边界:
- 与当前 main 有实际语义冲突。 对 main
365e313c做只读git merge-tree检查,冲突位于crates/services/src/runs.rs的 interaction resolution。main 已合入 #986:superseded response 不再拥有旧 action 的执行权,但必须释放它确实拥有的 live wait,让 owner 消费新 guidance。解决冲突时需同时保留该语义和本 PR 的 invocation guidance 判定;直接选当前 HEAD 的resume_wait = false分支会丢掉 #986 的修复。这是集成要求,不另计为相对本 PR merge-base 的新增缺陷。合并后应一起验证 #986 的 wait-release 回归与本 PR 的 native question 回归。 - 最新 head 的 CI 尚未确认。 本次两次查询
d18e7b28的 PR workflow runs 均为空,旧 head 的绿色 CI 不能覆盖这次提交。 - 整体功能验收仍未完成。 完整 continuation history、全 parent/TUI 链路、千 session/长时间运行,以及累计结果保留成本,仍是明确未证明的边界;本次索引修正不关闭这些事项。
验证来源:独立核对了 source/diff、生产调用链、回归测试断言、git range-diff 和合并冲突;git diff --check 通过。range-diff 确认 rebase 后前两次提交的实现与上轮相同,仅已进入 base 的 Cargo.lock 修正退出差异,因此复用上轮未变化部分的审查。当前环境没有 cargo,本轮未独立重跑 Rust、MatrixOne 或 TSan;PR 描述中的 214/19/1 等结果属于作者提供的执行证据。
由于这是当前账号自己的 PR,以 COMMENT 提交;建议保持 Draft。
Integrate persistent Codex stages with the canonical child-run, invocation, receipt and User Runner owners. Preserve explicit provider/model binding, permissions, cancellation, guidance and bounded diagnostics; share consumed result custody without altering serialized identity. Consolidate the validated feature history without changing its source tree.
d18e7b2 to
1dbde2b
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
结论:需要修改,继续保持 Draft。 本轮确认 1 项新的集成阻断:rebase 后 runtime 测试目标无法编译。上轮指出的 #986 合并冲突已正确解决,guidance 历史扫描 P2 保持关闭。
审查范围:base/merge-base 365e313cba7e018edd8c35ab1552f8e67b85c5db → head 1dbde2b923f322e7d5dbb9db1f079d3c2a02b4e2。提交前已确认 head 未变。当前账号为 PR 作者,因此提交 COMMENT;本条建议是 Request changes,不表示批准。
[P1] 补齐 rebase 带入的 runtime 测试对新接口的适配。
本 PR 给 mark_user_intents_applied 增加了第六个参数,并给 AskUserQuestion 增加了必填结构字段 id,但从 #986 带入的三个位置仍使用旧接口:
- lifecycle/tests.rs:25893:缺少
invocation_identity参数,E0061。 - lifecycle/tests.rs:26281:
AskUserQuestioninitializer 缺少id,E0063。 - lifecycle/tests.rs:26324:同样缺少第六个参数,E0061。
这些都是普通 model-boundary/无协议 question ID 的场景,按相应语义补 None 即可;应保留现有 wait-release、guidance application 和幂等断言。不要通过跳过测试或弱化接口解决。
这是源码可确认且已被当前 head 编译器验证的问题:Clippy、runtime、bridge hooks、online runtime 和 integration 均在相同三处停止。多个红色任务属于同一组集成遗漏,不重复计为多个缺陷;它们也不是运行到数据库后发生的环境故障。修复后需重跑 runtime 测试目标(含 e2e-hooks)和相关回归,目前尚不能声称最新 head 的 runtime 验证通过。
本轮关闭与复核结果:
- #986 语义冲突已关闭。 当前 base 已包含 #986,GitHub 显示可合并;数据库分支保留了 superseded interaction 对 exact live wait 的释放,同时仍使用本 PR 的 invocation supersession 查询。运行时将 superseded approval/question/provider response 转为拒绝或错误,保留对旧 action 的阻断。没有恢复上轮指出的
resume_wait = false分支。 - guidance 索引修正保持成立。 canonical writer、scope/index、grant 验证和恢复逻辑相对上轮没有新的实现变化。有效 guidance 不使 invocation-owned question 失效,非法/non-guidance intent 仍按原 dispatch epoch 判定;没有通过可变 cursor 放宽授权。
- 当前提交已有独立可读的数据库证据。 online services 为 465 passed / 1826 skipped,实际日志包含
database_superseded_interaction_releases_wait_for_guidance、native_question_remains_answerable_after_current_run_guidance、0/64/1024 guidance 查询工作量测试及 guidance COMMIT-ACK recovery。它支持上述 service 层语义闭环;不能替代被编译错误阻断的 runtime 层测试。 - CLI 当前证据通过。 shared CLI 为 4815 passed / 20 skipped,另有
authenticated_shared_ws_executes_native_provider_through_cli_entrypoint通过。没有把 skipped 算入通过数。
提交与复杂度核对:git range-diff 显示第一提交仅因 #986 的 wait-release 语义调整;第二提交与上轮等价;第三提交保留原索引修正,仅补了 service 层新测试的 invocation_identity/purpose 字段,遗漏的是上述 runtime 测试。全 PR 当前为 170 文件、+38,372/−3,136,净增 35,236 行,不能把 rebase 引入的 main 改动另算成新增功能膨胀。本轮未确认其他新增行为缺陷或新的过度设计。
仍有原先明确的边界:scope 索引成本随 grants/非 guidance intents 增长,并增加写入维护;共享 child result 减少复制但不限制累计保留字节;完整 parent/TUI、continuation history、千 session/长时间验收未闭环。它们没有在本次 rebase 中被解决,也不重复包装为新发现。
本轮完成 source/call-chain、逐提交差异和实际 CI 日志审查,git diff --check 通过。本地没有 Rust 工具链,未声称本地执行 Rust/MatrixOne/TSan。PR 正文仍记录旧 head d18e7b28 和旧 merge-base,应在修复后更新验证版本及结果,避免复用旧的 Clippy 通过声明。
| @@ -335,6 +343,7 @@ pub trait UserIntentProvider: Send + Sync { | |||
| run_id: &str, | |||
| event_indices: &[usize], | |||
| authority: UserIntentAdmissionAuthority, | |||
| invocation_identity: Option<UserIntentInvocationApplication<'_>>, | |||
There was a problem hiding this comment.
[P1] 更新 rebase 带入的测试调用方,恢复 runtime 测试目标编译
新增参数后,从 #986 带入的 crates/runtime/src/server/run/lifecycle/tests.rs:25893 和 :26324 仍只传 5 个参数,当前 head 在两处报 E0061;同文件 :26281 的 AskUserQuestion initializer 也缺少本 PR 新增的 id,报 E0063。这使 runtime、e2e-hooks/online 测试目标和 all-target Clippy 在执行测试前就失败。当前 runtime CI 日志 已确认同一组错误。
这两个调用测试普通 model-boundary apply,应显式传 None;无协议 ID 的 question fixture 应补 id: None,保留其余行为断言,然后重跑相关目标。
There was a problem hiding this comment.
Fixed in 0a91f1a. Both rebased ordinary mark_user_intents_applied callers now explicitly pass None; the builtin question fixture supplies id: None. Existing generation, wait-release, stale-answer, owner-loss and idempotence assertions are unchanged; no trait/default/wrapper/production or CI configuration change. Current default runtime CI profile: 5950 passed, 177 skipped, original default stack. Original e2e-hooks/bridge CI selection: 129 passed, 6216 skipped, original lane stack configuration. Repository all-target Clippy with -D warnings and format/diff checks pass. Actual current-source TSan passes 75 existing/new risk contracts with instrumented std, corrected compiler-rt, two threads/default stack and no suppressions. gpt-6.1-sol/xhigh design and final overall review accepted scoped Draft delivery. PR body now records current revision/base and clearly separates reused services/CLI evidence from current runtime validation. New-head CI remains pending and was not waited on.
Summary
Add persistent Codex collaborators through Astra's existing multi-agent backbone. Keep this PR Draft: protocol/ownership verification is not complete-product or scale acceptance. Claude/OpenCode are out of scope.
Related issue
PR964 review findings and reported collaborator journeys; latest database finding: comment4257499010.
Latest integration correction: comment4259295903. Main #986 added three runtime test callsites without this branch's explicit invocation/question identity fields. Two
mark_user_intents_appliedcallers now passNone(ordinary model boundary); one builtin questionnaire suppliesid: None(no provider protocol ID). The trait, implementation, permissions, guards and all existing assertions remain unchanged. Five compilation failures plus two failed aggregates shared this cause; they were not seven independent defects or database failures.Change type
User and compatibility impact
Unsupported native contracts fail before physical execution; transient failures do not authorize replay or silently select another model. Failed stages retain safe causes and partial output. Valid guidance does not invalidate an invocation-owned question, including after successful application; malformed/non-guidance intents still supersede it at the original epoch.
No compatibility, backfill or migration path is added. Fresh-schema readiness now requires the canonical event projection and exact index shape; an outdated database is rejected, not silently repaired.
Architecture and performance
The existing protocol adapter, delivery supervisor, provider resolver, RunEngine, event append owner, invocation ledger and child-result owner remain authoritative. No parallel lifecycle, message ledger, mutable scan cursor, result cache, protocol parser or fallback execution path is added.
For the latest SQL correction:
floor(N/64)+1payload reads per supersession check when all N historical intents were guidance: 17 reads at N=1024, plus repeated deserialization under existing Run locks.EXPLAIN ANALYZEat 1024 guides examines one index candidate and one base row for one grant/no superseder. The diagnostic uses literal text because the engine does not prepare EXPLAIN; the public journey uses parameters. A returned superseder calibrates the real SQLx row observer.Recorded prior SQL/owner correction physical-line accounting: implementation +196/−69, net +127; tests +374/−7, net +367; documentation +15/−0; total +585/−76, net +509. Test growth supplies a real producer/consumer workload, access-plan oracle, ownership corruption and recovery checks; it does not justify the full historical feature increment. Moving files is not code reduction.
Current CI correction: implementation 0, tests +3/−0, documentation 0, no new test suite, defaults, wrappers or execution path.
Complete branch versus current merge base
365e313cba7e018edd8c35ab1552f8e67b85c5db: 170 files, +38,375/−3,136, net +35,239. Scoped acceptance does not establish that the historical increment is minimal or certify whole-feature readiness.Verification
Delivery revision:
0a91f1a9287b3d3b3316bb62c0092e83e42e914e. Base365e313cba7e018edd8c35ab1552f8e67b85c5dbincludes #986 wait-release semantics, #995 working-memory preservation and #984 locale-independent release checks. Actual gpt-6.1-sol / xhigh design and final overall review accepted scoped Draft delivery, session01a13365-4357-7883-91dc-53c4f6fd1e61, tested/committed patch fingerprint4ac9464b8422765014cb174b42af4f98f0be8e2d7122d6706edb2c5b593c7353. Unchanged prior native-owner/SQL review remains reusable, but pre-rebase runtime race evidence is not treated as fresh.-D warnings, 6m49s; formatting/diff checks.1dbde2b92; includes real guidance-history/index, wait-release and recovery cases. Unchanged by the test-only correction.1dbde2b92; includes real authenticated native entrypoint. Unchanged by the runtime unit-test correction.Prior SQL correction controls: services 214, multithreaded real MatrixOne collaborator 19 (two filtered), ACK-loss 1, and applicable TSan runs passed on their recorded earlier revisions. The current-base services CI independently validates the unchanged durable boundary. They are not mislabeled as newly rerun current runtime gates.
Unchanged native controls from the prior head: adapter/delivery/default-terminal 93/93, installed Codex synthetic-provider controls 3/3, original Linux dev-tty command 16/16, additional real PTY resize runs 10/10. Installed-client controls use isolated configuration and no paid inference. They are not a rebuilt Server/full-parent/TUI model harness or macOS result.
The extra installed-client refresh fixture now reuses its original SessionState/attachment instead of fabricating epoch 0. Narrow fixture diagnostics cover spawned supervisor tasks without logging raw protocol/auth/stderr. Its exact current journey and the final 95-case cohort pass, preserving publication counters, permissions and deadlines. An earlier candidate stopped before publication; the original discovery failure had no trace, so its cause is unclassified, not explained by the later fixture-epoch correction. Current passes do not establish universal cold-client availability.
CI and remaining limits
Before update, head
1dbde2b92has seven failed check labels: five runtime test-compilation failures at the same three incomplete fixtures/calls and two dependent aggregates. Services, CLI, core's 3894 initial tests, Docker and MOI succeeded. Current local validation addresses the compile/behavior boundary; new-head CI is not waited on or reported as passed.Final checklist