sage-mem 2.23.0 → 2.23.1

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.23.0`** — 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.23.1`** — 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.23.0`** —— 顶部 npm 徽章是动态权威。**契约基线:`1.0.0`** —— 第一个稳定版,公开承诺、能力边界与「明确做不到」的清单冻结在
17
+ **当前发布版本:`2.23.1`** —— 顶部 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 是最直接的反馈。
@@ -27,9 +27,36 @@ export function isNonEntry(raw) {
27
27
  return NON_ENTRY_FILES.has(nameKey(raw))
28
28
  }
29
29
 
30
+ /**
31
+ * 同步冲突副本:**不是记忆条目**。
32
+ *
33
+ * 为什么必须单独认:任何同步工具撞到「两边都改了」都会在同一个目录里落一份副本,
34
+ * 而副本的名字仍以 `.md` 结尾 —— 只按后缀判断的旧判据会把它当正常记忆读进去、
35
+ * 参与检索、参与注入。3.0 调研 §2.1 用仓库自己的函数实测过:
36
+ * `isMemoryEntry('x.sync-conflict-….md')` 返回 true。
37
+ *
38
+ * 认的模式都带**具体来源的专有标记**,不按「像不像副本」猜:
39
+ * - Syncthing:`<name>.sync-conflict-YYYYMMDD-HHMMSS-XXXXX.md`
40
+ * - Dropbox:`<name> (conflicted copy …).md`
41
+ * - 资源管理器中文 / 英文:`<name> - 副本.md`、`<name> - Copy.md`
42
+ *
43
+ * **故意不认** `x (1).md` 这种纯编号:太宽,会把正常按序号命名的文件误伤;
44
+ * 也不认 `~$x.md`(那是 Word 锁文件,不以 .md 结尾的场景更多)。
45
+ */
46
+ export function isConflictCopy(raw) {
47
+ const n = nameKey(raw)
48
+ return (
49
+ n.includes('.sync-conflict-') ||
50
+ n.includes('conflicted copy') ||
51
+ n.includes(' - 副本') ||
52
+ n.includes(' - copy')
53
+ )
54
+ }
55
+
30
56
  /** 目录扫描过滤:这个名字算不算一条记忆条目。 */
31
57
  export function isMemoryEntry(name) {
32
- return /\.md$/i.test(String(name ?? '')) && !isNonEntry(name)
58
+ const s = String(name ?? '')
59
+ return /\.md$/i.test(s) && !isNonEntry(s) && !isConflictCopy(s)
33
60
  }
34
61
 
35
62
  /**
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.23.0",
4
+ "version": "2.23.1",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "icon": "./icon.png",