pi-think-anchor 1.0.25 → 1.0.27
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 +10 -35
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,18 +17,6 @@
|
|
|
17
17
|
| 命令行 | /think-anchor [on|off|reset|stats] |
|
|
18
18
|
| 调用方式 | **全自动**:turn_end 评估 + 条件注入。on/off 只改当前会话内存(不写文件),重启后回到配置文件的值 |
|
|
19
19
|
|
|
20
|
-
完整配置(全部键与默认值):
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{
|
|
24
|
-
"enabled": true,
|
|
25
|
-
"score": { "minHits": 3, "spec": 1.2, "react": 0.5, "alpha": 1 },
|
|
26
|
-
"windowSize": 5,
|
|
27
|
-
"weights": { "beta": 0.4, "eps": 0.5 },
|
|
28
|
-
"intervention": { "l1CooldownMin": 10, "l2CooldownMin": 15, "maxL2": 2 }
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
20
|
## 安装
|
|
33
21
|
|
|
34
22
|
```bash
|
|
@@ -53,7 +41,6 @@ pi install npm:pi-think-anchor
|
|
|
53
41
|
| `intervention.l2CooldownMin` | `15` | L2 冷却(分钟) |
|
|
54
42
|
| `intervention.maxL2` | `2` | 每会话 L2 上限 |
|
|
55
43
|
| `lexicon.positive/negative/neutral` | 专注 28 词 / 发散 18 词 / 中性 **默认空** | 词表覆盖 |
|
|
56
|
-
| `bands.spec/react` | `1.2 / 0.5` | 旧版兼容(无 `score` 时生效) |
|
|
57
44
|
|
|
58
45
|
其他:日志 `~/.pi/think-anchor.jsonl`(1 MiB 截断,保留尾部整行)。
|
|
59
46
|
**词表覆盖规则(源码事实)**
|
|
@@ -162,12 +149,12 @@ pi install npm:pi-think-anchor
|
|
|
162
149
|
flowchart TD
|
|
163
150
|
A[turn_end<br/>读 assistant thinking] --> B[词频指纹 pos/neg/neu]
|
|
164
151
|
B --> C{本轮命中 >= minHits?}
|
|
165
|
-
C
|
|
152
|
+
C -->|否:只推进窗口| A
|
|
166
153
|
C -->|是| D[滑窗聚合 + alpha 平滑比率]
|
|
167
154
|
D --> E{波段}
|
|
168
|
-
E -->|spec
|
|
169
|
-
E -->|mixed
|
|
170
|
-
E -->|react| H[
|
|
155
|
+
E -->|spec:静默| A
|
|
156
|
+
E -->|mixed:观察| A
|
|
157
|
+
E -->|react| H[状态机 L1 / L2]
|
|
171
158
|
H -->|nextTurn 尾部消息| A
|
|
172
159
|
```
|
|
173
160
|
|
|
@@ -179,7 +166,7 @@ flowchart TD
|
|
|
179
166
|
flowchart TD
|
|
180
167
|
A[你说的话] --> B[教练看用词]
|
|
181
168
|
B --> C{清晰吗}
|
|
182
|
-
C -->|清晰|
|
|
169
|
+
C -->|清晰| A
|
|
183
170
|
C -->|有点散| E[轻提醒]
|
|
184
171
|
C -->|一直散| F[认真提醒]
|
|
185
172
|
E --> A
|
|
@@ -212,16 +199,6 @@ Chain-of-thought drift monitor: reads a word-frequency fingerprint from thinking
|
|
|
212
199
|
|
|
213
200
|
Full config (all keys and defaults):
|
|
214
201
|
|
|
215
|
-
```json
|
|
216
|
-
{
|
|
217
|
-
"enabled": true,
|
|
218
|
-
"score": { "minHits": 3, "spec": 1.2, "react": 0.5, "alpha": 1 },
|
|
219
|
-
"windowSize": 5,
|
|
220
|
-
"weights": { "beta": 0.4, "eps": 0.5 },
|
|
221
|
-
"intervention": { "l1CooldownMin": 10, "l2CooldownMin": 15, "maxL2": 2 }
|
|
222
|
-
}
|
|
223
|
-
```
|
|
224
|
-
|
|
225
202
|
## Install
|
|
226
203
|
|
|
227
204
|
```bash
|
|
@@ -246,7 +223,6 @@ Config file `~/.pi/think-anchor.json` (optional; defaults apply, invalid JSON fa
|
|
|
246
223
|
| `intervention.l2CooldownMin` | `15` | L2 cooldown (minutes) |
|
|
247
224
|
| `intervention.maxL2` | `2` | Max L2 per session |
|
|
248
225
|
| `lexicon.positive/negative/neutral` | 28 focus / 18 drift / neutral **empty by default** | Lexicon override |
|
|
249
|
-
| `bands.spec/react` | `1.2 / 0.5` | Legacy keys (used when `score` is absent) |
|
|
250
226
|
|
|
251
227
|
Also: log `~/.pi/think-anchor.jsonl` (1 MiB truncation, tail-preserving).
|
|
252
228
|
**Lexicon override rules (from source)**
|
|
@@ -355,14 +331,13 @@ Full config (copy-paste ready, includes the default lexicon):
|
|
|
355
331
|
flowchart TD
|
|
356
332
|
A[turn_end<br/>read assistant thinking] --> B[word fingerprint pos/neg/neu]
|
|
357
333
|
B --> C{hits >= minHits?}
|
|
358
|
-
C -->|no
|
|
334
|
+
C -->|no: window only| A
|
|
359
335
|
C -->|yes| D[sliding window + alpha-smoothed ratio]
|
|
360
336
|
D --> E{band}
|
|
361
|
-
E -->|spec
|
|
362
|
-
E -->|mixed|
|
|
363
|
-
E -->|react| H[state machine
|
|
337
|
+
E -->|spec: silent| A
|
|
338
|
+
E -->|mixed: watch| A
|
|
339
|
+
E -->|react| H[state machine L1 / L2]
|
|
364
340
|
H -->|nextTurn message| A
|
|
365
|
-
|
|
366
341
|
```
|
|
367
342
|
|
|
368
343
|
## How it works (plain words)
|
|
@@ -373,7 +348,7 @@ flowchart TD
|
|
|
373
348
|
flowchart TD
|
|
374
349
|
A[what you say] --> B[coach reads wording]
|
|
375
350
|
B --> C{focused?}
|
|
376
|
-
C -->|yes|
|
|
351
|
+
C -->|yes| A
|
|
377
352
|
C -->|slightly off| E[gentle nudge]
|
|
378
353
|
C -->|drifting| F[stronger nudge]
|
|
379
354
|
E --> A
|