feat(runtime-host): own session catalog and configuration - #1651
Conversation
|
I went through the storage and Runtime Host paths. The ownership split is coherent: Host exposes closed operations, while execution-sensitive configuration stays in Runtime. I found one P1 and three P2 findings.
I do not think the PR needs to be split. The slice is cohesive, but I would fix these durability and authority gaps before it lands. |
English@Astro-Han Thanks for the detailed review. I addressed all four findings in
Validated with the full Storage (820 passed), Runtime (2,827 passed), and Runtime Host (376 passed) suites, plus the root build and typecheck. 简体中文感谢详细审查。
完整 Storage(820 项)、Runtime(2,827 项)、Runtime Host(376 项)测试,以及根目录 build 和 typecheck 均已通过。 |
9c491e1 to
cc6b9ee
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Approve. The original four findings are fixed, and the PR still reads as one cohesive change.
A few follow-ups remain:
-
[P2] Recover an existing empty or truncated stable-create transcript. If the process exits after the create claim becomes durable but while
session.jsonlis being written,ensureMarkerOnlyTranscript()finds the file but rejects it instead of restoring the marker. An exact retry can then fail permanently for that Session ID. -
[P2] Repair a pending catalog projection before serving more reads. If the JSONL append succeeds and
commitCatalogProjectionWrite()fails, the same Host can continue returning stale catalog data because projection recovery only runs during store initialization. -
[P2] Reject reserved execution labels in
session.create. Labels such asmode:deep_researchandmode:expert-team:*are accepted at creation, but root admission rejects those modes and metadata replacement preserves the labels. This can create a Session that cannot run and cannot be repaired through the catalog API. -
[P2] Apply the existing Plan-mode restriction to
session.configuration.update. Creation rejectscollaborationMode: "plan", but configuration updates still accept it, leaving the Session unusable until another update changes it back. -
[P2] Canonicalize
cwdwithrealpath()before fingerprinting and persistence.resolve()plusstat()leaves the stored execution identity tied to a symlink path whose target can later change without a Session revision. -
[P3] Add focused coverage for the 48 KiB pagination boundary, forbidden configuration states, read-marker retry exhaustion, and response loss followed by Host restart. Splitting the long UDS scenario would also make failures easier to isolate.
None of these requires another architectural layer or a PR split. They fit the seams already introduced here.
cc6b9ee to
7fa3ac8
Compare
7fa3ac8 to
4d58677
Compare
|
The latest fixes close the earlier P2 findings. I have two non-blocking follow-ups:
These do not block this PR under the current scope and severity threshold. |
English
Summary
Make Runtime Host the canonical authority for Session catalog reads, stable creation, metadata changes, configuration replacement, and message-based read markers, while keeping execution-sensitive configuration transitions under Runtime authority.
Multiple Clients now observe one revisioned Session projection and serialize competing mutations through the Host instead of owning independent Session state.
Catalog and creation
Metadata and configuration
Coordination and lifecycle
Boundaries
This slice does not add archive, unarchive, remove, working-directory moves, branching, or revision operations. It does not wire Desktop or TUI production adapters and does not change production Host activation.
Configuration changes that require shell-lineage cleanup or Plan-state validation fail closed until the serving Host composition provides those authorities. The pre-release Runtime Host wire protocol remains v0.
Validation
git diff --checkpassed.Part of #1167 and #853.
简体中文
概要
让 Runtime Host 成为 Session catalog 读取、稳定创建、metadata 变更、configuration 完整替换和基于 message 的 read marker 的权威所有者;涉及执行资源的 configuration transition 仍由 Runtime authority 负责。
多个 Client 现在会观察同一份带 revision 的 Session projection,并通过 Host 串行化竞争 mutation,不再各自持有独立的 Session 状态。
Catalog 与创建
Metadata 与 Configuration
协调与生命周期
边界
本 slice 不增加 archive、unarchive、remove、working-directory move、branch 或 revision operation;也不接入 Desktop/TUI production adapter,不改变生产 Host activation。
需要清理 shell lineage 或校验 Plan 状态的 configuration change 会 fail closed,直到 serving Host composition 提供对应 authority。预发布 Runtime Host wire protocol 继续保持 v0。
验证
git diff --check通过。属于 #1167 和 #853 的一部分。