feat(runtime-host): support native Windows managed deployments - #4658
Open
M4n5ter wants to merge 5 commits into
Open
feat(runtime-host): support native Windows managed deployments#4658M4n5ter wants to merge 5 commits into
M4n5ter wants to merge 5 commits into
Conversation
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 12:40
518e566 to
fd3ebfc
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 12:44
fd3ebfc to
03d14c3
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
5 times, most recently
from
September 3, 2026 13:52
0c6b211 to
8eb7a30
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 14:27
8eb7a30 to
9ce29a9
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 14:41
9ce29a9 to
cd1cfb2
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 15:37
cd1cfb2 to
c600e60
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 15:59
c600e60 to
b22360a
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 16:12
b22360a to
60f4343
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
3 times, most recently
from
September 3, 2026 16:59
ad3d2fe to
fd2653f
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 17:16
fd2653f to
df39617
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
2 times, most recently
from
September 3, 2026 17:40
9def741 to
b649461
Compare
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 17:55
b649461 to
34318c6
Compare
Generated-by: OpenAI Codex
M4n5ter
force-pushed
the
feat/runtime-host-windows-task
branch
from
September 3, 2026 18:54
1fbc284 to
5f07e96
Compare
M4n5ter
marked this pull request as ready for review
September 3, 2026 19:21
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
Add a canonical per-user Windows managed Runtime Host lifecycle with
supervised / sessionavailability. The persisted provider projects two owned Task Scheduler tasks: one for Host activation at user logon/on demand, and one for scheduled one-shot reconciliation through the stable operator.Task Scheduler's COM API is handled by typed functions in the existing Runtime Host native addon, with exact semantic verification, ownership markers, locale-independent status, and no private protocol, shell, password, elevation, pidfile, or second lifecycle state machine. Because ExecAction expands
%NAME%, a single exact-package task runner carries desired argv as Base64URL tokens and decodes it beforespawn(..., shell: false); executable or runner paths containing%fail closed.Persisted provider resolution now takes only the canonical deployment config and derives Root ID, provider identity, task runner, and native addon from it. This removes contradictory inputs and selects executable artifacts from the managed exact package rather than the ambient controller, keeping update verification and later package pruning inside the same authority boundary. Pre-install capability discovery remains separate because no deployment exists yet.
Windows Task Scheduler does not reliably classify a normal ExecAction's nonzero process exit as a restartable task failure. An internal exact-package Node supervisor therefore restarts only unexpected Host exits. An outer kill-on-close Job fences the entire scheduled-task tree on retirement, while each managed Host owns a nested generation Job so its detached descendants are reclaimed before a replacement starts. The native status projection maps Task Scheduler's wrapper PID to the unique Node Host child, preserving the existing
supervisor PID == State Root owner PIDtransaction fence.Closes #4646
Verification
runtime-host-windows-*changes always select installed-package validation%PATH%, hostile Unicode/shell-metacharacter argv, double activation to one Host, exact Host PID status, forced crash with detached-descendant cleanup before a fresh PID, running definition replacement with old-tree fencing, retirement cleanup, and owned-task uninstallAvailability and migration
This provider promises availability only while the Windows user is signed in. It does not use SCM, S4U, stored credentials, or claim machine availability. PR 1 automatically upgrades shipped managed Host and WSL state; no Windows provider state has shipped, so unreleased Windows development artifacts do not add another migration format.
AI use
Tool(s) and scope: OpenAI Codex implemented and verified the Windows provider under maintainer direction.
Checklist
Does this PR entail a change in behavior?
中文
摘要
增加 canonical 的 per-user Windows managed Runtime Host lifecycle,availability 为
supervised / session。持久化 provider 投影两个自有 Task Scheduler task:一个负责用户登录/按需 Host activation,另一个通过稳定 operator 触发定时 one-shot reconciliation。现有 Runtime Host native addon 通过 typed function 直接调用 Task Scheduler COM API,使用精确语义验证、ownership marker 和与 locale 无关的状态读取;不增加私有协议,也不使用 shell、密码、提权、pidfile 或第二套 lifecycle 状态机。由于 ExecAction 会展开
%NAME%,统一的 exact-package task runner 将 desired argv 作为 Base64URL token 传输,解码后通过spawn(..., shell: false)执行;executable 或 runner 路径含%时 fail closed。持久化 provider 现在只从 canonical deployment config 解析,并从中派生 Root ID、provider identity、task runner 与 native addon。这样消除了可矛盾输入,且可执行 artifact 来自 managed exact package,而不是当前 ambient controller,使 update 验证与后续 package pruning 始终处于同一 authority 边界。安装前尚无 deployment,因此 capability discovery 保持独立。
Windows Task Scheduler 不会可靠地把普通 ExecAction 的非零进程退出认定为可重启 task failure。因此,一个 exact-package 内部 Node supervisor 只负责重启异常退出。外层 kill-on-close Job 在 retirement 时 fence 整个 scheduled-task process tree;每个 managed Host 再拥有一个嵌套的 generation Job,使其 detached descendants 在 replacement 启动前被完整回收。native status 将 Task Scheduler 的 wrapper PID 投影到唯一 Node Host 子进程,继续满足既有的
supervisor PID == State Root owner PID事务 fence。关闭 #4646
验证
runtime-host-windows-*变更始终触发 installed-package validation%PATH%、恶意 Unicode/shell 元字符 argv、双 activation 单 Host、强制崩溃后先清理 detached descendant 再产生新 PID、运行中替换 definition 并 fence 旧进程树、retirement 清理与 owned-task uninstall可用性与迁移
该 provider 只承诺 Windows 用户登录期间可用,不使用 SCM、S4U 或保存的凭据,也不宣称 machine availability。PR 1 会自动升级已发布的 managed Host 与 WSL 状态;Windows provider 状态从未发布,因此不为开发期 Windows artifact 增加另一套迁移格式。
AI 使用
工具与范围:OpenAI Codex 在维护者指导下实现并验证 Windows provider。
检查清单
该 PR 是否改变行为?