sage-mem 2.15.7 → 2.15.9

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.en.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  **Cross-session memory for DeepSeek Harness — plain markdown files, no database, no worker.**
14
14
 
15
- **Current release: `2.15.7`** — the npm badge above is the dynamic source of truth. **Contract baseline: `1.0.0`** — the first stable release, whose public commitments, the capability boundaries and the list of things it explicitly cannot do are frozen in the
15
+ **Current release: `2.15.9`** — the npm badge above is the dynamic source of truth. **Contract baseline: `1.0.0`** — the first stable release, whose public commitments, the capability boundaries and the list of things it explicitly cannot do are frozen in the
16
16
  [frozen contract](https://github.com/gezi-wen/sage-mem/blob/main/docs/1.0.0-contract.md).
17
17
 
18
18
  If it is useful to you, a Star is the most direct feedback.
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  > File-based cross-session memory for DeepSeek Harness — every memory is a plain markdown file you can open, edit and delete. No database, no worker, no port.
16
16
 
17
- **当前发布版本:`2.15.7`** —— 顶部 npm 徽章是动态权威。**契约基线:`1.0.0`** —— 第一个稳定版,公开承诺、能力边界与「明确做不到」的清单冻结在
17
+ **当前发布版本:`2.15.9`** —— 顶部 npm 徽章是动态权威。**契约基线:`1.0.0`** —— 第一个稳定版,公开承诺、能力边界与「明确做不到」的清单冻结在
18
18
  [契约冻结](https://github.com/gezi-wen/sage-mem/blob/main/docs/1.0.0-contract.md)。
19
19
 
20
20
  如果它对你有用,给个 Star 是最直接的反馈。
@@ -0,0 +1,33 @@
1
+ /**
2
+ * 检查点聚合的结果形状(2.15.0 引入,2026-11-22 从 `typert.host.js` 拆出)。
3
+ *
4
+ * 为什么单独一份:`typert.host.js` 的行数线(1160)是「契约面不许无限膨胀」的守卫,
5
+ * 2026-11-22 补残篇/诊断字段时正好贴顶(1162 行)。D47 已经写过一次「下次撞线先想
6
+ * 能不能挪走」,这里按它执行:**只把这一族 schema 挪出来**,invocation 声明仍留在
7
+ * `typert.host.js`(那一份是契约的索引面,拆开就找不到入口了)。
8
+ *
9
+ * 依赖方向:只依赖 zod,不 import 任何本仓库模块 —— 它是纯形状。
10
+ */
11
+ import { z } from 'zod'
12
+
13
+ /** 一个任务检查点的「未完成」摘要。 */
14
+ export const checkpointTaskSchema = z.object({
15
+ 'taskId': z.string().readonly(),
16
+ 'project': z.string().readonly(),
17
+ 'revision': z.number().readonly(),
18
+ 'items': z.array(z.string().readonly()).readonly(),
19
+ }).readonly()
20
+
21
+ /**
22
+ * `memory.checkpoints` 的结果。
23
+ *
24
+ * `truncated` 同时表达两种截断(任务数超上限 / 某任务条目超上限);
25
+ * `skipped` 是「读不出来被跳过」的任务数(2.15.2 起)。
26
+ */
27
+ export const checkpointsResultSchema = z.object({
28
+ 'ok': z.boolean().readonly(),
29
+ 'truncated': z.boolean().readonly(),
30
+ 'tasks': z.array(checkpointTaskSchema).readonly(),
31
+ 'skipped': z.number().readonly().optional(),
32
+ 'error': z.string().readonly().optional(),
33
+ }).readonly()
@@ -5,6 +5,7 @@
5
5
  * schema 必须是 zod v4 实例(typert-loader 校验 "_zod" in schema)。
6
6
  */
7
7
  import { z } from 'zod'
8
+ import { checkpointsResultSchema } from './shared/checkpoints-schema.js'
8
9
  import { MD_NAME_PATTERN } from './shared/md-name.js'
9
10
  import { MAX_FILE_BYTES, MAX_RAW_BYTES } from './shared/limits.js'
10
11
 
@@ -264,8 +265,12 @@ const archiveCandidatesResultSchema = z.object({
264
265
  // 上锁 / 解锁的结果
265
266
  const lockResultSchema = z.object({
266
267
  'ok': z.boolean().readonly(),
267
- 'file': z.string().readonly(),
268
- 'locked': z.boolean().readonly(),
268
+ // 2.15.9(M4):失败分支(锁表不可读)只回 {ok:false, code, error} —— 这两个字段必须是可选的,
269
+ // 否则「锁表坏了」时整条调用被判坏,界面连那句原因都拿不到。
270
+ 'file': z.string().readonly().optional(),
271
+ 'locked': z.boolean().readonly().optional(),
272
+ 'code': z.string().readonly().optional(),
273
+ 'error': z.string().readonly().optional(),
269
274
  }).readonly()
270
275
 
271
276
  // 设置:limits = 已生效值,pendingLimits = 待生效值(settings.json > 环境变量 > 默认);两个都给,界面才说得清「改了要重启」。
@@ -419,6 +424,10 @@ const autodreamLastResultSchema = z.object({
419
424
  'runId': z.string().readonly().optional(),
420
425
  'changeCount': z.number().readonly().optional(),
421
426
  'preflight': z.boolean().readonly().optional(),
427
+ // 2.15.8(M3):残篇要能在界面上被认出来 —— 只报「成功」是不够的。
428
+ 'continuations': z.number().readonly().optional(),
429
+ 'retries': z.number().readonly().optional(),
430
+ 'truncated': z.boolean().readonly().optional(),
422
431
  'snapshotId': z.string().readonly().nullable().optional(),
423
432
  'report': z.string().readonly().optional(),
424
433
  }).readonly()
@@ -656,15 +665,7 @@ const conflictRemoveResultSchema = z.object({
656
665
  'code': z.string().readonly().optional(),
657
666
  'error': z.string().readonly().optional(),
658
667
  }).readonly()
659
- // 2.15.0:任务检查点里「未完成」的条目(待办看板只读聚合)。
660
- const checkpointTaskSchema = z.object({
661
- 'taskId': z.string().readonly(), 'project': z.string().readonly(),
662
- 'revision': z.number().readonly(), 'items': z.array(z.string().readonly()).readonly(),
663
- }).readonly()
664
- const checkpointsResultSchema = z.object({
665
- 'ok': z.boolean().readonly(), 'truncated': z.boolean().readonly(),
666
- 'tasks': z.array(checkpointTaskSchema).readonly(), 'skipped': z.number().readonly().optional(), 'error': z.string().readonly().optional(),
667
- }).readonly()
668
+
668
669
 
669
670
  export const TYPERT = {
670
671
  package: 'sage-mem',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sage-mem",
3
3
  "description": "Cross-session memory for DeepSeek Harness — plain markdown files, no database, no worker.",
4
- "version": "2.15.7",
4
+ "version": "2.15.9",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "icon": "./icon.png",