Skip to content

Restore Goal stop and resume in standalone Core - #8840

Merged
cocolord merged 4 commits into
mainfrom
codex/core-goal-lifecycle-selected-loading-20261116
Nov 16, 2026
Merged

cocolord merged 4 commits into
mainfrom
codex/core-goal-lifecycle-selected-loading-20261116

Conversation

@cocolord

@cocolord cocolord commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Standalone Core bundles the Goal activation owner but does not route goal-lifecycle through 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 dead3c8ce709c720ed6d80954353a6cb3d720f41 have been inspected; their Git blobs are unchanged from the prior C1 review, while combined execution remains unqualified.

Validation at f63d46274556a7122c236e48f7fddda46fa640e7:

  • PASS: changed Python lint, configured kernel type checks (17 source files), the direct paired RFC diff gate and diff hygiene at the exact head.
  • PASS: HOME-preserving source CLI regression, all 55 original selected cases and 78 nested CLI invocations. Independent readback checked the original assertions, expected success/refusal results, retained output bytes, environment preservation and observed cleanup outcomes. The selected/full parser batch produced identical 114-row results. Its two CLI calls remained within the original 90-second limit; only this private aggregate test used a 300-second outer window. Earlier native-library failures and the 120-second aggregate timeout remain preserved as separate failed attempts. This qualifies the selected source behavior; complete native denial capture and escaped-descendant closure remain unqualified.
  • PASS: CI installed Core execution, context, recovery, replay and refusal suite: 48 cases at temporary merge 2dca202af072333d9450d8c49afdb13627772c97 (this head into base f3bdad2387397e078fbc887e7cb7ed80adaf7510). This is CI evidence and does not certify the local HOME-preserving or full original-goal acceptance.
  • UNVERIFIED: local HOME-preserving installed Core lifecycle qualification. Earlier retained attempts stopped at native-loader startup, named-helper import, fenced Node discovery and preserved-evidence preflight. The exact evidence-read repair now passes separate native OS and Python checks. A fresh continuation then entered the unchanged File fixture connect command, but the Effect runtime exited before readiness. Source ordering and disposable-state readback show no Effect request dispatch or persisted Goal/Todo/lease; the original File machine configuration remains unchanged. Separate preload-only diagnostics identified native-configuration access and recursive qualification-observer writes as the next local prerequisites. All original failed allocations/results remain retained, the lifecycle body has not run, and SQLite is still pending. The exact-head formal approval conclusion is now published; merge-readiness is checked separately.
  • CI diagnostic: TypeScript shard 2 failed the digest-owner scan at 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.
  • Earlier Core CI failed the two added lifecycle cases: first because the test expected an absent top-level error_code, then because it required False where an entered executor conservatively reports None. 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 f3bdad2387397e078fbc887e7cb7ed80adaf7510 and 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.

cocolord and others added 2 commits November 16, 2026 01:24
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 and others added 2 commits November 16, 2026 02:05
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 cocolord left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cocolord

Copy link
Copy Markdown
Member Author

Merge decision for f63d46274556a7122c236e48f7fddda46fa640e7: use the existing maintainer authorization for an admin merge after exact-head qualification.

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 ready=false: TypeScript shard 2 and aggregate checks fail, and whole-repository shards plus the refreshed diff inspection are pending. Their causes remain unresolved; identical TypeScript blobs are not a baseline failure proof. Admin bypass applies to this recorded CI/readiness and GitHub review-policy hold, while the exact-head review, required checks and unresolved-finding gates remain binding. The Goal retains wait_for_ci=true; no policy was weakened.

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.

@cocolord
cocolord merged commit f38fae0 into main Nov 16, 2026
54 of 63 checks passed
@cocolord
cocolord deleted the codex/core-goal-lifecycle-selected-loading-20261116 branch November 16, 2026 00:30
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