dsh-instruction-memory 1.4.6 → 1.4.7

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 (3) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +38 -0
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,30 @@
7
7
  > 1.0.13 起由 CI 经 OIDC Trusted Publishing 发布(首个带 provenance 的版本)。
8
8
  > 这些历史 tag **不应回填**——npm 上的版本号已被占用。
9
9
 
10
+ ## [1.4.7] — 2026-10-31
11
+
12
+ **文档版**:没有一行运行时代码变更,只把 2026-10-31「插件在 DSH Go(Android)上的适配性」
13
+ 审计结论写进 README,并补上新跑的一组实机证据。
14
+
15
+ ### 新增证据
16
+
17
+ - `0.2.1-rc.4`(正是 DSH Go 锁定的内核版本)在隔离 `DSH_HOME` 上复跑
18
+ `compat-1016-live-check.mjs`:**21/21**;注入 `chars=292 / budget=4000`、`state` p95 1.09 ms、
19
+ SSE 首帧 0.71 ms。证据文件 `dsh-memory-verification/out/compat-1016-live-rc4-audit.json`。
20
+
21
+ ### 文档
22
+
23
+ - README「请求来源防护」新增一节:**DSH Go 的鉴权来自平台补丁** `runtime/patches/route-guard.diff`
24
+ (钉在 `0.2.1-rc.4`),在 `route.handler` 之前对 `exact`/`prefix` 路由统一执行
25
+ `connection.requestRejection()`,缺 cookie → 401、`connection` 未挂载 → 503;
26
+ 并写明这层保护是**平台属性**——手动 `dsh web` 不带 `--patch`、或升级到锚点对不上的内核,
27
+ 就会回退成"仅回环、无鉴权"。
28
+ - README「兼容性」新增「在 DSH Go(Android)上运行」:引擎经 `/usr/bin/env -i` 启动,
29
+ `HOME=/root`、`DSH_HOME=/root/.dsh`(App 侧设置的 `HOME` 对引擎无效);数据落在
30
+ `/root/.dsh/instruction-memory/memory.json`(App 私有、与桌面端不共享);配置入口是网页岛
31
+ (本插件没有 config schema);发现页索引 `api.dshfind.com/market/dsh-index.json` 仍只登记
32
+ `1.4.2`,要最新版需在 guest shell 里 `dsh plugin --profile web add dsh-instruction-memory`。
33
+
10
34
  ## [1.4.6] — 2026-10-30
11
35
 
12
36
  针对 1.4.5 的三方复核(架构 / 安全 / 验收)结论做的修复版本。安全面**没有新增对外暴露**,
package/README.md CHANGED
@@ -586,6 +586,20 @@ DNS 重绑定恰好推翻了它**:`evil.com` 解析到 `127.0.0.1` 之后,
586
586
  路径前缀为 `/instruction-memory/api`,代理转发规则需覆盖它。
587
587
  5. **限制来源**:至少用代理层做 IP 白名单或加 Basic Auth——插件本身不提供任何鉴权。
588
588
 
589
+ ### 在 DSH Go(Android)上:鉴权来自平台补丁,不是本插件
590
+
591
+ DSH Go 给官方 Web 服务器包了一层**构建期补丁** `runtime/patches/route-guard.diff`(钉在
592
+ `0.2.1-rc.4`,`pins.json` 记了 before/after SHA-256,锚点对不上时构建直接失败):它在
593
+ `route.handler` 之前对**每一条命名路由**调用 `connection.requestRejection()`——`exact` 与
594
+ `prefix` 都算,本插件的 `/instruction-memory/api` 属后者;放行名单只有 `/connect` 与
595
+ `/oauth/callback`;缺 cookie → **401**,`connection` 尚未挂载 → **503**(fail-closed),拒绝响应
596
+ 带 `x-dsh-go-guard: reject`。因此 Android 上"同机其他 App 直接打本插件路由"这条路已被平台挡住;
597
+ 上面几节描述的"无鉴权"缺口只适用于桌面端 / 网页端的端口。
598
+
599
+ ⚠️ 这层保护是**平台属性,不是插件属性**:在 guest shell 里手动 `dsh web`(不带 `--patch`),
600
+ 或在 guest 内把内核升级到补丁锚点对不上的版本,鉴权就回退成"仅回环、无鉴权"。判断装机是否
601
+ 仍受保护,只看启动命令行里有没有 `--patch /etc/dsh-app/dsh-web.patch.yml`。
602
+
589
603
  ## 兼容性
590
604
 
591
605
  同一串范围写在**三处**,而**只有一处会被宿主强制执行**——这一点以前写错过,现在按实测更正:
@@ -722,6 +736,30 @@ FAIL LIVE GUARD: the installed host 0.1.8-rc.1 is admitted by both modes -> ..
722
736
  `host-range-test.mjs` 会断言 `peerDependencies` 与另外两处字段**逐字节一致**,并断言 peer 只声明这一个包名——
723
737
  三处任一被手改都会在测试里失败。
724
738
 
739
+ ### 在 DSH Go(Android)上运行
740
+
741
+ DSH Go(Android 客户端)内置的引擎就是**真实 DSH**,锁定 `@deepseek-ai/dsh` **`0.2.1-rc.4`**
742
+ (`runtime/locks/dsh-0.2.1-rc.4/package.json`),在 PRoot rootfs 内以
743
+ `dsh web --patch /etc/dsh-app/dsh-web.patch.yml --host 127.0.0.1 --port N --no-open` 运行;
744
+ 环境经 `/usr/bin/env -i` 清空后只注入 `HOME=/root`、`DSH_HOME=/root/.dsh`——**App 侧设置的
745
+ `HOME` 对引擎无效**,别按字面读 `DshProcess.kt`。
746
+
747
+ - **兼容性**:`0.2.1-rc.4` 正好是上表①档已实测的版本。2026-10-31 又用同一个 rc.4 在隔离的
748
+ `DSH_HOME` 上复跑一遍 **21/21**(`compat-1016-live-check.mjs`),注入实测
749
+ `chars=292 / budget=4000`、`state` p95 1.09 ms、SSE 首帧 0.71 ms;证据
750
+ `dsh-memory-verification/out/compat-1016-live-rc4-audit.json`。
751
+ - **数据位置**:`/root/.dsh/instruction-memory/memory.json`,在 App 私有目录的 rootfs 内,
752
+ 与桌面端**不是同一份**;快照里的路径以 `~` 显示,不泄露绝对路径。卸载 App 会连 rootfs 一起清空,
753
+ 卸载**插件**保留数据。
754
+ - **配置入口**:原生设置页依赖 schema 表单,本插件没有 config schema,所以那一行点进去是
755
+ **网页岛**(WebView 里加载的官方 Web UI),`settings.section` 的落点在网页客户端里。
756
+ 若从未打开过任何网页岛,这一行可能尚未出现。
757
+ - **市场版本可能滞后**:DSH Go 的发现页只读 `api.dshfind.com/market/dsh-index.json`,该文件对本
758
+ 插件在 2026-10-31 仍只登记 `1.4.2`(npm latest 已是 1.4.6)。要装最新版,在 guest shell 里执行
759
+ `dsh plugin --profile web add dsh-instruction-memory`,直接取 npm 上的版本。
760
+ - **双端记忆不共享**:手机与"遥控 PC"各自维护自己的 `memory.json`,没有同步——这是当前形态,
761
+ 不是缺陷。
762
+
725
763
  ## 发布(维护者)
726
764
 
727
765
  **正规流程是推 tag,由 CI 通过 OIDC(Trusted Publishing)发布**,不需要任何长期令牌:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-instruction-memory",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
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",