@deepseek-ai/dsh-session-snapshot 0.1.5-rc.2 → 0.1.6-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/session-snapshot/README.md
5
- README.md: a73ea265516f965bec8d11c41d6eb5bb028c7ac6
6
- README.zh.md: 544694a9fe9678d89cffb1f3293ea4e648e89f5d
5
+ README.md: 51aaff9af7dfce83ed032b42ce0bb471aa384002
6
+ README.zh.md: ad136b19a75170c130bbb872ba02bb88e010bb02
package/README.md CHANGED
@@ -107,7 +107,7 @@ This section explains the design of the kit; the observable behavior is fully co
107
107
 
108
108
  ### Design
109
109
 
110
- The shared core owns manifests, generation-qualified role selection, workspace setup/comparison, typed identity mapping, normalizers, and fixture invariants. The ACP adapter adds four composable layers: launcher, scenario harness, normalizers, and suite factory. `launchAcpTestAgent` boots a source profile under tsx or a built `lib` profile under plain Node, connects the SDK client over a raw-byte stdout tee, collects Session updates and stderr, fails closed on unhandled permission requests, and owns shutdown. `runScenario` drives ACP JSON-RPC stdio and harvests the numerically highest persisted raw JSONL generation for every Session directory. The pure normalizers replace cwd paths and typed identities with stable tokens, zero times, expand physical provenance ranges, and scrub system-prompt text and tool-schema bulk. `defineAcpSnapshotSuite` registers comparisons, generation-qualified fixture write-back, and the live uniformity guard.
110
+ The shared core owns manifests, generation-qualified role selection, workspace setup/comparison, typed identity mapping, normalizers, and fixture invariants. The ACP adapter adds four composable layers: launcher, scenario harness, normalizers, and suite factory. `launchAcpTestAgent` boots a source profile under tsx or a built `lib` profile under plain Node, connects the SDK client over a raw-byte stdout tee, collects Session updates and stderr, fails closed on unhandled permission requests, and owns shutdown. `runScenario` drives ACP JSON-RPC stdio and harvests the numerically highest persisted raw JSONL generation for every Session directory. The pure normalizers replace cwd paths and typed identities with stable tokens, zero times, expand physical source-event ranges, and scrub system-prompt text and tool-schema bulk. `defineAcpSnapshotSuite` registers comparisons, generation-qualified fixture write-back, and the live uniformity guard.
111
111
 
112
112
  ### Source map
113
113
 
package/README.zh.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "面向无密钥 profile 测试的 session-log 快照支持:manifest、身份脱敏、规范化、workspace 检查与协议适配器。"
2
+ description: "面向无密钥 profile 测试的会话日志快照支持:manifest(元数据清单)、身份脱敏、规范化、workspace 检查与协议适配器。"
3
3
  kind: "package-library"
4
4
  ---
5
5
 
@@ -9,7 +9,7 @@ kind: "package-library"
9
9
 
10
10
  ## 概述
11
11
 
12
- `dsh-session-snapshot` 提供无密钥已记录会话测试(`pnpm run test:snapshot`)背后的共享支持:封闭 manifest、类型化身份脱敏、规范化、workspace 比较、fixture 保护,以及 headless、SDK、ACP 与 Web owner 使用的协议适配器。ACP 适配器以真实子进程启动被测 profile,驱动确定性输入脚本,并注册完整的录制、回放与刷新套件。每个场景都提交足够证据来证明模型可见输出与文件系统效果,不依赖 agent 自述。包入口会导入 vitest,因此只能在 vitest 运行中使用。
12
+ `dsh-session-snapshot` 提供无密钥已记录会话测试(`pnpm run test:snapshot`)背后的共享支持:封闭 manifest、类型化身份脱敏、规范化、workspace 比较、fixture(测试前置数据)保护,以及 headless、SDK、ACP(Agent Client Protocol)与 Web owner 使用的协议适配器。ACP 适配器以真实子进程启动被测 profile,驱动确定性输入脚本,并注册完整的录制、回放与刷新套件。每个场景都提交足够证据来证明模型可见输出与文件系统效果,不依赖 agent(智能体)自述。包入口会导入 vitest,因此只能在 vitest 运行中使用。
13
13
 
14
14
  ## 目录
15
15
 
@@ -68,25 +68,25 @@ defineAcpSnapshotSuite({
68
68
  })
69
69
  ```
70
70
 
71
- 每个已记录 Session 目录携带封闭的 `snapshot.yml` manifest,以及规范 parent 与连续 child 角色。parent 文件名是 `session[.vN].jsonl`;child 是 `session.<ordinal>[.vN].jsonl`;v0 省略 `.v0`,正版本使用小写 `.vN`,且每个文件名与其 header 一致。一个角色可以保留旧 generation,但 harness 会选择数值最高的一项。拥有 fixture 的 manifest 可以声明 `sessionFormat.version` 与一个或多个封闭 `coverage` 名称,把该历史 generation 保留为显式迁移 fixture;省略此字段时跟随当前 writer。manifest 还会指名场景、随附 profile、组合/header 类别、录制来源,以及已完成 Session 无法重建的 replay、平台、权限、环境、workspace 或输入事实。存储保护检查每个选定 parent 与 child 角色的工具结果和可移植路径。提示词/schema 擦除、消息身份及提示词先于请求的顺序检查适用于当前 generation;保留的前代维持其历史表示。适配器注册预期输出、Session 日志与可选 `workspace.expected/` 比较;保护会拒绝遗留目录、缺失角色、非规范名称、绝对路径、malformed manifest 与平台专用分隔符。
71
+ 每个已记录 Session 目录携带封闭的 `snapshot.yml` manifest,以及规范 parent 与连续 child 角色。parent 文件名是 `session[.vN].jsonl`;child 是 `session.<ordinal>[.vN].jsonl`;v0 省略 `.v0`,正版本使用小写 `.vN`,且每个文件名与其 header 一致。一个角色可以保留旧 generation,但 harness 会选择数值最高的一项。拥有 fixture 的 manifest 可以声明 `sessionFormat.version` 与一个或多个封闭 `coverage` 名称,把该历史 generation 保留为显式迁移 fixture;省略此字段时跟随当前 writer。manifest 还会指名场景、随附 profile、组合/header 类别、录制来源,以及已完成 Session 无法重建的 replay、平台、权限、环境、workspace 或输入事实。存储保护检查每个选定 parent 与 child 角色的工具结果和可移植路径。提示词/schema 擦除、消息身份及提示词先于请求的顺序检查适用于当前 generation;保留的前代维持其历史表示。适配器注册预期输出、Session 日志与可选 `workspace.expected/` 比较;保护会拒绝遗留目录、缺失角色、非规范名称、绝对路径、格式错误的 manifest 与平台专用分隔符。
72
72
 
73
73
  `normalizeSessionSnapshot` 在规范化路径并擦除系统提示文本与工具 schema 后,会保留完整 Session header 与事件 payload,但从已提交 fixture 中省略顶层 `seq`/`time` envelope;它还会规范化嵌入式 stream clock 与历史 packed-row 的 `seq0`/`time0` envelope 与 catalog child 创建时钟。事件顺序与来源事件引用保持不变。Replay 只在内存中合成顶层 envelope,而运行时持久化仍写入完整日志。多 Session 比较会先通过严格的构建期静态 Session 格式目录校验预期日志与收集日志,再进行身份脱敏与规范化;来源文件名不能改变格式校验。保留的历史 replay 输入不是原生当前格式 writer 输出的比较基准:结构迁移保留请求含义,但可以产生不同的事件布局。归一化保留意外的 request-header 字段(包括 `system`),使回归保持可见。无版本的协议适配器单元测试 fixture 不属于已发布 Session 格式语料。[当前写入器格式](../../../docs/session-format-status.zh.md)的 fixture 每个事件占一行;保留的 v0/v1 fixture 可以使用规范 packed row。[临时仓库迁移器](../../../scripts/migrate-packed-session-fixtures.ts)(`pnpm run migrate:packed-session-fixtures`)会改写更旧的历史布局,由其[移除提案](../../../.agents/notes/proposed/process/2026-07-26-remove-packed-session-fixture-migrator.zh.md)负责删除该迁移器。
74
74
 
75
- Spill 场景通过真实本地 provider 保存到私有临时根目录。夹具适配器提供固定长度的逻辑定位符,并仅将本次运行已保存的定位符映射回实际文件以供检索,在不写入共享逻辑路径的情况下保留预览预算。已知的快照 spill 路径会规范化为稳定的定位信息 token,包括 JSON 省略通知中带引号、使用 JSON 转义 Windows 分隔符的路径。刷新提取会保留匹配路径的序列化写法,以便进行字面替换。规范化只改变定位信息:保存字节数与省略计数仍作为比较证据。
75
+ spill 场景通过真实本地提供方保存到私有临时根目录。fixture 适配器提供固定长度的逻辑定位符,并仅将本次运行已保存的定位符映射回实际文件以供检索,在不写入共享逻辑路径的情况下保留预览预算。已知的快照 spill 路径会规范化为稳定的定位符 token,包括 JSON 省略通知中带引号、使用 JSON 转义 Windows 分隔符的路径。刷新提取会保留匹配路径的序列化写法,以便进行字面替换。规范化只改变定位符:保存字节数与省略计数仍作为比较证据。
76
76
 
77
77
  保留历史输入的场景保持规范 Session 文件不变,并继续选择它们进行回放;固定历史版本的目录中没有更新的规范同角色文件。其精确的规范化原生当前格式输出单独记录在父会话的 `writer.expected.jsonl` 和子会话的 `writer.<ordinal>.expected.jsonl` 中;这些是输出比较基准,而非 replay 代际。保留历史输入的 SDK 场景使用 `notifications.current.expected.jsonl` 记录当前协议输出。比较既不将当前事件反向投影为历史格式,也不剥除结构差异。独立迁移测试验证正式转换,而不把原生 writer 布局当作其预期事件序列。
78
78
 
79
79
  ### 录制、回放与刷新
80
80
 
81
- `pnpm run test:snapshot:record` 调用在线 LLM(大语言模型),并在规范具名版本文件下写入收集到的当前 generation。record 与 refresh 绝不重命名或删除已完成的 generation,即使后续运行不再产生某个 child 角色也一样;受审阅的源树整理只有在同角色存在已验证的当前替代文件后才移除前代。显式声明 `sessionFormat` 的场景在录制模式下保持只读。`pnpm run test:snapshot:refresh` 保持无密钥,运行选定的最高 replay 输入,并写入 stdout、各 pin 自有的 prompt 与工具 schema sidecar,以及新鲜当前 generation 的可比较 Session 输出;保留历史输入的场景写入单独的 writer 输出比较基准,而非规范当前格式 replay 代际。每个组合 owner 把 replay patch 放在 live patch 旁;顶层 `snapshots/` 拥有 Session 驱动场景,其他预期输出留在其 package owner 旁。[`dsh-llm-replay`](../llm-replay/README.zh.md) 提供通过 `DSH_SNAPSHOT_*` 环境值选择的已记录流。
81
+ `pnpm run test:snapshot:record` 调用在线 LLM(大语言模型),并在规范具名版本文件下写入收集到的当前 generation。record 与 refresh 绝不重命名或删除已完成的 generation,即使后续运行不再产生某个 child 角色也一样;受审阅的源树整理只有在同角色存在已验证的当前替代文件后才移除前代。显式声明 `sessionFormat` 的场景在录制模式下保持只读。`pnpm run test:snapshot:refresh` 保持无密钥,运行选定的最高 replay 输入,并写入 stdout、各 pin 自有的提示词与工具 schema 伴随文件,以及新鲜当前 generation 的可比较 Session 输出;保留历史输入的场景写入单独的 writer 输出比较基准,而非规范当前格式 replay 代际。每个组合 owner 把 replay patch 放在 live patch 旁;顶层 `snapshots/` 拥有 Session 驱动场景,其他预期输出留在其 package owner 旁。[`dsh-llm-replay`](../llm-replay/README.zh.md) 提供通过 `DSH_SNAPSHOT_*` 环境值选择的已记录流。
82
82
 
83
83
  ### 固定请求 header 与系统提示
84
84
 
85
- 每个 pin 默认拥有其生成的 `system-prompt.expected.md` 或 `tool-schemas.expected.json` sidecar;当完整的对应序列相同时,`systemPromptSource` 与 `toolSchemasSource` 指定另一个 pin 作为来源,因此每个不同版本只提交一次。系统提示是 surface 节点 0,作为 `system/message` 事件记录在该步骤第一个 `request/header` 之前;每个 fixture 把其文本块存储为 `"text":"{{system}}"`,提示词 sidecar 保留完整文本。该 pin 的 `request/header` 事件存储 `"tools":"{{tools}}"`,同时保留配置与原因,结构化 schema sidecar 保留完整目录。自身作用域组合出不同请求的 child Session 按 fixture 索引以 `pinsChildToolSchemas` 与 `pinsChildSystemPrompts` 单独声明。运行中改变请求 header 的场景声明 `expectedHeaderChanges`;运行中提示词发生变化的场景——替换节点 0,或在 `in-history` 路由上追加到已缓存历史之后——声明 `expectedPromptChanges`,每次变化在提示词 sidecar 中增加一个 `<!-- system/message change N -->` 小节。manifest 中对应字段为 `header.changes` 与 `header.promptChanges`。
85
+ 每个 pin 默认拥有其生成的 `system-prompt.expected.md` 或 `tool-schemas.expected.json` 伴随文件;当完整的对应序列相同时,`systemPromptSource` 与 `toolSchemasSource` 指定另一个 pin 作为来源,因此每个不同版本只提交一次。系统提示是 surface 节点 0,作为 `system/message` 事件记录在该步骤第一个 `request/header` 之前;每个 fixture 把其文本块存储为 `"text":"{{system}}"`,提示词伴随文件保留完整文本。该 pin 的 `request/header` 事件存储 `"tools":"{{tools}}"`,同时保留配置与原因,结构化 schema 伴随文件保留完整目录。自身作用域组合出不同请求的 child Session 按 fixture 索引以 `pinsChildToolSchemas` 与 `pinsChildSystemPrompts` 单独声明。运行中改变请求 header 的场景声明 `expectedHeaderChanges`;运行中提示词发生变化的场景——替换节点 0,或在 `in-history` 路由上追加到已缓存历史之后——声明 `expectedPromptChanges`,每次变化在提示词伴随文件中增加一个 `<!-- system/message change N -->` 小节。manifest 中对应字段为 `header.changes` 与 `header.promptChanges`。
86
86
 
87
87
  ### 平台与组合变体
88
88
 
89
- 需要非 Windows 主机的场景声明 `posixOnly`,在 Windows 上跳过运行测试,但 fixture 保护仍在所有平台覆盖其已提交文件;组合需要可用 `pwsh` 的场景声明 `pwshOnly`。当临时目录授权自身待测时,`workspaceParent` 将生成子级 cwd 移出平台临时区域;场景签入的 `workspace/` 会先复制到该子级,随后 `prepareWorkspace` 在 agent 启动前针对生成 cwd 运行。默认生成的 workspace 在会话 fixture 中存储为 `{{cwd}}`,使平台临时根目录与随机 basename 不影响录制。 Headless manifest 在测试 Session workspace 授权本身时使用 `workspace.parent: outside-temp`。适配器在父目录可写且位于系统临时授权之外时,于平台临时根目录旁分配目录,否则使用 home,并拒绝已被自动临时写授权覆盖的生成 cwd。
89
+ 需要非 Windows 主机的场景声明 `posixOnly`,在 Windows 上跳过运行测试,但 fixture 保护仍在所有平台覆盖其已提交文件;组合需要可用 `pwsh` 的场景声明 `pwshOnly`。当临时目录授权自身待测时,`workspaceParent` 将生成子级 cwd 移出平台临时区域;场景签入的 `workspace/` 会先复制到该子级,随后 `prepareWorkspace` 在 agent 启动前针对生成 cwd 运行。默认生成的 workspace 在会话 fixture 中存储为 `{{cwd}}`,使平台临时根目录与随机 basename 不影响录制。headless manifest 在测试 Session workspace 授权本身时使用 `workspace.parent: outside-temp`。适配器在父目录可写且位于系统临时授权之外时,于平台临时根目录旁分配目录,否则使用 home,并拒绝已被自动临时写授权覆盖的生成 cwd。
90
90
 
91
91
  ### 可能出什么问题
92
92
 
package/lib/index.js CHANGED
@@ -313,7 +313,7 @@ function profileArgs(profile, basePatch, selectedPatch, snapshotMode, cwd) {
313
313
  return [
314
314
  "--profile",
315
315
  profile,
316
- ...patches.map((file, index) => materializeProfilePatch(file, cwd, materializedDir, index)).flatMap((file) => ["--patch", file])
316
+ ...patches.map((file, index) => materializeProfilePatch(file, cwd, profile, materializedDir, index)).flatMap((file) => ["--patch", file])
317
317
  ];
318
318
  }
319
319
  /** Derive the replay-only sibling patch selected by the former app-bin swap. */
@@ -336,13 +336,13 @@ function packageDirFromPatch(source, packageName) {
336
336
  }
337
337
  /**
338
338
  * Install an authored patch's resolvable bare package into the temporary
339
- * profile fallback. This mirrors `dsh plugin` while retaining the bare entry
340
- * name and package provenance used by request metadata.
339
+ * profile. This mirrors `dsh plugin` while retaining the bare entry
340
+ * name and package identity used by request metadata.
341
341
  */
342
- function linkProfilePackage(source, cwd, packageName) {
342
+ function linkProfilePackage(source, cwd, profile, packageName) {
343
343
  const packageDir = packageDirFromPatch(source, packageName);
344
344
  if (packageDir === void 0) return;
345
- const link = join(cwd, ".dsh", "profiles", "node_modules", packageName);
345
+ const link = join(cwd, ".dsh", "profiles", profile, "node_modules", packageName);
346
346
  mkdirSync(dirname(link), { recursive: true });
347
347
  if (existsSync(link)) {
348
348
  if (realpathSync(link) !== packageDir) throw new Error(`snapshot profile package ${packageName} resolves to two directories`);
@@ -354,19 +354,20 @@ function linkProfilePackage(source, cwd, packageName) {
354
354
  /**
355
355
  * Copy one authored patch into the launch cwd with relative plugin names made absolute.
356
356
  * @param source - authored profile patch path.
357
- * @param cwd - isolated process cwd whose profile fallback receives package links.
357
+ * @param cwd - isolated process cwd whose profile receives package links.
358
+ * @param profile - profile whose local package lookup receives the test links.
358
359
  * @param targetDir - existing directory that owns the materialized patch.
359
360
  * @param index - stable patch ordinal used in the output filename.
360
361
  * @returns absolute materialized patch path.
361
362
  */
362
- function materializeProfilePatch(source, cwd, targetDir, index) {
363
+ function materializeProfilePatch(source, cwd, profile, targetDir, index) {
363
364
  const parsed = yaml.load(readFileSync(source, "utf8"), { schema: entryListSchema });
364
365
  if (!Array.isArray(parsed)) throw new Error(`snapshot profile patch must be a top-level array: ${source}`);
365
366
  const patches = parsed;
366
367
  const baseDir = dirname(source);
367
368
  const resolveName = (value) => {
368
369
  const packageName = barePackageName(value);
369
- if (packageName !== void 0) linkProfilePackage(source, cwd, packageName);
370
+ if (packageName !== void 0) linkProfilePackage(source, cwd, profile, packageName);
370
371
  return value.startsWith("./") || value.startsWith("../") ? pathToFileURL(resolve(baseDir, value)).href : value;
371
372
  };
372
373
  const visitEntry = (entry) => {
@@ -1453,7 +1454,7 @@ function normalizeSessionSnapshot(rawLog, ctx, options = {}) {
1453
1454
  * @returns normalized session fixtures in input order.
1454
1455
  */
1455
1456
  function normalizeSessionSnapshots(rawLogs, ctx, options = {}) {
1456
- return redactSessionSnapshotIds(rawLogs.map((log) => hasSessionFormatVersion(log) ? prepareSessionSnapshotFixtureForComparison(log) : log).map(normalizeSessionFormatProvenance)).map((log) => projectSessionSnapshot(scrubSessionSnapshot(normalizeSessionLog(log, {
1457
+ return redactSessionSnapshotIds(rawLogs.map((log) => hasSessionFormatVersion(log) ? prepareSessionSnapshotFixtureForComparison(log) : log).map(normalizeSessionFormatMetadata)).map((log) => projectSessionSnapshot(scrubSessionSnapshot(normalizeSessionLog(log, {
1457
1458
  ...ctx,
1458
1459
  sessionIds: []
1459
1460
  }, {
@@ -1467,7 +1468,7 @@ function normalizeSessionSnapshots(rawLogs, ctx, options = {}) {
1467
1468
  * @param rawLog - Session records or events as compact JSON lines.
1468
1469
  * @returns the same records with only the Session header version omitted.
1469
1470
  */
1470
- function normalizeSessionFormatProvenance(rawLog) {
1471
+ function normalizeSessionFormatMetadata(rawLog) {
1471
1472
  return rawLog.split("\n").map((line) => {
1472
1473
  if (line.trim().length === 0) return line;
1473
1474
  const record = JSON.parse(line);
@@ -1621,7 +1622,8 @@ const SESSION_FORMAT_COVERAGE = new Set([
1621
1622
  "packed-row",
1622
1623
  "retry-failure",
1623
1624
  "shipped-profile",
1624
- "adjacent-migration"
1625
+ "adjacent-migration",
1626
+ "retired-tools"
1625
1627
  ]);
1626
1628
  const NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
1627
1629
  function record(value, label) {
@@ -2846,4 +2848,4 @@ function defineAcpSnapshotSuite(options) {
2846
2848
  });
2847
2849
  }
2848
2850
  //#endregion
2849
- export { EMPTY_WORKSPACE_MARKER, assertPersistedSessionVersion, assertSessionFixtureVersion, captureExpectedWorkspaceSnapshot, captureWorkspaceSnapshot, defineAcpSnapshotSuite, extractSnapshotSpillPaths, fixtureContext, formatSystemPromptSnapshot, formatToolSchemasSnapshot, headerChangeCount, latestPersistedSessionPaths, launchAcpTestAgent, materializeProfilePatch, normalizeSessionFormatProvenance, normalizeSessionLog, normalizeSessionSnapshot, normalizeSessionSnapshots, normalizeStdout, normalizedHeaders, normalizedSystemPrompts, normalizedToolSchemas, parsePersistedSessionFilename, parseSessionFixtureName, parseSnapshotManifest, parseSystemPromptSnapshot, parseToolSchemasSnapshot, persistedSessionFilename, redactSessionSnapshotIds, refreshFixtureReplacements, restorePinnedToolSchemas, runScenario, scrubModelRequestBulk, scrubSessionSnapshot, scrubSystemPrompts, scrubToolSchemas, sessionFixtureFiles, sessionFixtureName, sessionFixtureNames, sessionHeaderVersion, snapshotSpillRoot, stabilizeFixtureMessageIds, stabilizeRefreshLog, systemPromptPrecedesRequests, tokenizeSessionFixtureCwd, writerSnapshotName, writesCurrentSessionFixtures };
2851
+ export { EMPTY_WORKSPACE_MARKER, assertPersistedSessionVersion, assertSessionFixtureVersion, captureExpectedWorkspaceSnapshot, captureWorkspaceSnapshot, defineAcpSnapshotSuite, extractSnapshotSpillPaths, fixtureContext, formatSystemPromptSnapshot, formatToolSchemasSnapshot, headerChangeCount, latestPersistedSessionPaths, launchAcpTestAgent, materializeProfilePatch, normalizeSessionFormatMetadata, normalizeSessionLog, normalizeSessionSnapshot, normalizeSessionSnapshots, normalizeStdout, normalizedHeaders, normalizedSystemPrompts, normalizedToolSchemas, parsePersistedSessionFilename, parseSessionFixtureName, parseSnapshotManifest, parseSystemPromptSnapshot, parseToolSchemasSnapshot, persistedSessionFilename, redactSessionSnapshotIds, refreshFixtureReplacements, restorePinnedToolSchemas, runScenario, scrubModelRequestBulk, scrubSessionSnapshot, scrubSystemPrompts, scrubToolSchemas, sessionFixtureFiles, sessionFixtureName, sessionFixtureNames, sessionHeaderVersion, snapshotSpillRoot, stabilizeFixtureMessageIds, stabilizeRefreshLog, systemPromptPrecedesRequests, tokenizeSessionFixtureCwd, writerSnapshotName, writesCurrentSessionFixtures };
@@ -19,7 +19,7 @@
19
19
  export { redactSessionSnapshotIds, } from './identity.ts';
20
20
  export { runScenario, snapshotSpillRoot, type HarvestedLog, type InputScript, type InputStep, type PermissionAnswer, type RunOptions, type RunResult, } from './harness.ts';
21
21
  export { launchAcpTestAgent, materializeProfilePatch, type AcpTestLaunchOptions, type AgentUnderTest, type LaunchedAcpTestAgent, } from './launcher.ts';
22
- export { extractSnapshotSpillPaths, normalizeSessionFormatProvenance, normalizeSessionLog, normalizeSessionSnapshot, normalizeSessionSnapshots, normalizeStdout, scrubModelRequestBulk, scrubSessionSnapshot, scrubSystemPrompts, scrubToolSchemas, tokenizeSessionFixtureCwd, type CwdPathMode, type NormalizeContext, type NormalizeOptions, } from './normalize.ts';
22
+ export { extractSnapshotSpillPaths, normalizeSessionFormatMetadata, normalizeSessionLog, normalizeSessionSnapshot, normalizeSessionSnapshots, normalizeStdout, scrubModelRequestBulk, scrubSessionSnapshot, scrubSystemPrompts, scrubToolSchemas, tokenizeSessionFixtureCwd, type CwdPathMode, type NormalizeContext, type NormalizeOptions, } from './normalize.ts';
23
23
  export { parseSnapshotManifest, writesCurrentSessionFixtures, type SnapshotHeaderManifest, type SnapshotInputAttachment, type SnapshotInputManifest, type SnapshotManifest, type SnapshotPermission, type SnapshotPlatform, type SnapshotProfile, type SnapshotRecording, type SnapshotReplayManifest, type SnapshotSessionReference, type SnapshotSessionFormatCoverage, type SnapshotSessionFormatManifest, type SnapshotSessionWriteMode, type SnapshotWorkspaceManifest, } from './manifest.ts';
24
24
  export { assertPersistedSessionVersion, assertSessionFixtureVersion, latestPersistedSessionPaths, parsePersistedSessionFilename, parseSessionFixtureName, persistedSessionFilename, sessionFixtureFiles, sessionFixtureName, sessionFixtureNames, sessionHeaderVersion, writerSnapshotName, type PersistedSessionFile, type SessionFixtureFile, } from './session-files.ts';
25
25
  export { formatSystemPromptSnapshot, formatToolSchemasSnapshot, fixtureContext, headerChangeCount, defineAcpSnapshotSuite, normalizedHeaders, normalizedSystemPrompts, normalizedToolSchemas, parseSystemPromptSnapshot, parseToolSchemasSnapshot, refreshFixtureReplacements, restorePinnedToolSchemas, stabilizeFixtureMessageIds, stabilizeRefreshLog, systemPromptPrecedesRequests, type Scenario, type SnapshotSuiteOptions, } from './suite.ts';
@@ -75,10 +75,11 @@ export declare function launchAcpTestAgent(options: AcpTestLaunchOptions): Launc
75
75
  /**
76
76
  * Copy one authored patch into the launch cwd with relative plugin names made absolute.
77
77
  * @param source - authored profile patch path.
78
- * @param cwd - isolated process cwd whose profile fallback receives package links.
78
+ * @param cwd - isolated process cwd whose profile receives package links.
79
+ * @param profile - profile whose local package lookup receives the test links.
79
80
  * @param targetDir - existing directory that owns the materialized patch.
80
81
  * @param index - stable patch ordinal used in the output filename.
81
82
  * @returns absolute materialized patch path.
82
83
  */
83
- export declare function materializeProfilePatch(source: string, cwd: string, targetDir: string, index: number): string;
84
+ export declare function materializeProfilePatch(source: string, cwd: string, profile: string, targetDir: string, index: number): string;
84
85
  //# sourceMappingURL=launcher.d.ts.map
@@ -61,13 +61,13 @@ export interface SnapshotSessionReference {
61
61
  /** Repository-relative POSIX path to the owning scenario's selected parent Session fixture. */
62
62
  source: string;
63
63
  }
64
- /** Historical-format behavior one retained scenario permanently exercises. */
65
- export type SnapshotSessionFormatCoverage = 'multi-hop' | 'packed-row' | 'retry-failure' | 'shipped-profile' | 'adjacent-migration';
64
+ /** Historical format or retired capability one retained scenario permanently exercises. */
65
+ export type SnapshotSessionFormatCoverage = 'multi-hop' | 'packed-row' | 'retry-failure' | 'shipped-profile' | 'adjacent-migration' | 'retired-tools';
66
66
  /** Explicit historical generation retained by an owning scenario. */
67
67
  export interface SnapshotSessionFormatManifest {
68
68
  /** Selected fixture generation; absent manifest metadata tracks the current writer. */
69
69
  readonly version: number;
70
- /** Migration behaviors that require this historical fixture. */
70
+ /** Migration or retired-tool behavior that requires this immutable fixture. */
71
71
  readonly coverage: readonly SnapshotSessionFormatCoverage[];
72
72
  }
73
73
  /** Declarative ownership metadata stored beside a recorded session. */
@@ -97,7 +97,7 @@ export declare function normalizeSessionSnapshots(rawLogs: readonly string[], ct
97
97
  * @param rawLog - Session records or events as compact JSON lines.
98
98
  * @returns the same records with only the Session header version omitted.
99
99
  */
100
- export declare function normalizeSessionFormatProvenance(rawLog: string): string;
100
+ export declare function normalizeSessionFormatMetadata(rawLog: string): string;
101
101
  /**
102
102
  * Replace the rendered prompt text of every `system/message` event with the
103
103
  * `{{system}}` token. The text block keeps its position and type, so the
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.1.5-rc.2",
4
+ "version": "0.1.6-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,28 +31,28 @@
31
31
  "js-yaml": "^4.2.0",
32
32
  "vitest": "^4.1.8",
33
33
  "@deepseek-ai/cordis-plugin-include": "1.0.7",
34
- "@deepseek-ai/dsh-llm-replay": "^0.1.5-rc.2",
35
- "@deepseek-ai/dsh-loader-smoke": "0.1.5-rc.2",
36
- "@deepseek-ai/dsh-session-format": "^0.1.5-rc.2"
34
+ "@deepseek-ai/dsh-llm-replay": "^0.1.6-alpha.2",
35
+ "@deepseek-ai/dsh-loader-smoke": "0.1.6-alpha.2",
36
+ "@deepseek-ai/dsh-session-format": "^0.1.6-alpha.2"
37
37
  },
38
38
  "peerDependencies": {
39
- "@deepseek-ai/dsh-http-proxy": "^0.1.5-rc.2",
40
- "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
41
- "@deepseek-ai/cordis": "^4.0.2"
39
+ "@deepseek-ai/cordis": "^4.0.2",
40
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
41
+ "@deepseek-ai/dsh-http-proxy": "^0.1.6-alpha.2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/js-yaml": "^4.0.9",
45
- "@deepseek-ai/dsh-agent": "^0.1.5-rc.2",
46
45
  "@deepseek-ai/cordis": "^4.0.2",
47
- "@deepseek-ai/dsh-compaction": "^0.1.5-rc.2",
48
- "@deepseek-ai/dsh-agent-loop": "^0.1.5-rc.2",
49
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
50
- "@deepseek-ai/dsh-sandbox": "^0.1.5-rc.2",
51
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.5-rc.2",
52
- "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
53
- "@deepseek-ai/dsh-subagent": "^0.1.5-rc.2",
54
- "@deepseek-ai/dsh-tools": "^0.1.5-rc.2",
55
- "@deepseek-ai/dsh-user-questions": "^0.1.5-rc.2",
56
- "@deepseek-ai/dsh-http-proxy": "^0.1.5-rc.2"
46
+ "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
47
+ "@deepseek-ai/dsh-agent-loop": "^0.1.6-alpha.2",
48
+ "@deepseek-ai/dsh-compaction": "^0.1.6-alpha.2",
49
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
50
+ "@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.2",
51
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
52
+ "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
53
+ "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2",
54
+ "@deepseek-ai/dsh-user-questions": "^0.1.6-alpha.2",
55
+ "@deepseek-ai/dsh-http-proxy": "^0.1.6-alpha.2",
56
+ "@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.2"
57
57
  }
58
58
  }