@deepseek-ai/dsh-session-snapshot 0.2.0-rc.1 → 0.2.1-alpha.1
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 +4 -4
- package/README.md +1 -2
- package/README.zh.md +1 -2
- package/lib/index.js +13 -8
- package/lib/types/harness.d.ts +1 -1
- package/package.json +20 -20
package/README.i18n.yaml
CHANGED
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
en: 64666ea2894acc4a
|
|
31
31
|
zh: 0e78df32bcfd3633
|
|
32
32
|
/deepseek-ai-dsh-session-snapshot/use-this-package/what-can-go-wrong:
|
|
33
|
-
en:
|
|
34
|
-
zh:
|
|
33
|
+
en: 9e596b474f37950a
|
|
34
|
+
zh: caef58074f332819
|
|
35
35
|
/deepseek-ai-dsh-session-snapshot/understand-the-implementation:
|
|
36
36
|
en: 18ff76b440fe40da
|
|
37
37
|
zh: 4dbf2eb5f9ee98a2
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
en: 8771607f15c4f4e1
|
|
40
40
|
zh: 7c2cf395f704717c
|
|
41
41
|
/deepseek-ai-dsh-session-snapshot/understand-the-implementation/source-map:
|
|
42
|
-
en:
|
|
43
|
-
zh:
|
|
42
|
+
en: 1510b3b09c3bd553
|
|
43
|
+
zh: 1931fba0891f7d65
|
|
44
44
|
/deepseek-ai-dsh-session-snapshot/understand-the-implementation/data-flow:
|
|
45
45
|
en: a71c8ab2e78798c5
|
|
46
46
|
zh: 419cebed1c023fbf
|
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ A scenario requiring a non-Windows host declares `posixOnly`, which skips its ru
|
|
|
92
92
|
|
|
93
93
|
### What can go wrong
|
|
94
94
|
|
|
95
|
-
- **A
|
|
95
|
+
- **A turn-end wait fails** — `waitForTurnEnd` and `waitForSubagentTurnEnd` identify the session or child and deadline even when the first log harvest exceeds that deadline. Child waits also name the requested turn. Both retain the underlying failure as the error cause.
|
|
96
96
|
- **A fixture guard rejects the committed files** — orphan scenario dirs, missing files, multiple pins for one header class, duplicate sidecar content, unscrubbed prompt text or tool schemas, a `request/header` with no preceding `system/message`, and malformed pinning headers all fail the suite before comparisons run.
|
|
97
97
|
- **The session harvest needs raw JSONL mode** — snapshot configs set the JSONL backend's `compression: 'none'`; compressed JSONL has no snapshot-harvest path.
|
|
98
98
|
- **Built mode needs current artifacts** — run `pnpm run build` before selecting `DSH_EXAMPLE_MODE=lib`; source mode remains the zero-build path.
|
|
@@ -124,7 +124,6 @@ The shared core owns manifests, generation-qualified role selection, workspace s
|
|
|
124
124
|
| [`src/workspace.ts`](src/workspace.ts) | Scenario workspace setup and complete expected-state comparison |
|
|
125
125
|
| [`src/suite.ts`](src/suite.ts) | Scenario-table suite factory, fixture guards, record/refresh write-back |
|
|
126
126
|
| [`src/index.ts`](src/index.ts) | Package entry re-exporting the four layers |
|
|
127
|
-
| — | No runtime invariant companion is published; this test-support package owns no production event stream or mutable data; consuming test suites exercise its behavior. |
|
|
128
127
|
|
|
129
128
|
### Data flow
|
|
130
129
|
|
package/README.zh.md
CHANGED
|
@@ -92,7 +92,7 @@ Headless/ACP 与 SDK 适配器在规范化之前,将原始目录中的子创
|
|
|
92
92
|
|
|
93
93
|
### 可能出什么问题
|
|
94
94
|
|
|
95
|
-
-
|
|
95
|
+
- **轮次结束等待失败**——即使首次日志收集就超过期限,`waitForTurnEnd` 和 `waitForSubagentTurnEnd` 也会指出会话或子会话及等待期限。子会话等待还会指出目标轮次。两者都通过错误的 cause 保留底层失败。
|
|
96
96
|
- **fixture 保护拒绝已提交文件**——遗留场景目录、缺失文件、一个 header 类别包含多个 pin、重复的伴随文件内容、未擦除的提示文本或工具 schema、没有前置 `system/message` 的 `request/header`,以及格式错误的 pin header 都会在比较运行前使套件失败。
|
|
97
97
|
- **会话收集需要原始 JSONL mode**——快照配置使用 JSONL 后端的 `compression: 'none'`;压缩 JSONL 没有快照收集路径。
|
|
98
98
|
- **构建 mode 需要当前产物**——选择 `DSH_EXAMPLE_MODE=lib` 前先运行 `pnpm run build`;源 mode 仍是零构建路径。
|
|
@@ -124,7 +124,6 @@ Headless/ACP 与 SDK 适配器在规范化之前,将原始目录中的子创
|
|
|
124
124
|
| [`src/workspace.ts`](src/workspace.ts) | 场景 workspace 设置与完整预期状态比较 |
|
|
125
125
|
| [`src/suite.ts`](src/suite.ts) | 场景表套件工厂、fixture 保护、录制/刷新回写 |
|
|
126
126
|
| [`src/index.ts`](src/index.ts) | 再导出四个层的包入口 |
|
|
127
|
-
| — | 不发布运行时不变式伴生入口;该测试支持包不拥有任何生产事件流或可变数据;消费它的测试套件会检验该工具包。 |
|
|
128
127
|
|
|
129
128
|
### 数据流
|
|
130
129
|
|
package/lib/index.js
CHANGED
|
@@ -672,7 +672,7 @@ function captureExpectedWorkspaceSnapshot(root) {
|
|
|
672
672
|
* shutdown flush. The pure normalizers in ./normalize.ts turn the captured
|
|
673
673
|
* stdout frames and the session-log events into stable, snapshot-able text.
|
|
674
674
|
*
|
|
675
|
-
* See
|
|
675
|
+
* See packages/test-support/session-snapshot/README.md.
|
|
676
676
|
*
|
|
677
677
|
* @module @deepseek-ai/dsh-session-snapshot/harness
|
|
678
678
|
*/
|
|
@@ -984,13 +984,18 @@ async function waitForPersistedTurnStart(root, sessionId, timeoutMs = DEFAULT_WA
|
|
|
984
984
|
* keep subprocess disposal from changing an `aborted` turn into `disposed`.
|
|
985
985
|
*/
|
|
986
986
|
async function waitForPersistedTurnEnd(root, sessionId, timeoutMs = DEFAULT_WAIT_TIMEOUT_MS) {
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
987
|
+
const message = `snapshot-harness: session "${sessionId}" did not persist turn/end within ${timeoutMs}ms`;
|
|
988
|
+
try {
|
|
989
|
+
await vi.waitFor(async () => {
|
|
990
|
+
const log = (await harvestSessionLogs(root)).find((candidate) => candidate.id === sessionId);
|
|
991
|
+
if (log === void 0 || !latestTurnIsClosed(log.content)) throw new Error(message);
|
|
992
|
+
}, {
|
|
993
|
+
interval: WAIT_POLL_INTERVAL_MS,
|
|
994
|
+
timeout: timeoutMs
|
|
995
|
+
});
|
|
996
|
+
} catch (cause) {
|
|
997
|
+
throw new Error(message, { cause });
|
|
998
|
+
}
|
|
994
999
|
}
|
|
995
1000
|
/**
|
|
996
1001
|
* Wait until the Nth harvested child Session closes a model work turn.
|
package/lib/types/harness.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* shutdown flush. The pure normalizers in ./normalize.ts turn the captured
|
|
12
12
|
* stdout frames and the session-log events into stable, snapshot-able text.
|
|
13
13
|
*
|
|
14
|
-
* See
|
|
14
|
+
* See packages/test-support/session-snapshot/README.md.
|
|
15
15
|
*
|
|
16
16
|
* @module @deepseek-ai/dsh-session-snapshot/harness
|
|
17
17
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-snapshot",
|
|
3
3
|
"description": "Session-log snapshot core with an ACP protocol adapter, expected-output normalization, and fixture invariants",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -30,29 +30,29 @@
|
|
|
30
30
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
31
31
|
"js-yaml": "^4.2.0",
|
|
32
32
|
"vitest": "^4.1.8",
|
|
33
|
-
"@deepseek-ai/
|
|
34
|
-
"@deepseek-ai/dsh-
|
|
35
|
-
"@deepseek-ai/dsh-loader-smoke": "0.2.
|
|
36
|
-
"@deepseek-ai/
|
|
33
|
+
"@deepseek-ai/dsh-llm-replay": "0.2.1-alpha.1",
|
|
34
|
+
"@deepseek-ai/dsh-session-format": "0.2.1-alpha.1",
|
|
35
|
+
"@deepseek-ai/dsh-loader-smoke": "0.2.1-alpha.1",
|
|
36
|
+
"@deepseek-ai/cordis-plugin-include": "~1.0.10-alpha.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@deepseek-ai/dsh-session": "0.2.
|
|
40
|
-
"@deepseek-ai/
|
|
41
|
-
"@deepseek-ai/
|
|
39
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.1",
|
|
40
|
+
"@deepseek-ai/dsh-http-proxy": "0.2.1-alpha.1",
|
|
41
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/js-yaml": "^4.0.9",
|
|
45
|
-
"@deepseek-ai/
|
|
46
|
-
"@deepseek-ai/
|
|
47
|
-
"@deepseek-ai/dsh-agent-loop": "0.2.
|
|
48
|
-
"@deepseek-ai/dsh-compaction": "0.2.
|
|
49
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
50
|
-
"@deepseek-ai/dsh-sandbox": "0.2.
|
|
51
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.
|
|
52
|
-
"@deepseek-ai/dsh-session": "0.2.
|
|
53
|
-
"@deepseek-ai/dsh-subagent": "0.2.
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
45
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
46
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
|
|
47
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.1",
|
|
48
|
+
"@deepseek-ai/dsh-compaction": "0.2.1-alpha.1",
|
|
49
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
|
|
50
|
+
"@deepseek-ai/dsh-sandbox": "0.2.1-alpha.1",
|
|
51
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.1-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.1",
|
|
53
|
+
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.1",
|
|
54
|
+
"@deepseek-ai/dsh-user-questions": "0.2.1-alpha.1",
|
|
55
|
+
"@deepseek-ai/dsh-http-proxy": "0.2.1-alpha.1",
|
|
56
|
+
"@deepseek-ai/dsh-tools": "0.2.1-alpha.1"
|
|
57
57
|
}
|
|
58
58
|
}
|