@michengai/dsh-archive-manager 0.1.20 → 0.1.21

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  Published release notes are retained below; new versions are added without removing earlier entries.
6
6
 
7
+ ## 0.1.21 — 2026-08-31
8
+
9
+ - Preserved the projection-cache `put()` Promise contract when a tombstone suppresses a deleted Session write, so DSH `v0.1.2-alpha.2` cold-read write-back remains fail-soft instead of throwing a synchronous `TypeError`.
10
+ - Added direct `put(...).catch(...)` regression coverage for alpha.2 while retaining the `putSoft` path used by DSH `v0.1.1-rc.2`, and clarified the separate safe cache domain and migration behavior.
11
+
12
+ Published package: [`@michengai/dsh-archive-manager@0.1.21`](https://www.npmjs.com/package/@michengai/dsh-archive-manager/v/0.1.21).
13
+
7
14
  ## 0.1.20 — 2026-08-31
8
15
 
9
16
  - Kept IM and other non-filesystem-safe Session ids unchanged while persisting projection checkpoints under fixed-length safe keys, preventing DSH `v0.1.2-alpha.2` from using colons as Windows filenames.
@@ -4,6 +4,13 @@
4
4
 
5
5
  以下发布说明会持续保留;新增版本时不再删除较早记录。
6
6
 
7
+ ## 0.1.21 — 2026-08-31
8
+
9
+ - 墓碑拦截已删除会话的投影缓存写入时仍保持 `put()` 的 Promise 契约,使 DSH `v0.1.2-alpha.2` 冷读写回继续按 fail-soft 方式处理,而不会同步抛出 `TypeError`。
10
+ - 补充 alpha.2 直接调用 `put(...).catch(...)` 的回归测试,同时保留 DSH `v0.1.1-rc.2` 使用的 `putSoft` 路径覆盖,并澄清独立安全缓存域与迁移行为。
11
+
12
+ 已发布包:[`@michengai/dsh-archive-manager@0.1.21`](https://www.npmjs.com/package/@michengai/dsh-archive-manager/v/0.1.21)。
13
+
7
14
  ## 0.1.20 — 2026-08-31
8
15
 
9
16
  - 保持 IM 等不适合作文件名的会话 ID 不变,将投影检查点改用固定长度安全键落盘,避免 DSH `v0.1.2-alpha.2` 在 Windows 上把冒号直接用作文件名。
package/lib/projcache.js CHANGED
@@ -122,10 +122,11 @@ async function importMissingRecords(ctx, target, records, label) {
122
122
  }
123
123
 
124
124
  /**
125
- * Seed the compatibility domain without ever opening alpha.2's unsafe
126
- * per-record source while a v3 whole-file cache is present. Imports are
127
- * add-only: a newer compatibility-domain checkpoint always wins, and a
128
- * partially completed import resumes on the next startup.
125
+ * Seed the compatibility domain without opening alpha.2's unsafe per-record
126
+ * source while the v3 whole-file cache contains rows. An empty v3 source may
127
+ * fall through to the current source; source-open failures stay fail-soft.
128
+ * Imports are add-only: a newer compatibility-domain checkpoint always wins,
129
+ * and a partially completed import resumes on the next startup.
129
130
  */
130
131
  async function importPreviousProjectionCache(ctx, target) {
131
132
  const legacy = await readSourceRecords(ctx, legacyProjectionCacheDomainSpec, "legacy v3");
@@ -142,17 +143,19 @@ async function importPreviousProjectionCache(ctx, target) {
142
143
  /**
143
144
  * dsh-archive-manager projcache 半边。
144
145
  *
145
- * `ArchiveProjectionCache` 继承上游 `SessionProjectionCache`
146
- * (服务名 `sessionProjectionCache`,同域、同 fail-soft 写路径),
147
- * 为归档管理的 `deleteSession` 增加三处守护:
146
+ * `ArchiveProjectionCache` 继承上游 `SessionProjectionCache`,保留服务名
147
+ * `sessionProjectionCache` 与 fail-soft 写路径,但使用独立、路径安全的
148
+ * `session_projcache_archive_manager` 兼容域,为归档管理的
149
+ * `deleteSession` 增加三处守护:
148
150
  *
149
- * - `delete(id)` - 永久移除一个会话的缓存投影行
150
- * (`session_projcache` 域上的 `table.delete`),写入前先登记墓碑。
151
+ * - `delete(id)` - 永久移除兼容域中该会话经 SHA-256 映射的缓存投影行,
152
+ * 写入前先登记墓碑。
151
153
  * - `whenIdle()` - 全部在途公开写入落定后 resolve。
152
154
  * - 墓碑挡住已删除会话的写入:迟到的写入要么被直接拦截,要么在
153
155
  * 落定后补删自己的残留行,不会复活已删除的缓存条目。守护覆盖
154
- * `write()`(dispose 写后路径)与 `putSoft()`(`coldSnapshot` 的
155
- * 冷读写回路径),两条落盘路径都纳入 `whenIdle` 跟踪。
156
+ * `write()`(dispose 写后路径)与 `put()`(rc.2 的 `putSoft` 最终调用
157
+ * 它,alpha.2 的 `coldSnapshot` 则直接调用它),两代落盘路径都纳入
158
+ * `whenIdle` 跟踪。
156
159
  *
157
160
  * 默认导出是 Service 子类(与上游 `@deepseek-ai/dsh-session-projection-cache`
158
161
  * 包同形),profile 补丁可直接替换 `session-projection-cache` 服务行,
@@ -201,7 +204,9 @@ var ArchiveProjectionCache = class extends SessionProjectionCache {
201
204
  * 直接经 `put`;把墓碑与 whenIdle 跟踪放在这里可同时兼容两代实现。
202
205
  */
203
206
  put(id, identity, rows) {
204
- if (this.deletedSessionIds.has(id)) return;
207
+ // alpha.2 coldSnapshot unconditionally chains `.catch()` onto put().
208
+ // A blocked write must therefore preserve the upstream Promise contract.
209
+ if (this.deletedSessionIds.has(id)) return Promise.resolve();
205
210
  const task = this.putCore(id, identity, rows);
206
211
  this.writeTail = Promise.allSettled([this.writeTail, task]).then(() => void 0);
207
212
  return task;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michengai/dsh-archive-manager",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "NPM-installable DSH Web plugin for managing archived sessions.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.21.0",