You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How should Maka let a newer Desktop, TUI, or CLI keep using a shared remote Runtime Host without making Host idleness a precondition, while preserving one Runtime Host authority for one State Root?
This discussion follows #3203. That issue is intentionally narrow: preserve the safe incompatibility facts already returned by the handshake. It does not choose a deployment policy.
Current facts
Current
A Runtime Host is the long-lived process that owns one State Root and its Runtime work. One process owns that root's writes, and one Hosted Execution authority admits and stops top-level Session work.
The Host Kernel owns the State Root's exclusive writer lease. Composition and its Module set are fixed before Ready.
A remote profile is Client-owned connection configuration, not Host state or lifecycle authority.
The current handshake rejects a compatibilityEpoch mismatch before a Domain command is admitted. The current protocolMin/protocolMax values do not yet provide a supported skew window.
Existing coverage proves that a remote Client reconnects to canonical state after a service restart. It does not claim zero-downtime upgrade of incompatible Runtime semantics.
Managed Linux Hosts now support an explicitly authorized exact-package maintenance transaction: stage, exact-Host retirement, service cutover, replacement readiness/version verification, and truthful incomplete-update recovery (feat(runtime-host): add managed Host retirement #3557, feat(runtime-host): add safe managed Host updates #3591). This supplies the replacement mechanism but does not define a supported Client–Host skew window.
Relevant anchors:
docs/architecture/runtime-host-architecture.md — one State Root writer, one Hosted Execution authority, fixed Composition
packages/runtime-host/src/protocol/index.ts — Client/Host handshake and compatibility epoch
packages/runtime-host/src/server/host-kernel.ts — handshake admission and lifecycle
packages/runtime-host/src/__tests__/authenticated-websocket.test.ts — remote service restart and canonical-state recovery
Constraints
Any direction must preserve all of the following:
One State Root has at most one writer owner.
One Session has at most one root Hosted Execution or pending root admission.
Desktop, TUI, CLI, and WebSocket transport remain Clients; none gains remote service lifecycle authority from an access credential.
An incompatibility never admits a Domain command, replays a command, or silently downgrades transport.
An AI agent may diagnose or draft an upgrade plan, but cannot silently deploy, replace, or restart a remote Host.
Direction to evaluate
Exploratory
1. Make ordinary release skew a negotiated contract, not an exact product-version test
Keep a product release identifier for diagnostics, artifact selection, and support. Do not use it as the connection gate.
Instead, define a bounded, explicit Client–Host compatibility contract:
a Host advertises supported protocol/contract revisions and safe capabilities;
a Client selects only a mutually supported revision and hides unsupported capabilities;
an epoch mismatch remains unsafe unless the Host intentionally ships and advertises a compatible decoder/adapter for that older contract;
no Client infers that the Host is "older" or that it may update the Host merely from a mismatch.
This is analogous to an explicit version-skew policy, not a claim that arbitrary builds are interoperable. Kubernetes, for example, publishes a bounded client/control-plane skew policy rather than requiring every kubectl binary to equal the server version.
2. Keep remote Host deployment operator-led by default
The default remote profile remains operator_managed in behavior, whether or not that name becomes a persisted field:
the Host operator selects the exact release artifact and authorizes service start, retirement, replacement, and any safe rollback;
ordinary Runtime Host Client credentials remain separate from deployment authority, and no connection or compatibility failure triggers a silent update.
VS Code and Zed automatically arrange exact local-client-matched remote binaries. That is useful installation UX for client-managed editor backends, but it is not a safe default for Maka's shared, durable Runtime Host.
3. Handle genuinely incompatible Host upgrades as one-Host recovery, not parallel Runtime ownership
When a new Host build cannot support the active contract, there is no safe promise of an uninterrupted in-place semantic upgrade under the current architecture. The operator must use an explicit maintenance path:
stage and verify the signed artifact without mutating the active Host;
announce a pending upgrade and stop admitting only the work that the maintenance policy forbids;
drain or explicitly interrupt work according to existing durable/result-unknown rules;
close the sole Host, start the replacement against the same State Root, and recover canonical state;
reconnect Clients under a new Host Epoch and expose any unresolved external effect honestly.
The key usability property is that normal Client updates do not require this path: compatible Clients keep using the active Host. A breaking Host update is an operator maintenance event, not an automatic Client action.
Explicit non-direction
The following is not proposed for the current Runtime Host architecture:
one State Root
├─ Runtime Host / execution revision A
└─ Runtime Host / execution revision B
If each branch owns Composition, Session lifecycle, or durable writes, it creates a second Runtime authority and violates the existing one-Host contract. Session-pinned multi-worker revisions may be worth a separate future architecture exploration only after a stable supervisor/worker boundary exists; it is not implied here.
Design questions
Which compatibility tuple should be advertised: protocol range alone, or a versioned contract plus capability set?
What bounded skew window is supportable, and which operation/capability additions can be safely feature-gated?
Should a Host advertise release channel/build identity and a signed update manifest reference solely for diagnostics? What fields are safe to disclose?
What are the exact draining, maintenance, restart, and recovery UX states for remote Clients?
Which evidence is required before allowing a new compatibility window: two-version protocol tests, restart recovery, revocation, no-command-replay, and external-effect uncertainty tests?
Question
How should Maka let a newer Desktop, TUI, or CLI keep using a shared remote Runtime Host without making Host idleness a precondition, while preserving one Runtime Host authority for one State Root?
This discussion follows #3203. That issue is intentionally narrow: preserve the safe incompatibility facts already returned by the handshake. It does not choose a deployment policy.
Current facts
Current
compatibilityEpochmismatch before a Domain command is admitted. The currentprotocolMin/protocolMaxvalues do not yet provide a supported skew window.Relevant anchors:
docs/architecture/runtime-host-architecture.md— one State Root writer, one Hosted Execution authority, fixed Compositionpackages/runtime-host/src/protocol/index.ts— Client/Host handshake and compatibility epochpackages/runtime-host/src/server/host-kernel.ts— handshake admission and lifecyclepackages/runtime-host/src/__tests__/authenticated-websocket.test.ts— remote service restart and canonical-state recoveryConstraints
Any direction must preserve all of the following:
Direction to evaluate
Exploratory
1. Make ordinary release skew a negotiated contract, not an exact product-version test
Keep a product release identifier for diagnostics, artifact selection, and support. Do not use it as the connection gate.
Instead, define a bounded, explicit Client–Host compatibility contract:
This is analogous to an explicit version-skew policy, not a claim that arbitrary builds are interoperable. Kubernetes, for example, publishes a bounded client/control-plane skew policy rather than requiring every
kubectlbinary to equal the server version.2. Keep remote Host deployment operator-led by default
The default remote profile remains
operator_managedin behavior, whether or not that name becomes a persisted field:VS Code and Zed automatically arrange exact local-client-matched remote binaries. That is useful installation UX for client-managed editor backends, but it is not a safe default for Maka's shared, durable Runtime Host.
3. Handle genuinely incompatible Host upgrades as one-Host recovery, not parallel Runtime ownership
When a new Host build cannot support the active contract, there is no safe promise of an uninterrupted in-place semantic upgrade under the current architecture. The operator must use an explicit maintenance path:
The key usability property is that normal Client updates do not require this path: compatible Clients keep using the active Host. A breaking Host update is an operator maintenance event, not an automatic Client action.
Explicit non-direction
The following is not proposed for the current Runtime Host architecture:
If each branch owns Composition, Session lifecycle, or durable writes, it creates a second Runtime authority and violates the existing one-Host contract. Session-pinned multi-worker revisions may be worth a separate future architecture exploration only after a stable supervisor/worker boundary exists; it is not implied here.
Design questions
draining, maintenance, restart, and recovery UX states for remote Clients?References
简体中文
问题
在保持一个 State Root 只有一个 Runtime Host authority 的前提下,Maka 应如何让较新的 Desktop、TUI 或 CLI 继续使用共享 remote Runtime Host,而不把“Host 必须空闲”变成用户可用性的前提?
本讨论承接 #3203。#3203 只负责保留握手已返回的安全不兼容事实,不决定部署策略。
当前事实
Current
compatibilityEpochmismatch;当前protocolMin/protocolMax尚未形成受支持的 skew window。相关锚点:
docs/architecture/runtime-host-architecture.md— one State Root writer、one Hosted Execution authority、fixed Compositionpackages/runtime-host/src/protocol/index.ts— Client/Host handshake 与 compatibility epochpackages/runtime-host/src/server/host-kernel.ts— handshake admission 与 lifecyclepackages/runtime-host/src/__tests__/authenticated-websocket.test.ts— remote service restart 与 canonical-state recovery约束
任何方向都必须保持:
待评估方向
Exploratory
1. 将普通 release skew 设计为协商契约,而非精确 product-version 检查
product release identity 用于诊断、artifact selection 与支持,不作为 connection gate。Host 广告受支持的 protocol/contract revisions 与 safe capabilities;Client 只选择双方支持的 revision,并隐藏不支持的 capability。epoch mismatch 仍不安全,除非 Host 明确提供并广告旧 contract 的 compatible decoder/adapter。任何 Client 都不会从 mismatch 推断 Host “旧了”,或获得更新 Host 的权力。
2. 默认保持 remote Host deployment 由 operator 管理
默认 remote profile 在行为上仍为
operator_managed:operator 选择精确 release artifact,并授权 service start、retirement、replacement 以及有证据支持的安全 rollback;Desktop 或 CLI 可以在 operator 明确确认后,通过 SSH management plane 执行 #3591 已交付的显式事务;普通 Runtime Host Client credential 仍与 deployment authority 分离,连接或兼容失败也不会触发静默更新。3. 真正不兼容的 Host 升级使用 one-Host recovery,而不是 parallel Runtime ownership
若新 Host build 无法支持 active contract,当前架构不能安全承诺不中断的 in-place semantic upgrade。operator 应走显式 maintenance path:先 stage/verify artifact,不修改 active Host;宣布 pending upgrade;按已有 durable/result-unknown 规则 drain 或明确 interrupt work;关闭唯一 Host;以同一 State Root 启动 replacement 并恢复 canonical state;Client 在新 Host Epoch 下重连,并如实显示 unresolved external effect。
正常 Client update 不需走此路径:兼容 Client 继续使用 active Host。breaking Host update 是 operator maintenance event,不是自动 Client action。
明确不采纳的方向
下面的结构不属于当前 Runtime Host 架构:
若两个分支各自拥有 Composition、Session lifecycle 或 durable write,就会产生第二个 Runtime authority,违反 one-Host contract。Session-pinned multi-worker revision 只能在未来已有稳定 supervisor/worker boundary 后另行探索,本讨论不暗示其已可实施。
设计问题
draining、maintenance、restart 与 recovery UX state 是什么?参考