Repository navigation
Restore Goal stop and resume in standalone Core - #8840
Conversation
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>
cocolord
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=GPT-6; provider=TRAE; self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
独立 Core CLI 用户及现有 Goal 操作投影的 stop/resume 调用者。 已有 Goal 需要暂停或恢复时,旧 Core 路由落入未打包的完整 CLI;当前路由直接调用已打包的生命周期 owner,并保留预览和写入检查。 独立 Core 包指只包含内核及所需命令 owner 的安装组合。旧路由让已经支持的暂停或恢复操作依赖完整 CLI,增加加载和切换成本。源码入口的帮助、预览、合法 stop/resume 和拒绝路径可通过已有 owner 完成;CI 的真实安装 Core 在 File/SQLite 上验证暂停、恢复及一次提交后的无副作用重放。 本 PR 不新增生命周期、权限、provider 或状态格式,也不宣称完成本地安装资格、真实模型采用、原中断 Task 恢复、R1、M3 或 C1 cutover。
本地保持原 HOME 的 Core 生命周期仍在 connect 的运行时就绪之前失败;File fixture 已进入 connect,ready 前失败,生命周期测试断言尚未开始;SQLite 尚未开始;C1 当前 head 的组合执行及原十项完整回归仍待资格化。
改动思路 / Approach
选中路由和同 Goal 写入保护都落在已有 owner;没有第二套状态决策、执行器、权限模型或新配置,进一步拆分会留下可达写入漏洞。 本 PR 交付既有 Core 命令接线与受管写入保护,以及对应公开回归;安装环境和完整 RFC 验收继续使用原任务与验收记录。 入口只在选中 goal-lifecycle 时注册原 parser 并调用原 handler;实际状态转换、actor 检查、source fingerprint、事务与 readback 都继续由原 activation service 负责。写入保护在 registry 解析之前检查既有 native controller 标志、请求 Goal 与 owned Goal 的精确匹配及 execute,不从 owner/controller 标签推导权限。预览、标志关闭和其他 Goal 保留原路径。
最强反对理由是源码帮助可用仍可能掩盖实际写入漏洞或安装环境失败。只接路由会留下同 Goal 写入绕过,打包整个 facade 又扩大默认依赖;复用原 owner 并补原 guard 是最小完整修复。原本地安装验收因此继续单独推进。
具体改动 / Changes
评审 head:f63d46274556a7122c236e48f7fddda46fa640e7。规范依据:docs/architecture/rfcs/monorepo-distribution-split-v0.md,固定规范 revision:f3bdad2387397e078fbc887e7cb7ed80adaf7510。按改动前已接受的规范判断,新 ledger 没有自行改写验收:V2 的生命周期权限及无重复副作用由 source negatives 和安装 CI 验证;V3 的命令解析、输出、拒绝及加载由源码差分和不可变基线对照验证。R1 的原本地、真实 Host、context、完整成本和回归资格继续 deferred;M3 的拆包发布及冷安装 qualification 在本修复范围之外,R1 行明确允许先验证源码组合。
关键代码讲解
_SELECTED_COMMANDS与_build_selected_parser将既有命令接入选中加载,并直接复用register_goal_lifecycle_command。详细帮助可以加载自己的 parser,未激活运行服务。不可变基线和 head 的帮助 stdout 相同,只有基线加载loopx.cli;移除命令 membership 的反例在禁止 Full 执行的边界失败,固定 head 成功。_dispatch_common_command调用原handle_goal_lifecycle_command。预览保持无写入,匿名/stale execute 保持原拒绝,合法 owner stop/resume 验证原 source/global 状态,不新增 Python 状态决策 owner。native_controller_cli_write_block只补 lifecycle execute 分支。相同 synthetic pre-state/argv 的 immutable baseline 对照:基线 rc0 且写入 registry,head rc2 且 source bytes 不变;删除该 guard 的当前源码反例也重新出现写入。两条 CLI 均在 registry 解析前执行这项保护,actor 标签不能绕过。test_installed_core_goal_lifecycle_preserves_work_and_resumes_execution通过已有安装入口及 File/SQLite backend 验证原 Todo/lease 保存、stop 无 Host/无 spend、resume 一次独立验收提交与无副作用 replay。错误中的False/None保留不确定性,实际效果另由 Host-body marker、输出、accepted artifact 和 spend ledger 验证;受控 Host 不证明真实模型采用。
8 个文件共新增 249 行,其中产品接线 13 行、回归 180 行、双语文档 56 行。原 registrar、handler、activation service 和 operator action consumers 已搜索并复用,没有新 provider、状态格式、公共词汇或迁移分支。当前 C1 #8266 的 head dead3c8ce709c720ed6d80954353a6cb3d720f41 共同 CLI、guard、activation 和 operator-action 边界与前次已审 head 的 Git blobs 一致,未见新增方向冲突;组合执行尚未验收。
对主干的风险 / Risks
没有发现阻塞性的公共代码问题。主要风险是 guard 捕获非 owned Goal 或将 actor 标签误当权限。原 source 55 个用例、78 次 CLI 调用验证 owned、off、unowned、preview、anonymous 和 stale 分支;114 行 parser 差分保持一致。新增 4 次 immutable base/head 调用使用相同 logical fixture fingerprint 和规范化 argv,仅替换隔离 fixture 的绝对根路径,保留每次真实输出和 registry 前后哈希。已有两个错误 help harness 的结果保留并排除,未把它们计入 PASS。guard mutation 的 head 调用使用 mutation 之后已经 stopped 的初态,只证明拒绝敏感性;相同 active 初态的真实对照由独立 immutable f3/head pair 提供。
PASS:changed Python Ruff、配置的 Mypy 17 文件、成对 RFC committed gate、标准 premerge 6 项直接检查及 14 项 smoke。PASS:CI 安装 Core 48 项,运行 revision 是本 head 合入基线后的临时 merge 2dca202af072333d9450d8c49afdb13627772c97,不能冒称当前本地 HOME 的安装验收。UNVERIFIED:本地 File connect 就绪失败后的生命周期、SQLite、C1 组合、原十项及完整回归。之前 loader、权限预检查、timeout 与断言失败都保留;当前通过的证据只覆盖各自范围。
语义与 CI 对齐
此 PR 复用既有 GoalActivationState、actor、command 和 refusal vocabulary;semantic vocabulary 和 bilingual 检查通过,规范性的 stop、replay、settlement 条件没有降低。远端 TypeScript shard 2 和 aggregate checks 仍 FAIL,Python shards 1–6 PENDING。相同 TS/scanner blobs 无法证明故障原因,归因保留 unresolved;这些是 diagnostic rows,独立源码对照、反例及安装 CI 已覆盖当前变化的 invariant。当前 Goal wait_for_ci=true,合入 readiness 独立保留这一 CI gate。
我的整体评价 / Verdict
这是有明确可验证收益的 justified_increment:修复既有调用者的加载与写入边界,原 R1 完成状态仍为未完成。long_horizon 评价为 preserved:原状态、准入、验证、journal、replay owner 未变,安装 CI 保留一次提交、无重复 Host 和 spend 的持续执行语义。user_experience 评价为 improved:支持的既有操作减少完整 CLI/源码切换,无新增输入或确认轮次,故障沿原诊断恢复。
选中路由和同 Goal 写入保护都落在已有 owner;没有第二套状态决策、执行器、权限模型或新配置,进一步拆分会留下可达写入漏洞。 本 PR 交付既有 Core 命令接线与受管写入保护,以及对应公开回归;安装环境和完整 RFC 验收继续使用原任务与验收记录。 已检查既有 App/Lark 操作消费者,diff 没有渲染页面变更,visual_review 为 not_applicable;未验证范围是本地安装生命周期和 C1 组合执行。保留原 owner 的同域整理已应用,较大的 transport/TypeScript cutover 交由当前 C1 并以组合真实路径验收。此 exact head 可给出批准结论;原目标完成、merge-readiness 和 CI hold 继续独立判断,批准不等于它们已通过。
English verdict: APPROVE — f63d462; existing Core lifecycle wiring and scoped native-write protection are verified by immutable source pairs, deliberate mutations, canonical source differentials, required local checks and installed CI. Local original-goal qualification, C1 combined execution and CI merge holds remain open.
|
Merge decision for The published author-owned approval conclusion is valid; all 19 required review evidence items are complete, required local validation and the paired RFC gate pass, installed Core CI covers the changed lifecycle invariants, and approval closeout reports no blockers or unresolved threads. The head remains open and mergeable. Readiness remains This merges the existing Core route and scoped native-write repair. It does not qualify the original local File/SQLite lifecycle, current C1 combined execution, R1/M3, actual-model adoption or full original-goal regression. Those acceptance gaps remain open. |
Standalone Core bundles the Goal activation owner but does not route
goal-lifecyclethrough selected CLI loading. A supported stop or resume request reaches the absent full CLI and exits before that owner. This change connects the existing command, registrar and handler so Core uses the ordinary lifecycle behavior, including preview, actor checks, source fingerprints and transition readback.The existing native outer-controller guard also recognizes lifecycle execution for its managed Goal. An owner/controller label cannot bypass that guard. Preview, a disabled controller and other Goals keep their existing paths.
Related specification: small-kernel runtime composition RFC, particularly V2 authority parity and V3 CLI compatibility. The paired RFC checkpoint records this bounded repair. This reuses the typed owner direction in C1 #8266; the shared CLI, guard, activation and operator-action source boundaries with C1 head
dead3c8ce709c720ed6d80954353a6cb3d720f41have been inspected; their Git blobs are unchanged from the prior C1 review, while combined execution remains unqualified.Validation at
f63d46274556a7122c236e48f7fddda46fa640e7:2dca202af072333d9450d8c49afdb13627772c97(this head into basef3bdad2387397e078fbc887e7cb7ed80adaf7510). This is CI evidence and does not certify the local HOME-preserving or full original-goal acceptance.native_child_result_inbox.ts:109. Both that module and the scanner have identical Git blobs on the reviewed head and target main; this PR changes no TypeScript sources. The same check has not been reproduced against an immutable base, so identical blobs alone do not establish the failure's cause. The failure remains visible and is separate from the passing changed-path evidence and the pending merge-readiness decision.error_code, then because it requiredFalsewhere an entered executor conservatively reportsNone. The current test preserves that uncertainty and separately observes a Host-body start marker, Host output, accepted artifact and spend ledger. It retains the original Todo/lease, stop/resume, independently validated same-Task result, single settlement and replay assertions. The current CI suite passes these assertions; the separately scoped local runs did not reach the lifecycle test body.This proposal restores an existing caller path and its ownership protection. Full install/import/process/network/context closure, actual-model adoption, original interrupted-Task recovery, R1/M3 completion, cost qualification and C1 cutover retain their own acceptance gates.
PASS: the final standard premerge gate ran against the exact eight public diff paths: six direct checks and fourteen smokes. The first run lacked the local TypeScript development dependency; after installing the existing lockfile dependencies, the semantic-vocabulary check and complete gate passed without changing tracked files.
PASS: four fresh public CLI calls compare immutable base
f3bdad2387397e078fbc887e7cb7ed80adaf7510and this exact head using identical logical File fixtures and normalized arguments. Help output is equal while only the base loads the full facade; same-Goal managed owner execution writes on the base and refuses with exit 2 without a registry write on the head. Separate selected-route and guard mutations establish sensitivity. The guard mutation head uses an already-stopped registry; it is refusal evidence, while the immutable pair supplies equal-active-prestate comparison.Formal exact-head review: approval conclusion. Required evidence and the published body passed the current review-result check; the CI diagnostic and original-goal gaps above remain open.