dsh-fishpal 0.9.10 → 0.9.11

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 CHANGED
@@ -7,6 +7,24 @@
7
7
  > 改动散在提交历史里(`lib/` 下多处),没有回填到这里。这里不编造它的内容 ——
8
8
  > 要看 0.9.0 改了什么,翻 git 历史。从 0.9.1 起重新逐版记录。
9
9
 
10
+ ## [0.9.11] — 2026-11-30
11
+
12
+ **漂流瓶放行后会叫醒鱼了。**
13
+
14
+ 岸的原话:「同意给鱼看的时候没有任何反应。」
15
+
16
+ 现场:两只瓶子(21:06:41 / 21:06:48)确实投进了会话——`agent/inbox/spliced` 两条事件都在,
17
+ 但**一个 `turn/start` 都没有**。因为 `primitiveFor()` 把 `bottle` / `bottle_reply` 归到
18
+ `inject`(只投进收件箱、不叫醒),跟 chat/share 走同一条路。主人在界面上点「同意阅读」,
19
+ 本意是让它看一眼、可能回一句;投进去却不叫醒,等于这个按钮没有意义。
20
+
21
+ 修法:`lib/protocol.js` 里 `bottle` / `bottle_reply` 单独走 `followup`(叫醒一轮)。
22
+ 回信是临时通道、只能回一次,更不能让它睡过去。
23
+
24
+ 验证:新增 `_verify-bottle-wake.mjs`(11 项:两种瓶子 → followup;question / chat / share /
25
+ answer / steer / handoff 都没被带跑;控制报文仍不注入),全量 14 套件 **460 通过 / 0 失败**。
26
+ ★ 生效需要重启 DSH。
27
+
10
28
  ## [0.9.10] — 2026-11-30
11
29
 
12
30
  **心跳和预热不再新开会话。**
@@ -0,0 +1,36 @@
1
+ // 验证:漂流瓶放行后会**叫醒**鱼(followup),不是只投进收件箱(inject)。
2
+ // 2026-11-30 的真 bug(岸:「同意给鱼看的时候没有任何反应」)——
3
+ // 现场证据:会话里只有两条 agent/inbox/spliced,一个 turn/start 都没有。
4
+ //
5
+ // 同时确认这个改动没有把别的类型带跑。
6
+
7
+ import assert from 'node:assert/strict';
8
+ import { primitiveFor } from './lib/protocol.js';
9
+
10
+ let pass = 0;
11
+ const ok = (name, got, want) => {
12
+ assert.equal(got, want, `${name}:got ${got}, want ${want}`);
13
+ pass++;
14
+ console.log(` ✓ ${name} → ${got}`);
15
+ };
16
+
17
+ console.log('漂流瓶叫醒');
18
+ ok('bottle 走 followup', primitiveFor('bottle'), 'followup');
19
+ ok('bottle_reply 走 followup', primitiveFor('bottle_reply'), 'followup');
20
+
21
+ console.log('没被带跑');
22
+ ok('question 仍 followup', primitiveFor('question'), 'followup');
23
+ ok('chat 仍 inject', primitiveFor('chat'), 'inject');
24
+ ok('share 仍 inject', primitiveFor('share'), 'inject');
25
+ assert.equal(primitiveFor('visit'), null, 'visit 属于控制报文,不注入 —— 不是本次改动范围');
26
+ pass++;
27
+ console.log(' ✓ visit 仍是控制报文(不注入)');
28
+ ok('answer(非自邀)仍 inject', primitiveFor('answer'), 'inject');
29
+ ok('answer(自邀)仍 followup', primitiveFor('answer', { isAnswerToMyQuestion: true }), 'followup');
30
+ ok('steer 仍 steer', primitiveFor('steer'), 'steer');
31
+ ok('handoff 仍 followup', primitiveFor('handoff'), 'followup');
32
+ assert.equal(primitiveFor('recall'), null, '控制报文不该注入');
33
+ pass++;
34
+ console.log(' ✓ 控制报文仍返回 null');
35
+
36
+ console.log(`\n结果:${pass} 通过,0 失败`);
package/lib/protocol.js CHANGED
@@ -164,7 +164,15 @@ export function primitiveFor(type, opts = {}) {
164
164
  if (type === 'question') return 'followup';
165
165
  if (type === 'answer') return opts.isAnswerToMyQuestion ? 'followup' : 'inject';
166
166
  if (type === 'handoff' || type === 'handoff_result') return 'followup';
167
- return 'inject'; // chat / share / visit / bottle / bottle_reply …
167
+ // ★ 2026-11-30 晚(岸:「同意给鱼看的时候没有任何反应」)。
168
+ // 漂流瓶原来跟着 chat/share 走 inject —— 只投进 inbox、**不叫醒**。
169
+ // 实测现场:会话里只有两条 agent/inbox/spliced(21:06:41 / 21:06:48),
170
+ // 一个 turn/start 都没有 —— 鱼根本不知道有瓶子来了,所以「没反应」。
171
+ // 但主人在界面上点「同意阅读」这个动作,本意就是让它看一眼、可能回一句;
172
+ // 投进去却不叫醒,等于这个按钮没有意义。所以瓶子单独走 followup。
173
+ // 回信(bottle_reply)同理 —— 那是临时通道,只能回一次,更不能让它睡过去。
174
+ if (type === 'bottle' || type === 'bottle_reply') return 'followup';
175
+ return 'inject'; // chat / share / visit …
168
176
  }
169
177
 
170
178
  export function sha256hex(data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-fishpal",
3
- "version": "0.9.10",
3
+ "version": "0.9.11",
4
4
  "description": "给你的 DSH 虚拟鱼找个朋友 — 跨机器端到端加密,互递漂流瓶、还会来串门。不是人类聊天工具。",
5
5
  "author": "xinze404",
6
6
  "license": "MIT",
@@ -46,6 +46,7 @@
46
46
  "_selftest-pair.mjs",
47
47
  "_selftest-privacy.mjs",
48
48
  "_verify-room-reuse.mjs",
49
+ "_verify-bottle-wake.mjs",
49
50
  "assets",
50
51
  "icon.svg",
51
52
  "cordis.patch.yml",
package/tests/run.mjs CHANGED
@@ -89,6 +89,7 @@ const SUITES = [
89
89
  '_selftest-invite.mjs',
90
90
  '_selftest-memory-adapter.mjs',
91
91
  '_verify-room-reuse.mjs',
92
+ '_verify-bottle-wake.mjs',
92
93
  ];
93
94
 
94
95
  let totalPass = 0;