dsh-vibe-math 0.2.0 → 0.3.0
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 +131 -341
- package/cordis.patch.yml +7 -43
- package/installer.js +51 -0
- package/package.json +14 -7
- package/{vibe-math.js → vibe-math-v1/vibe-math.js} +2 -2
- package/vibe-math-v1//345/256/236/347/216/260/346/226/271/346/241/210-/345/244/232/344/273/243/347/220/206/346/225/260/345/255/246/351/227/256/351/242/230/346/261/202/350/247/243/344/270/216/351/252/214/350/257/201/346/241/206/346/236/266.md +159 -0
- package/vibe-math-v2/agent.cordis.yml +201 -0
- package/vibe-math-v2/preset.yml +2 -0
- package/vibe-math-v2/vibe-math-v2.js +1046 -0
- package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +180 -0
- /package/{agent.cordis.yml → vibe-math-v1/agent.cordis.yml} +0 -0
- /package/{preset.yml → vibe-math-v1/preset.yml} +0 -0
package/README.md
CHANGED
|
@@ -1,341 +1,131 @@
|
|
|
1
|
-
# Vibe Mathematics —
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/dsh-vibe-math)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://github.com/ChongCyrus/Vibe-Mathematics)
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
>
|
|
9
|
-
>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
SCHED -->|"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
### 方式 A:作为插件包一键安装(推荐)
|
|
133
|
-
|
|
134
|
-
发布到 npm 后:
|
|
135
|
-
|
|
136
|
-
```sh
|
|
137
|
-
dsh plugin --profile <你的 profile> add dsh-vibe-math
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
不发布也能直接从 GitHub 装:
|
|
141
|
-
|
|
142
|
-
```sh
|
|
143
|
-
dsh plugin --profile <你的 profile> add github:ChongCyrus/Vibe-Mathematics
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### 方式 B:作为 agent preset 手动安装
|
|
147
|
-
|
|
148
|
-
1. 把本仓库的三个文件放到 preset 目录:
|
|
149
|
-
|
|
150
|
-
```
|
|
151
|
-
C:\Users\<你>\.dsh\.agent-presets\vibe-math\
|
|
152
|
-
├─ agent.cordis.yml
|
|
153
|
-
├─ preset.yml
|
|
154
|
-
└─ vibe-math.js
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
2. 新建一个会话,在 preset 选择器里选 **「Vibe Math」**。
|
|
158
|
-
3. 会话启动后即可使用:工具列表里会出现 20 个 `vibe_math_*` 工具,输入框键入 `/vibe` 有自动补全。
|
|
159
|
-
|
|
160
|
-
> 修改 preset 文件后需**重启 DSH 进程**再开新会话(preset 的 standing mount 会缓存到进程退出)。
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## ⚡ 快速上手
|
|
165
|
-
|
|
166
|
-
### 方式 A:直接对话(推荐,最省事)
|
|
167
|
-
|
|
168
|
-
因为主代理内置了使用说明,你**直接说人话即可**:
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
帮我用 Vibe Math 证明 √2 是无理数。
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
主代理会自动:`vibe_math_add_problem` 加题 → `vibe_math_start` 启动 → 之后你随时问它进度。
|
|
175
|
-
|
|
176
|
-
```
|
|
177
|
-
现在进展怎么样了?
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
主代理会自动调用 `vibe_math_status` / `vibe_math_report` 并把结果用人话汇报给你。
|
|
181
|
-
|
|
182
|
-
### 方式 B:命令 / 工具(精确控制)
|
|
183
|
-
|
|
184
|
-
在对话里直接调用工具(参数为 JSON):
|
|
185
|
-
|
|
186
|
-
| 工具 | 作用 |
|
|
187
|
-
|---|---|
|
|
188
|
-
| `vibe_math_add_problem` | 加题(id/description/priority) |
|
|
189
|
-
| `vibe_math_start` / `vibe_math_resume` | 启动 / 断点恢复调度器 |
|
|
190
|
-
| `vibe_math_pause` / `vibe_math_abort` | 暂停 / 终止(中断所有子代理) |
|
|
191
|
-
| `vibe_math_status` / `vibe_math_report` | 查看状态 / 完整进度报告 |
|
|
192
|
-
| `vibe_math_set_mode` | 切换 `auto` / `manual` |
|
|
193
|
-
| `vibe_math_set_params` | 运行时调参 |
|
|
194
|
-
| `vibe_math_setup` | 返回参数 schema(交互式配置用) |
|
|
195
|
-
| `vibe_math_save_settings` | 把当前参数存成新默认 |
|
|
196
|
-
| `vibe_math_template` | 生成默认参数模板文件 |
|
|
197
|
-
| `vibe_math_new_project` / `set_project` / `list_projects` | 项目管理 |
|
|
198
|
-
| `vibe_math_list_decisions` / `decide` | 查看 / 裁决人工决策 |
|
|
199
|
-
| `vibe_math_list_agents` / `message_agent` / `interrupt_agent` | 查看 / 发消息 / 中断子代理 |
|
|
200
|
-
|
|
201
|
-
斜杠命令(与工具等价):`/vibe start|resume|pause|abort|status|report|mode <auto|manual>|setup|save|template [global|project]|add <id> <desc>|project [list|new <name>|<name>]|decisions|agents`
|
|
202
|
-
|
|
203
|
-
---
|
|
204
|
-
|
|
205
|
-
## 🎓 教学:让主代理替你干活
|
|
206
|
-
|
|
207
|
-
### 1. 自然语言驱动(不用记命令)
|
|
208
|
-
|
|
209
|
-
主代理的作用就是当你的「翻译官」。你只需描述**目标**,它会自己选择并调用工具:
|
|
210
|
-
|
|
211
|
-
| 你说的话 | 主代理做的事 |
|
|
212
|
-
|---|---|
|
|
213
|
-
| “求解 / 证明 XXX” | `add_problem` + `start`,之后汇报 |
|
|
214
|
-
| “现在进度怎么样 / 有哪些代理在跑” | `status` / `report` / `list_agents` 并总结 |
|
|
215
|
-
| “暂停 / 终止求解” | `pause` / `abort` |
|
|
216
|
-
| “切到人工模式,我要逐步把关” | `set_mode manual`,之后有决策就 `list_decisions` 提醒你 |
|
|
217
|
-
| “给 q1 的某个求解方向换个思路(比如改成构造性证明)” | `list_agents` 找到 childId → `message_agent` 注入新指令 |
|
|
218
|
-
| “中断某个卡住的子代理” | `interrupt_agent` |
|
|
219
|
-
|
|
220
|
-
### 2. 问答式参数配置(/vibe setup)
|
|
221
|
-
|
|
222
|
-
你甚至不用记参数名。说:
|
|
223
|
-
|
|
224
|
-
```
|
|
225
|
-
帮我配置一下参数。
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
主代理会调用 `vibe_math_setup` 拿到完整参数 schema(每项含**说明 / 选项 / 建议 / 当前值**),
|
|
229
|
-
然后用 `ask_user_question` **逐项问你**(选项自带解释与建议),你选完它用 `vibe_math_set_params`
|
|
230
|
-
应用,最后问你是否 `vibe_math_save_settings` 存为默认。
|
|
231
|
-
|
|
232
|
-
也可以直接跑命令:`/vibe setup`(看 schema)→ 跟主代理说你要改哪些 → `/vibe save`(存默认)。
|
|
233
|
-
|
|
234
|
-
### 3. 配置文件(vibe_math_setting.json)
|
|
235
|
-
|
|
236
|
-
- **生成模板**:`/vibe template`(生成到工作区)或 `/vibe template project`(生成到当前项目)——
|
|
237
|
-
会产出一份**带 `//` 注释、逐项中文说明**的 JSON 模板,你手改后重启/resume 即生效。
|
|
238
|
-
- **保存当前值**:`/vibe save` 把当前生效参数写回该文件。
|
|
239
|
-
|
|
240
|
-
---
|
|
241
|
-
|
|
242
|
-
## 🌱 新手示例流程(以“证明 √2 是无理数”为例)
|
|
243
|
-
|
|
244
|
-
**Step 1 — 用一句话启动**
|
|
245
|
-
|
|
246
|
-
```
|
|
247
|
-
帮我用 Vibe Math 证明:√2 是无理数。
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
主代理执行 `vibe_math_add_problem {"id":"q1","description":"证明:√2 是无理数。","priority":0}`
|
|
251
|
-
再执行 `vibe_math_start`,然后告诉你“已启动”。
|
|
252
|
-
|
|
253
|
-
**Step 2 — 询问进度**
|
|
254
|
-
|
|
255
|
-
```
|
|
256
|
-
进展如何?
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
主代理执行 `vibe_math_status` 并用人话汇报:当前活跃子代理数、正在验证的单元、是否有待决策等。
|
|
260
|
-
|
|
261
|
-
**Step 3 — 问答式调参(可选)**
|
|
262
|
-
|
|
263
|
-
```
|
|
264
|
-
我想让它用加权投票,并发数设成 6。
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
主代理 `vibe_math_set_params {"verdictMode":"weighted-vote","maxParallelThreshold":6}`,
|
|
268
|
-
并问你是否 `vibe_math_save_settings` 保存。
|
|
269
|
-
|
|
270
|
-
**Step 4 — 中途干预(可选)**
|
|
271
|
-
|
|
272
|
-
```
|
|
273
|
-
切到人工模式,我要在每个关键节点把关。
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
主代理 `vibe_math_set_mode {"mode":"manual"}`。之后每到一个关键节点它会 `vibe_math_list_decisions`
|
|
277
|
-
拿到决策,向你说明,等你 `vibe_math_decide {"id":"...","action":"approve"}`(或 `reject` / `override`)。
|
|
278
|
-
|
|
279
|
-
**Step 5 — 收尾**
|
|
280
|
-
|
|
281
|
-
```
|
|
282
|
-
结束了吗?结论是什么?
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
主代理 `vibe_math_status`:`qs.csv` 里 `q1` 已回写 `solved`,解法文件在 `Verified/` 里并被命名为
|
|
286
|
-
`q1-的解法_<唯一标识>.csv`。
|
|
287
|
-
|
|
288
|
-
---
|
|
289
|
-
|
|
290
|
-
## 🖼️ 实际使用示例(长截图)
|
|
291
|
-
|
|
292
|
-
> 截图很长,这里默认**折叠**:点击下方「展开」才加载整张长图,避免它占满页面、遮挡前后文字。
|
|
293
|
-
|
|
294
|
-
<details>
|
|
295
|
-
<summary>📸 展开查看实际使用示例长截图</summary>
|
|
296
|
-
|
|
297
|
-

|
|
298
|
-
|
|
299
|
-
</details>
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
## ⚙️ 参数速查表(默认值)
|
|
304
|
-
|
|
305
|
-
| 参数 | 默认 | 说明 |
|
|
306
|
-
|---|---|---|
|
|
307
|
-
| `mode` | `auto` | `auto` / `manual` |
|
|
308
|
-
| `maxParallelThreshold` | 4 | 全局最大并发子代理数 |
|
|
309
|
-
| `solverMaxRounds` | 20 | 每个求解方向最大迭代轮数 |
|
|
310
|
-
| `verifierCount` | 3 | 每验证单元独立验证器数(≥3) |
|
|
311
|
-
| `debateMaxRounds` | 5 | 验证辩论最大轮数 |
|
|
312
|
-
| `verdictMode` | `direct-veto` | `direct-veto` / `weighted-vote` |
|
|
313
|
-
| `provider` / `model` | 空 | 子代理模型(空 = 继承根代理) |
|
|
314
|
-
| `solverPersona` / `verifierPersona` | 空 | 注入求解器/验证器的额外要求 |
|
|
315
|
-
| `solverToolAllow` / `solverToolDeny` | `[]` | 求解器允许/禁止的工具(硬性 toolFilter) |
|
|
316
|
-
| `verifierToolAllow` / `verifierToolDeny` | `[]` | 验证器允许/禁止的工具 |
|
|
317
|
-
| `solverMaxToolCalls` / `verifierMaxToolCalls` | 0 | 每轮外部工具调用上限(0=不限,软性) |
|
|
318
|
-
| `reportIntervalMs` | 30000 | 自动写进度报告的最小间隔 |
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## 📝 断点续跑 & 人工干预(两大硬性需求)
|
|
323
|
-
|
|
324
|
-
- **断点续跑**:所有状态落盘到 `VibeMath_State/*.json`,每个子代理都是 DSH 的 **continuable 持久会话**(对话由 DSH 自动保存)。重启后新开会话 → `vibe_math_resume` 即可续跑。
|
|
325
|
-
- **中途人工干预**:`manual` 模式在关键节点(brainstorm/solver 派发、验证裁决、晋升 Verified)挂起决策;可随时 `set_mode auto` 切回自动;可对任意子代理 `message_agent` / `interrupt_agent`。
|
|
326
|
-
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
## ⚠️ 已知边界(有意简化)
|
|
330
|
-
|
|
331
|
-
- `Pending_Verification` 按文件逐个拆解,未做跨文件的“去重 / 引用整合”(不损正确性)。
|
|
332
|
-
- `weighted-vote` 会记录每个验证器的历史准确率 + 严谨性权重,但最终裁决仍遵循“证伪优先 / 全 Uncertain→False”(数值权重仅用于审计)。
|
|
333
|
-
- manual 模式在第一个未决关键节点暂停整条主循环。
|
|
334
|
-
|
|
335
|
-
完整逻辑见仓库内规格文档 `实现方案-多代理数学问题求解与验证框架.md`。
|
|
336
|
-
|
|
337
|
-
---
|
|
338
|
-
|
|
339
|
-
## 📄 License
|
|
340
|
-
|
|
341
|
-
MIT
|
|
1
|
+
# Vibe Mathematics — 多代理数学问题求解与验证框架(双架构)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-vibe-math)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://github.com/ChongCyrus/Vibe-Mathematics)
|
|
6
|
+
|
|
7
|
+
> 运行在 **DeepSeek Harness** 内的一组 **agent preset**(`vibe-math-v1` / `vibe-math-v2`),
|
|
8
|
+
> 用多代理协作自动求解数学问题并对结论做多代理交叉验证。两个预设共享「**断点续跑**、
|
|
9
|
+
> **中途人工干预**、**进度汇报**、**自然语言驱动**」三大底座能力,但采用两套不同的求解架构:
|
|
10
|
+
>
|
|
11
|
+
> - **`vibe-math-v1`(经典流水线)**:「广度探索 → 深度迭代 → 交叉验证 → 知识沉淀」闭环;
|
|
12
|
+
> - **`vibe-math-v2`(新架构 · 概率驱动)**:`qs.json` 问题清单 + `Propos/` 命题库 + 概率驱动调度。
|
|
13
|
+
|
|
14
|
+
安装本插件包(或手动复制预设)后,DSH 的预设选择器里会出现**两个** agent preset。
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 🚀 安装
|
|
19
|
+
|
|
20
|
+
**方式 A:插件包一键安装(推荐)** —— 同时装出两个预设:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
dsh plugin --profile <你的 profile> add dsh-vibe-math
|
|
24
|
+
# 或从 GitHub 直装:
|
|
25
|
+
dsh plugin --profile <你的 profile> add github:ChongCyrus/Vibe-Mathematics
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
安装时插件会自动把两个 preset 写入 `~/.dsh/.agent-presets/`:
|
|
29
|
+
`vibe-math-v1/` 与 `vibe-math-v2/`。之后新建会话,预设选择器里选择 **Vibe Math** 或 **Vibe Math V2** 即可。
|
|
30
|
+
|
|
31
|
+
**方式 B:手动复制**(任选其一)
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
C:\Users\<你>\.dsh\.agent-presets\vibe-math-v1\ ← 复制 vibe-math-v1/ 下的 agent.cordis.yml / preset.yml / vibe-math.js
|
|
35
|
+
C:\Users\<你>\.dsh\.agent-presets\vibe-math-v2\ ← 复制 vibe-math-v2/ 下的 agent.cordis.yml / preset.yml / vibe-math-v2.js
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
> 修改 preset 文件后需**重启 DSH 进程**再开新会话(standing mount 缓存到进程退出)。
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 🧭 两个预设怎么选
|
|
43
|
+
|
|
44
|
+
| | **vibe-math-v1(经典)** | **vibe-math-v2(新架构)** |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| 核心思想 | 流水线:拆方向 → 逐方向求解 → 拆最小单元 → 多验证器辩论 → 晋升 `Verified/` | 概率驱动:`qs.json` 问题 + `Propos/` 命题库,按「正确概率 / 价值」调度求解与验证 |
|
|
47
|
+
| 数据 | `qs/qs.csv` + `Progress_Logs/` | `qs/qs.json` + `Propos/<分类>_Propos.json` + `Reliable/` |
|
|
48
|
+
| 角色 | brainstorm / solver / derive / verifier / decider | explorer(拆方向)→ 逐方向 solver → verifier(独立审查→辩论→裁决) |
|
|
49
|
+
| 收口规则 | 验证通过晋升 `Verified/`,decider 判定解决 | 解法/证明达概率 `1` 即收口(问题 solved、命题 1/0),`never` 永不调度 |
|
|
50
|
+
| 特设能力 | 子问题分支(Aux_Hypothesis) | 命题「价值/关键性」自动晋升问题清单;`reportMode file/push/both`;`priorityAdjust` 三种优先级策略 |
|
|
51
|
+
|
|
52
|
+
两者都支持:断点续跑(`vibe_math_resume`)、人工/自动模式切换、`vibe_math_*` 工具集与 `/vibe` 命令、按项目隔离、子代理权限调控。
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 🧩 架构图(v1)
|
|
57
|
+
|
|
58
|
+
> Mermaid 原生渲染;可编辑图源见 [docs/架构图.md](docs/架构图.md)。
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
```mermaid
|
|
63
|
+
flowchart TB
|
|
64
|
+
subgraph L1["👤 交互层"]
|
|
65
|
+
U["😀 用户(自然语言)"]
|
|
66
|
+
M["🤖 主代理(助手 + 汇报者)<br/>翻译需求 · 汇报进度 · 问答配置<br/>不求解 · 不调度"]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
subgraph L2["⚙️ 调度层(插件代码)"]
|
|
70
|
+
SCHED["调度器 Scheduler<br/>唯一文件写者<br/>读 qs.csv · 派发子代理 · 推进状态机"]
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
subgraph L3["🧠 子代理层(continuable 持久会话)"]
|
|
74
|
+
BRAIN["🧭 Brainstorm<br/>拆解多个求解方向"]
|
|
75
|
+
SOLV["✍️ Solver × N<br/>逐方向多轮迭代"]
|
|
76
|
+
DERI["🔀 Derive<br/>死路时派生新方向"]
|
|
77
|
+
VERI["🔬 Verifier × ≥3<br/>独立审查 → 辩论 → 裁决"]
|
|
78
|
+
DECI["⚖️ Decider<br/>判定是否解决"]
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
subgraph L4["💾 数据层 · VibeMath/Projects/<项目>/"]
|
|
82
|
+
QS["📋 qs.csv"]
|
|
83
|
+
PEND["📥 Pending_Verification/"]
|
|
84
|
+
UNDR["📂 Under_Verification/"]
|
|
85
|
+
TVAL["✅ Temp_Validated/"]
|
|
86
|
+
KNOW["📚 Verified/ 可信知识库"]
|
|
87
|
+
STATE["🗄️ Progress_Logs/ · VibeMath_State/"]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
U -->|"求解 XX / 查进度 / 干预"| M
|
|
91
|
+
M -->|"vibe_math_* 工具"| SCHED
|
|
92
|
+
|
|
93
|
+
SCHED -->|"① 派发"| BRAIN
|
|
94
|
+
BRAIN -->|"多个大相径庭的方向"| SCHED
|
|
95
|
+
SCHED -->|"② 每方向一个"| SOLV
|
|
96
|
+
SOLV -->|"结构化结果 JSON"| SCHED
|
|
97
|
+
SOLV -.->|"迭代至卡死"| DERI
|
|
98
|
+
DERI -->|"派生 1~3 个新方向"| SCHED
|
|
99
|
+
SCHED -->|"③ 写盘"| PEND
|
|
100
|
+
SCHED -->|"④ 拆解为最小验证单元"| UNDR
|
|
101
|
+
SCHED -->|"⑤ 派发 ≥3 个"| VERI
|
|
102
|
+
VERI -->|"裁决 JSON"| SCHED
|
|
103
|
+
SCHED -->|"⑥ 通过"| TVAL
|
|
104
|
+
SCHED -->|"⑦ 晋升"| KNOW
|
|
105
|
+
SCHED -->|"⑧ 派发"| DECI
|
|
106
|
+
DECI -->|"⑨ 已解决 → 回写"| QS
|
|
107
|
+
SCHED <-->|"读取问题"| QS
|
|
108
|
+
SCHED <-->|"状态落盘 / 断点恢复"| STATE
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 📚 规格文档
|
|
114
|
+
|
|
115
|
+
- **v1(经典)**:[`vibe-math-v1/实现方案-多代理数学问题求解与验证框架.md`](vibe-math-v1/实现方案-多代理数学问题求解与验证框架.md)
|
|
116
|
+
- **v2(新架构)**:[`vibe-math-v2/实现方案.md`](vibe-math-v2/实现方案.md)
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## ⚠️ 已知边界
|
|
121
|
+
|
|
122
|
+
- 两个预设的 preset 文件互相独立、可共存;同一会话同时只能选一个预设。
|
|
123
|
+
- `vibe-math-v1` 的 `Pending_Verification` 按文件逐个拆解,未做跨文件去重。
|
|
124
|
+
- `vibe-math-v2` 的 `flat` 裁决在辩论不一致时直接判 `0.5`;`forced` 按历史准确率+置信度加权。
|
|
125
|
+
- 安装器只**补装缺失**的 preset 文件,不覆盖你已编辑的预设(删除对应目录即可重新安装)。
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 📄 License
|
|
130
|
+
|
|
131
|
+
MIT
|
package/cordis.patch.yml
CHANGED
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
# The dsh-vibe-math bundle patch.
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
# The plugin consumes the HOST subagents/agents/fs/tools/commands services (all
|
|
8
|
-
# provided by dsh-base) and publishes nothing, so it sits loose with no realm.
|
|
9
|
-
#
|
|
10
|
-
# A patch replaces the target row's whole `config`; `system-prompt` only owns
|
|
11
|
-
# `persona`, so restating just that key is complete.
|
|
12
|
-
|
|
13
|
-
- id: system-prompt
|
|
14
|
-
config:
|
|
15
|
-
persona: |-
|
|
16
|
-
You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
|
|
17
|
-
|
|
18
|
-
## Vibe Math toolkit
|
|
19
|
-
|
|
20
|
-
This session includes the "Vibe Math" multi-agent mathematical problem-solving and
|
|
21
|
-
verification framework. It is driven by a background scheduler (code), NOT by the model:
|
|
22
|
-
you only issue the control tools below and read status; the scheduler automatically runs
|
|
23
|
-
brainstorm → solver iteration → multi-verifier debate → promotion to Verified → triage
|
|
24
|
-
back to the problem list.
|
|
25
|
-
|
|
26
|
-
- vibe_math_add_problem {id, description, priority} — add a problem to qs.csv.
|
|
27
|
-
- vibe_math_start / vibe_math_resume — start / resume the scheduler (resume = continue after a checkpoint or restart).
|
|
28
|
-
- vibe_math_status / vibe_math_report — read scheduler status / full progress report.
|
|
29
|
-
- vibe_math_pause / vibe_math_abort — pause / abort (abort interrupts all children).
|
|
30
|
-
- vibe_math_set_mode {mode: manual|auto} — switch manual / auto control.
|
|
31
|
-
- vibe_math_set_params {...} — tune any parameter (see vibe_math_setup for the full schema).
|
|
32
|
-
- vibe_math_setup — parameter schema for guided configuration.
|
|
33
|
-
- vibe_math_save_settings — persist current params as new defaults.
|
|
34
|
-
- vibe_math_new_project / vibe_math_set_project / vibe_math_list_projects — per-project folders.
|
|
35
|
-
- vibe_math_list_decisions / vibe_math_decide {id, action} — resolve manual decisions.
|
|
36
|
-
- vibe_math_list_agents / vibe_math_message_agent / vibe_math_interrupt_agent — inspect / steer / interrupt subagents.
|
|
37
|
-
|
|
38
|
-
A /vibe slash command mirrors these. When the user asks to solve or verify a math problem:
|
|
39
|
-
add the problem (or ask for it first), then vibe_math_start, then report vibe_math_status.
|
|
40
|
-
In manual mode, poll vibe_math_list_decisions and resolve each with vibe_math_decide.
|
|
41
|
-
Data lives under {{cwd}}/VibeMath/Projects/<project>/ and survives restarts via vibe_math_resume.
|
|
1
|
+
# The dsh-vibe-math merged bundle patch. Installing this bundle (dsh plugin add
|
|
2
|
+
# dsh-vibe-math / dsh-market) runs ONE plugin row: the preset installer, which
|
|
3
|
+
# copies both agent presets (vibe-math-v1 + vibe-math-v2) into the DSH preset
|
|
4
|
+
# root. The presets themselves register the vibe_math_* tools — nothing is
|
|
5
|
+
# injected into the profile composition directly.
|
|
42
6
|
|
|
43
7
|
- insert:
|
|
44
|
-
- id: vibe-math
|
|
45
|
-
name: dsh-vibe-math
|
|
8
|
+
- id: vibe-math-preset-installer
|
|
9
|
+
name: dsh-vibe-math/installer
|
package/installer.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// dsh-vibe-math merged bundle installer.
|
|
2
|
+
// When this bundle is installed (e.g. `dsh plugin add dsh-vibe-math` or from the
|
|
3
|
+
// dsh-market), this plugin copies BOTH agent presets out of the package into the
|
|
4
|
+
// DSH preset root, so the user immediately gets two presets in the picker:
|
|
5
|
+
// vibe-math-v1/ (classic pipeline architecture)
|
|
6
|
+
// vibe-math-v2/ (new probability-driven architecture)
|
|
7
|
+
// Copy is per-file and only installs MISSING files (idempotent; never clobbers
|
|
8
|
+
// a preset the user already edited — delete the dir to force a reinstall).
|
|
9
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
10
|
+
import { homedir } from 'node:os'
|
|
11
|
+
import { dirname, join } from 'node:path'
|
|
12
|
+
import { fileURLToPath } from 'node:url'
|
|
13
|
+
|
|
14
|
+
export const name = 'vibe-math-preset-installer'
|
|
15
|
+
|
|
16
|
+
export function apply(ctx) {
|
|
17
|
+
const logger = ctx && ctx.logger
|
|
18
|
+
try {
|
|
19
|
+
const dshHome = process.env.DSH_HOME || join(homedir(), '.dsh')
|
|
20
|
+
const here = dirname(fileURLToPath(import.meta.url))
|
|
21
|
+
const targets = [
|
|
22
|
+
{
|
|
23
|
+
src: join(here, 'vibe-math-v1'),
|
|
24
|
+
dst: join(dshHome, '.agent-presets', 'vibe-math-v1'),
|
|
25
|
+
files: ['agent.cordis.yml', 'preset.yml', 'vibe-math.js', '实现方案-多代理数学问题求解与验证框架.md'],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
src: join(here, 'vibe-math-v2'),
|
|
29
|
+
dst: join(dshHome, '.agent-presets', 'vibe-math-v2'),
|
|
30
|
+
files: ['agent.cordis.yml', 'preset.yml', 'vibe-math-v2.js', '实现方案.md'],
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
let installed = 0
|
|
34
|
+
for (const t of targets) {
|
|
35
|
+
if (!existsSync(t.src)) continue
|
|
36
|
+
mkdirSync(t.dst, { recursive: true })
|
|
37
|
+
for (const f of t.files) {
|
|
38
|
+
const s = join(t.src, f)
|
|
39
|
+
const d = join(t.dst, f)
|
|
40
|
+
if (!existsSync(s) || existsSync(d)) continue
|
|
41
|
+
writeFileSync(d, readFileSync(s))
|
|
42
|
+
installed += 1
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (installed > 0) {
|
|
46
|
+
logger?.info?.('[dsh-vibe-math] installed ' + installed + ' preset file(s) — presets vibe-math-v1 & vibe-math-v2 are now available in the preset picker (new session)')
|
|
47
|
+
}
|
|
48
|
+
} catch (err) {
|
|
49
|
+
logger?.warn?.('[dsh-vibe-math] preset install failed: %s', String((err && err.message) || err))
|
|
50
|
+
}
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-vibe-math",
|
|
3
|
-
"description": "Multi-agent mathematical problem-solving & verification
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Multi-agent mathematical problem-solving & verification frameworks for DeepSeek Harness — TWO agent presets in one install: vibe-math-v1 (classic pipeline: brainstorm → solver iteration → multi-verifier debate → Verified) and vibe-math-v2 (new probability-driven architecture: qs.json + Propos knowledge base + explorer→solver→review/debate verdict). Installing this bundle auto-installs both presets into the DSH preset root.",
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "installer.js",
|
|
7
7
|
"exports": {
|
|
8
|
-
".": "./
|
|
8
|
+
".": "./installer.js",
|
|
9
|
+
"./installer": "./installer.js",
|
|
9
10
|
"./cordis.patch.yml": "./cordis.patch.yml"
|
|
10
11
|
},
|
|
11
12
|
"files": [
|
|
12
|
-
"
|
|
13
|
+
"installer.js",
|
|
13
14
|
"cordis.patch.yml",
|
|
14
|
-
"agent.cordis.yml",
|
|
15
|
-
"preset.yml"
|
|
15
|
+
"vibe-math-v1/agent.cordis.yml",
|
|
16
|
+
"vibe-math-v1/preset.yml",
|
|
17
|
+
"vibe-math-v1/vibe-math.js",
|
|
18
|
+
"vibe-math-v1/实现方案-多代理数学问题求解与验证框架.md",
|
|
19
|
+
"vibe-math-v2/agent.cordis.yml",
|
|
20
|
+
"vibe-math-v2/preset.yml",
|
|
21
|
+
"vibe-math-v2/vibe-math-v2.js",
|
|
22
|
+
"vibe-math-v2/实现方案.md"
|
|
16
23
|
],
|
|
17
24
|
"license": "MIT",
|
|
18
25
|
"keywords": [
|
|
@@ -17,12 +17,12 @@ import { dirname, join } from 'node:path'
|
|
|
17
17
|
import { fileURLToPath } from 'node:url'
|
|
18
18
|
|
|
19
19
|
// Ensure the agent-preset form is installed under the DSH preset root, so a
|
|
20
|
-
// market/bundle install also surfaces "Vibe Math" in the agent-preset picker.
|
|
20
|
+
// market/bundle install also surfaces "Vibe Math V1" in the agent-preset picker.
|
|
21
21
|
// No-op when the preset already exists or when running inside the preset itself.
|
|
22
22
|
function ensurePresetInstalled(logger) {
|
|
23
23
|
try {
|
|
24
24
|
const dshHome = process.env.DSH_HOME || join(homedir(), '.dsh')
|
|
25
|
-
const presetDir = join(dshHome, '.agent-presets', 'vibe-math')
|
|
25
|
+
const presetDir = join(dshHome, '.agent-presets', 'vibe-math-v1')
|
|
26
26
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
27
27
|
const files = ['agent.cordis.yml', 'preset.yml', 'vibe-math.js']
|
|
28
28
|
if (files.every((f) => existsSync(join(presetDir, f)))) return false
|