@x1a0f3n9/dsh-session-persistence-jsonl 0.1.5-alpha.2 → 0.1.5-rc.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 +2 -2
- package/README.md +3 -1
- package/README.zh.md +9 -7
- package/package.json +13 -13
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-jsonl/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 7fbcbbf87f7fdf4f48a8456b99a2b542b05078b6
|
|
6
|
+
README.zh.md: 045b82d497b11f504dd778eada46f91df6917354
|
package/README.md
CHANGED
|
@@ -62,9 +62,11 @@ Each session gets a session-owned directory under a readable project directory.
|
|
|
62
62
|
session.jsonl.zstd # released v0, compressed root
|
|
63
63
|
session.v1.jsonl.zstd # released v1, compressed root
|
|
64
64
|
session.v2.jsonl.zstd # released v2, compressed root
|
|
65
|
+
session.v3.jsonl.zstd # released v3/current, compressed root
|
|
65
66
|
session.jsonl # released v0, raw root
|
|
66
67
|
session.v1.jsonl # released v1, raw root
|
|
67
|
-
session.v2.jsonl # released v2, raw root
|
|
68
|
+
session.v2.jsonl # released v2, raw root
|
|
69
|
+
session.v3.jsonl # released v3/current, raw root; later versions use vN
|
|
68
70
|
```
|
|
69
71
|
|
|
70
72
|
Session ids are injectively escaped to one safe path segment before use (no traversal, no collision). The normalized cwd keeps the project directory readable for navigation; cwd strings that normalize alike share a project directory while session ids still select distinct session directories. Runtime operations select the numerically highest canonical generation, and format-refusal diagnostics name that absolute path so an operator can find the raw log a build refused to interpret.
|
package/README.zh.md
CHANGED
|
@@ -29,7 +29,7 @@ kind: "package-reference"
|
|
|
29
29
|
|
|
30
30
|
### 何时选择
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
当消费方受益于每会话一份产物——导航、外部工具或可逐行读取的原始日志——时选择此后端。它是唯一的第一方会话持久化提供方。后端把会话保存在部署控制的根下:项目本地、共享、临时或集中式。
|
|
33
33
|
|
|
34
34
|
### 最小配置
|
|
35
35
|
|
|
@@ -62,12 +62,14 @@ kind: "package-reference"
|
|
|
62
62
|
session.jsonl.zstd # released v0, compressed root
|
|
63
63
|
session.v1.jsonl.zstd # released v1, compressed root
|
|
64
64
|
session.v2.jsonl.zstd # released v2, compressed root
|
|
65
|
+
session.v3.jsonl.zstd # released v3/current, compressed root
|
|
65
66
|
session.jsonl # released v0, raw root
|
|
66
67
|
session.v1.jsonl # released v1, raw root
|
|
67
|
-
session.v2.jsonl # released v2, raw root
|
|
68
|
+
session.v2.jsonl # released v2, raw root
|
|
69
|
+
session.v3.jsonl # released v3/current, raw root; later versions use vN
|
|
68
70
|
```
|
|
69
71
|
|
|
70
|
-
会话 id 在使用前被单射转义为一个安全路径段(无遍历、无冲突)。规范化 cwd 让项目目录保持可读、便于导航;规范化相同的 cwd 字符串共享项目目录,而会话 id
|
|
72
|
+
会话 id 在使用前被单射转义为一个安全路径段(无遍历、无冲突)。规范化 cwd 让项目目录保持可读、便于导航;规范化相同的 cwd 字符串共享项目目录,而会话 id 仍选择不同会话目录。运行时操作选择数值最高的规范 generation,格式拒绝诊断会点名该绝对路径,让操作者能找到构建拒绝解读的原始日志。
|
|
71
73
|
|
|
72
74
|
### 持久性与崩溃语义
|
|
73
75
|
|
|
@@ -77,7 +79,7 @@ kind: "package-reference"
|
|
|
77
79
|
|
|
78
80
|
### 读取日志
|
|
79
81
|
|
|
80
|
-
`open(id, 'read'|'write')` 选择最高规范 generation。当前格式输入走普通快速路径。对于历史输入,只读 open 会单遍解码并迁移源、校验当前逻辑结果,然后在不发布后继的情况下返回。写 open 会在可用时复用按 revision 为键的 preparation,否则执行同一套 preparation,再按有界分片编码同目录临时文件、在 Worker Thread 中校验、复查源修订,并在返回前以不覆盖方式发布当前后继。源保持逐字节不变。如果源在 preparation 后发生变化,该次写 open 会失败,已经返回给读方的逻辑历史不会被替换;后续写 open 会针对新的 revision 重新执行 preparation
|
|
82
|
+
`open(id, 'read'|'write')` 选择最高规范 generation。当前格式输入走普通快速路径。对于历史输入,只读 open 会单遍解码并迁移源、校验当前逻辑结果,然后在不发布后继的情况下返回。写 open 会在可用时复用按 revision 为键的 preparation,否则执行同一套 preparation,再按有界分片编码同目录临时文件、在 Worker Thread 中校验、复查源修订,并在返回前以不覆盖方式发布当前后继。源保持逐字节不变。如果源在 preparation 后发生变化,该次写 open 会失败,已经返回给读方的逻辑历史不会被替换;后续写 open 会针对新的 revision 重新执行 preparation。后端在 memo 化前冻结已解码的 event graph,并在此时将其标记为 `shared-frozen`;句柄读取和 slice 即使为空也保留该状态。只有尚未实体化的 pending 空日志报告 `detached`。`stat(id)` 与 `list()` 只选择并转换最高 generation 的 header,不读取事件行,也不启动迁移;快照携带所选文件的 `sizeBytes` 与尽力而为的 stat 派生修订号。选择 `compression: 'none'` 后,日志是外部读取方可直接消费的换行分隔文本;压缩默认值必须经后端读取。
|
|
81
83
|
|
|
82
84
|
-----
|
|
83
85
|
|
|
@@ -108,7 +110,7 @@ kind: "package-reference"
|
|
|
108
110
|
| [`src/migration-verifier.ts`](src/migration-verifier.ts) | stage 与竞争 generation 校验的 Worker 生命周期 |
|
|
109
111
|
| [`src/zstd.ts`](src/zstd.ts) | Zstandard 帧压缩、解码与帧扫描 |
|
|
110
112
|
| [`src/win32.ts`](src/win32.ts) | Windows write-through 发布与目录创建 |
|
|
111
|
-
| — |
|
|
113
|
+
| — | 不发布运行时不变式伴生入口;身份在存储层强制;持久化正确性依赖后端往返与崩溃尾部测试,本包不公开可持续观察的进程内关系。 |
|
|
112
114
|
|
|
113
115
|
</details>
|
|
114
116
|
|
|
@@ -151,11 +153,11 @@ JSONL 存储不修改实时请求前缀。只有重建历史、当前 envelope
|
|
|
151
153
|
|
|
152
154
|
这些限制说明本后端何时不合适,或何时需要特别的运维注意。它们是当前包约束,不是任务积压。
|
|
153
155
|
|
|
154
|
-
- **格式迁移保留已配置编码,且只支持 catalog 中的链**——本 build
|
|
156
|
+
- **格式迁移保留已配置编码,且只支持 catalog 中的链**——本 build 把受支持的历史代迁移到当前格式;更改压缩需要独立根,保留的旧版本不提供自动 fallback 或 downgrade 支持。
|
|
155
157
|
- **平铺文件存储布局不加载**——加载前使用独立根,或将预发布产物移入项目/会话目录布局。
|
|
156
158
|
- **压缩文件不能直接按行读取**——使用后端加载;或在写入新根前选择 `compression: 'none'`,供外部行读取方使用。
|
|
157
159
|
- **不删除会话文件**——日志在 `root` 下累积,直到外部移除;seam 无删除接口。
|
|
158
|
-
- **每会话一个活动写入方**——写句柄认领在所属后端实例内排除第二个写入方,内核锁(`session.lock` 上的非阻塞 `flock(2)`;Windows
|
|
160
|
+
- **每会话一个活动写入方**——写句柄认领在所属后端实例内排除第二个写入方,内核锁(`session.lock` 上的非阻塞 `flock(2)`;Windows 上为由该路径派生的命名内核信号量,零文件系统足迹)排除其他所有实例与进程;锁在以写模式打开既有产物时立即获取,新建会话则仅在首次实体化写入之前获取,因此未实体化的会话不留任何文件系统足迹。崩溃持有者的锁随其进程消亡,会话立即可再写入,而活着但卡死的持有者会阻塞写入方直到其进程退出(POSIX 上删除锁文件即放弃该排他;释放本身从不删除它)。咨询式 `flock` 在部分网络文件系统(NFSv3)上不可靠,Windows 信号量名按登录会话隔离。
|
|
159
161
|
- **POSIX 实体化需要硬链接支持**——第一次 append 使用 `link()`,使同 id 竞态失败而不覆盖已提交日志;Windows 使用无替换 write-through rename。
|
|
160
162
|
- **POSIX 写入需要匹配的预编译系统 addon**——[`node-addon-system`](../../../native/system/README.zh.md) 提供异步 flock,无须在用户侧编译。addon 缺失时拒绝写入所有权;Windows 保留其信号量实现。
|
|
161
163
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x1a0f3n9/dsh-session-persistence-jsonl",
|
|
3
3
|
"description": "JSONL durable session persistence backend for the DeepSeek Harness",
|
|
4
|
-
"version": "0.1.5-
|
|
4
|
+
"version": "0.1.5-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -28,23 +28,23 @@
|
|
|
28
28
|
],
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@x1a0f3n9/dsh-session": "^0.1.5-
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
31
|
+
"@x1a0f3n9/dsh-session": "^0.1.5-rc.2",
|
|
32
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
33
|
+
"@x1a0f3n9/dsh-session-persistence": "^0.1.5-rc.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"koffi": "^3.1.0",
|
|
37
|
-
"@x1a0f3n9/dsh-
|
|
38
|
-
"@x1a0f3n9/dsh-
|
|
39
|
-
"@x1a0f3n9/dsh-session-format-
|
|
40
|
-
"@x1a0f3n9/dsh-session-format-v2-to-v3": "^0.1.5-alpha.2",
|
|
37
|
+
"@x1a0f3n9/dsh-session-format-catalog": "^0.1.5-rc.2",
|
|
38
|
+
"@x1a0f3n9/dsh-llm": "^0.1.5-rc.2",
|
|
39
|
+
"@x1a0f3n9/dsh-session-format-v2-to-v3": "^0.1.5-rc.2",
|
|
41
40
|
"@deepseek-ai/node-addon-system": "^0.1.2",
|
|
42
|
-
"@deepseek-ai/schemastery": "^3.18.2"
|
|
41
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
42
|
+
"@x1a0f3n9/dsh-session-format": "^0.1.5-rc.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@x1a0f3n9/dsh-session
|
|
46
|
-
"@x1a0f3n9/dsh-session-
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
45
|
+
"@x1a0f3n9/dsh-session": "^0.1.5-rc.2",
|
|
46
|
+
"@x1a0f3n9/dsh-session-format-v0-to-v1": "^0.1.5-rc.2",
|
|
47
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
48
|
+
"@x1a0f3n9/dsh-session-persistence": "^0.1.5-rc.2"
|
|
49
49
|
}
|
|
50
50
|
}
|