refactor(runtime-host): unify local deployment handoffs - #3813
Open
me2seeks wants to merge 1 commit into
Open
Conversation
Astro-Han
approved these changes
Aug 26, 2026
Contributor
There was a problem hiding this comment.
I reviewed this head and found no blocking issues.
Unified handoff correctly covers both transfer paths, with hosted checks green.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
selecttransition so an owned deployment cannot change without the handoff transactionWhy
#3769 delivered the serialized local-process transaction, but intentionally required different installation owners. Installed npm CLI upgrades in #3243 also need to replace a deployment while retaining the same persistent owner.
A separate same-owner replacement transaction would duplicate the durable state, authority lock, cutover phases, and crash-recovery rules. This change keeps one physical sequence for both cases:
The owner may stay the same or change. No source-specific CLI, Desktop,
npx, managed-service, remote-operator, or presentation policy is added here.Simplification and first-principles audit
GO. The final diff adds no authority, lock, journal, or state kind. It removes the uncoordinated
selectpath and makes the existing transaction deep enough for both owner-preserving and cross-owner handoffs. A selected deployment can now change only at initial claim, verified handoff commit, or explicit rollback.Verification
npm --workspace @maka/runtime-host run buildnpm --workspace @maka/runtime-host run typecheckgit diff --checkThe repository-wide Runtime Host test command cannot provide an additional local signal in this checkout because the existing dependency closure lacks
minisearchand has an incompatiblehttps-proxy-agentexport; the missingminisearchimport reproduces from the unchanged main worktree.Refs #3243
Refs #3231
Refs #3709
简体中文摘要
本 PR 把 #3769 的“仅跨 owner 转移”深化为一条统一的本地 deployment handoff:
from与to可以相同,也可以不同。这样,同一 persistent CLI installation 更新 deployment 与 Desktop/CLI 等跨 owner 转移复用同一份 durable state、同一把 authority lock、同一套退场/单写者释放/Ready 验证/崩溃恢复规则。同时删除可绕过 Host 退场与 Ready 证明直接修改 selected deployment 的
selecttransition。最终 selected deployment 只能在初始 claim、验证完成后的 handoff commit,或明确 rollback 时变化。本 PR 不加入 CLI、Desktop、临时
npx、managed service、remote operator 或 TUI 展示策略。双重审查结论为 GO:没有新增 authority、lock、journal 或 state kind,反而消除了一条并行状态变更路径。验证:Runtime Host build 与 typecheck 通过;owner + handoff 聚焦测试 30/30;scoped Biome 与 diff-check 通过。全包 Runtime Host 测试在本地受既有依赖闭包缺失影响,纯 main 可复现,与本 diff 无关。
Generated-by: Codex