dsh-plugin-memory 0.9.1 → 0.9.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/CHANGELOG.md +25 -0
- package/package.json +1 -1
- package/scripts/memory.mjs +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
所有记录跟随 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 风格;版本号与 `package.json` 保持一致。
|
|
4
4
|
|
|
5
|
+
## [0.9.2] - 2026-10-08
|
|
6
|
+
|
|
7
|
+
### Fixed(Windows 路径分隔符)
|
|
8
|
+
|
|
9
|
+
- **Windows 上 `lint` 不再把每个页面都报成 orphan**(贡献者 [@lukiriun-bit](https://github.com/lukiriun-bit),[PR #1](https://github.com/LittleBlackTong/dsh-plugin-memory/pull/1))。`pages()` 原样返回 `path.relative()` 的结果,在 Windows 上是 `user\a.md`,而 `index.md` 的链接写的是 `/`——于是**每个已被索引的页面**都被判成 `orphan page not in index.md`,健康的库也会让 `lint` 退出 1。现在统一规范成 POSIX 分隔符。
|
|
10
|
+
- **与既有约定对齐**:`lib/pages.js` 的 `listPagePaths()` 早就是 `relative(...).split(sep).join('/')`,文件头注释也写明 `store-relative paths using / separators`。这次是把 `scripts/memory.mjs` 这处**漏网的**补齐,写法与其逐字一致。
|
|
11
|
+
- **影响面逐个核对过**(改分隔符最怕破坏调用方):
|
|
12
|
+
| 调用点 | 判定 |
|
|
13
|
+
|---|---|
|
|
14
|
+
| `cmdLint` | ✅ 正是修复目标(与 `index.md` 链接比较) |
|
|
15
|
+
| `cmdQuery` | ✅ 比较对象 `matched` 来自 `lib/pages.js`,本来就是 `/` |
|
|
16
|
+
| `cmdTouch` | ✅ 由「全被判 orphan」变正确 |
|
|
17
|
+
| `cmdStatus` / `pack` | ✅ Node 的 fs 在 Windows 同样接受 `/` |
|
|
18
|
+
|
|
19
|
+
### Tests
|
|
20
|
+
|
|
21
|
+
- 新增 `test/lint-index-separators.test.mjs`(贡献者提供):断言「被索引链接的页面不得被判 orphan」。
|
|
22
|
+
- ⚠️ **该测试在 POSIX 上没有区分度**(`sep` 就是 `/`,改前改后都通过)。它能锁定行为,但**无法在 macOS/Linux CI 上证明 Windows 端的修复**——这一点在合并评审时已说明。
|
|
23
|
+
- 全量 **174/174 通过**(基线 173/173,增量正是上面这个测试)。
|
|
24
|
+
- `npm test`(self-test:`init` / `pack` / `unpack`)通过。
|
|
25
|
+
|
|
26
|
+
### Notes
|
|
27
|
+
|
|
28
|
+
- `scripts/memory.mjs` 的 `manifestFor()`(pack 用的文件清单)仍是原生 `relative()`,属**同类残留**;它同平台自洽,只有跨平台迁移(Windows pack → Linux unpack)才可能出问题,留待后续顺手统一。
|
|
29
|
+
|
|
5
30
|
## [0.9.1] - 2026-09-29
|
|
6
31
|
|
|
7
32
|
### Fixed(DSH 0.2.0 兼容)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-memory",
|
|
3
3
|
"description": "Long-term memory plugin for DeepSeek Harness: persistent cross-session markdown memory with a soul/persona file, auto-injected at every session start, plus remember/recall/consolidate/forget workflows and portable migration tooling.",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|
package/scripts/memory.mjs
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
readdirSync, readFileSync, writeFileSync, existsSync, statSync,
|
|
23
23
|
mkdirSync, cpSync, rmSync,
|
|
24
24
|
} from 'node:fs'
|
|
25
|
-
import { join, resolve, relative, basename } from 'node:path'
|
|
25
|
+
import { join, resolve, relative, basename, sep } from 'node:path'
|
|
26
26
|
import { execFileSync } from 'node:child_process'
|
|
27
27
|
import { tmpdir, homedir } from 'node:os'
|
|
28
28
|
import { createHash } from 'node:crypto'
|
|
@@ -55,8 +55,10 @@ function walk(dir, out = []) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
function pages(store) {
|
|
58
|
+
// POSIX separators on every platform: index.md links are written with `/`,
|
|
59
|
+
// so a Windows `\` would make every page look like an orphan in `lint`.
|
|
58
60
|
return walk(store).filter((f) => f.endsWith('.md'))
|
|
59
|
-
.map((f) => relative(store, f))
|
|
61
|
+
.map((f) => relative(store, f).split(sep).join('/'))
|
|
60
62
|
.filter((r) => !META.has(basename(r)))
|
|
61
63
|
}
|
|
62
64
|
|