瀏覽代碼

docs(session): align projection replay criteria

pku-xht 1 月之前
父節點
當前提交
68c48109e3

+ 2 - 2
.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.i18n.yaml

@@ -2,5 +2,5 @@
 # side as of the last confirmed-consistent state. Both languages carry equal authority;
 # after editing either side, bring the other along and re-record with:
 #   pnpm run verify-translation-pairing --write .agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.md
-2026-07-27-session-projection-and-command-log.md: 0864a4d2e41cf6bc46c9cd42b39a3755c0996234
-2026-07-27-session-projection-and-command-log.zh.md: 0513819fb12a04afa70afc01d1f15e3462b05471
+2026-07-27-session-projection-and-command-log.md: 3fbf07b90945c58a33d48eadd77b5838a4ccacb1
+2026-07-27-session-projection-and-command-log.zh.md: 7eb78cc3cbec6a459776dafee69b91568b11dc74

+ 1 - 1
.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.md

@@ -177,7 +177,7 @@ Infrastructure first; the three in-flight PRs are left untouched and re-target a
 
 - A domain plugin ships per-session log-derived state to React by writing only: its durable event declaration, one deterministic host unit with `init(header)`, `apply`, and a complete `wire.view`, its `SessionProjectionMap` merge, and inject callbacks — zero client-side folding code, no edits to the client `Session` class, `ConversationSnapshot`, api-proxy, or the wire schema files. Live and detached folds receive the same immutable header that supplied their events, with the normalized seed boundary centrally validated.
 - The history tail page carries `projections` with `asOfSeq` equal to the window tail seq; loadOlder pages never carry it; a deployment without the registry serves histories without the block and clients treat every key as absent.
-- A follow opening baseline exactly replaces tentative cache rows, while control frames and replacement baselines arriving during opening or reconnection replay in order; outside that replacement boundary, stale or replayed frames cannot regress the value store.
+- A follow opening baseline exactly replaces tentative cache rows. During opening or reconnection, the client retains only the latest captured replacement baseline and the frames that follow it; the newer complete cut wins, and only frames above that selected cut replay. Outside that replacement boundary, stale or replayed frames cannot regress the value store.
 - A slash command executed on one tab renders a durable node in the flow on refresh, on a second tab, and after resume; unregistered commands render the generic card; the composer notice path for command outcomes is gone.
 - `useProjection` reaches components through the standard props kit; no hook crosses an inject contract (including `useSelection`).
 - Session titles ride the generic pair (baseline block + projection frame); the bespoke `session/title` frame and the client title-snapshot map are gone.

+ 1 - 1
.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.zh.md

@@ -177,7 +177,7 @@ host 侧命令执行器(`packages/interaction/commands`)在调用处理器
 
 - 领域插件把按会话的日志派生状态送达 React,只需写:自己的持久事件声明、一个具有 `init(header)`、`apply` 和完整 `wire.view` 的确定性 host 单元、自己那份 `SessionProjectionMap` merge,以及 inject 回调——零客户端侧折叠代码,不改客户端 `Session` 类、`ConversationSnapshot`、api-proxy 或任何协议 schema 文件。live 与 detached 折叠接收提供对应事件的同一个不可变 header,规范化 seed 边界由注册表集中校验。
 - 历史尾页携带 `projections`,其 `asOfSeq` 等于窗口尾部 seq;loadOlder 页永不携带;未装注册表的部署照常返回不带该块的历史,客户端把所有 key 视为缺席。
-- Follow opening baseline 会精确替换暂存 cache row,而 opening 或重连期间到达的 control frame 与 replacement baseline 会按顺序重放;在该替换边界之外,陈旧或重放 frame 不能让值仓倒退。
+- Follow opening baseline 会精确替换暂存 cache row。opening 或重连期间,客户端只保留最后一份捕获的 replacement baseline 及其后续 frame;较新的完整 cut 胜出,只有高于所选 cut 的 frame 才会重放。在该替换边界之外,陈旧或重放 frame 不能让值仓倒退。
 - 在一个标签页执行的斜杠命令,刷新后、在第二个标签页上、恢复之后都在 flow 中渲染出持久节点;未注册的命令渲染通用卡片;命令结果的 composer 通知路径彻底移除。
 - `useProjection` 经标准 props 套件抵达组件;没有任何钩子穿过 inject 约定(包括 `useSelection`)。
 - 会话标题搭乘这对通用机制(基线块 + 投影帧);专设的 `session/title` 帧与客户端标题快照表彻底移除。