@deepseek-ai/dsh-client-test-runtime 0.1.1-rc.2 → 0.1.2-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/test-support/client-runtime/README.md
5
- README.md: 443cadb63d2e290874d7248d7fb104c7340d55c7
6
- README.zh.md: 596f6a90f1223a6108fd09b66c1451539c8ce1fd
5
+ README.md: 085b819258f235bcbda0d5406c52fc03a12b81d5
6
+ README.zh.md: e2292802b19109cc6e39100fb9c0ff5147a78497
package/README.md CHANGED
@@ -1,15 +1,126 @@
1
+ ---
2
+ description: "jsdom slot test runtime for browser feature specs, for test authors exercising slots, stores, and rendering against production machinery."
3
+ kind: "package-library"
4
+ ---
5
+
1
6
  # @deepseek-ai/dsh-client-test-runtime
2
7
 
3
8
  English | [中文](README.zh.md)
4
9
 
5
- jsdom slot test runtime for client feature specs: a real Cordis `Context`, the production `SlotRegistry` and UI renderer, assembled around typed session/workspace doubles. Feature suites exercise declaration, registration, scope, store, inject, rendering, updates, and disposal without hand-building the machinery per suite — and without a second implementation of any production logic.
10
+ ## Summary
11
+
12
+ `dsh-client-test-runtime` gives a browser feature spec a real jsdom test bench: it assembles a Cordis context, the renderer-owned slot registry, and the production `UiSession` adapter around typed Session and Workspace Controller doubles. Feature suites exercise declaration, registration, scoping, stores, injection, rendering, updates, and disposal without copying production renderer or adapter logic. Suites publish Session lifecycle state, Workspace state, projection values, and Conversation events through typed fixtures, then use local DOM snapshot roots, scoped Testing Library queries, and fail-loud service checks. It is not part of the product plugin graph (no `dsh.client`); feature packages depend on it in `devDependencies` only.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ This package gives a browser feature spec a real runtime to mount against: create the bench, declare the slots your feature occupies, mount the feature plugin, render a slot, assert on the local view, and dispose — with no second implementation of production logic.
29
+
30
+ ### Setting up a feature spec
31
+
32
+ `SlotTestRuntime.create()` assembles the runtime, `declare(children)` registers an auto frame whose per-key `<div data-slot>` wrappers become snapshot roots, `mount(plugin)` runs the feature on a real fiber, and `renderSlot(key, owner)` returns the slot-local view with scoped queries and in-place updates:
33
+
34
+ ```text
35
+ const runtime = await SlotTestRuntime.create()
36
+ await runtime.declare({ 'feature-slot': {} })
37
+ const handle = await runtime.mount(FeaturePlugin)
38
+ const view = runtime.renderSlot('feature-slot', { owner: props })
39
+ expect(view.container).toMatchSnapshot()
40
+ await runtime.dispose()
41
+ ```
42
+
43
+ `mount` prechecks required services and fails loud when one is missing — `provide(name, value)` supplies an extra service first. `storeOf(key, scopeKey)` returns the live store instance the renderer hands a slot's component for identity and action-driven-write assertions.
44
+
45
+ ### Local DOM snapshots
46
+
47
+ A registered snapshot serializer folds CSS-module class hashes (`_frame_a1b2c3` → `frame`) so `.snap` files stay structural, and collapses `<svg>` internals to a `data-content` fingerprint. Suites needing a custom page frame use `root.declare(children, Frame)` instead of the auto frame; `dispose()` tears down views, feature fibers, minted scopes, and persisted store state on one axis and is idempotent.
48
+
49
+ ### Scripting Remote answers and failures
50
+
51
+ `TestRemote` is the double for the `ctx.remote` face: it registers itself plus one service per scripted namespace so a plugin injecting `remote.<name>` unparks, drives `$on` subscriptions from an explicit test event driver, and exposes `$host` as a plain mutable field a spec assigns to script a homed or non-loopback Host. This package is also where a UI spec takes the `RemoteError` constructor as a value — the `dsh-api-remotes` facade cannot carry it, because a value import from a spec would pull that assembly's unbuilt `/remote` artifact chain.
52
+
53
+ Script a failure by the code the Host would answer with, and assert the same way production code discriminates — on `code`, never on the class:
54
+
55
+ ```text
56
+ import { RemoteError } from '@deepseek-ai/dsh-client-test-runtime'
57
+
58
+ remote.goals.create.mockResolvedValue({
59
+ ok: false,
60
+ error: new RemoteError('goal/not-found', 'goal "g1" does not exist', { goalId: 'g1' }),
61
+ })
62
+ expect(view.getByRole('alert')).toHaveTextContent('goal/not-found')
63
+ ```
64
+
65
+ ### When to use it
66
+
67
+ Use the bench for feature suites that exercise slots, stores, rendering, and disposal under a real runtime — the production `SlotRegistry`, renderer, and provide-bundle materialization are mounted, never reimplemented. It is browser-side test infrastructure: it never reaches a model request, and feature packages depend on it in `devDependencies` only.
68
+
69
+ ### What can go wrong
6
70
 
7
- The doubles implement the same outward faces features receive through ctx (`TestSessions implements ISessions`, `TestWorkspaces implements IWorkspaces`; each fixture session is a `FixtureSession implements SessionFace`; `stubSettingsScope` is a `SettingsScope` with test-driven publications and a write spy), so a production face change breaks the bench at compile time instead of silently drifting. Provide-bundle materialization runs the production `SessionProvideChannel` — the one implementation shared with `SessionRuntime`. Fixtures feed plain data: list rows, conversation snapshots (immer-patched via `updateSnapshot`), projection values, and `ISession`-typed behavior stubs that fail loud when a spec calls an unstubbed verb. The typed `provide()` constrains fakes for declared service names to `Partial` of that service's outward face.
71
+ - **A declared service is not provided** `mount` fails loud with the missing names; `provide()` them first.
72
+ - **A render is attempted before `declare`** — `renderSlot` fails loud; declare the key first.
73
+ - **A spec calls an unstubbed verb on a session behavior stub** — fixture stubs fail loud by design, so a missing stub surfaces at the call site rather than silently passing.
8
74
 
9
- Local DOM snapshots: `declare(children)` registers an auto frame whose per-key `<div data-slot>` wrappers are snapshot roots; `renderSlot(key, owner)` returns the slot-local view (container, scoped Testing Library queries, in-place `update(owner)`); a registered snapshot serializer folds CSS-module class hashes (`_frame_a1b2c3` → `frame`) to keep `.snap` files structural and collapses `<svg>` internals to a `data-content` fingerprint. Suites needing a custom page frame use `root.declare(children, Frame)` instead; `mount(plugin)` runs a real fiber with fail-loud service prechecks, and `dispose()` tears down views, feature fibers, minted scopes, and persisted store state on one axis.
75
+ -----
10
76
 
11
- Not part of the product plugin graph (no `dsh.client`); feature packages depend on it in `devDependencies` only.
77
+ <a id="understand-the-implementation"></a>
78
+ ## Understand the implementation
12
79
 
80
+ <details>
81
+ <summary>Implementation internals — click to expand</summary>
82
+
83
+ This section explains the design of the bench; the observable behavior is fully covered in [Use this package](#use-this-package).
84
+
85
+ ### Design
86
+
87
+ The bench copies no production logic: it mounts the production `SlotRegistry`, production renderer, and `UiSession` adapter. `TestSessions` and `TestWorkspaces` implement the owner interfaces that features consume through Cordis, each fixture Session implements `SessionFace`, and `stubSettingsScope` implements `SettingsScope`. `UiSession` derives standard renderer sources from those Controller bindings. Unstubbed `ISession` behavior fails with the missing method name.
88
+
89
+ ### Source map
90
+
91
+ | File | Role |
92
+ |---|---|
93
+ | [`src/index.ts`](src/index.ts) | `SlotTestRuntime` assembly, `TestRoot`, auto frame, `mount`/`dispose` |
94
+ | [`src/sessions.ts`](src/sessions.ts) + [`src/workspaces.ts`](src/workspaces.ts) | `ISessions`/`IWorkspaces` test doubles and `FixtureSession` behavior stubs |
95
+ | [`src/fixtures.ts`](src/fixtures.ts) | Plain fixture builders: conversation snapshots, workspace list state |
96
+ | [`src/snapshot.ts`](src/snapshot.ts) | DOM snapshot serializer (class-hash folding, `<svg>` fingerprint) |
97
+ | [`src/remote.ts`](src/remote.ts) | `TestRemote` double for host RPC, `RemoteError` value re-export |
98
+ | [`src/translate.ts`](src/translate.ts) + [`src/locale-env.ts`](src/locale-env.ts) | Translation and pinned-browser-language test helpers |
99
+ | [`src/settings-scope.ts`](src/settings-scope.ts) | `stubSettingsScope` with test-driven publications and a write spy |
100
+ | [`src/invariant.ts`](src/invariant.ts) | Invariant companion (no runtime invariant; the mounted production packages own theirs) |
101
+
102
+ ### Lifecycle
103
+
104
+ `create()` builds a fresh context, mounts the slot and conversation registries, installs the renderer, and provides the session/workspace doubles. `mount` checks every declared injection against the context before starting the fiber, so a missing provider fails loud instead of suspending forever. `dispose()` unmounts React trees first, then disposes feature fibers, releases the root registration, disposes minted session scopes, and clears persisted store state; every public mutator is act-wrapped, so tests never handle SlotCore microtask batching or React `act` themselves.
105
+
106
+ </details>
107
+
108
+ -----
109
+
110
+ <a id="further-exploration"></a>
111
+ ## Further Exploration
112
+
113
+ Read these pages when the package-level contract is not enough. They move from the bench to the production machinery it mounts and the tests that use it.
114
+
115
+ - [ui-session](../../client/ui-session/README.md) — the production adapter that derives standard Slot sources from the Controller doubles.
116
+ - [UI slots package](../../client/ui-slots/README.md) — the `SlotRegistry` contract the bench mounts.
117
+ - [UI renderer package](../../client/ui-renderer/README.md) — the renderer the bench installs.
118
+ - [Testing policy](../../../docs/testing.md) — the coverage tiers and browser snapshot lane.
119
+ - [Test-support group map](../README.md) — sibling harnesses and support packages.
120
+
121
+ -----
122
+
123
+ <a id="model-experience"></a>
13
124
  ## Model Experience
14
125
 
15
126
  None, as this package is browser-side test infrastructure; nothing here reaches a model request.
@@ -20,5 +131,20 @@ None; this package neither assembles nor sends a provider request.
20
131
 
21
132
  ## Known Limitations and Deferred Work
22
133
 
23
- - **Consumed through repository source aliases only.** Specs resolve the package through tsconfig `paths` to `src`; the built `lib/` artifact re-exports `@deepseek-ai/dsh-client-runtime/client`, whose bundle is a browser loader script with no Node ESM exports, so `lib/index.js` is not importable under plain Node. Every consumer is an in-repository Vitest suite; there is no Node-compatible runtime entry.
24
- - **Conversation snapshots are fixture data, not replayed history.** `updateSnapshot` writes the snapshot store directly; the wire-to-snapshot computation stays covered by the runtime package's own tests and the replay e2e. A fixture can therefore express states the production projection would never produce.
134
+ <a id="known-limitations-and-deferred-work"></a>
135
+
136
+
137
+ These limits define how the bench is consumed. They are current package constraints, not a task backlog.
138
+
139
+ - **Vitest and jsdom only** — every consumer is an in-repository browser-oriented Vitest suite. The package is not a product plugin or a general Node test harness.
140
+ - **Session, Conversation, and Chat fixtures stay separate** — `sessionSnapshot` contains only Session Controller state, `conversationSnapshot` contains target-neutral Conversation state, and `chatSnapshot` contains Chat target state. Assembly tests provide Session event entries instead of adding Conversation or Chat fields to `SessionSnapshot`.
141
+
142
+ <a id="dev-note"></a>
143
+ ### Dev Note
144
+
145
+ <details>
146
+ <summary>Working context for maintainers — click to expand</summary>
147
+
148
+ None.
149
+
150
+ </details>
package/README.zh.md CHANGED
@@ -1,24 +1,150 @@
1
+ ---
2
+ description: "面向浏览器功能测试的 jsdom slot 测试运行时,供测试作者针对生产机制检验 slot、store 与渲染。"
3
+ kind: "package-library"
4
+ ---
5
+
1
6
  # @deepseek-ai/dsh-client-test-runtime
2
7
 
3
8
  [English](README.md) | 中文
4
9
 
5
- 面向客户端功能测试的 jsdom slot 测试运行时:真实 Cordis `Context`、生产 `SlotRegistry` 与 UI 渲染器,围绕带类型的 session/workspace 测试替身组装。功能套件无需逐套件手搭机器即可测遍声明、注册、scope、store、inject、渲染、更新与销毁——且不存在任何生产逻辑的第二份实现。
10
+ ## 概述
11
+
12
+ `dsh-client-test-runtime` 让浏览器功能测试拥有真实的 jsdom 测试台:它把 Cordis 上下文、渲染器拥有的 slot 注册表与生产 `UiSession` 适配器组装在带类型的 Session 和 Workspace Controller 替身周围。功能套件无需复制生产渲染器或适配器逻辑,即可检验声明、注册、作用域、store、注入、渲染、更新与销毁。套件通过带类型 fixture 发布 Session 生命周期状态、Workspace 状态、projection 值与 Conversation 事件,再使用局部 DOM 快照根、限定范围的 Testing Library 查询与自明的服务缺失检查。它不属于产品插件图(无 `dsh.client`);feature 包仅以 `devDependencies` 依赖之。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [进一步探索](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与延期工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ 本包让浏览器功能测试拥有可挂载的真实运行时:创建测试台,声明你的功能所占用的 slot,挂载功能插件,渲染一个 slot,在局部视图上断言,然后 dispose(资源释放)——全程不存在生产逻辑的第二份实现。
29
+
30
+ ### 搭建功能测试
31
+
32
+ `SlotTestRuntime.create()` 组装运行时,`declare(children)` 注册一个自动 frame,其逐 key 的 `<div data-slot>` 包裹层成为快照根,`mount(plugin)` 在真实 fiber 上运行功能,`renderSlot(key, owner)` 返回带限定查询与原位更新的 slot 局部视图:
33
+
34
+ ```text
35
+ const runtime = await SlotTestRuntime.create()
36
+ await runtime.declare({ 'feature-slot': {} })
37
+ const handle = await runtime.mount(FeaturePlugin)
38
+ const view = runtime.renderSlot('feature-slot', { owner: props })
39
+ expect(view.container).toMatchSnapshot()
40
+ await runtime.dispose()
41
+ ```
42
+
43
+ `mount` 会预检必需服务,缺失时自明报错——先用 `provide(name, value)` 提供额外服务。`storeOf(key, scopeKey)` 返回渲染器交给 slot 组件的实时 store 实例,用于身份与动作驱动写入断言。
44
+
45
+ ### 局部 DOM 快照
46
+
47
+ 注册的快照序列化器把 CSS-module 哈希类名折回语义名(`_frame_a1b2c3` → `frame`),使 `.snap` 文件只含结构,并把 `<svg>` 内部折叠为 `data-content` 指纹。需要自定义页面 frame 的套件改用 `root.declare(children, Frame)` 而非自动 frame;`dispose()` 沿单一轴拆除视图、feature fiber、已铸 scope 与持久化 store 状态,且幂等。
48
+
49
+ ### 脚本化 Remote 应答与失败
50
+
51
+ `TestRemote` 是 `ctx.remote` 面的替身:它把自己连同每个被脚本化的命名空间各注册一个服务,使注入 `remote.<name>` 的插件得以解除挂起;`$on` 订阅由显式的测试事件驱动器推动;`$host` 是普通可变字段,套件直接赋值即可脚本化带 home 或非 loopback 的 Host。UI 套件也在本包取用 `RemoteError` 构造器这个值——`dsh-api-remotes` facade 承载不了它,因为从套件发起的值 import 会拉起该装配尚未构建的 `/remote` 产物链。
52
+
53
+ 按 Host 会答的码来脚本化失败,并以生产代码同样的方式断言——判 `code`,绝不判类:
54
+
55
+ ```text
56
+ import { RemoteError } from '@deepseek-ai/dsh-client-test-runtime'
57
+
58
+ remote.goals.create.mockResolvedValue({
59
+ ok: false,
60
+ error: new RemoteError('goal/not-found', 'goal "g1" does not exist', { goalId: 'g1' }),
61
+ })
62
+ expect(view.getByRole('alert')).toHaveTextContent('goal/not-found')
63
+ ```
64
+
65
+ ### 何时使用
66
+
67
+ 当功能套件要在真实运行时下检验 slot、store、渲染与销毁时使用本测试台——生产 `SlotRegistry`、渲染器与 provide bundle 物化都会被挂载,绝不重实现。它是浏览器侧测试基础设施:永远不触及模型请求,feature 包仅以 `devDependencies` 依赖之。
68
+
69
+ ### 可能出什么问题
6
70
 
7
- 替身实现的正是功能通过 ctx 获得的对外接口(`TestSessions implements ISessions`、`TestWorkspaces implements IWorkspaces`;每个 fixture session 是 `FixtureSession implements SessionFace`;`stubSettingsScope` 是发布由测试驱动、带写入 spy 的 `SettingsScope`),生产面一旦改形,测试台在编译期即断,而非静默漂移。provide bundle 材料化直接运行生产 `SessionProvideChannel`——与 `SessionRuntime` 共用同一份实现。fixture 灌入的是普通数据:列表行、会话快照(经 `updateSnapshot` 以 immer 补丁改写)、projection 值,以及按 `ISession` 取型的行为桩——spec 调用未打桩的动词时报错自明。带类型的 `provide()` 将已声明服务名的 fake 约束为该服务对外面的 `Partial` 子集。
71
+ - **已声明服务未提供**——`mount` 自明报错并列出缺失名称;请先用 `provide()` 提供。
72
+ - **在 `declare` 之前尝试渲染**——`renderSlot` 自明报错;请先声明该 key。
73
+ - **测试调用会话行为桩上未打桩的动词**——fixture 桩按设计自明报错,缺失的桩会在调用点浮现,而非静默通过。
8
74
 
9
- 局部 DOM 快照:`declare(children)` 注册自动 frame,逐 key 的 `<div data-slot>` 包裹层即快照根;`renderSlot(key, owner)` 返回该 slot 的局部视图(container、限定范围的 Testing Library 查询、原位 `update(owner)`);注册的快照序列化器把 CSS-module 哈希类名折回语义名(`_frame_a1b2c3` → `frame`)保持 `.snap` 只含结构,并把 `<svg>` 内部折叠为 `data-content` 指纹。需要自定义页面 frame 的套件改用 `root.declare(children, Frame)`;`mount(plugin)` 在真实 fiber 上运行并对缺失服务先行报错;`dispose()` 沿单一轴拆除视图、feature fiber、已铸 scope 与持久化 store 状态。
75
+ -----
10
76
 
11
- 不属于产品插件图(无 `dsh.client`);feature 包仅以 `devDependencies` 依赖之。
77
+ <a id="understand-the-implementation"></a>
78
+ ## 理解实现
12
79
 
80
+ <details>
81
+ <summary>实现细节——点击展开</summary>
82
+
83
+ 本节解释测试台的设计;可观察行为已在[使用本包](#use-this-package)中完整说明。
84
+
85
+ ### 设计
86
+
87
+ 测试台不复制生产逻辑:它挂载生产 `SlotRegistry`、生产渲染器与 `UiSession` 适配器。`TestSessions` 与 `TestWorkspaces` 实现功能通过 Cordis 消费的 owner 接口,每个 fixture Session 实现 `SessionFace`,`stubSettingsScope` 实现 `SettingsScope`。`UiSession` 从这些 Controller binding 派生标准渲染器 source。未 stub 的 `ISession` 行为会携缺失方法名失败。
88
+
89
+ ### 源码地图
90
+
91
+ | 文件 | 职责 |
92
+ |---|---|
93
+ | [`src/index.ts`](src/index.ts) | `SlotTestRuntime` 组装、`TestRoot`、自动 frame、`mount`/`dispose` |
94
+ | [`src/sessions.ts`](src/sessions.ts) + [`src/workspaces.ts`](src/workspaces.ts) | `ISessions`/`IWorkspaces` 测试替身与 `FixtureSession` 行为桩 |
95
+ | [`src/fixtures.ts`](src/fixtures.ts) | 普通 fixture 构造器:会话快照、workspace 列表状态 |
96
+ | [`src/snapshot.ts`](src/snapshot.ts) | DOM 快照序列化器(类名哈希折叠、`<svg>` 指纹) |
97
+ | [`src/remote.ts`](src/remote.ts) | 用于 host RPC 的 `TestRemote` 替身、`RemoteError` 值转出 |
98
+ | [`src/translate.ts`](src/translate.ts) + [`src/locale-env.ts`](src/locale-env.ts) | 翻译与固定浏览器语言测试辅助 |
99
+ | [`src/settings-scope.ts`](src/settings-scope.ts) | 带测试驱动发布与写入 spy 的 `stubSettingsScope` |
100
+ | [`src/invariant.ts`](src/invariant.ts) | 不变式伴生插件(无运行时不变式;所挂载的生产包拥有各自的不变式) |
101
+
102
+ ### 生命周期
103
+
104
+ `create()` 构建全新上下文,挂载 slot 与会话注册表,安装渲染器,并提供 session/workspace 替身。`mount` 在启动 fiber 前对照上下文检查每个已声明注入,使缺失提供方自明报错而非永久挂起。`dispose()` 先卸载 React 树,再 dispose feature fiber、释放根注册、dispose 已铸 session scope 并清除持久化 store 状态;每个公共修改器都包裹在 act 中,因此测试无需自行处理 SlotCore 微任务批处理或 React `act`。
105
+
106
+ </details>
107
+
108
+ -----
109
+
110
+ <a id="further-exploration"></a>
111
+ ## 进一步探索
112
+
113
+ 当包级约定不够用时阅读以下页面。它们从测试台逐步进入它所挂载的生产机制以及使用它的测试。
114
+
115
+ - [ui-session](../../client/ui-session/README.zh.md)——从 Controller 替身派生标准 Slot source 的生产适配器。
116
+ - [UI slots 包](../../client/ui-slots/README.zh.md)——测试台挂载的 `SlotRegistry` 约定。
117
+ - [UI renderer 包](../../client/ui-renderer/README.zh.md)——测试台安装的渲染器。
118
+ - [测试策略](../../../docs/testing.zh.md)——覆盖层级与浏览器快照流水线。
119
+ - [test-support 组地图](../README.zh.md)——兄弟 harness 与支持包。
120
+
121
+ -----
122
+
123
+ <a id="model-experience"></a>
13
124
  ## 模型体验
14
125
 
15
126
  无;本包是浏览器侧测试基础设施,无一物到达模型请求。
16
127
 
17
- #### KV Cache effect
128
+ #### KV Cache 影响
18
129
 
19
130
  无;本包既不组装也不发送提供方请求。
20
131
 
21
132
  ## 已知限制与延期工作
22
133
 
23
- - **仅可经仓内源码别名消费。** spec 通过 tsconfig `paths` 解析到 `src`;构建产物 `lib/` 再导出 `@deepseek-ai/dsh-client-runtime/client`,而该 bundle 是无 Node ESM 导出的浏览器 loader 脚本,故 `lib/index.js` 在纯 Node 下不可导入。所有消费方都是仓内 Vitest 套件;不存在 Node 兼容的运行时入口。
24
- - **会话快照是 fixture 数据,不是重放历史。** `updateSnapshot` 直写快照 store;wire 到快照的运算仍由 runtime 包自身测试与 replay e2e 把守。因此 fixture 可以表达生产投影永不产出的状态。
134
+ <a id="known-limitations-and-deferred-work"></a>
135
+
136
+
137
+ 这些限制说明本测试台如何被消费。它们是当前包约束,不是任务积压。
138
+
139
+ - **仅限 Vitest 与 jsdom**——所有消费方都是仓内、面向浏览器的 Vitest 套件。本包不是产品插件,也不是通用 Node 测试框架。
140
+ - **Session、Conversation 与 Chat fixture 保持分离**——`sessionSnapshot` 只包含 Session Controller 状态,`conversationSnapshot` 包含 target-neutral Conversation 状态,`chatSnapshot` 包含 Chat target 状态。组装测试提供 Session event entry,而不是向 `SessionSnapshot` 添加 Conversation 或 Chat 字段。
141
+
142
+ <a id="dev-note"></a>
143
+ ### 开发备注
144
+
145
+ <details>
146
+ <summary>维护者的工作上下文——点击展开</summary>
147
+
148
+ 无。
149
+
150
+ </details>