@ilaomianyang/dsh-memory-graph 0.10.0 → 0.10.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 +29 -1
- package/README.en.md +33 -2
- package/README.md +33 -2
- package/package.json +4 -2
- package/src/graph.js +1585 -1582
- package/test/page.mjs +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.2 — 2026-11-03
|
|
4
|
+
|
|
5
|
+
补一个从第一天就存在的渲染缺陷,并让发布流水线第一次真正跑完。
|
|
6
|
+
|
|
7
|
+
**Fixed**
|
|
8
|
+
|
|
9
|
+
- 图里每个节点的光晕(halo)一直是 `r="NaN"`。`haloScale` 在模型里算好了(实体 2.5、卡片 2.7),序列化给页面的 payload 时漏了这个字段,浏览器做 `node.r * undefined` 得到 NaN,柔光画不出来,控制台上每个节点报一条 `<circle> attribute r: Expected length, "NaN"`。截图上完全看不出来——缺的是柔光,不是骨架——只有打开控制台才发现。现在 payload 带上 `haloScale`。
|
|
10
|
+
- `test/page.mjs` 加一条检查兜住这一类问题:解析页面里的 `DATA`,断言每个节点的 `r` 与 `haloScale` 都是有限数,并且整页不出现字面量 `NaN`。
|
|
11
|
+
|
|
12
|
+
**Changed**
|
|
13
|
+
|
|
14
|
+
- 检查数 231 → 232(README 两版、`test.yml` 的注释同步)。
|
|
15
|
+
|
|
16
|
+
**已发布到 npm:`@ilaomianyang/dsh-memory-graph@0.10.2`,由 GitHub Actions 用 trusted publishing(OIDC,仓库里不存任何 token)发布,带 SLSA provenance。**
|
|
17
|
+
|
|
18
|
+
## 0.10.1 — 2026-11-03
|
|
19
|
+
|
|
20
|
+
**Added**
|
|
21
|
+
|
|
22
|
+
- `.github/workflows/publish.yml`:推 `v*` tag 就发布,不再靠本机 `npm publish`。核对 tag 与 `package.json`、跳过已发布的版本(重推 tag 是空操作)、`npm publish --provenance`,npm 页面上因此有「Built and signed on GitHub Actions」。
|
|
23
|
+
- `npm run release`:跑测试 → bump → 提交 → 打 tag → 推 tag 的一条命令。
|
|
24
|
+
- 首版流水线踩了两个坑,都只影响 CI,与插件本身无关:`npm view` 在「版本尚未发布」时退出码为 1,而 runner 打开了 `PSNativeCommandUseErrorActionPreference`,这个预期内的非零退出直接把守门步骤干掉了;改成直接读 registry 文档判断。另外 trusted publishing 需要 npm ≥ 11.5.1,Node 22 自带 10.x,所以先 `npm install -g npm@latest`。
|
|
25
|
+
|
|
3
26
|
## 0.10.0 — 2026-11-03
|
|
4
27
|
|
|
5
|
-
|
|
28
|
+
**已发布到 npm:`npm i @ilaomianyang/dsh-memory-graph`(0.10.0,2026-11-03)。** npmmirror 已同步,国内直接装。`dsh-memory-graph` 这个名字在 npm 上已经被别人占了(maintainer `lilai123`,2026-11-01 发的 0.1.2,是个同名但不同的插件),所以换名发布。
|
|
6
29
|
|
|
7
30
|
**Changed**
|
|
8
31
|
|
|
@@ -18,6 +41,11 @@
|
|
|
18
41
|
|
|
19
42
|
- README 两版新增「从 npm 装」:`plugin_manager action=install_bundle target="@ilaomianyang/dsh-memory-graph"`,并给出国内走 `registry="https://registry.npmmirror.com/"` 的写法(镜像自动同步 npm,滞后几分钟到几小时)。
|
|
20
43
|
|
|
44
|
+
**Added(发布流水线)**
|
|
45
|
+
|
|
46
|
+
- `.github/workflows/publish.yml`:推 `v*` tag 就发布,不再靠本机 `npm publish`。它会核对 tag 与 `package.json`、跳过已发布的版本(重推 tag 是空操作)、`npm publish --provenance`,并在 npm 页面上留一条「Built and signed on GitHub Actions」。凭据是仓库 secret `NPM_TOKEN`(必须是 Automation token,账号开着 2FA 时普通 Publish token 会被 403 挡掉)。
|
|
47
|
+
- `npm run release`:先跑测试、再 bump、提交、打 tag、推 tag 的一条命令;README 两版都加了「发布」一节。
|
|
48
|
+
|
|
21
49
|
**Removed**
|
|
22
50
|
|
|
23
51
|
- `package-lock.json`:里面还写着 `@local/dsh-memory-graph`(第一次本地装时的残留),且只有一个依赖,留着只会误导。
|
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English · [中文](README.md)
|
|
4
4
|
|
|
5
|
-
[](https://github.com/ilaomianyang/dsh-memory-graph/actions/workflows/test.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/@ilaomianyang/dsh-memory-graph) [](https://github.com/ilaomianyang/dsh-memory-graph/actions/workflows/test.yml)
|
|
6
6
|
|
|
7
7
|
Long-term **associative memory** for [DeepSeek Harness](https://getartcraft.com) (DSH).
|
|
8
8
|
|
|
@@ -383,7 +383,7 @@ Side benefit: an injected message no longer cuts a turn in half, so an episode's
|
|
|
383
383
|
No network, no real vault:
|
|
384
384
|
|
|
385
385
|
```bash
|
|
386
|
-
npm test # 43 + 13 + 35 + 12 + 22 + 54 + 15 +
|
|
386
|
+
npm test # 43 + 13 + 35 + 12 + 22 + 54 + 15 + 8 + 11 + 19 = 232 checks, plus the 25-question retrieval eval
|
|
387
387
|
npm run eval # retrieval eval only (offline, deterministic)
|
|
388
388
|
```
|
|
389
389
|
|
|
@@ -409,6 +409,37 @@ node test/live.mjs --tokens 900 # a small output cap, watch a tr
|
|
|
409
409
|
|
|
410
410
|
They read the key from `~/.dsh/.credentials.yaml` or the environment (see above); nothing is hard-coded or persisted. Both run in a plain `node` process with no harness `llm` service to borrow, so they set `transport: 'http'` explicitly — the plugin's own default is `harness`.
|
|
411
411
|
|
|
412
|
+
## Releasing
|
|
413
|
+
|
|
414
|
+
There is one source of truth for the version: `version` in `package.json`. Releasing a version *is* pushing a tag:
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
npm run release # = npm version patch (runs the suite first) → commit → tag → git push --follow-tags
|
|
418
|
+
npm version minor -m "chore(release): v%s" && git push --follow-tags # for minor / major
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
The tag triggers `.github/workflows/publish.yml`, which does four things:
|
|
422
|
+
|
|
423
|
+
1. checks that the tag and `package.json` agree — a mismatch fails instead of publishing a package whose version lies;
|
|
424
|
+
2. checks whether that version is already on the registry — if so it skips, so re-running a tag is a no-op rather than an error;
|
|
425
|
+
3. `npm publish --provenance --access public` (`prepublishOnly` runs the 232 checks again; a red build cannot reach the registry);
|
|
426
|
+
4. adds "Built and signed on GitHub Actions" to the npm page, proving the tarball came from this commit of this repository.
|
|
427
|
+
|
|
428
|
+
Two ways to authenticate; the workflow accepts both (it uses `NPM_TOKEN` when the secret exists and falls back to OIDC when it does not):
|
|
429
|
+
|
|
430
|
+
**1. Trusted publishing — recommended, no secret stored anywhere.** npm treats this as the intended path and is retiring 2FA-bypassing tokens for it (per npm's notice: account changes restricted from Aug 2026, direct publishing from Jan 2027). On the package page: **Package → Settings → Trusted publishing → Add a publisher → GitHub Actions**, repository `ilaomianyang/dsh-memory-graph`, workflow `publish.yml`, environment empty. CI then publishes as this run's OIDC identity and `--provenance` comes along for free.
|
|
431
|
+
|
|
432
|
+
**2. `NPM_TOKEN` — works today, a stopgap.** npmjs.com → Access Tokens → Generate New Token, choose **Granular Access Token**: tick **Bypass two-factor authentication (2FA)**, set Permissions to **Read and write (publish and stage)** (if it offers a package picker, pick only this package), and do not leave the Expiration at the default 30 days. Then add it to the repository: Settings → Secrets and variables → Actions → New repository secret, named `NPM_TOKEN`. With 2FA on the account an ordinary Publish token is rejected with `403 ... two-factor authentication ... required to publish`; only the bypass one gets through. That token is for CI only — keep it out of `~/.npmrc`.
|
|
433
|
+
|
|
434
|
+
To publish locally instead (no CI, or GitHub is unreachable that minute):
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
npm publish # publishConfig pins the registry to npmjs; prepublishOnly runs the tests
|
|
438
|
+
git push --follow-tags # push the tag too, or CI has no record of this release
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
After a manual publish, the CI path hits the skip branch in step 2 and will not publish twice.
|
|
442
|
+
|
|
412
443
|
## Distillation, measured (real runs, not estimates)
|
|
413
444
|
|
|
414
445
|
With `deepseek-chat` via `npm run live`:
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.en.md) · 中文
|
|
4
4
|
|
|
5
|
-
[](https://github.com/ilaomianyang/dsh-memory-graph/actions/workflows/test.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/@ilaomianyang/dsh-memory-graph) [](https://github.com/ilaomianyang/dsh-memory-graph/actions/workflows/test.yml)
|
|
6
6
|
|
|
7
7
|
给 DeepSeek Harness 的**长期联想记忆**插件。上下文压缩会把东西真的抹掉;这个插件在上下文之外留一层持久的、可读的、属于你自己的记忆。
|
|
8
8
|
|
|
@@ -376,7 +376,7 @@ Harness 会把运行时快照、技能目录、时间戳、审批通知、压缩
|
|
|
376
376
|
零依赖,不联网,不碰真实记忆库:
|
|
377
377
|
|
|
378
378
|
```bash
|
|
379
|
-
npm test # 43 + 13 + 35 + 12 + 22 + 54 + 15 +
|
|
379
|
+
npm test # 43 + 13 + 35 + 12 + 22 + 54 + 15 + 8 + 11 + 19 = 232 项检查,另加 25 题检索评测
|
|
380
380
|
npm run eval # 只跑检索评测(离线,确定性的)
|
|
381
381
|
```
|
|
382
382
|
|
|
@@ -402,6 +402,37 @@ npm run live:supersede # 真模型:先记一条,再让它被"更正"推翻
|
|
|
402
402
|
|
|
403
403
|
它们从 `~/.dsh/.credentials.yaml` 或环境变量取 key(见下文),不写死、不落盘。这两个脚本跑在普通 `node` 进程里,没有 Harness 的 `llm` 服务可借,所以它们显式用 `transport: 'http'`;插件自己在界面里默认走 harness。
|
|
404
404
|
|
|
405
|
+
## 发布
|
|
406
|
+
|
|
407
|
+
版本号只有一个来源:`package.json` 的 `version`。发一个版本就等于打一个 tag:
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
npm run release # = npm version patch(先跑测试)→ 提交 → tag → git push --follow-tags
|
|
411
|
+
npm version minor -m "chore(release): v%s" && git push --follow-tags # minor / major 换这个写法
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
推上去的 tag 会触发 `.github/workflows/publish.yml`,它只做四件事:
|
|
415
|
+
|
|
416
|
+
1. 核对 tag 和 `package.json` 的版本号——不一致就失败,不会发出一个版本号对不上的包;
|
|
417
|
+
2. 查这个版本是不是已经在注册表上——在就跳过,重推同一个 tag 是空操作而不是报错;
|
|
418
|
+
3. `npm publish --provenance --access public`(`prepublishOnly` 会再跑一遍那 232 项,红的进不去);
|
|
419
|
+
4. npm 页面上多一条「Built and signed on GitHub Actions」,证明这个 tarball 是从这个仓库的这个提交构建的。
|
|
420
|
+
|
|
421
|
+
凭据有两条路,工作流两条都认(有 `NPM_TOKEN` 就用它,没有就走 OIDC):
|
|
422
|
+
|
|
423
|
+
**一、Trusted publishing——推荐,仓库里不存任何密钥。** npm 把这条当正路,同时正在把「绕过 2FA 的 token」收掉(npm 的公告:账号类操作 2026 年 8 月起限制,直接发布 2027 年 1 月起禁用)。在包页面上:**Package → Settings → Trusted publishing → Add a publisher → GitHub Actions**,repository 填 `ilaomianyang/dsh-memory-graph`,workflow 填 `publish.yml`,environment 留空。之后 CI 用这次运行的 OIDC 身份发布,`--provenance` 自动带上。
|
|
424
|
+
|
|
425
|
+
**二、`NPM_TOKEN`——今天就能用,过渡方案。** npmjs.com → Access Tokens → Generate New Token,选 **Granular Access Token**:勾上 **Bypass two-factor authentication (2FA)**,Permissions 选 **Read and write (publish and stage)**(如果出现选包的地方,只勾这一个包),Expiration 别留默认的 30 天。然后加到仓库:Settings → Secrets and variables → Actions → New repository secret,名字 `NPM_TOKEN`。账号开着 2FA 时,普通的 Publish token 会被 `403 ... two-factor authentication ... required to publish` 挡回来,只有勾了 bypass 的发得出去。这个 token 只给 CI 用,别写进 `~/.npmrc`。
|
|
426
|
+
|
|
427
|
+
不想等 CI、或者 GitHub 那一刻连不上,就在本地发:
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
npm publish # publishConfig 已经把 registry 钉在 npmjs,prepublishOnly 会跑测试
|
|
431
|
+
git push --follow-tags # 别忘推 tag,否则 CI 里没有这次发布的记录
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
手动发过之后,CI 那条会命中第 2 步的跳过分支,不会再发一次。
|
|
435
|
+
|
|
405
436
|
## 蒸馏实测(真模型跑过,不是估计)
|
|
406
437
|
|
|
407
438
|
用 `deepseek-chat`,`npm run live`:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilaomianyang/dsh-memory-graph",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "ISKING <admin@isking.cc>",
|
|
6
6
|
"repository": {
|
|
@@ -52,7 +52,9 @@
|
|
|
52
52
|
"live": "node test/live.mjs",
|
|
53
53
|
"live:supersede": "node test/live-supersede.mjs",
|
|
54
54
|
"check": "node --check index.js",
|
|
55
|
-
"
|
|
55
|
+
"preversion": "npm test",
|
|
56
|
+
"prepublishOnly": "npm test",
|
|
57
|
+
"release": "npm version patch -m \"chore(release): v%s\" && git push --follow-tags"
|
|
56
58
|
},
|
|
57
59
|
"dsh": {
|
|
58
60
|
"bundle": {
|