dsh-goal-ledger 0.2.1 → 0.2.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/README.md +51 -4
- package/market-index.json +2 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -38,19 +38,24 @@ embedding 距离衡量的是「目标与输出的字面语义分离度」,有
|
|
|
38
38
|
|
|
39
39
|
### 从插件市场装(推荐)
|
|
40
40
|
|
|
41
|
-
DSH
|
|
41
|
+
DSH 的插件市场读取你**自己配置的索引地址**。本插件已发布到 npm,索引随包提供,在 设置 → 插件 → 发现(Discover)里添加:
|
|
42
42
|
|
|
43
43
|
```
|
|
44
|
-
https://
|
|
44
|
+
https://unpkg.com/dsh-goal-ledger@0.2.2/market-index.json
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
然后在市场里搜索「目标台账」或 `dsh-goal-ledger` 安装即可。
|
|
48
48
|
|
|
49
|
+
**为什么用 unpkg 而不是 GitHub raw**:实测这台机器访问 `raw.githubusercontent.com` 会被连接重置(curl 与 node 均 `ECONNRESET`,3/3 失败),而 `unpkg.com` 稳定 200。索引地址是用户手动填的,必须给一个真的能打开的。
|
|
50
|
+
|
|
49
51
|
### 命令行装
|
|
50
52
|
|
|
51
53
|
```bash
|
|
52
|
-
#
|
|
53
|
-
dsh plugin --profile desktop add
|
|
54
|
+
# 从 npm 装(推荐,48 KB,秒级)
|
|
55
|
+
dsh plugin --profile desktop add dsh-goal-ledger
|
|
56
|
+
|
|
57
|
+
# 从 Git 装(固定 commit,不走 npm 缓存)
|
|
58
|
+
dsh plugin --profile desktop add git+https://github.com/zhegemingzimeibanquan/dsh-goal-ledger.git#f7669338eae9e15acb3a263890cc88d79e8ef0f1
|
|
54
59
|
|
|
55
60
|
# 或者从本地目录装(开发用)
|
|
56
61
|
dsh plugin --profile desktop add file:C:/Project/dsh-goal-ledger
|
|
@@ -202,6 +207,7 @@ test/full.mjs 全链路:解析 → 聚类 → 真实 embedding 调用
|
|
|
202
207
|
npm install # 装 devDependencies(react / react-dom / jsdom)
|
|
203
208
|
npm run test:render # 渲染回归测试,离线,不需要 DSH 运行
|
|
204
209
|
npm run test:correction # 纠正逻辑 + 动态配置路由,离线
|
|
210
|
+
npm run test:manifest # 用 DSH 自己的校验器验证 manifest 与 market-index
|
|
205
211
|
npm test # 冒烟测试,直接跑真实会话
|
|
206
212
|
npm run test:full # 全链路(会真实调用 embedding API)
|
|
207
213
|
npm run check # 全部文件语法检查
|
|
@@ -216,6 +222,47 @@ npm install --no-save @napi-rs/canvas
|
|
|
216
222
|
npm run test:render-field # 读真实 snapshot.json,输出 drift-field.png
|
|
217
223
|
```
|
|
218
224
|
|
|
225
|
+
### 发布新版本
|
|
226
|
+
|
|
227
|
+
### 发布新版本
|
|
228
|
+
|
|
229
|
+
顺序很重要:**先提交、再打 tag、最后发布**。反过来的话,npm 上的内容和 tag 指向的代码会对不上,而这件事没有任何工具会报错——`test/published-matches-tag.mjs` 就是为它写的。
|
|
230
|
+
|
|
231
|
+
`market-index.json` 随包发布,所以索引里记的版本号与 manifest 的版本号必须是同一个事实的两次记录。
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# 1. 同步升版本(package.json 与 market-index.json 一起改,避免只改一处)
|
|
235
|
+
node scripts/bump-version.cjs 0.2.3
|
|
236
|
+
|
|
237
|
+
# 2. 更新 README 里的索引地址(用户要从这里复制)
|
|
238
|
+
# https://unpkg.com/dsh-goal-ledger@0.2.3/market-index.json
|
|
239
|
+
|
|
240
|
+
# 3. 校验,并跑一遍全量测试
|
|
241
|
+
npm run test:manifest
|
|
242
|
+
npm test && npm run test:correction && npm run test:render
|
|
243
|
+
|
|
244
|
+
# 4. 提交,打 tag(与 package.json 版本一致,带 v 前缀)
|
|
245
|
+
git add -A && git commit -m "release: v0.2.3"
|
|
246
|
+
git tag -a v0.2.3 -m "dsh-goal-ledger v0.2.3"
|
|
247
|
+
git push origin master --follow-tags
|
|
248
|
+
|
|
249
|
+
# 5. 发布,然后断言 npm 上的内容就是 tag 里的内容
|
|
250
|
+
npm publish --registry=https://registry.npmjs.org --access public
|
|
251
|
+
npm run test:published -- 0.2.3 v0.2.3
|
|
252
|
+
|
|
253
|
+
# 6. 等 unpkg 同步后确认索引可读(正常 1-5 分钟)
|
|
254
|
+
npm run test:published -- 0.2.3 v0.2.3 # 再跑一次即为复查
|
|
255
|
+
curl -sS -o /dev/null -w "%{http_code}\n" https://unpkg.com/dsh-goal-ledger@0.2.3/market-index.json
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
`test:published` 会把 npm 上的 tarball 解开,逐文件与 tag 里的 git 内容比对,并核对 `version` / `engines` / `dsh` / `exports` / `files` 字段。**这是「npm 发布的就是这个 tag」的唯一硬证据**。
|
|
259
|
+
|
|
260
|
+
**索引地址必须带精确版本号**:`unpkg.com/dsh-goal-ledger/market-index.json` 会 302 重定向到最新版,而 DSH 市场**拒绝重定向**(文档明确写「Redirects refused」),所以只能写 `@0.2.3` 这种精确地址。
|
|
261
|
+
|
|
262
|
+
### 为什么不在 GitHub raw 上托管索引
|
|
263
|
+
|
|
264
|
+
实测本机访问 `raw.githubusercontent.com` **全部被重置**(curl 与 node 都 `ECONNRESET`,3/3 失败),而同一时刻 `github.com`、`api.github.com`、`npmjs.org`、`unpkg.com` 都正常。索引地址是用户手动配置的,必须给一个真的打得开的——所以索引随 npm 包走 unpkg。
|
|
265
|
+
|
|
219
266
|
### 测试里两个 jsdom 坑(都真实踩过)
|
|
220
267
|
|
|
221
268
|
1. **`react-dom` 必须在 jsdom 全局就位之后再 `require`**。它在模块初始化时就固化 `canUseDOM`;提前加载会让它判定「没有 DOM」,整套事件系统都不装,之后合成的 `input` 事件**永远到不了 `onChange`** —— 表现和「受控输入框坏了」一模一样,但插件代码其实是对的。
|
package/market-index.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-goal-ledger",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Goal-distance ledger and failure-cluster panel for DeepSeek Harness — audits your own sessions, shows where goals drifted and where tool calls actually failed.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
"test:full": "node test/full.mjs",
|
|
60
60
|
"test:render-field": "node test/render-field.mjs",
|
|
61
61
|
"check": "node --check lib/index.js && node --check lib/client.js && node --check src/session-reader.js && node --check src/failure-cluster.js && node --check src/embed-config.js && node --check src/correction.js && node --check src/distance.js",
|
|
62
|
-
"test:manifest": "node test/manifest.mjs"
|
|
62
|
+
"test:manifest": "node test/manifest.mjs",
|
|
63
|
+
"test:published": "node test/published-matches-tag.mjs"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
66
|
"jsdom": "^26.1.0",
|