pi-think-anchor 1.0.17 → 1.0.18
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 +26 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,6 +51,19 @@ pi install npm:pi-think-anchor
|
|
|
51
51
|
- 无效不升级:上次 `eff >= 0` 时 L2 降为 L1。
|
|
52
52
|
- `session_start`:重置状态机,仅保留最近 3 条与 pending(跨会话结算)。
|
|
53
53
|
|
|
54
|
+
```mermaid
|
|
55
|
+
flowchart TD
|
|
56
|
+
A[turn_end<br/>读 assistant thinking] --> B[词频指纹 pos/neg/neu]
|
|
57
|
+
B --> C{本轮命中 >= minHits?}
|
|
58
|
+
C -->|否| Z[只推进窗口<br/>不评分不干预]
|
|
59
|
+
C -->|是| D[滑窗聚合 + alpha 平滑比率]
|
|
60
|
+
D --> E{波段}
|
|
61
|
+
E -->|spec| F[healthy 静默]
|
|
62
|
+
E -->|mixed| G[watch]
|
|
63
|
+
E -->|react| H[状态机<br/>L1 / L2 干预]
|
|
64
|
+
H -->|nextTurn 尾部消息| A
|
|
65
|
+
```
|
|
66
|
+
|
|
54
67
|
## 借鉴
|
|
55
68
|
|
|
56
69
|
蒸馏自 DSH 插件 [`dsh-anchored-monitor`](https://dsh-plugin.org/zh/plugins/aik358/dsh-anchored-monitor) 0.3.1:机制思想来源,非代码移植(本实现为回合级,无独立进程)。
|
|
@@ -109,6 +122,19 @@ Also: log `~/.pi/think-anchor.jsonl` (1 MiB truncation, tail-preserving).
|
|
|
109
122
|
- No escalation: when the previous `eff >= 0`, L2 degrades to L1.
|
|
110
123
|
- `session_start`: resets state, keeping only the last 3 samples and pending (cross-session settlement).
|
|
111
124
|
|
|
125
|
+
```mermaid
|
|
126
|
+
flowchart TD
|
|
127
|
+
A[turn_end<br/>read assistant thinking] --> B[word fingerprint pos/neg/neu]
|
|
128
|
+
B --> C{hits >= minHits?}
|
|
129
|
+
C -->|no| Z[advance window only<br/>no score, no nudge]
|
|
130
|
+
C -->|yes| D[sliding window + alpha-smoothed ratio]
|
|
131
|
+
D --> E{band}
|
|
132
|
+
E -->|spec| F[healthy: silent]
|
|
133
|
+
E -->|mixed| G[watch]
|
|
134
|
+
E -->|react| H[state machine<br/>L1 / L2 nudge]
|
|
135
|
+
H -->|nextTurn message| A
|
|
136
|
+
```
|
|
137
|
+
|
|
112
138
|
## Credits
|
|
113
139
|
|
|
114
140
|
Distilled from the DSH plugin [`dsh-anchored-monitor`](https://dsh-plugin.org/zh/plugins/aik358/dsh-anchored-monitor) 0.3.1: the mechanism is upstream, the code is not (turn-level, no separate process).
|