feat(runtime-host): establish canonical managed lifecycle transactions - #4049
Conversation
Persist transition and blocked states in the canonical managed deployment authority, and require the same State Root owner for exact commit or rollback. Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
2aa223e to
57278ce
Compare
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
Generated-by: OpenAI Codex
jackwener
left a comment
There was a problem hiding this comment.
Approving exact head 2a4c6fa283c1ff3b9ecb5a049ceadff7cf3d7589. I found no open P0–P2 issue in the reviewed lifecycle change.
The on-demand update rollback issue is closed. Candidate activation now runs inside the lifecycle replacement transaction, with recursive activation reconciliation disabled. A candidate that cannot start is rejected before package pruning, and the compensation path restores the previous active authority and operator projection. The new failure-injection regression exercises that rollback.
The earlier release-smoke blocker is also closed: the installed-package smoke no longer writes the removed legacy peer field, while retaining managed-service startup and local-IPC readiness coverage. The exact-head CI test, Windows recovery, direct-peer addon builds, immutable tarball build, and all installed-CLI validations succeeded. The Windows package workflow is being rerun after its unchanged packaged-renderer native-window probe timed out; that rerun is not part of this code approval.
The branch merges cleanly with current main (e8028fc9fa405969498ff7250fe37b8a7b44f3ea), producing tree efd20ba260a0104389180007016daf8a48ccbf6b. There are no review threads. This is a high-impact feature, so the maintainer retains the merge decision; this approval does not authorize or perform a merge.
Posted by an automated review agent operated by @WAWQAQ. This is not an
independent human review and does not satisfy the committer review required by
CONTRIBUTING.md. A human is accountable for this comment — please push back if
anything here is wrong.
简体中文
本条评论由 @WAWQAQ 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。
English
Summary
Establish one canonical transaction model for managed Runtime Host lifecycle ownership.
statediscriminator and recovery direction.listeners.directPeeris the sole managed peer authority.Refs #3984
Why this is one cross-cutting change
Lifecycle ownership is a consistency boundary, not an isolated provider feature. Converting only setup, one provider, or one client would leave competing mutation paths and two effective authorities. This PR replaces that boundary across its existing callers while deliberately excluding WSL controllers and OpenRC drivers.
Review guide
Suggested order:
packages/runtime-host/src/operator/managed-deployment.tspackages/cli/src/runtime-host-managed-deployment.tspackages/cli/src/runtime-host-lifecycle-transaction.tspackages/cli/src/runtime-host-managed-lifecycle-manager.tsThe large diff is primarily production integration, not test volume. No generated release artifacts are included.
Invariants
from; activation compensation completestoand never restores a known-bad owner.environment, nevermachine, availability.Out of scope
Verification
npm run format:checknpm run lintnpm run buildnpm run typechecknpx knip --workspace apps/desktopnpx knip --workspace packages/uiAI use
Tool(s) and scope: OpenAI Codex contributed implementation, tests, review, and this description under human direction.
Checklist
origin/mainDoes this PR entail a change in behavior?
中文
摘要
为 managed Runtime Host lifecycle ownership 建立唯一的 canonical transaction model。
statediscriminator 区分,并记录恢复方向。listeners.directPeer是唯一 managed peer authority。关联 #3984
为什么这是一个横切变更
Lifecycle ownership 是一致性边界,不是孤立的 provider 功能。如果只改 setup、单个 provider 或单个 client,会留下彼此竞争的 mutation path,实际形成两个 authority。本 PR 一次替换现有调用链上的这条边界,但明确不实现 WSL controller 与 OpenRC driver。
审查顺序
建议按以下顺序审查:
packages/runtime-host/src/operator/managed-deployment.tspackages/cli/src/runtime-host-managed-deployment.tspackages/cli/src/runtime-host-lifecycle-transaction.tspackages/cli/src/runtime-host-managed-lifecycle-manager.ts大部分 diff 来自生产路径整合,不是测试数量;PR 不包含生成的 release artifact。
不变量
from;activation 补偿完成to,不会恢复已知失败的 owner。environmentavailability,不能记录machine。不在本 PR 范围内
验证
npm run format:checknpm run lintnpm run buildnpm run typechecknpx knip --workspace apps/desktopnpx knip --workspace packages/uiAI 使用情况
已选择:生成式工具作出了实质贡献。
工具及范围:OpenAI Codex 在人工指导下参与了实现、测试、审查和本描述编写。
检查清单
origin/mainrebase本 PR 是否包含行为变化?