Repository navigation
feat(runtime-host): add runtime policy authority - #1401
Conversation
c502869 to
e4c43b5
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
I found two lower-severity gaps:
- [P2]
SessionManager.refreshIdleBackends()relies onRuntimeKernel.invalidateBackend(), but the idle path reachesdisposeBackend(), which catches everybackend.dispose()error and returns success.onCommittedMutation()therefore resolves, the activation gate is not poisoned, and the Host does not drain. This contradicts the PR's stated failure contract. A backend that fails cleanup can remain alive outside the cache while later activations continue. Propagate disposal failures through this policy invalidation path. - [P2]
refreshIdleBackends()callsstore.list()and invalidates every persisted session. ProductionSessionStore.list()reads preview messages for every record and full transcript snapshots for the first three. A policy or credential edit therefore performs storage work proportional to the entire session history, even though only cached backends need invalidation. It can also poison and drain the Host because of an unrelated session-list failure. The runtime kernel already owns the active backend maps, so this refresh should target those cached session IDs.
These do not block the non-serving authority slice, so I am approving. They should be fixed before production cutover.
e4c43b5 to
d127a6f
Compare
|
@Astro-Han Agreed with both findings. They are fixed in
The overlap tests use a real RuntimeEvent persistence gate. Removing either the parent or child wait/recheck makes its corresponding test fail deterministically. After rebasing to current 简体中文同意这两项 finding,已在
Overlap 测试使用真实 RuntimeEvent persistence gate;分别移除 parent 或 child 的 wait/recheck 后,对应测试都会确定性失败。Rebase 到当前 |
|
Needs a rebase onto latest Only one real conflict, in @M4n5ter can you rebase onto |
d127a6f to
2704a10
Compare
@Astro-Han Done |
|
@Astro-Han Rebased onto the latest 简体中文已 rebase 到最新 |
English
Context
This PR establishes the Runtime Host authority for Runtime Policy, the Connection Catalog, and the Credential Vault. It is a complete M3 authority slice tracked by #1167.
The Host remains non-serving in production. This PR does not switch Desktop, TUI, CLI, or Headless entrypoints, and it does not migrate the current mixed surface settings document.
What changes
Canonical contracts
Lease-bound persistence
commit_outcome_unknownrather than guessing whether a retry is safe.Typed Host operations
Evidence
Coverage includes strict codec boundaries, lease authentication, compare-and-set conflicts, secret redaction, ambiguous durable publication, interrupted connection removal and successor recovery, large revision-pinned catalogs, two real UDS Clients racing one authority, production gate composition, cached-only invalidation, disposal failure propagation, and deterministic parent/child replacement races.
After rebasing onto current
main, the full Runtime suite passes 2,495 tests with seven existing skips, and Runtime Host passes all 89 tests. The workspace build and typecheck, Biome format/lint checks, andgit diff --checkalso pass.Scope
This slice intentionally does not perform model discovery, connection testing, OAuth refresh/presentation, or other network/native effects. Those belong to later Connection Effects and OAuth slices, which will commit their results through this authority. Production surface wiring,
AppSettingsremoval, deferred-tool economy wiring, and the M4 cutover also remain out of scope.Part of #1167. Related to #853.
简体中文
背景
本 PR 建立 Runtime Host 对 Runtime Policy、Connection Catalog 与 Credential Vault 的权威所有权,是 #1167 跟踪的一份完整 M3 authority slice。
Runtime Host 仍未进入 production serving。本 PR 不切换 Desktop、TUI、CLI 或 Headless 的入口,也不迁移当前混合了多个 owner 的 surface settings 文档。
改动内容
Canonical 契约
Lease-bound 持久化
commit_outcome_unknown,不猜测重试是否安全。Typed Host operation
验证证据
覆盖严格 codec 边界、lease 认证、compare-and-set 冲突、秘密脱敏、durable publication 结果不确定、connection removal 中断后的 successor recovery、大型 revision-pinned Catalog、两个真实 UDS Client 竞争同一 authority、production gate composition、cached-only invalidation、disposal failure propagation,以及确定性的 parent/child replacement race。
Rebase 到当前
main后,Runtime 全量 2,495 项通过,另有 7 项既有 skip;Runtime Host 89 项全部通过。全 workspace build 与 typecheck、Biome format/lint 和git diff --check也均通过。范围
本 slice 刻意不执行 model discovery、connection test、OAuth refresh/presentation 或其他 network/native effect。这些内容属于后续 Connection Effects 与 OAuth slice,并通过本 authority 提交结果。Production surface wiring、
AppSettings删除、deferred-tool economy 接线与 M4 cutover 也不在本 PR 范围内。属于 #1167;关联 #853。