Repository navigation
Conversation
Route goal-acceptance help and execution through the selected command parser so the command no longer imports the full CLI graph. The full CLI keeps registration and reaches the same handler through the shared common-command dispatch. Cover owner-only help loading, parser diagnostic parity, and refusal parity without loading loopx.cli. Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
songoow
left a comment
There was a problem hiding this comment.
Reviewer: model_agent — GPT-6 Astra Pro — OpenAI — self_reported
动机 / Motivation
使用 goal-acceptance 查看、配置、校验和清除 Goal 验收合同的 CLI 用户与自动化调用方,当前每次调用都会加载完整命令图。
原来已有公共解析器仍把 goal-acceptance 送进 full CLI;本 PR 让公开入口在 selected runtime 中调用同一个验收 handler。默认配置、预览、执行、权限与错误语义保持原有行为。
真实 File/SQLite 的 30 次配对 CLI 调用获得一致的规范化完整结果;候选不再加载 loopx.cli,旧基线每次都会加载。收益是移除无关导入,未将它外推为固定启动时间或模型成本。
本次不增加验收权限,不改持久化合同、校验流程或共享 provider;不声称完整应用冷启动、原生远程数据库或真实模型资格。
改动思路 / Approach
这是执行路由的归位:原 selected runtime 已有公共注册和请求作用域,只缺验收命令接入。把命令送进该边界后,授权、合同和持久化继续由原 owner 决定,既减少无关导入,也避免两份业务分派。
范围止于一个现有命令的 lazy registration/common dispatch 及实际入口回归;不引入新的状态模型、能力安装或事务机制。
用户参数经 selected parser 进入既有 guard 与 registry,再在统一 effect request scope 中调用原验收 handler。预览只读,显式执行才写;验证失败、权限拒绝和 stale revision 继续沿原错误路径返回,后续修复也不需新增恢复协议。
共享 selected dispatcher 已承担同类命令的解析、registry、native guard 和 effect request scope;这次把原 handler 接到已有分支即可。另建启动器或复制验收 owner 都会增加无必要的规则分叉。
具体改动 / Changes
关键代码讲解
- _dispatch_common_command:复用既有命令分派边界。goal-acceptance 分支在需要时导入原 handler,参数、registry 和输出格式直接传入;完整 CLI 也进入这个共享分派。
- dispatch_common_command:维持请求作用域。选中的验收调用仍包在既有 effect_runtime_request_scope 内,未另造 socket、provider 或事务路径。
- _dispatch_selected:维持入口的 guard 与 registry。在共享分派前沿用原 native controller guard、配置与 registry;新增 selected command 不绕过验收授权。
- handle_goal_acceptance_command:沿用验收业务 owner。配置、预览、校验、清除及失败读回仍由这个未改动的 handler 处理,路由变化不重新解释合同。
规范基准:docs/reference/goal-acceptance-observations.md;修订 26f7305。用改动前已存在的验收 observation/preview/execute 契约作基准;下列标签是对原段落的定位说明,不虚构新的 RFC 验收编号。迁移 RFC 中既有 selected parser/common dispatcher 是复用依据。
| Criterion | 当前结论 | 对应实现或剩余边界 |
|---|---|---|
| canonical authority only | implemented | cli_runtime._dispatch_common_command -> unchanged goal_acceptance.handle_goal_acceptance_command |
| preview versus execute | implemented | unchanged goal_acceptance handler under selected effect_runtime_request_scope |
| owner authorization and stable errors | implemented | _dispatch_selected guard/registry then original handler |
实际验证 / Validation
本轮在 exact head 跑了三个既有验收模块,共 130 个案例全部通过;在不可变基线也跑了相同 130 个案例,全部通过。另有 4 个 selected-entrypoint 案例通过。验证没有修改断言、超时或 authority 数据。
补充真实 public-entrypoint 路径:每个版本 30 次独立 subprocess 调用,覆盖 File/SQLite 的配置预览/执行、失败与成功校验、读回、清除,以及 agent 写拒绝和 stale-CAS 拒绝。完整规范化 stdout、stderr、退出码一致(SHA256 20c636cc536a4d006719b74e4c7c21d4049f09e6aa99c4789c39f84080e18cca);规范化只处理临时根、时钟和保持引用关系的生成身份。基线每次加载 full CLI,head 每次都不加载;在实际 --help 路径加入导入缺席断言,基线失败、候选通过。
对主干的风险 / Risks
最危险的回归是 selected 路径绕过授权或请求作用域,或仅在动作/错误分支丢参数。代码仍复用同一 guard、registry、scope 和 handler,且真正执行了双 provider 的 mutation/rejection/readback。未发现阻断性实现问题;这不是对远程 provider、完整应用启动性能或任意调用组合的穷尽证明。
语义与 CI 对齐
改动前的验收合同是独立标准;完整结果和诊断配对保留权限、修订及验证含义,没有以删输出换性能,也没有调整验收目标。
当前 CI 快照中 dashboard-browser(2) 在未修改的 research-display-language.mjs:146 等待“Expand judgment details”后的页面条件超时(30 秒),aggregate checks 也红,其他分片尚未结束。这是独立的合并就绪风险;本轮保留失败事实,没有证明其基线同样失败,故不称为已排除的历史问题。当前路由结论来自上面的直接 File/SQLite 证据,不能表述成整套 CI 通过。
当前阻断是验证缺口,不是凭红灯虚构的代码 finding。 仓库当前 verdict_policy 明确未归因的 current failures 阻止批准;仅证明变更文件不在失败路径,尚不足以归类 pre_existing。最小解除条件是对上述具体失败提供不可变 base/head 的同命令、同签名对照,或独立证明外部/环境原因并补齐受影响合同的当前资格;若归因确属回归,再修相应代码。本轮不要求为未归因失败修改无关代码,也不放宽已有预算。
我的整体评价 / Verdict
REQUEST_CHANGES:未发现阻断性的代码缺陷;当前 CI 失败尚缺政策要求的归因证据,因此暂不具备批准资格。 审查绑定 exact head 8a06403。
长期执行所需的验收读回、配置身份与失败恢复保持在原 owner 中;本次没有增加状态副本或另一个重试入口。观察到的改善限于重复命令的导入负担,不能代表整个长期执行链提速。
用户继续使用原命令和参数,权限拒绝、校验失败及后续修复路径保留;没有增加交互步骤。正常输出与错误诊断的完整配对比较比仅核对退出码更能约束兼容性。 改动仅为 CLI 分派与导入,不涉及页面或视觉交互。
这次已采用最小共享分派,不需要新 adapter 或复制 handler。保留原 full parser 注册是帮助与完整 CLI 兼容所需;可以独立审阅,不与验收业务重构捆绑。
未执行安装后真实 provider/模型工作,也未把模块减少当作冷启动或长期延迟资格;远程全套 CI 尚未完成,本次针对这个路由改动的独立证据与最终合并就绪分开。
English verdict: REQUEST_CHANGES — exact head 8a06403; Current required CI failures lack the repository-required attribution, so approval is withheld. No blocking code defect was found in the exercised change; resolve the named validation gap rather than changing unrelated code.
…-demand-loading-20261030 Signed-off-by: huangruiteng <huangrt01@163.com>
|
The failing This is base/head parity evidence for an environment-sensitive performance gate, not a goal-acceptance routing regression. No browser threshold is relaxed in this PR; the failed job will be rerun after the pending long shards make the workflow terminal. |
CI failure attribution for head
|
| Revision | Result | Failure signature |
|---|---|---|
base 04c5799b8 |
1 failed, 8 passed | test_shipped_runtime_pins_utf8...: loopx/capabilities/benchmark_toolkit/native_codex_process.py:71 |
head 451236f08 |
1 failed, 8 passed | identical |
- UTF-8 failure: the same failure is on
main. It was introduced by fix(benchmark): preserve native process evidence before cleanup #7707 (native_codex_process.py), and fix(benchmark): pin UTF-8 for the native process start identity read #7745 is the open repair. - Codex-accounts and dashboard-launcher cases: these pass on macOS for both base and head. They fail only on the Linux runner, with
platform_unavailableand a missingrelease/scripts/chat_bundle.pyin the launcher fixture respectively. test_workflow_skill_local_links_remain_inside_the_distributed_skill[loopx-project]: this checksskills/loopx-project/SKILL.md:158. That line is byte-identical on base and head, and this PR does not touchskills/.
Same signatures on unrelated PRs, same CI window. I collected the FAILED lines from the failed jobs of four other PRs, run 2026-10-30 19:07–19:17Z. Their diffs do not overlap this one:
| Failing test | Other PRs with the same failure |
|---|---|
test_native_restart_uses_real_accepted_work_fence_before_app_quit[queued/starting/running/...] |
#7739, #7735, #7700, #7711 |
test_dashboard_launcher_* (nvm/node selection) |
#7700, #7711, #7735 |
test_workflow_skill_local_links_remain_inside_the_distributed_skill[loopx-project] |
2 of the 4 |
dashboard-browser (2) (research-display-language.mjs wait timeout) |
2 of the 4 |
checks aggregate |
fails whenever a lane fails |
test-shard (1)andtest-shard (3)were cancelled, not failed:The operation was canceled, with no junit uploaded.- The scheduled
mainrun 41146897061 for04c5799b8is still pending, so there is no greenmainbaseline yet. I am not claiming the full suite passes.
Classification: every current failure is pre_existing/environmental. Each one reproduces on base main with the same signature, or recurs with the same signature on unrelated PRs, or both. The route-specific evidence in the PR body is unchanged:
- File/SQLite parity
- the selected-entrypoint tests
- the help import-absence assertion
Remaining gates:
- a fresh exact-head review
- a green rerun after the
mainrepairs (fix(benchmark): pin UTF-8 for the native process start identity read #7745) land - maintainer merge authorization
中文摘要:
- 当前 CI 失败可分三类:
- 在不可变 base
04c5799b8上以同一命令得到相同签名(UTF-8 pin,由 fix(benchmark): preserve native process evidence before cleanup #7707 引入,修复见 fix(benchmark): pin UTF-8 for the native process start identity read #7745); - 仅在 Linux runner 出现、本地 base/head 均通过;
- 在同时段四个无关 PR 上以相同签名重复出现。
- 在不可变 base
- 本 PR 只改 CLI 选择路由的三个文件,与任何失败用例无交集。
- shard 1/3 为取消而非失败;
main定时运行尚未完成,因此不声称全套通过。
songoow
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; GPT-6; OpenAI; self_reported.
动机 / Motivation
受影响的是通过现有CLI检查或验证Goal验收的用户和自动化调用者。以前goal-acceptance没有走已选命令的轻量入口;本项把它注册到既有common dispatch。已验证help和缺失Goal拒绝在selected/full入口一致,后续原验收CLI测试覆盖真实调用。本项不改变验收决策、提案状态、权限或需要读取的事实。
这次判断绑定PR #7741的完整head 451236f。评价对象是已经存在的实际调用任务与局部可观察结果;重复调用带来的成本或错误恢复路线是本项动机,不能把较小响应或更少导入直接等同于长期任务质量。
改动思路 / Approach
沿用现有selected parser与_dispatch_common_command,保留完整parser注册,删除原full CLI中的重复提前处理路径。本 PR 的合理边界是goal-acceptance路由和按需导入,验收业务处理仍调用原handler。
沿入口跟踪到原所有者、返回值和失败恢复后,这个实现仍在现有边界上处理问题。无改动会保留原成本或错误指引;另起一套业务规则、持久化状态或通用缓存会增加同步义务,此处没有这类必要性。新增说明和投影应服务原调用方完成任务,不能改变原来的准入、权限、结算或来源完整性要求。
具体改动 / Changes
关键代码讲解
- _build_selected_parser:选择goal-acceptance时加载既有命令注册,其他命令分支不被改变。 输入与拒绝分支沿用现有调用路径;这一处的返回内容或依赖时机改变,不把局部投影提升为新的业务判定。
- _dispatch_common_command:将同一args、registry/runtime和输出函数传给原验收handler。 输入与拒绝分支沿用现有调用路径;这一处的返回内容或依赖时机改变,不把局部投影提升为新的业务判定。
命令、参数、拒绝顺序及完整JSON/Markdown所有者保持;没有把验收功能复制为另一个handler。正向场景是:选中命令help可用且不加载full CLI,原验收调用沿用真实handler。负向场景是:inspect、inspect-proposal和verify缺失Goal的退出码、stdout、stderr逐字一致,registry字节不变。这些是依据实际源码与已有调用测试核对的行为边界;失败和恢复继续由原owner负责,没有以返回字段存在代替真实状态读取。
规范依据为原公开调用行为、既有所有者和相应回归;已检索改动路径与周边文档,没有为这次局部性能/适配修正找到另一个已接受专项RFC。作者的量测叙述不充当独立功能合同。
实际验证 / Validation
4项selected goal-acceptance测试 PASS。完整goal-acceptance CLI suite有32项断言通过,但pytest session在结束时因真实默认runtime目录出现而退出1;未归因,不能记为整套通过。Python编译与 diff hygiene PASS。
执行命令:python -m pytest -q tests/test_cli_entrypoint.py -k goal_acceptance; python -m pytest -q tests/control_plane/test_goal_acceptance_cli.py。完整goal-acceptance CLI套件的32项断言通过,但session结束时默认runtime路由污染检查使退出码为1。并行本地执行是可能原因,尚无可证归因,故本review保留该失败而不宣布整套通过。
对主干的风险 / Risks
命令、参数、拒绝顺序及完整JSON/Markdown所有者保持;没有把验收功能复制为另一个handler。最需要防止的情况是:inspect、inspect-proposal和verify缺失Goal的退出码、stdout、stderr逐字一致,registry字节不变。已核对相关调用方和已有review,未重复发布旧head意见;本轮对新增head的源代码与局部回归单独作判断。原持久化状态和业务所有者保持,仍然不能由小范围通过推断整仓或所有部署入口已经合格。
当前精确head失败证据:test-shard (6)、test-shard (2)、test-shard (4)、dashboard-browser (2)。作者已补充固定base/head相同浏览器预算失败证据;当前其他test-shard失败仍缺可核验日志,不能以该浏览器归因覆盖所有失败。 未取得的分片日志明确留作未知;同名错误或改动文件不相交都不足以建立pre_existing归因。
最小补齐是针对当前实际失败取得日志,并提供不可变base/head同命令同条件归因,或能独立覆盖该失败不变量的当前真实入口证据。已完成的聚焦回归不应无条件重做,也不要求无关功能重写;如果归因确认是回归,再修相应最小代码路径。未完成的检查不是单凭pending就要求改代码的理由。
我的整体评价 / Verdict
REQUEST_CHANGES:当前阻断是具体的验证证据缺口。聚焦审查尚未发现可复现的阻断性生产代码缺陷,不能把未归因红灯写成代码finding。 审查仅适用于exact head 451236f。
本 PR 的合理边界是goal-acceptance路由和按需导入,验收业务处理仍调用原handler。 已验证help和缺失Goal拒绝在selected/full入口一致,后续原验收CLI测试覆盖真实调用。 已检查 loopx/cli_runtime.py:_build_selected_parser;loopx/cli_runtime.py:_dispatch_common_command;变更是CLI/内部读取或文本协议,没有修改浏览器页面布局,视觉截图不适用。
作者已补充固定base/head相同浏览器预算失败证据;当前其他test-shard失败仍缺可核验日志,不能以该浏览器归因覆盖所有失败。 本项不改变验收决策、提案状态、权限或需要读取的事实。所有本轮探针使用合成fixture,没有运行真实模型任务或发起业务作业;本review陈述审查与验证事实,不声称已经发布部署或完成合并。
English verdict: REQUEST_CHANGES — exact head 451236f. Focused code review and the listed local regressions found no confirmed blocking implementation defect. Approval is held for the named current validation gaps; resolve their source-bound evidence rather than changing unrelated code.
Summary
goal-acceptancewas dispatched only by the full CLI, so everygoal-acceptancecall — including--helpand argument errors — imported the wholeloopx.cligraph before reaching a handler that needs only its own owner. This PR routes the command through the selected CLI runtime, the same demand-loading path already used bystatus,quota,todo,handoffandperformance-diagnosis:loopx/cli_runtime.py: addsgoal-acceptanceto_SELECTED_COMMANDS, registers its parser fromloopx.cli_commands.goal_acceptanceon demand, and dispatcheshandle_goal_acceptance_commandfrom_dispatch_common_commandwith the same arguments the full CLI used.loopx/cli.py: keeps the parser registration for full-CLI help and the command catalog, and drops its ownhandle_goal_acceptance_commandcall. The full CLI already calls the shareddispatch_common_commandbefore its own handlers, so both entrypoints now reach one dispatch site.loopx/cli_commands/goal_acceptance.pyis unchanged. Registry resolution, the effect-runtime request scope, authority ownership (TS lease/CAS), scheduling, settlement, defaults and output contracts are unchanged.Measurements
These are fresh-process probes of
goal-acceptance --helpthroughloopx.entrypoint, run against the exact base26f73056cand this head. Each side ran 6 times; the first, cold run is discarded, and the table reports the median of the other 5.modscounts importedloopx.*modules.loopx.cliloadedgoal-acceptance --helpExecution routes (
inspect,verify, …) now pay for the goal-acceptance owner instead of the full CLI graph. Their remaining cost is the owner's own authority reads.Behavior parity
--help, a missing--goal-id, an unknown action and an unknown option produce byte-identical stdout, stderr and exit codes throughloopx.entrypointandloopx.cli. These cases join the existingtest_selected_parser_matches_full_help_and_diagnosticsbatch.inspect,inspect-proposalandverifywith--proposal-idagainst a missing Goal return identical stdout, stderr and exit code 1 on both entrypoints. The selected run must not importloopx.cli, and the registry bytes stay unchanged.python -m loopx.cli, which delegates to the entrypoint, so they exercise the new selected route end to end.Tests
tests/test_cli_entrypoint.pyadds 5 cases; 4 fail on the base and pass on this head:goal-acceptance --helploads onlyloopx.cli_commands.goal_acceptance, withoutloopx.cli, benchmark dispatch, content-ops or turn run-once;inspect,inspect-proposal,verify --proposal-id) without loadingloopx.cli.The extended parser-parity batch passes on both base and head, which is expected: it checks that routing did not change behavior.
Validation
tests/test_cli_entrypoint.pyplus all 9tests/control_plane/test_goal_acceptance*.pyfiles: 321 passed.goal-acceptance(28 files, including objective revision, outcome refinement, research continuity, quota acceptance references and replan composition): 616 passed.loopx canary premerge --from-git-diff --git-diff-base origin/main: passed. That is 6 direct checks and 5 selected catalog smokes, with 0 failures, 0 warnings and 0 manual holds, on surfacepython. The selected smokes were the maintainability ratchet, semantic vocabulary drift, CLI output budget, CLI version modularization and CLI control-plane command modularization. Two earlier runs failed for environment reasons only:semantic-vocabulary-drift-smoke.pyneeds the TypeScript dev dependencies; it passed after a localnpm ci --ignore-scripts;cli-output-budget-regression-smoke.pyhit its timeout while the 616-test suite ran in parallel. Run alone, it passed in 96 s, and the final premerge run passed it in 89 s.Follow-up and future-facing pass
goal-acceptance, shared by both entrypoints. No new modules, wrappers or options.goal_acceptance.pyitself. Its imports are already limited to the goal-acceptance owners.Runtime self-merge is not requested; this needs ordinary review.