feat(runtime-host): coordinate local owner transfer - #3769
Draft
me2seeks wants to merge 2 commits into
Draft
Conversation
This was referenced Aug 25, 2026
me2seeks
force-pushed
the
feat/runtime-host-local-process-transaction
branch
from
August 25, 2026 07:10
5928dc7 to
9323f81
Compare
6 tasks
me2seeks
force-pushed
the
feat/runtime-host-local-process-transaction
branch
2 times, most recently
from
August 25, 2026 09:08
0cfab38 to
61b61a8
Compare
6 tasks
me2seeks
force-pushed
the
feat/runtime-host-local-process-transaction
branch
2 times, most recently
from
August 25, 2026 09:39
fa0af6d to
4e78816
Compare
Generated-by: Codex
Stage an exact target before persisting transfer intent, then hold the single deployment-authority lock through exact Host retirement, writer release, activation, Ready verification, and owner commit. Preserve transferring state for crash recovery and safely restore the previous owner only when active work refused retirement before cutover. Generated-by: Codex
me2seeks
force-pushed
the
feat/runtime-host-local-process-transaction
branch
from
August 25, 2026 10:02
4e78816 to
dd4756a
Compare
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
Add the local-process owner-transfer transaction on top of #3767.
The transaction stages and verifies the exact target before durable intent, then holds the one deployment-authority lock across revision CAS, exact observed-Host cutover, State Root writer release, target activation, Ready verification, and owner commit. A retry re-observes reality: it can recognize the same transaction-scoped target after a caller crash, while post-retirement failures remain truthfully
transferringinstead of claiming rollback.An
active_workrefusal is the only automatic rollback path, and its adapter contract guarantees retirement never began and the previous owner remains runnable. Target staging failures and stale owner confirmations do not retire a Host.This PR deliberately adds no second deployment journal or lock, no PID/HostEpoch/version authority, no ordinary
connectOrSpawnreplacement policy, and no remote Client mutation path. Source-specific Desktop, installed CLI, and managed-service adapters remain separate follow-up slices because their launch and supervisor evidence genuinely differ.Refs #3231
Refs #3709
简体中文摘要
在 #3767 的 durable owner record 之上增加本地进程 owner transfer transaction。
Transaction 先 stage 并验证精确 target,再用唯一的 deployment-authority lock 串行完成 revision CAS、精确 observed Host cutover、State Root writer 释放、target 启动、Ready 验证和 owner commit。Crash 后不会从 PID 或 HostEpoch 续跑,而是重新观察现实;如果本次 transaction 的精确 target 已经在运行,则只重验 Ready 并 commit,不会重复 retirement 或 launch。
只有 Host 因 active work 拒绝、且 adapter 保证 retirement 尚未开始时,才自动恢复旧 owner。Staging 失败或 stale confirmation 都不会 retirement Host。
本 PR 不增加第二份 deployment journal 或第二把 authority lock,不把 version/epoch 当 owner,不把 replacement policy 塞回普通
connectOrSpawn,也不允许 remote Client 修改 Host。Desktop、installed CLI 与 managed service 的 adapter 因 launch/supervisor 证据不同,留作独立后续切片。Dependency and review focus
mainincludes feat(runtime-host): add durable local deployment ownership #3767 plus the transfer transaction; after feat(runtime-host): add durable local deployment ownership #3767 merges, this branch will be rebased ontomainand retain only the transaction commit.target_presentwith a transaction-scoped launch fence or managed deployment evidence, never version alone.Verification
npm --workspace @maka/runtime-host test— 1160 passed, 0 failed.npx biome lint packages/runtime-host/src/operator/local-deployment-owner.ts packages/runtime-host/src/operator/local-process-owner-transfer.ts packages/runtime-host/src/operator/index.ts packages/runtime-host/src/__tests__/local-process-owner-transfer.test.ts— passed.AI use
Select exactly one:
Tool(s) and scope: Codex designed and implemented the transaction seam, recovery semantics, and tests under user direction. The commit includes a
Generated-by: Codextrailer.Checklist
Does this PR entail a change in behavior?