@x1a0f3n9/dsh-session-persistence 0.1.5-rc.2 → 0.1.5-rc.4
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 +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/index.js +3 -1
- package/lib/types/index.d.ts +3 -1
- package/package.json +9 -9
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/session/session-persistence/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 16111343b95b9598417d91ee1836783371e8c209
|
|
6
|
+
README.zh.md: 16f631cff6e1979f733de2261fe5c1020a1933ff
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ The package is a seam, not a backend framework: it exports the abstract `Session
|
|
|
80
80
|
|
|
81
81
|
### The invariants every backend honors
|
|
82
82
|
|
|
83
|
-
- **Contiguous `seq`.** Ordinary `append` never rewrites committed events; an explicit persistence `truncate` is the destructive exception that replaces the current generation's retained prefix. `append`'s first `seq` must equal the stored next-seq, and a gap rejects.
|
|
83
|
+
- **Contiguous `seq`.** Ordinary `append` never rewrites committed events; an explicit persistence `truncate` is the destructive exception that replaces the current generation's retained prefix. `append`'s first `seq` must equal the stored next-seq, and a gap rejects. Destructive truncate drops routed live events at or past the retained length so a later flush cannot replay the discarded tail.
|
|
84
84
|
- **A torn physical tail never reaches a reader.** It belongs to an append that never resolved; the write path truncates it durably before its first new append.
|
|
85
85
|
- **Lossless JSON data.** Batches and headers pass the shared one-pass validate-and-snapshot boundary (`materializeAppendBatch`/`materializeCreateHeader`); non-serializable payloads reject at the call site.
|
|
86
86
|
- **Durability.** `append` persists best-effort; `flush` — per handle or service-wide — is the barrier that promises storage and also materializes an empty session.
|
package/README.zh.md
CHANGED
|
@@ -80,7 +80,7 @@ await ctx.sessionPersistence.flush() // backend-wide d
|
|
|
80
80
|
|
|
81
81
|
### 每个后端必须遵守的不变量
|
|
82
82
|
|
|
83
|
-
- **连续 `seq`。** 普通 `append` 绝不重写已提交事件;显式的 persistence `truncate` 是破坏性例外,它替换当前 generation 的保留前缀。`append` 的第一个 `seq` 必须等于已存储 next-seq
|
|
83
|
+
- **连续 `seq`。** 普通 `append` 绝不重写已提交事件;显式的 persistence `truncate` 是破坏性例外,它替换当前 generation 的保留前缀。`append` 的第一个 `seq` 必须等于已存储 next-seq,缺口会被拒绝。破坏性 truncate 会丢弃序号大于等于保留长度的已路由实时事件,避免后续 flush 重放被丢弃的尾部。
|
|
84
84
|
- **撕裂的物理尾部绝不到达读取方。** 它属于一次从未完成的 append;写路径在第一次新 append 之前将其持久截断。
|
|
85
85
|
- **无损 JSON 数据。** 批次与 header 经过共享的单遍校验并快照边界(`materializeAppendBatch`/`materializeCreateHeader`);无法序列化的载荷在调用处被拒绝。
|
|
86
86
|
- **持久性。** `append` 尽力而为地持久化;`flush`——逐句柄或服务级——是承诺存储并同时把空会话实体化的屏障。
|
package/lib/index.js
CHANGED
|
@@ -267,7 +267,9 @@ var SessionPersistence = class extends Service {
|
|
|
267
267
|
/**
|
|
268
268
|
* Permanently replace one session's durable event log with an earlier prefix.
|
|
269
269
|
* The caller must apply the matching in-memory truncation only after this
|
|
270
|
-
* promise resolves.
|
|
270
|
+
* promise resolves. The backend must drop routed live events at or past
|
|
271
|
+
* `_length` so a later flush cannot replay the discarded tail. Backends that
|
|
272
|
+
* do not support rewriting reject loudly.
|
|
271
273
|
* @param _id - the live session whose durable log is being rewritten.
|
|
272
274
|
* @param _length - number of events to retain.
|
|
273
275
|
* @returns resolution after the retained prefix is durable.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -183,7 +183,9 @@ export declare abstract class SessionPersistence extends Service {
|
|
|
183
183
|
/**
|
|
184
184
|
* Permanently replace one session's durable event log with an earlier prefix.
|
|
185
185
|
* The caller must apply the matching in-memory truncation only after this
|
|
186
|
-
* promise resolves.
|
|
186
|
+
* promise resolves. The backend must drop routed live events at or past
|
|
187
|
+
* `_length` so a later flush cannot replay the discarded tail. Backends that
|
|
188
|
+
* do not support rewriting reject loudly.
|
|
187
189
|
* @param _id - the live session whose durable log is being rewritten.
|
|
188
190
|
* @param _length - number of events to retain.
|
|
189
191
|
* @returns resolution after the retained prefix is durable.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x1a0f3n9/dsh-session-persistence",
|
|
3
3
|
"description": "Abstract durable session persistence seam (ctx.sessionPersistence) for the DeepSeek Harness",
|
|
4
|
-
"version": "0.1.5-rc.
|
|
4
|
+
"version": "0.1.5-rc.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
31
|
-
"@x1a0f3n9/dsh-brand": "^0.1.5-rc.
|
|
32
|
-
"@x1a0f3n9/dsh-session": "^0.1.5-rc.
|
|
33
|
-
"@x1a0f3n9/dsh-timeout": "^0.1.5-rc.
|
|
31
|
+
"@x1a0f3n9/dsh-brand": "^0.1.5-rc.4",
|
|
32
|
+
"@x1a0f3n9/dsh-session": "^0.1.5-rc.4",
|
|
33
|
+
"@x1a0f3n9/dsh-timeout": "^0.1.5-rc.4"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
37
|
-
"@x1a0f3n9/dsh-brand": "^0.1.5-rc.
|
|
38
|
-
"@x1a0f3n9/dsh-scope": "^0.1.5-rc.
|
|
39
|
-
"@x1a0f3n9/dsh-
|
|
40
|
-
"@x1a0f3n9/dsh-
|
|
37
|
+
"@x1a0f3n9/dsh-brand": "^0.1.5-rc.4",
|
|
38
|
+
"@x1a0f3n9/dsh-scope": "^0.1.5-rc.4",
|
|
39
|
+
"@x1a0f3n9/dsh-session": "^0.1.5-rc.4",
|
|
40
|
+
"@x1a0f3n9/dsh-timeout": "^0.1.5-rc.4"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@x1a0f3n9/dsh-util-values": "^0.1.5-rc.
|
|
43
|
+
"@x1a0f3n9/dsh-util-values": "^0.1.5-rc.4"
|
|
44
44
|
}
|
|
45
45
|
}
|