refactor(runtime-host): make operator control platform-neutral - #4657
Draft
M4n5ter wants to merge 1 commit into
Draft
refactor(runtime-host): make operator control platform-neutral#4657M4n5ter wants to merge 1 commit into
M4n5ter wants to merge 1 commit into
Conversation
M4n5ter
force-pushed
the
refactor/runtime-host-operator-command
branch
12 times, most recently
from
September 3, 2026 17:40
0f19a1c to
1bf5ba1
Compare
Generated-by: OpenAI Codex
M4n5ter
force-pushed
the
refactor/runtime-host-operator-command
branch
from
September 3, 2026 17:55
1bf5ba1 to
e43706e
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.
English
Summary
Make managed Runtime Host control describe a target-platform invocation instead of assuming every operator is a POSIX-executable path. New deployments use one exact
{ nodePath, modulePath, platform }command across Desktop, CLI, SSH, and WSL; Windows SSH uses an encoded PowerShell invocation independent of the account's default shell.SSH preflight now reports the remote Node identity as a fact. Published npm onboarding derives only the operator platform from it, while development archive selection alone applies the finite Direct-peer prebuild policy; supported published targets such as macOS x64 are no longer rejected by an unrelated native-artifact whitelist.
Shipped path-based SSH/WSL profiles, interrupted SSH pairing journals, and Desktop managed bindings are upgraded automatically without changing their target identity or credential binding. Existing POSIX deployment operators become stable forwarders to the persisted exact package, so migrated WSL and SSH installations survive later updates and package pruning. The shipped WSL
profile set --operator-pathCLI remains a legacy POSIX alias for existing automation, while new callers use--operator-command. Native Windows also receives its correct application-data root. This slice deliberately adds no lifecycle provider; that is the stacked follow-up.Re-adding an existing WSL Host now recognizes deployment identity independently from its control route. It upgrades the existing profile and binding atomically instead of creating a duplicate profile; a failed binding write restores the previous profile.
The stable operator also preserves child signal exits: it removes only its own forwarding handlers before reproducing the child's signal, so lifecycle callers cannot mistake a terminated exact package for a successful operation.
Refs #4646
Verification
SIGTERMpropagationReview focus
The operator command is the only cross-platform invocation authority. Callers must not reconstruct shell commands or infer the target platform. Compatibility is limited to persisted shapes that shipped: reads work immediately, owning mutations rewrite current schemas, and unreleased intermediate representations remain unsupported.
AI use
Tool(s) and scope: OpenAI Codex implemented and verified the refactor under maintainer direction.
Checklist
Does this PR entail a change in behavior?
中文
摘要
managed Runtime Host 控制面不再假设所有 operator 都是 POSIX 可执行路径,而是描述目标平台调用。新部署在 Desktop、CLI、SSH 与 WSL 中统一使用精确的
{ nodePath, modulePath, platform }命令;Windows SSH 使用编码后的 PowerShell 调用,不依赖账号默认 shell。SSH preflight 现在只报告远端 Node identity 这一事实。发布版 npm onboarding 仅据此确定 operator platform,只有开发 archive 选择才应用有限的 Direct-peer prebuild 策略;macOS x64 等发布版可支持目标不再被无关的原生产物白名单拒绝。
已发布版本留下的 path-based SSH/WSL profile、未完成的 SSH pairing journal 与 Desktop managed binding 会自动升级,并保持原 target identity 与 credential binding。既有 POSIX deployment operator 会变为指向持久化 exact package 的稳定 forwarder,使迁移后的 WSL/SSH 安装在后续更新和 package pruning 后仍可工作。已发布的 WSL
profile set --operator-pathCLI 会保留为既有自动化使用的 legacy POSIX alias,新调用方使用--operator-command。该切片同时使用 Windows 原生 application-data 目录;lifecycle provider 位于 stack 的后续 PR。重新添加既有 WSL Host 时,会独立于 control route 识别 deployment identity,原子升级已有 profile 与 binding,而不是创建重复 profile;binding 写入失败则恢复原 profile。
稳定 operator 还会保留子进程的 signal exit:在复现子进程信号前只移除自身安装的 forwarding handler,避免 lifecycle 调用方把被终止的 exact package 误判为成功。
关联 #4646
验证
SIGTERM传播集成覆盖审查重点
operator command 是唯一跨平台调用 authority。调用方不得重新拼 shell command,也不得重新猜测目标平台。兼容范围只覆盖真正发布过的持久化形态:读取立即可用,下一次 owning mutation 写回当前 schema;未发布的中间表示不兼容。
AI 使用
工具与范围:OpenAI Codex 在维护者指导下实现并验证本次重构。
检查清单
该 PR 是否改变行为?