dsh-lite-memory 0.18.42 → 0.18.44
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/docs/BENCH.md +14 -0
- package/docs/RELEASE-0.18.43.md +18 -0
- package/docs/RELEASE-0.18.44.md +21 -0
- package/package.json +3 -3
- package/state.js +2 -1
- package/test/anchor.test.mjs +0 -795
- package/test/client.test.mjs +0 -400
- package/test/contract.test.mjs +0 -1342
- package/test/control.test.mjs +0 -324
- package/test/crossing.test.mjs +0 -471
- package/test/eval-seed.test.mjs +0 -113
- package/test/evolution-read.test.mjs +0 -658
- package/test/fixtures/legacy-v1/archive/mem_444444444444.json +0 -18
- package/test/fixtures/legacy-v1/entries/mem_111111111111.md +0 -2
- package/test/fixtures/legacy-v1/entries/mem_222222222222.md +0 -1
- package/test/fixtures/legacy-v1/entries/mem_333333333333.md +0 -1
- package/test/fixtures/legacy-v1/index.json +0 -63
- package/test/ha.test.mjs +0 -186
- package/test/layer-read.test.mjs +0 -293
- package/test/learning.test.mjs +0 -1450
- package/test/lexical.test.mjs +0 -68
- package/test/palace.test.mjs +0 -104
- package/test/recall.test.mjs +0 -1039
- package/test/record.test.mjs +0 -130
- package/test/resident.test.mjs +0 -46
- package/test/runtime-context.test.mjs +0 -192
- package/test/safety.test.mjs +0 -119
- package/test/scenario.test.mjs +0 -184
- package/test/state.test.mjs +0 -663
- package/test/store.test.mjs +0 -1487
- package/test/view.test.mjs +0 -264
package/docs/BENCH.md
CHANGED
|
@@ -75,3 +75,17 @@ npm run bench:evolution # 实验规则/样例/检查点/回执的存储与投
|
|
|
75
75
|
## 效果评测
|
|
76
76
|
|
|
77
77
|
§17.4 的 2×2 防污染实验要跑真实模型、固定评分,不在 CI 里,也没有预填改善百分比。`test/scenario.test.mjs` 与 `bench/evolution.mjs` 只证明场景边界、读取条件和成本上限;不声称模型更聪明。GitHub 上的功能主张只对应这些确定性测试和本地性能数字,模型侧效果等实跑后再写。
|
|
78
|
+
|
|
79
|
+
## 增删改后基线(0.18.43)
|
|
80
|
+
|
|
81
|
+
回执上限 256→64、`hits` 改记真实交付后的同一台机器重跑(macOS arm64,Node v24.16.0):
|
|
82
|
+
|
|
83
|
+
| 指标 | 0.18.41 | 0.18.43 |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| 热快照 P50 / P95 | 67.1 / 84.6 ms | 70.3 / 85.7 ms |
|
|
86
|
+
| 单次注入字节 | 368 B | 365 B |
|
|
87
|
+
| 2000 次操作后 `state.json` | 406 KB | 406 KB |
|
|
88
|
+
| 热点层回执条数上限 | 256(实测 35.7 KB) | 64(约 9 KB) |
|
|
89
|
+
|
|
90
|
+
P50 差值在同机噪音范围内(同一进程内 3 次中位数),注入字节与状态体积未增长;
|
|
91
|
+
`state.json` 仍远低于 2 MiB 上限。命令:`npm run bench`。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 0.18.43:回执上限从 256 降到 64
|
|
2
|
+
|
|
3
|
+
## 问题
|
|
4
|
+
|
|
5
|
+
回执只用于同一 `operationId` 的重放保护,重试都发生在当下;按 7 天 TTL 叠加 256 条
|
|
6
|
+
上限,热点层实测单层回执 35 KB。面板并不读这份列表,`state.receipts` 纯粹是防重
|
|
7
|
+
数据,留 256 条等于白占状态体积。
|
|
8
|
+
|
|
9
|
+
## 改法
|
|
10
|
+
|
|
11
|
+
- `LIMITS.receipts` 256 → 64。仍按 7 天 TTL 过期,仍在每次状态写入时清理。
|
|
12
|
+
- 单个热点层实测回执体积从 35.7 KB 降到约 9 KB;重放窗口覆盖当下重试与并发收尾,
|
|
13
|
+
不涉及历史查询。
|
|
14
|
+
|
|
15
|
+
## 验证
|
|
16
|
+
|
|
17
|
+
- 全量 `npm test` 通过(含回执过期清理、按 `operationId` 重放两条回归)。
|
|
18
|
+
- 线上层 `DSH-0ea3b310` 下一次写入即截到 64 条。
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# 0.18.44 — npm 包里不再装测试
|
|
2
|
+
|
|
3
|
+
## 变化
|
|
4
|
+
|
|
5
|
+
- `package.json` 的 `files` 加 `!test`:测试留在仓库、CI 与本地 `npm test` 照常跑,只是不随 npm 包发出去。
|
|
6
|
+
- 依据:装到 profile 里的插件只运行 `index.js` / `store.js` / `state.js` / `view.js` / `anchor.js` / `learning.js` / `client.js`;`test/` 有 600 KB 解包体积,装完从不执行。
|
|
7
|
+
|
|
8
|
+
## 数字
|
|
9
|
+
|
|
10
|
+
| 指标 | 0.18.43 | 0.18.44 |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| tarball | 377.6 KB | 249.4 KB |
|
|
13
|
+
| 解包 | 1.4 MB | 856.1 KB |
|
|
14
|
+
| 文件数 | 97 | 71 |
|
|
15
|
+
|
|
16
|
+
运行时行为、状态格式、接口与注入字节全部不变;`npm run bench` / `bench:evolution` 不受影响。测试仍在仓库:`test/` 与 CI 一个文件没少。
|
|
17
|
+
|
|
18
|
+
## 验证
|
|
19
|
+
|
|
20
|
+
- `npm test`:21 个套件全绿(改动只涉及发布文件清单)。
|
|
21
|
+
- `npm pack --dry-run`:71 个文件,249.4 KB,`test/` 不在清单里,`index.js`/`client.js` 等入口仍在。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-lite-memory",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.44",
|
|
4
4
|
"description": "On-demand memory for the DeepSeek Harness: nothing resident, at most three small cards on a real hit, bodies read on demand.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"!docs/ha-audit.md",
|
|
38
38
|
"!docs/ROADMAP.md",
|
|
39
39
|
"LICENSE",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"!test",
|
|
41
|
+
"bench"
|
|
42
42
|
],
|
|
43
43
|
"dsh": {
|
|
44
44
|
"bundle": {
|
package/state.js
CHANGED
|
@@ -232,7 +232,8 @@ export const LIMITS = {
|
|
|
232
232
|
suggestionTtlMs: 48 * 60 * 60 * 1000,
|
|
233
233
|
pending: 20,
|
|
234
234
|
pendingBytes: 64 * 1024,
|
|
235
|
-
|
|
235
|
+
/** 回执只用于同一操作的重放保护,重试都发生在当下;256 条会白占几十 KB。 */
|
|
236
|
+
receipts: 64,
|
|
236
237
|
receiptTtlMs: 7 * 24 * 60 * 60 * 1000,
|
|
237
238
|
suppressions: 64,
|
|
238
239
|
suppressionTtlMs: 7 * 24 * 60 * 60 * 1000,
|