dsh-instruction-memory 1.0.12 → 1.0.13

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.
Files changed (2) hide show
  1. package/README.md +33 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -245,15 +245,44 @@ FAIL LIVE GUARD: the installed host 0.1.8-rc.1 is admitted by both modes -> ..
245
245
 
246
246
  ## 发布(维护者)
247
247
 
248
+ **正规流程是推 tag,由 CI 通过 OIDC(Trusted Publishing)发布**,不需要任何长期令牌:
249
+
248
250
  ```sh
249
- # 1. 自检(prepublishOnly 也会自动跑,占位符未替换会中止发布)
251
+ # 1. 自检(prepublishOnly 也会自动跑;占位符未替换会中止发布)
250
252
  npm test
251
253
  node check-metadata.mjs
252
- # 2. 发布(需先 npm login)
253
- npm publish
254
+ # 2. 升版本并提交
255
+ # package.json 的 version 必须与 tag 完全一致,否则工作流会拒绝发布
256
+ git commit -am "1.0.N: ..."
257
+ git push origin main
258
+ # 3. 打 tag 推送 → 触发 .github/workflows/publish.yml
259
+ git tag -a v1.0.N -m "1.0.N: ..."
260
+ git push origin v1.0.N
254
261
  ```
255
262
 
256
- 发布前自检会拒绝在 `TODO` 占位符残留时发布,避免把空仓库地址或无名版权声明发出去。
263
+ 工作流会先跑 `npm test` 与"tag ↔ version 一致"校验,再 `npm publish --access public`;
264
+ 公开仓库 + OIDC 会自动附带 **provenance 存证**。
265
+
266
+ **npm 侧的一次性配置(发布前必须完成,且 npm 不会校验你填了什么)**:
267
+ Package → Settings → Trusted publishing → Add trusted publisher
268
+
269
+ | 字段 | 值 |
270
+ | --- | --- |
271
+ | Organization or user | `HERO476` |
272
+ | Repository | `dsh-instruction-memory` |
273
+ | Workflow filename | `publish.yml`(**只写文件名**,须完全一致) |
274
+ | Environment name | (留空) |
275
+ | Allowed actions | 勾选 **npm publish** |
276
+
277
+ > ⚠️ 2026-09-03 之后创建的 trusted publisher **默认只允许 `npm stage publish`**,直发必须显式勾选。
278
+ > 字段填错不会在保存时报错,只会在**第一次发布尝试**时以 `ENEEDAUTH` 之类的错误暴露。
279
+
280
+ **这就是本仓库 1.0.10 / 1.0.11 / 1.0.12 由本地 `npm publish` 发布的原因**:这三版发布时该配置尚未就绪,
281
+ `Publish` 工作流的唯一失败步骤正是 `npm publish`(其余步骤含 `npm test` 全部通过),因此那三版**没有 provenance**、也没有对应的 git tag。
282
+ **不要为这三个版本补推 tag** —— 版本已被占用,重跑只会再得到一次必红的 CI。从下一个新版本起走上面的正规流程。
283
+
284
+ **本地兜底发布**(仅在 OIDC 不可用时):`npm login` 后直接 `npm publish --access public`。
285
+ 本机若已有 `~/.npmrc` 令牌即可直接发布,但产物**不含 provenance**。
257
286
 
258
287
  ## 数据格式
259
288
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-instruction-memory",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "User-only instruction memory for DSH: long-term instructions maintained in the settings UI and auto-injected into every conversation — the model has no write access. 指令记忆:只由用户在设置页维护的长期指令,自动注入此后每轮对话;模型没有任何写入口。",
5
5
  "license": "MIT",
6
6
  "type": "module",