dsh-vibe-math 2.7.3 → 2.8.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/LICENSE +21 -21
- package/README.en.md +682 -682
- package/README.md +683 -683
- package/docs/AUDIT-CHECKLIST.md +755 -744
- package/docs/COMPAT-AUDIT-ROUND2.md +351 -351
- package/docs/COMPAT-AUDIT-ROUND3.md +154 -154
- package/docs/audit-methodology.md +93 -0
- package/docs/final-paper.md +172 -172
- package/docs/formal-verification.md +613 -588
- package/docs/generate_framework_diagram_v2.py +114 -114
- package/docs/generate_framework_diagram_v3.py +127 -127
- package/docs/math-computation.md +195 -194
- package/docs/release-notes/README.en.md +1 -0
- package/docs/release-notes/README.md +1 -0
- package/docs/release-notes/RELEASE-NOTES-2.0.22.md +112 -112
- package/docs/release-notes/RELEASE-NOTES-2.1.0.md +143 -143
- package/docs/release-notes/RELEASE-NOTES-2.2.0.md +266 -266
- package/docs/release-notes/RELEASE-NOTES-2.2.1.md +43 -43
- package/docs/release-notes/RELEASE-NOTES-2.2.2.md +88 -88
- package/docs/release-notes/RELEASE-NOTES-2.3.0.md +207 -207
- package/docs/release-notes/RELEASE-NOTES-2.3.1.md +134 -134
- package/docs/release-notes/RELEASE-NOTES-2.3.10.md +105 -105
- package/docs/release-notes/RELEASE-NOTES-2.3.11.md +57 -57
- package/docs/release-notes/RELEASE-NOTES-2.3.12.md +80 -80
- package/docs/release-notes/RELEASE-NOTES-2.3.2.md +145 -145
- package/docs/release-notes/RELEASE-NOTES-2.3.3.md +115 -115
- package/docs/release-notes/RELEASE-NOTES-2.3.4.md +69 -69
- package/docs/release-notes/RELEASE-NOTES-2.3.5.md +63 -63
- package/docs/release-notes/RELEASE-NOTES-2.3.6.md +66 -66
- package/docs/release-notes/RELEASE-NOTES-2.3.7.md +59 -59
- package/docs/release-notes/RELEASE-NOTES-2.3.8.md +45 -45
- package/docs/release-notes/RELEASE-NOTES-2.3.9.md +70 -70
- package/docs/release-notes/RELEASE-NOTES-2.8.0.en.md +65 -0
- package/docs/release-notes/RELEASE-NOTES-2.8.0.md +65 -0
- package/docs/release-playbook.md +103 -0
- package/docs/slv-playbook.md +117 -0
- package/docs/test-timing.md +158 -157
- package/docs//346/236/266/346/236/204/345/233/276.md +77 -77
- package/installer.js +792 -792
- package/package.json +13 -3
- package/prompt-corpus-v2/formal-verify-v2.json +2 -2
- package/prompt-corpus-v2/formal-verify-v2.md +4 -0
- package/prompt-corpus-v3/formal-verify-v3.json +7 -7
- package/prompt-corpus-v3/formal-verify-v3.md +14 -0
- package/prompt-corpus-v5/prompt-corpus-v5.json +61 -61
- package/prompt-corpus-v5/prompt-corpus-v5.md +122 -0
- package/scripts/clean-temp.mjs +234 -0
- package/tests/audit-engine-faces.mjs +298 -0
- package/tests/audit-formal-sensitivity.mjs +345 -342
- package/tests/audit-installer-compat.test.mjs +256 -256
- package/tests/audit-math-computation-sensitivity.mjs +1 -1
- package/tests/audit-persona-sensitivity.mjs +323 -323
- package/tests/audit-persona-surface.test.mjs +431 -431
- package/tests/audit-prompt-duplication.mutants.mjs +3 -2
- package/tests/audit-prompt-invariants.mjs +589 -546
- package/tests/audit-registration.mjs +78 -78
- package/tests/audit-spec-traceability.mjs +193 -193
- package/tests/audit-status-report-fields.mjs +172 -172
- package/tests/audit-v5-integrity.mjs +795 -795
- package/tests/audit-v5-sensitivity.mjs +433 -432
- package/tests/e2e-v5-round2.test.mjs +2453 -2426
- package/tests/formal-verify-v2.test.mjs +1806 -1800
- package/tests/formal-verify-v3.test.mjs +1757 -1750
- package/tests/formal-verify-v4.test.mjs +2114 -2106
- package/tests/formal-verify-v5.test.mjs +774 -767
- package/tests/math-computation-discovery.mutants.mjs +3 -3
- package/tests/math-computation-shared.test.mjs +122 -5
- package/tests/math-computation-v2.test.mjs +14 -2
- package/tests/math-computation-v3.test.mjs +14 -2
- package/tests/math-computation-v4.test.mjs +739 -739
- package/tests/prompt-v5-integrity.test.mjs +1291 -1291
- package/tests/run-tests.mjs +393 -332
- package/tests/selfdrive-v5.mjs +560 -560
- package/tests/temp-hygiene.mutants.mjs +80 -0
- package/tests/v2-fix-probes.mutants.mjs +4 -0
- package/tests/v2-fix-probes.test.mjs +1034 -1033
- package/tests/v2v3-interrupt.mutants.mjs +111 -0
- package/tests/v3-fix-probes.mutants.mjs +99 -95
- package/tests/v3-fix-probes.test.mjs +891 -890
- package/tests/v4-final-paper.mutants.mjs +108 -0
- package/tests/v5-institute-fixes.mutants.mjs +218 -190
- package/vibe-math-v2/agent.cordis.yml +376 -376
- package/vibe-math-v2/math-computation.js +17 -15
- package/vibe-math-v2/preset.yml +2 -2
- package/vibe-math-v2/v2/347/232/204/351/242/235/345/244/226/350/246/201/346/261/202.txt +21 -21
- package/vibe-math-v2/vibe-math-v2.js +5078 -5011
- package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +486 -486
- package/vibe-math-v3/agent.cordis.yml +420 -420
- package/vibe-math-v3/math-computation.js +17 -15
- package/vibe-math-v3/preset.yml +2 -2
- package/vibe-math-v3/vibe-math-v3.js +6215 -6149
- package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +649 -649
- package/vibe-math-v4/agent.cordis.yml +438 -438
- package/vibe-math-v4/math-computation.js +17 -15
- package/vibe-math-v4/preset.yml +2 -2
- package/vibe-math-v4/vibe-math-v4.js +4490 -4422
- package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +1015 -1015
- package/vibe-math-v5/math-computation.js +17 -15
- package/vibe-math-v5/vibe-math-v5.js +93 -11
- package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +1728 -1728
- package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +693 -693
|
@@ -1,693 +1,693 @@
|
|
|
1
|
-
# Vibe Math V5 架构图
|
|
2
|
-
|
|
3
|
-
> **状态说明(round-3 补记)**:本文是**设计期文档**,写于 `math_computation`(数学计算工具)、
|
|
4
|
-
> `leanAsync`/`leanJobsMaxParallel`/`leanSearchPaths`(Lean 异步作业与复用)、`paperEditor` 与
|
|
5
|
-
> `paper.lock.json`(最终论文定稿/写锁)等新功能之前;**功能与参数的权威描述以 `docs/` 为准**
|
|
6
|
-
> (`docs/math-computation.md`、`docs/formal-verification.md`、`docs/final-paper.md`、`docs/test-timing.md`),
|
|
7
|
-
> 参数表以 README 的双语「共用参数 / 各预设专属参数」表为准。本文保留其原始设计意图,不再逐条追平。
|
|
8
|
-
|
|
9
|
-
> 本文件是 v5 的图源(GitHub 上 Mermaid 会**原生渲染**)。总览大图另有一张生成好的
|
|
10
|
-
> **SVG**:[`../示例图/框架图-v5.svg`](../示例图/框架图-v5.svg),由
|
|
11
|
-
> [`../docs/generate_framework_diagram_v5.mjs`](../docs/generate_framework_diagram_v5.mjs) 生成
|
|
12
|
-
> (零依赖,`node docs/generate_framework_diagram_v5.mjs`)。
|
|
13
|
-
> 文字规格见 [`实现方案.md`](实现方案.md)。
|
|
14
|
-
|
|
15
|
-
**一句话**:v5 = **一个所办**(对外接口,不研究不投票)+ **一所研究所**(院士 / 常驻研究员 / 临时工)
|
|
16
|
-
+ **一个只做媒介的框架**(中继 · 沉淀 · 计数 · 调度)。
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 1. 总览:三层 + 两个面
|
|
21
|
-
|
|
22
|
-
```mermaid
|
|
23
|
-
flowchart TB
|
|
24
|
-
subgraph L0["👤 所办(会话根代理 / 人)—— 对外接口"]
|
|
25
|
-
OFF["自然语言接口 + 汇报者<br/>不研究 · 不投票<br/>只汇报、转达人的指令<br/>代持平台要求的一次性创建权"]
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
subgraph L1["🏛️ 研究所(所内自治:编制、组织与分派都在成员之间完成)"]
|
|
29
|
-
ACAD["院士 acad<br/>领头人 · 组织与协调中心<br/>L1 全所视图 / L2 分派 / L3 优先级<br/>L4 主持会议 / L5 督导 / L6 调人 / L7 对外"]
|
|
30
|
-
RES["常驻研究员 r-n(有表决权)<br/>continuable 持久会话 · 自主方向<br/>可自主雇佣/解雇自己的临时工"]
|
|
31
|
-
TMP["临时工 t-n(无表决权)<br/>为特定任务临时雇入<br/>可读/可想/可发言/可写自己的库"]
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
subgraph L2["⚙️ 框架 vibe-v5 —— 只是媒介"]
|
|
35
|
-
MSG["消息中继(持久邮箱)<br/>群聊 / 私信 / 致全体表决者<br/>所办通知 / 分派 / 督办 / 框架提示"]
|
|
36
|
-
MTG["会议 / 辩论<br/>议程 · 名册对账 · 随机发言序<br/>与验证互斥 · 看门狗"]
|
|
37
|
-
TASK["任务板(CAS + DAG)<br/>版本号比较交换 · 依赖环检测"]
|
|
38
|
-
VOTE["m 票共识验证<br/>独立初评 → 公开辩论"]
|
|
39
|
-
CTX["上下文与活性<br/>阈值压缩 · 免轮询活动等待 · 心跳"]
|
|
40
|
-
STAFF["编制与雇佣<br/>真实解雇(释放子会话)"]
|
|
41
|
-
SCHED["调度器<br/>优先级 + 并发闸 maxParallel"]
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
subgraph L3["💾 状态与产物"]
|
|
45
|
-
STATE["唯一权威状态源:加固 JSON 文件<br/>State/<研究所>.v5state.json<br/>12 类事件 · 纯折叠 applyV5Event"]
|
|
46
|
-
FS["人可读产物(镜像,勿手改)<br/>Members/<id>/* · Shared/* · Verified/ · Problems/ · State/README.md"]
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
RULE{{"求真门槛<br/>布尔一致 且 布尔票 ≥ m = min(quorumCap, 有表决权人数)<br/>否则留库 + 平均概率 + 辩论录"}}
|
|
50
|
-
|
|
51
|
-
OFF -->|"vibe_v5_* 工具 / /v5 命令"| SCHED
|
|
52
|
-
SCHED -->|"status / report(自然语言汇报)"| OFF
|
|
53
|
-
SCHED -->|"每轮提示词:状态块 + 本轮问句"| ACAD
|
|
54
|
-
SCHED -->|"每轮提示词:状态块 + 本轮问句"| RES
|
|
55
|
-
SCHED -->|"每轮提示词:状态块 + 本轮问句"| TMP
|
|
56
|
-
ACAD -->|"JSON 回执"| SCHED
|
|
57
|
-
RES -->|"JSON 回执"| SCHED
|
|
58
|
-
TMP -->|"JSON 回执"| SCHED
|
|
59
|
-
ACAD -.->|"所内组织:分派 / 优先级 / 督办(虚线 = 不由框架执行)"| RES
|
|
60
|
-
ACAD -.->|"调配"| TMP
|
|
61
|
-
MSG --- SCHED
|
|
62
|
-
MTG --- SCHED
|
|
63
|
-
TASK --- SCHED
|
|
64
|
-
VOTE --- SCHED
|
|
65
|
-
CTX --- SCHED
|
|
66
|
-
STAFF --- SCHED
|
|
67
|
-
SCHED <-->|"commit 事件 / 折叠读状态"| STATE
|
|
68
|
-
SCHED <-->|"读写产物"| FS
|
|
69
|
-
VOTE --> RULE
|
|
70
|
-
RULE -->|"定论"| FS
|
|
71
|
-
|
|
72
|
-
classDef human fill:#f1eefc,stroke:#5b4bb8,stroke-width:1.5px,color:#2b2359
|
|
73
|
-
classDef house fill:#fdf5e2,stroke:#b26a00,stroke-width:1.5px,color:#6b4200
|
|
74
|
-
classDef frame fill:#eaf3fd,stroke:#0b6fb8,stroke-width:1.5px,color:#084d80
|
|
75
|
-
classDef data fill:#eef7f1,stroke:#1f7a52,stroke-width:1.5px,color:#125a3c
|
|
76
|
-
classDef gate fill:#fdeef0,stroke:#b3202c,stroke-width:2px,color:#7d1620
|
|
77
|
-
class OFF human
|
|
78
|
-
class ACAD,RES,TMP house
|
|
79
|
-
class MSG,MTG,TASK,VOTE,CTX,STAFF,SCHED frame
|
|
80
|
-
class STATE,FS data
|
|
81
|
-
class RULE gate
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## 2. 成员生命周期
|
|
87
|
-
|
|
88
|
-
```mermaid
|
|
89
|
-
stateDiagram-v2
|
|
90
|
-
direction LR
|
|
91
|
-
[*] --> provisioning : newMember(分配代号,代号永不复用)
|
|
92
|
-
provisioning --> active : spawnMember 成功<br/>先落盘编制、再构造入职提示词
|
|
93
|
-
provisioning --> failed : startContinuable 抛错
|
|
94
|
-
active --> active : 一轮结束(subagent/end)→ 回执 → 调度
|
|
95
|
-
active --> dismissed : fire(真实释放子会话 + 收回任务 + 丢弃邮件)
|
|
96
|
-
dismissed --> [*]
|
|
97
|
-
failed --> [*] : 在 [未就位] 里对全所可见
|
|
98
|
-
|
|
99
|
-
note right of active
|
|
100
|
-
每轮:框架发「状态块 + 本轮问句」,
|
|
101
|
-
成员回一个 JSON(say/progress/record/
|
|
102
|
-
verdict/task_*/hire/fire/reject_assign/…)
|
|
103
|
-
end note
|
|
104
|
-
note right of dismissed
|
|
105
|
-
未完成的任务自动释放回板;
|
|
106
|
-
代号永不复用,重新雇佣会得到新代号
|
|
107
|
-
end note
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## 3. 一轮唤醒的时序(唯一的推进驱动)
|
|
113
|
-
|
|
114
|
-
```mermaid
|
|
115
|
-
sequenceDiagram
|
|
116
|
-
autonumber
|
|
117
|
-
participant S as 调度器(框架代码)
|
|
118
|
-
participant M as 成员(continuable 子会话)
|
|
119
|
-
participant L as 状态文件(State/<研究所>.v5state.json)
|
|
120
|
-
|
|
121
|
-
S->>S: schedulePass:按优先级挑一个成员
|
|
122
|
-
S->>S: 构造本轮提示词(收件箱:先构造、后 ack —— 仅发送成功才 `await ackPending(`)
|
|
123
|
-
S->>M: 【轮次】+ 状态块(编制/m/我的任务/新消息)+ 回执契约
|
|
124
|
-
M->>M: 读同事的库 · 推导 · 写自己的 Progress/ 与卡片
|
|
125
|
-
M-->>S: subagent/end + 单个 JSON 回执
|
|
126
|
-
S->>L: commit 事件(整份快照串行写入;读前必先 load)
|
|
127
|
-
S->>S: handleReply:发言 / 入库 / 任务 / 提议 / 投票 / 雇佣
|
|
128
|
-
S->>S: 记 contextPct;必要时发压缩指令
|
|
129
|
-
S->>S: scheduleNext()(蹦床:同一时刻只有一个调度 pass)
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
> 关键点:**成员的一轮结束是唯一的推进驱动**。没有轮询;`vibe_v5_wait` 是一次性活动等待,
|
|
133
|
-
> 心跳只是最后的兜底,且每次唤醒后**永远重新武装**,所以调度器不会永久冻结。
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## 4. 共识验证状态机(m 票布尔一致)
|
|
138
|
-
|
|
139
|
-
```mermaid
|
|
140
|
-
stateDiagram-v2
|
|
141
|
-
[*] --> queued : 任何成员 propose_verify
|
|
142
|
-
queued --> initial : armNextVerify(会议进行中则排队等待)
|
|
143
|
-
initial --> debate : 所有表决者都答完<br/>但未定论且轮次 < verdictMaxRounds
|
|
144
|
-
debate --> debate : 重新投票(history 存上一轮)
|
|
145
|
-
initial --> true_ : 布尔票 ≥ m 且全为 1
|
|
146
|
-
initial --> false_ : 布尔票 ≥ m 且全为 0
|
|
147
|
-
debate --> true_
|
|
148
|
-
debate --> false_
|
|
149
|
-
initial --> undecided : 轮次用尽,或布尔票不足 m,或出现 1 与 0 分歧
|
|
150
|
-
debate --> undecided
|
|
151
|
-
true_ --> [*] : 写 Verified/卡 + 改写来源卡 + 辩论录
|
|
152
|
-
false_ --> [*] : 同上(结论为假)
|
|
153
|
-
undecided --> [*] : 留原库 + 全组平均概率 + 完整辩论录(不强行裁决)
|
|
154
|
-
|
|
155
|
-
note right of initial
|
|
156
|
-
票是 [0,1] 的数值:
|
|
157
|
-
恰好 1 = 断言为真;恰好 0 = 断言为假;
|
|
158
|
-
严格介于两者 = 弃权/存疑
|
|
159
|
-
(不计入 m,但计入平均)
|
|
160
|
-
end note
|
|
161
|
-
note left of undecided
|
|
162
|
-
看门狗:超过 2×activityTimeoutMs
|
|
163
|
-
没有新票 → 放弃该验证并回到自组织
|
|
164
|
-
end note
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**判定规则(`judgeVerdict`)**:任何一张反向布尔票都**阻塞**定论 —— 少数派无法靠别人弃权
|
|
168
|
-
把结论推过去。`quorumMode: "all-unanimous"` 可切回 v4 的"全体有表决权者一致"口径。
|
|
169
|
-
|
|
170
|
-
### 4.1 Lean 形式化验证(可调参数 `formalVerify`)
|
|
171
|
-
|
|
172
|
-
完整契约见 [`../docs/formal-verification.md`](../docs/formal-verification.md)。**它改变的不是"更严格一点",
|
|
173
|
-
而是审查对象本身**:m 票一致是**共识**(排除不了共同误解),Lean 通过是**机器核对**,
|
|
174
|
-
于是剩下的唯一不确定项缩小为"Lean 代码是否忠实于命题原文"。
|
|
175
|
-
|
|
176
|
-
```mermaid
|
|
177
|
-
stateDiagram-v2
|
|
178
|
-
direction LR
|
|
179
|
-
[*] --> none : 对象被记录 / 被提议验证
|
|
180
|
-
none --> attempted : lean_run 跑了但未通过(记录编译器输出)
|
|
181
|
-
none --> attempted : 回执 formal.decision='used'
|
|
182
|
-
attempted --> passed : lean_archive kind='proof' 且该文件运行 exit 0
|
|
183
|
-
attempted --> blocked : lean_archive kind='blocked'(note 必填)
|
|
184
|
-
none --> blocked : 同上
|
|
185
|
-
passed --> attempted : 回执 formal.decision='defect'(忠实性缺陷)<br/>清空 proof · 撤回 Verified/Lean/<id>.lean · 写 Formal/TODO.md · 公告
|
|
186
|
-
blocked --> attempted : 同上(缺陷优先于阻塞判断)
|
|
187
|
-
passed --> [*] : 归档到 Verified/Lean/<id>.lean
|
|
188
|
-
blocked --> [*] : 记入 Formal/Index.md 的难度判断列
|
|
189
|
-
|
|
190
|
-
note right of passed
|
|
191
|
-
验证提示词随之切换为
|
|
192
|
-
「你不需要重新检查推导,
|
|
193
|
-
任务是忠实性审查」
|
|
194
|
-
end note
|
|
195
|
-
note left of attempted
|
|
196
|
-
忠实性缺陷不是"命题为假"(契约 §4.1):
|
|
197
|
-
表决者不得投 0,只给 0 与 1 之间的弃权值;
|
|
198
|
-
require 档本轮因此不定论(formal-required),
|
|
199
|
-
encourage 档没有门禁,靠该弃权值阻止一致结论。
|
|
200
|
-
end note
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
```mermaid
|
|
204
|
-
flowchart TB
|
|
205
|
-
A["全票一致判真 / 判假"] --> B{"formalVerify 模式"}
|
|
206
|
-
B -->|"off"| OK["照常写 Verified/ 卡片"]
|
|
207
|
-
B -->|"encourage"| OK
|
|
208
|
-
B -->|"require"| C{"formal.status ∈ {passed, blocked}?"}
|
|
209
|
-
C -->|"是"| OK2["照常写卡片,并在卡片上记 - 形式化: …"]
|
|
210
|
-
C -->|"否"| D["★ 本次裁定不生效:记为 undecided<br/>原因 formal-required|写 Formal/TODO.md<br/>群聊公告|不写 Verified/ 卡片"]
|
|
211
|
-
D --> E["完成形式化(kind='proof')或记录阻塞(kind='blocked')后重新提议验证"]
|
|
212
|
-
E --> A
|
|
213
|
-
|
|
214
|
-
style D fill:#fdeef0,stroke:#b3202c,stroke-width:2px
|
|
215
|
-
style OK2 fill:#eef7f1,stroke:#1f7a52
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
**三档**:`off`(默认,**真正的无操作**:不注入任何 Lean 文本、不设门禁、不改验证流程)|
|
|
219
|
-
`encourage`(按实现难度自行决定,不设门禁)|
|
|
220
|
-
`require`(真/假结论必须先有 Lean 通过或**显式、可审计**的阻塞记录)。
|
|
221
|
-
|
|
222
|
-
> `off` 的"无操作"约束的是**框架主动做的事**(提示词、门禁、验证流程、回执里的 formal 通道)。
|
|
223
|
-
> 三个 Lean 工具仍然无条件注册、任何档位下都可被代理或人**主动**调用,并且会照实执行与记录
|
|
224
|
-
> ——"调用是一个明确的动作,不会被静默忽略"。
|
|
225
|
-
|
|
226
|
-
**"根据实现难度决定不做"是被允许的,但必须说出来**:`blocked` 记录要求 `note` 非空 ——
|
|
227
|
-
决定权在代理,静默跳过不行。
|
|
228
|
-
|
|
229
|
-
**路径**:工作文件 `Formal/<对象id>.lean`|**归档证明 `Verified/Lean/<对象id>.lean`**(与定论卡片同处
|
|
230
|
-
`Verified/`)|可复用定义 `<VibeMath根>/Formal/Lib/`|已证引理 `<VibeMath根>/Formal/Proved/`。
|
|
231
|
-
跨项目复用是这套设计的核心收益,因此 Lean 路径守卫的边界是 **VibeMath 根**而不是研究所根
|
|
232
|
-
(爬出研究所但仍在 VibeMath 内是合法的,那正是全局库所在)。
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
|
-
## 5. 会议流程(与验证互斥)
|
|
237
|
-
|
|
238
|
-
```mermaid
|
|
239
|
-
flowchart TB
|
|
240
|
-
A["任何人 vibe_v5_meeting"] --> B{"院士或所办?"}
|
|
241
|
-
B -->|"否(含临时工)"| C["只能提议:框架转呈全体表决者<br/>署名 = 真实提议人"]
|
|
242
|
-
B -->|"是"| D{"已有验证进行中?"}
|
|
243
|
-
D -->|"是"| E["暂存 pendingMeeting<br/>(只保留第一条,后到者不覆盖)"]
|
|
244
|
-
D -->|"否"| F["真正召开:写纪要头 + 公告群聊"]
|
|
245
|
-
E -->|"验证清空后"| F
|
|
246
|
-
F --> G["按随机顺序逐个唤醒发言<br/>每人看到此前已发言者的意见"]
|
|
247
|
-
G --> H{"全部在册成员都发言了?"}
|
|
248
|
-
H -->|"否"| I["继续收集(跳过仍在忙的人)<br/>看门狗:2×activityTimeoutMs 无新发言 → 放弃"]
|
|
249
|
-
I --> H
|
|
250
|
-
H -->|"是"| J["收口:汇总表决 / 讨论结论<br/>检查是否全体认为已解决"]
|
|
251
|
-
J --> K["暂存会议补开(若有)"]
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
**互斥的双向保证**(v2.2.2 起对称):
|
|
255
|
-
- `startMeeting`:验证进行中 → **会议暂存**;
|
|
256
|
-
- `armNextVerify`:会议进行中 → **验证排队**(此前只做了前一半,成员在会上提议验证会真的
|
|
257
|
-
并发启动第二个共识过程,进而饿死会议的看门狗时钟)。
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## 6. 调度优先级(`schedulePass`)
|
|
262
|
-
|
|
263
|
-
```mermaid
|
|
264
|
-
flowchart TB
|
|
265
|
-
S["一轮结束 / 提议 / 定时器到期 → scheduleNext()(蹦床:只有一个 pass 在跑)"] --> P1
|
|
266
|
-
P1{"有进行中的会议?"} -->|"是"| M["continueMeetingRound()<br/>缺人则继续问;齐了就收口"]
|
|
267
|
-
P1 -->|"否"| P2{"有进行中的验证?"}
|
|
268
|
-
P2 -->|"是"| V["continueVerifyRound()<br/>缺票则继续问;齐了就裁定"]
|
|
269
|
-
P2 -->|"否"| P3["armNextVerify():启动队列里的下一个验证"]
|
|
270
|
-
P3 --> P4{"有暂存会议?"}
|
|
271
|
-
P4 -->|"是"| P5["beginMeeting()"]
|
|
272
|
-
P4 -->|"否"| P6["按 maxParallel 填并发预算:<br/>① 已认领/被分派的在办任务(按 activityTimeoutMs 节流)<br/>② 加急邮件(私信/分派/督办/框架提示)<br/>③ 到期群聊摘要"]
|
|
273
|
-
P6 --> P7{"本所停滞超过 stallAutoMeetingMs<br/>且无人在跑?"}
|
|
274
|
-
P7 -->|"是"| P8["自动召集一次同步会议(只促成,不指派)"]
|
|
275
|
-
P7 -->|"否"| P9{"最久未动者已空闲 ≥ activityTimeoutMs?"}
|
|
276
|
-
P9 -->|"是"| P10["推一把:有在办任务 → 常规工作轮;否则 → 心跳轮"]
|
|
277
|
-
P9 -->|"否"| P11["armDigest() + armHeartbeat()"]
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
---
|
|
281
|
-
|
|
282
|
-
## 7. 状态:纯折叠 + 唯一后端(加固 JSON 文件)
|
|
283
|
-
|
|
284
|
-
```mermaid
|
|
285
|
-
flowchart LR
|
|
286
|
-
subgraph EV["12 类事件"]
|
|
287
|
-
E["institute · member · task · message · delivered ·<br/>meeting · debate · verdict · formal · queue · counters · progress"]
|
|
288
|
-
end
|
|
289
|
-
EV --> FOLD["applyV5Event(纯函数折叠,只此一份)"]
|
|
290
|
-
FOLD --> ST["V5State<br/>{ institutes, order, diagnostics }"]
|
|
291
|
-
ST --> R1["读:先 ready()(load),再 state()"]
|
|
292
|
-
ST --> R2["未知/损坏事件 → 跳过 + 记入 diagnostics<br/>(可用性优先,绝不因一条坏事件卡死全场)"]
|
|
293
|
-
|
|
294
|
-
subgraph B1["唯一后端:加固 JSON 文件"]
|
|
295
|
-
P1["State/<研究所>.v5state.json<br/>事件只在内存里折叠,读前必先 load"]
|
|
296
|
-
P2["每次提交把整份快照经一条 promise 链<br/>串行写入:后写者不会用旧子集覆盖新状态"]
|
|
297
|
-
end
|
|
298
|
-
R1 --> B1
|
|
299
|
-
|
|
300
|
-
style FOLD fill:#eaf3fd,stroke:#0b6fb8
|
|
301
|
-
style P1 fill:#eef7f1,stroke:#1f7a52
|
|
302
|
-
style P2 fill:#eef7f1,stroke:#1f7a52
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
**为什么不再用会话日志投影**:DSH 的会话持久化**拒绝加载**日志里带未知事件类型的会话 ——
|
|
306
|
-
除非写入方把它标成 `ignorable: true`,而 `Session.append` **无法设置**该字段。所以把 `vibe5/*`
|
|
307
|
-
事件追加进根会话,等于让**用户自己的会话无法恢复**。研究所状态因此只落在
|
|
308
|
-
`State/<研究所>.v5state.json` 这一个加固 JSON 文件里;`sessionProjections` 单元注册、投影后端与
|
|
309
|
-
`sessions.flush` 调用都已删除,插件也不再注入 `sessions`。
|
|
310
|
-
|
|
311
|
-
**为什么仍然安全**:v4 的 `State/*.json` 直写带来"损坏静默覆盖 / 并发丢写 / 跨进程陈旧快照"
|
|
312
|
-
一整类问题。v5 用同一份纯折叠 + 整份快照串行写入 + 写前必 load 消掉它们,跨进程与同进程
|
|
313
|
-
恢复**走同一条代码路径**(都是"读文件 → 折叠")。
|
|
314
|
-
|
|
315
|
-
---
|
|
316
|
-
|
|
317
|
-
## 8. 提示词是怎么构成的(成员读到的文字 = 产品)
|
|
318
|
-
|
|
319
|
-
```mermaid
|
|
320
|
-
flowchart LR
|
|
321
|
-
subgraph P["人设 persona(入职时冻结,随会话持久化,压缩后依然有效)"]
|
|
322
|
-
CH["公共规章(十节)<br/>编制与同事 · 通用规章 · 资料库与 progress<br/>组织与协调 · 表决规则 · 每轮节奏<br/>雇佣解雇 · 任务板 · 上下文纪律 · 停止条件"]
|
|
323
|
-
end
|
|
324
|
-
subgraph R["每轮提示词(临时,短)"]
|
|
325
|
-
ST["状态块<br/>[状态] 你是 <代号>(职位)|轮次|m|表决者数<br/>[在册] … [未就位] …<br/>[任务板] … [新到的消息/通知] …"]
|
|
326
|
-
ASK["本轮问句(常规 / 心跳 / 会议 / 表决)<br/>+ 收件箱(**先构造、后 ack**:构造阶段只做去重注入 `inboxInjected`/`inboxSuppressed`;**仅发送成功才确认** `await ackPending(`;**同一轮内不重复 prepend**)"]
|
|
327
|
-
SPEC["回执契约(按职位裁剪)<br/>say / progress / record / propose_verify / verdict<br/>propose_meeting / task_* / reject_assign / input<br/>hire / fire / vote_solved / solved / contextPct / compacted"]
|
|
328
|
-
end
|
|
329
|
-
P --> MEM["成员(子会话)"]
|
|
330
|
-
R --> MEM
|
|
331
|
-
MEM --> OUT["单个 JSON 回执"]
|
|
332
|
-
|
|
333
|
-
style CH fill:#fdf5e2,stroke:#b26a00
|
|
334
|
-
style ST fill:#eaf3fd,stroke:#0b6fb8
|
|
335
|
-
style ASK fill:#eaf3fd,stroke:#0b6fb8
|
|
336
|
-
style SPEC fill:#eaf3fd,stroke:#0b6fb8
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
**身份不变式(有测试与语料保证)**:
|
|
340
|
-
|
|
341
|
-
- 提示词里的身份 = 这条提示词**实际发给的成员**;题头、`[状态]`、人设资料库路径三者必须一致;
|
|
342
|
-
- 成员**先落盘进编制、再构造**它的入职提示词(否则会漏掉自己、并按加入前的编制算 m);
|
|
343
|
-
- 章程快照**冻结在入职时**(它写着"你入职时的在册编制"),重建会话时原样复用;
|
|
344
|
-
- 会话重建框为 `【会话重建】`,**不**自称"刚入职";
|
|
345
|
-
- 领袖叙事跟随真实编制:没有院士时,章程不得声称存在院士或承诺其派活;
|
|
346
|
-
- 框头按**真实来源**标注(所办分派 ≠ 院士分派;督办 ≠ 分派;致全体表决者 ≠ 私信);
|
|
347
|
-
- 框架反馈有独立发送者(`【框架提示】`),且**一次提示词只投递一条消息**。
|
|
348
|
-
|
|
349
|
-
---
|
|
350
|
-
|
|
351
|
-
## 9. 任务板(compare-and-set + DAG)
|
|
352
|
-
|
|
353
|
-
```mermaid
|
|
354
|
-
flowchart LR
|
|
355
|
-
A["task_create<br/>subject / description / blocked_by / write_scopes / priority"] --> B["pending"]
|
|
356
|
-
B -->|"task_claim(全部依赖已完成才可认领)"| C["in_progress"]
|
|
357
|
-
C -->|"complete"| D["completed"]
|
|
358
|
-
C -->|"release"| B
|
|
359
|
-
D -->|"reopen"| B
|
|
360
|
-
B -->|"delete(有依赖者则拒绝)"| E["deleted"]
|
|
361
|
-
C -->|"reassign(仅院士/所办)"| C
|
|
362
|
-
F["任何修改都要带 expected_revision<br/>版本不符 → V5_TASK_STALE_REVISION"] -.-> A
|
|
363
|
-
G["owner 被解雇 → releaseTasksOf 自动收回"] -.-> B
|
|
364
|
-
|
|
365
|
-
style B fill:#eaf3fd,stroke:#0b6fb8
|
|
366
|
-
style C fill:#fdf5e2,stroke:#b26a00
|
|
367
|
-
style D fill:#eef7f1,stroke:#1f7a52
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
---
|
|
371
|
-
|
|
372
|
-
## 10. 职权矩阵
|
|
373
|
-
|
|
374
|
-
| 动作 | 院士 | 常驻研究员 | 临时工 | 所办 |
|
|
375
|
-
|---|---|---|---|---|
|
|
376
|
-
| 发言 / 私信 / 致全体表决者 | ✅ | ✅ | ✅ | ✅(所办通知) |
|
|
377
|
-
| 写自己的成果库 / 认领任务 | ✅ | ✅ | ✅ | ❌(不是成员) |
|
|
378
|
-
| **表决**(进 `Verified/`) | ✅ 一票 | ✅ 一票 | ❌ | ❌ |
|
|
379
|
-
| 提议验证 / 提议开会 | ✅ | ✅ | ✅ | ✅(可直接召开) |
|
|
380
|
-
| **直接召开会议** | ✅ | ❌(只能提议) | ❌ | ✅ |
|
|
381
|
-
| **分派任务**(`vibe_v5_assign`) | ✅ | ❌ | ❌ | ✅ |
|
|
382
|
-
| 设定优先级(`vibe_v5_prioritize`) | ✅ | ❌ | ❌ | ✅ |
|
|
383
|
-
| 督导(`vibe_v5_nudge`) | ✅ | ❌ | ❌ | ✅ |
|
|
384
|
-
| **雇佣临时工** | ✅ | ✅(自己的) | ❌ | ✅ |
|
|
385
|
-
| **解雇临时工** | ✅(任何) | ✅(自己雇的) | ❌ | ✅ |
|
|
386
|
-
| 增聘 / 解聘**常驻研究员** | ❌(建议) | ❌(建议) | ❌ | ✅ |
|
|
387
|
-
| 暂停 / 恢复 / 停止 / 调参 | ❌ | ❌ | ❌ | ✅ |
|
|
388
|
-
|
|
389
|
-
> **分派不改变真假**:院士能分派工作、定优先级,但不能让任何断言因此变正确 ——
|
|
390
|
-
> 对象进 `Verified/` 仍然只能靠 m 票布尔一致。
|
|
391
|
-
|
|
392
|
-
---
|
|
393
|
-
|
|
394
|
-
## 11. 目录结构与制品
|
|
395
|
-
|
|
396
|
-
```text
|
|
397
|
-
<会话工作区>/VibeMath/Projects/<项目>/Institutes/<研究所>/
|
|
398
|
-
├─ Institutes.md # 编制镜像(人读快照,勿手改)
|
|
399
|
-
├─ Problems/<id>.md # 原问题
|
|
400
|
-
├─ Problems/conclusion.md # 结题记录(全体有表决权者一致认为已解决时生成)
|
|
401
|
-
├─ Members/<代号>/
|
|
402
|
-
│ ├─ Progress/progress.md # 研究日志(叙述体,可追加;压缩后恢复状态的主要依据)
|
|
403
|
-
│ ├─ Propos/<id>.md # 命题
|
|
404
|
-
│ ├─ Methods/<id>.md # 方法 / 理论 / 工具
|
|
405
|
-
│ └─ Subproblems/<id>.md # 子问题
|
|
406
|
-
├─ Shared/
|
|
407
|
-
│ ├─ Chat/<日期>.md # 群聊记录
|
|
408
|
-
│ ├─ Meetings/<mt-id>.md # 会议纪要(含表决小节)
|
|
409
|
-
│ ├─ Debates/<对象>.md # 辩论录(各轮票与理由 + 平均概率)
|
|
410
|
-
│ ├─ TaskBoard.md # 任务板镜像
|
|
411
|
-
│ └─ State-of-institute.md # 各成员对"是否已解决"的判断快照
|
|
412
|
-
├─ Verified/<类型>/<id>.md # 定论(只读;只有它能被当作已确立)
|
|
413
|
-
└─ State/
|
|
414
|
-
├─ README.md # 说明"权威状态就是本目录的 <研究所>.v5state.json"
|
|
415
|
-
└─ <研究所>.v5state.json # 唯一权威状态源(纯折叠快照;读前必 load,整份串行写入)
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
**可信分层**:只有 `Verified/` 与标注"已验证·真/假"的卡片**绝对可信**;
|
|
419
|
-
`Progress/`、`Methods/`、未定论命题、他人推测都只是**经验参考**,引用时必须注明"未验证"。
|
|
420
|
-
|
|
421
|
-
---
|
|
422
|
-
|
|
423
|
-
## 12. 不变式速查(这些都有测试守着)
|
|
424
|
-
|
|
425
|
-
| 不变式 | 由谁保证 |
|
|
426
|
-
|---|---|
|
|
427
|
-
| 提示词身份 = 收件人;题头/状态块/人设三者一致 | `prompt-v5-integrity.test.mjs`(逐条断言 + 语料) |
|
|
428
|
-
| 成员先落盘进编制、再构造入职提示词 | 同上 |
|
|
429
|
-
| 章程冻结在入职时;重建会话自称"重建" | 同上 |
|
|
430
|
-
| 无院士时不出现任何院士叙事 | 同上 |
|
|
431
|
-
| 框头署名 = 真实来源 | 同上 |
|
|
432
|
-
| 一次提示词不重复投递同一条消息 | 同上 |
|
|
433
|
-
| 回执契约涵盖框架真正处理的每个字段 | 同上 |
|
|
434
|
-
| 只有 ≥ m 张一致的布尔票才能定论 | `selfdrive-v5.mjs` / `e2e-v5-round2.test.mjs` |
|
|
435
|
-
| 反向布尔票阻塞结论 | 同上 |
|
|
436
|
-
| 临时工无表决权、不能雇佣 | 同上 |
|
|
437
|
-
| 只有院士/所办能分派、定优先级、督办 | 同上 |
|
|
438
|
-
| 会议与验证互斥(双向) | `prompt-v5-integrity.test.mjs` |
|
|
439
|
-
| `formalVerify` 默认 `off` 是**真正的无操作**;非法值只回退到 `off` | `formal-verify-v5.test.mjs` |
|
|
440
|
-
| Lean 通过后,审查对象切换为**忠实性**("你不需要重新检查推导") | `formal-verify-v5.test.mjs` |
|
|
441
|
-
| `require` 模式:无形式化记录的真/假结论被记为未定论 + 形式化待办,不写 `Verified/` | `formal-verify-v5.test.mjs` |
|
|
442
|
-
| 「因难度决定不做形式化」必须显式记录原因(`note` 非空) | `formal-verify-v5.test.mjs` |
|
|
443
|
-
| 忠实性缺陷**不得**记成"命题为假":撤回 `passed`、删除 `Verified/Lean/<id>.lean`、写待办,`require` 档不定论 | `formal-verify-v5.test.mjs` |
|
|
444
|
-
| 命题的证明归档到 `Verified/Lean/<id>.lean`;可复用定义归档到**跨项目** `Formal/Lib/` | `formal-verify-v5.test.mjs` |
|
|
445
|
-
| Lean 路径守卫按词法归一 `..`(字符串前缀检查会被穿越绕过) | `formal-verify-v5.test.mjs` |
|
|
446
|
-
| 解雇是真实的(释放子会话、收回任务) | `selfdrive-v5.mjs` |
|
|
447
|
-
| 跨进程恢复不丢研究所 | `e2e-v5-round2.test.mjs` |
|
|
448
|
-
| 每条不变式都有能让套件变红的探针 | `audit-v5-sensitivity.mjs` + [`../docs/AUDIT-CHECKLIST.md`](../docs/AUDIT-CHECKLIST.md) |
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
---
|
|
452
|
-
|
|
453
|
-
## 13. 从 README 移入的 v5 说明(原文保留)
|
|
454
|
-
|
|
455
|
-
> 本节内容原先在 README / README.en.md 的「Vibe Math V5(研究所体系)」小节里。为让 README 中四套架构的篇幅均衡,
|
|
456
|
-
> 这些段落移入本文件(README 只保留一句话摘要与指向本节的链接)。**文字未改写,仅在此保留**;
|
|
457
|
-
> 其中与本篇 §1–§12 重叠的部分是刻意保留的原文,便于对照。
|
|
458
|
-
|
|
459
|
-
### 13.1 中文原文(原 README.md)
|
|
460
|
-
|
|
461
|
-
#### 职位与职权
|
|
462
|
-
|
|
463
|
-
| 职位 | 代号 | 表决权 | 职权 |
|
|
464
|
-
|---|---|---|---|
|
|
465
|
-
| **院士**(领头人) | `acad` | ✅ 一票,**与他人等重** | **组织与协调中心**:建立全所视图(`overview`)、把原问题拆解成任务并**分派**(`assign`)、设定优先级(`prioritize`)、召集并主持会议(`convene`)、督导进度(`nudge`)、调配临时工、对外汇报。**不能单方面定论**,也不能自我扩张编制。 |
|
|
466
|
-
| **常驻研究员** | `r-<n>` | ✅ 一票 | 在自己的方向上深入钻研;**可自主雇佣/解雇自己的临时工**;向院士汇报进展、接受其组织与分派(**有据理反对权**)。 |
|
|
467
|
-
| **临时工** | `t-<n>` | ❌ | 为特定任务临时雇入:可读/可想/可发言/可写自己的成果库/可认领或被分派任务;由**雇主或院士**解雇。代号永不复用。 |
|
|
468
|
-
| **所办**(主助手) | —— | ❌ | **不参与研究、不投票**。只汇报、把人的话翻译成工具调用,并代持平台要求的创建权(建所/增聘常驻研究员)。 |
|
|
469
|
-
|
|
470
|
-
**分工一句话**:**组织由院士负责,但判断属于每个人自己** —— 院士分派的是**工作**,不是**结论**。
|
|
471
|
-
|
|
472
|
-
#### 求真规则(V5 的核心)
|
|
473
|
-
|
|
474
|
-
一个对象进入 `Verified/` 必须**同时**满足:
|
|
475
|
-
|
|
476
|
-
1. 至少有 **m = min(`quorumCap`, 在册有表决权人数)** 名有表决权者投出**布尔概率值**;
|
|
477
|
-
2. 这些票**全部**是 `1`(绝对为真)或**全部**是 `0`(绝对为假)。
|
|
478
|
-
|
|
479
|
-
票是 `[0,1]` 的数值:**严格介于 0 与 1 之间 = 弃权/存疑**(不计入 m,但计入全组平均概率)。
|
|
480
|
-
**任何一张反向布尔票都会阻塞定论** —— 少数派无法靠别人弃权把结论推过去。
|
|
481
|
-
未达门槛的对象**留在原库**,并附上全组平均概率与完整辩论录,**不强行裁决**。
|
|
482
|
-
|
|
483
|
-
表决两段式:先【独立初评】(彼此不可见),未定论再进入【公开辩论】后重投,轮次上限 `verdictMaxRounds`。
|
|
484
|
-
`quorumMode: "all-unanimous"` 可切回 v4 的"全体一致"口径。
|
|
485
|
-
|
|
486
|
-
#### 运行机制
|
|
487
|
-
|
|
488
|
-
- **通信**:群聊(扇出给每位其他成员)、私信、只投给有表决权者;消息**逐收件人持久化**,
|
|
489
|
-
先落盘再投递,群聊按 `chatDigestMs` / `chatDigestMax` 合批摘要(私信/会议/表决不合批)。
|
|
490
|
-
一切所内通信都经框架中继(DSH 的邻接限制不允许成员之间直接发消息),但**署名始终是真实发送者**。
|
|
491
|
-
- **会议与验证互斥**(双向):验证进行中会议请求会**暂存**;会议进行中提出的验证会**排队**——
|
|
492
|
-
两个共识过程永不同时进行,避免互相饿死看门狗时钟。会议按**随机发言序**逐个收集意见,
|
|
493
|
-
收口时汇总表决并检查是否全体认为已解决。
|
|
494
|
-
- **任务板**:compare-and-set(改前必须读到最新 `expected_revision`)+ 依赖 DAG(认领前必须全部依赖已完成,
|
|
495
|
-
环检测拒绝坏依赖)+ 写范围重叠告警;owner 被解雇时任务自动收回。
|
|
496
|
-
- **雇佣 / 解雇**:院士与常驻研究员都可雇**自己的**临时工,配额按人(`maxTempPerMember`)与全所
|
|
497
|
-
(`maxTempTotal`)双限;解雇是**真实的**——取消在途回合、释放常驻子会话、收回任务、丢弃未投递邮件。
|
|
498
|
-
- **活性**:主驱动是**一次性活动等待**(`vibe_v5_wait`,不轮询);调度器按优先级推进
|
|
499
|
-
(进行中的会议/验证 → 队列中的验证 → 暂存会议 → 在办任务 → 加急邮件 → 群聊摘要 → 停滞自动开会 → 兜底心跳),
|
|
500
|
-
并发受 `maxParallel` 闸门限制;任务板的"推一把"按 `activityTimeoutMs` **节流**。
|
|
501
|
-
- **看门狗**:会议/验证超过 2×`activityTimeoutMs` 没有新发言/新票 → 放弃它并回到自组织;
|
|
502
|
-
心跳**每次唤醒后都重新武装**,所以调度器不会永久冻结。
|
|
503
|
-
- **上下文**:达 `compactThreshold`(%)或累计 `compactAfterRounds` 轮时要求成员把工作状态浓缩进
|
|
504
|
-
`Progress/`;**规章在 persona 里**,压缩后依然有效,不需要每轮重申。
|
|
505
|
-
- **停止**:**仅当全体有表决权者都认为原问题已解决**才结题(写 `Problems/conclusion.md`)。
|
|
506
|
-
|
|
507
|
-
#### 状态与持久化
|
|
508
|
-
|
|
509
|
-
研究所状态只写在**研究所目录下的加固 JSON** `State/<研究所>.v5state.json` 里:框架的副作用只是把 11 类事件
|
|
510
|
-
交给 `applyV5Event` 纯折叠成状态,再把整份快照**串行落盘**(每条序列化链只服务一个文件)。因此
|
|
511
|
-
|
|
512
|
-
- **零 token 成本**:这些事件**不进模型上下文**,不占成员的对话预算;
|
|
513
|
-
- **恢复走同一条代码路径**:跨进程重启与同进程 abort 后 resume 都靠"读前必 load",两条路径是同一段代码;
|
|
514
|
-
- v4 的 `State/*.json` 直写带来的"损坏静默覆盖 / 并发丢写 / 跨进程陈旧快照"这一整类问题在构造上被消除。
|
|
515
|
-
|
|
516
|
-
**v5 不再把研究所事件写进宿主会话日志**:DSH 的会话持久化遇到日志里不认识的事件类型会**拒绝加载整个会话**
|
|
517
|
-
(除非写入方标记 `ignorable: true`,而 `Session.append` 无法设置该字段),那会让**你自己的会话在下次恢复时打不开**。
|
|
518
|
-
除状态文件之外的文件(成员成果库、群聊、会议纪要、辩论录、编制镜像、任务板镜像)都是**人可读产物**,
|
|
519
|
-
手工改坏不会破坏研究所。
|
|
520
|
-
|
|
521
|
-
#### 提示词是怎么构成的
|
|
522
|
-
|
|
523
|
-
成员的"人设"(persona)承载**十节公共规章**(编制与同事、通用规章、资料库与 progress 格式、
|
|
524
|
-
组织与协调、表决规则、每轮节奏、雇佣解雇、任务板、上下文纪律、停止条件),在**入职时冻结**并随会话持久化;
|
|
525
|
-
每轮提示词只携带短小的**状态块**(我是谁 / 轮次 / m / 在册名单 / 我的任务 / 新到的消息)、**本轮问句**
|
|
526
|
-
和**回执契约**。回执契约里框架真正处理的每个字段都会出现并按职位裁剪
|
|
527
|
-
(临时工没有 `verdict`/`hire`/`fire`;非院士没有 `assign`/`prioritize`/`nudge`/`convene_meeting`)。
|
|
528
|
-
|
|
529
|
-
框架把"成员读到的文字"当作产品来保证:身份**显式传递、绝不猜测**;成员**先落盘进编制、再构造**它的入职
|
|
530
|
-
提示词;章程快照冻结在入职时,会话重建会框为 `【会话重建】` 而不是"刚入职";没有院士时不出现任何院士叙事;
|
|
531
|
-
消息框头按**真实来源**标注(所办分派 ≠ 院士分派;督办 ≠ 分派);框架反馈有独立发送者,
|
|
532
|
-
且**一次提示词只投递一条消息**。
|
|
533
|
-
|
|
534
|
-
#### 目录结构(研究所)
|
|
535
|
-
|
|
536
|
-
```
|
|
537
|
-
<会话工作区>/VibeMath/Projects/<项目>/Institutes/<研究所>/
|
|
538
|
-
├─ Institutes.md # 编制镜像(人读快照,勿手改)
|
|
539
|
-
├─ Problems/<id>.md # 原问题
|
|
540
|
-
├─ Problems/conclusion.md # 结题记录
|
|
541
|
-
├─ Members/<代号>/
|
|
542
|
-
│ ├─ Progress/progress.md # 研究日志(压缩后恢复状态的主要依据)
|
|
543
|
-
│ ├─ Propos/<id>.md # 命题
|
|
544
|
-
│ ├─ Methods/<id>.md # 方法 / 理论 / 工具
|
|
545
|
-
│ └─ Subproblems/<id>.md # 子问题
|
|
546
|
-
├─ Shared/
|
|
547
|
-
│ ├─ Chat/<日期>.md # 群聊记录
|
|
548
|
-
│ ├─ Meetings/<mt-id>.md # 会议纪要(含表决小节)
|
|
549
|
-
│ ├─ Debates/<对象>.md # 辩论录(各轮票与理由 + 平均概率)
|
|
550
|
-
│ ├─ TaskBoard.md # 任务板镜像
|
|
551
|
-
│ └─ State-of-institute.md # 成员对"是否已解决"的判断快照
|
|
552
|
-
├─ Verified/<类型>/<id>.md # 定论(只读;只有它能被当作已确立)
|
|
553
|
-
└─ State/README.md # 说明"这里的文件是镜像,请勿手改"
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
#### 工具面
|
|
557
|
-
|
|
558
|
-
| 谁 | 工具 |
|
|
559
|
-
|---|---|
|
|
560
|
-
| **所办 / 人** | `vibe_v5_configure`(先配置)→ `vibe_v5_start`(开工);`vibe_v5_resume` / `pause` / `stop`;`vibe_v5_set`(调参,立即生效);`vibe_v5_status` / `report` / `members`;`vibe_v5_message` / `meeting`;`vibe_v5_hire` / `fire` / `add_researcher` / `remove_researcher`;斜杠命令 `/v5` |
|
|
561
|
-
| **全体成员** | `vibe_v5_say`(群聊/私信/致全体表决者)、`vibe_v5_wait`(免轮询等待)、`vibe_v5_record_progress`、`vibe_v5_record_proposition` / `_method` / `_subproblem`、`vibe_v5_read_library`(跨读他人库,只读)、`vibe_v5_propose_verify`、`vibe_v5_verdict`、`vibe_v5_task_create` / `_list` / `_get` / `_update`、`vibe_v5_meeting`(提议) |
|
|
562
|
-
| **院士**(另有 `academicianLeads` 开关) | `vibe_v5_overview`(全所视图)、`vibe_v5_assign`(分派,须写明理由与验收标准)、`vibe_v5_prioritize`、`vibe_v5_nudge` |
|
|
563
|
-
|
|
564
|
-
#### 与 v4 的关键差异
|
|
565
|
-
|
|
566
|
-
- **有领头人**:v4 无中央调度、一切靠讨论涌现;v5 在**所内**设有院士负责组织与分派
|
|
567
|
-
(**框架仍然绝不指派**——指派者是院士,同样受 m 票约束)。
|
|
568
|
-
- **求真门槛从"全体一致"改为"≥ m 一致"**(可切回 v4 口径)。
|
|
569
|
-
- **状态存于研究所目录下的加固 JSON** `State/<研究所>.v5state.json`(串行写、读前必 load):恢复就是"读之前先 load"(见上)。
|
|
570
|
-
- **三类职位 + 可雇用的临时工**:编制是可变的,雇佣/解雇是真实的可逆操作。
|
|
571
|
-
- **不引入任何 npm 实验包**:v5 是 preset 内的单个 `.js` 文件,零依赖。
|
|
572
|
-
- **会议与验证严格互斥**(双向排队)。
|
|
573
|
-
|
|
574
|
-
详见 [`vibe-math-v5/实现方案.md`](vibe-math-v5/实现方案.md)(文字规格)与
|
|
575
|
-
[`vibe-math-v5/架构图.md`](vibe-math-v5/架构图.md)(全部细节图)。
|
|
576
|
-
|
|
577
|
-
### 13.2 English original (moved from README.en.md)
|
|
578
|
-
|
|
579
|
-
#### Positions and Authority
|
|
580
|
-
|
|
581
|
-
| Position | Codename | Voting right | Authority |
|
|
582
|
-
|---|---|---|---|
|
|
583
|
-
| **Academician** (leader) | `acad` | ✅ one vote, **of equal weight with others** | **Center of organization and coordination**: build an institute-wide overview (`overview`), decompose the original problem into tasks and **assign** them (`assign`), set priorities (`prioritize`), convene and chair meetings (`convene`), supervise progress (`nudge`), move temp workers around, report outward. **Cannot unilaterally conclude**, and cannot expand the roster on its own. |
|
|
584
|
-
| **Resident researcher** | `r-<n>` | ✅ one vote | Digs deep in its own direction; **may autonomously hire/fire its own temp workers**; reports progress to the academician and accepts its organization and assignments (**has the right of reasoned objection**). |
|
|
585
|
-
| **Temp worker** | `t-<n>` | ❌ | Hired temporarily for a specific task: can read/think/speak/write its own output library/claim or be assigned tasks; fired by its **employer or the academician**. Codenames are never reused. |
|
|
586
|
-
| **Institute office** (main assistant) | —— | ❌ | **Does not take part in research and does not vote.** Only reports, translates the human's words into tool calls, and holds on the human's behalf the creation rights the platform requires (creating an institute / adding resident researchers). |
|
|
587
|
-
|
|
588
|
-
**Division of labor in one sentence**: **organization is the academician's responsibility, but judgment belongs to each person individually** —— what the academician assigns is **work**, not **conclusions**.
|
|
589
|
-
|
|
590
|
-
#### Truth Rules (the core of V5)
|
|
591
|
-
|
|
592
|
-
For an object to enter `Verified/` it must **simultaneously** satisfy:
|
|
593
|
-
|
|
594
|
-
1. At least **m = min(`quorumCap`, number of registered voting members)** voting members cast a **Boolean probability value**;
|
|
595
|
-
2. These votes are **all** `1` (absolutely true) or **all** `0` (absolutely false).
|
|
596
|
-
|
|
597
|
-
A vote is a numeric value in `[0,1]`: **strictly between 0 and 1 = abstention/doubt** (not counted toward m, but counted in the group's average probability).
|
|
598
|
-
**Any single opposing Boolean vote blocks a conclusion** —— the minority cannot push a conclusion through by having others abstain.
|
|
599
|
-
An object that falls short of the threshold **stays in its original library**, with the group's average probability and the complete debate record attached, and is **not forcibly ruled on**.
|
|
600
|
-
|
|
601
|
-
Voting has two stages: first [independent initial assessment] (mutually invisible), and if undecided, then [open debate] followed by a re-vote, with a round cap of `verdictMaxRounds`.
|
|
602
|
-
`quorumMode: "all-unanimous"` switches back to v4's "all-unanimous" standard.
|
|
603
|
-
|
|
604
|
-
#### Operating Mechanisms
|
|
605
|
-
|
|
606
|
-
- **Communication**: group chat (fanned out to every other member), direct message, votes cast only to members with voting rights; messages are **persisted per recipient**,
|
|
607
|
-
written to disk before delivery, and group chat is batched into digests by `chatDigestMs` / `chatDigestMax` (direct messages/meetings/votes are not batched).
|
|
608
|
-
All in-institute communication goes through the framework relay (DSH's adjacency restriction does not allow members to message each other directly), but **the signature is always the real sender**.
|
|
609
|
-
- **Meetings and verification are mutually exclusive** (in both directions): meeting requests while verification is under way are **held**; verification requested while a meeting is under way is **queued** ——
|
|
610
|
-
the two consensus processes never run at the same time, avoiding mutual starvation of the watchdog clocks. Meetings collect opinions one by one in a **random speaking order**,
|
|
611
|
-
and at closing they aggregate the votes and check whether everyone considers the problem solved.
|
|
612
|
-
- **Task board**: compare-and-set (the latest `expected_revision` must be read before a change) + dependency DAG (all dependencies must be complete before claiming;
|
|
613
|
-
cycle detection rejects bad dependencies) + write-scope overlap warnings; when an owner is fired, its tasks are automatically reclaimed.
|
|
614
|
-
- **Hiring / firing**: both academicians and resident researchers can hire **their own** temp workers, with a dual quota per member (`maxTempPerMember`) and institute-wide
|
|
615
|
-
(`maxTempTotal`); firing is **real** —— it cancels in-flight turns, releases the resident sub-session, reclaims tasks, and discards undelivered mail.
|
|
616
|
-
- **Liveness**: the main drive is a **one-shot activity wait** (`vibe_v5_wait`, no polling); the scheduler advances by priority
|
|
617
|
-
(in-progress meetings/verification → queued verification → held meetings → active tasks → urgent mail → group chat digest → auto-meeting on stall → fallback heartbeat),
|
|
618
|
-
and concurrency is gated by `maxParallel`; the task board's "nudge" is **throttled** by `activityTimeoutMs`.
|
|
619
|
-
- **Watchdog**: if a meeting/verification goes beyond 2×`activityTimeoutMs` with no new speech/new votes → abandon it and return to self-organization;
|
|
620
|
-
the heartbeat is **re-armed after every wake**, so the scheduler never freezes permanently.
|
|
621
|
-
- **Context**: upon reaching `compactThreshold` (%) or accumulating `compactAfterRounds` rounds, members are asked to condense their working state into
|
|
622
|
-
`Progress/`; **the charter lives in the persona**, remains in effect after compaction, and does not need to be restated every round.
|
|
623
|
-
- **Stopping**: the problem is concluded (**writing `Problems/conclusion.md`**) **only when all voting members consider the original problem solved**.
|
|
624
|
-
|
|
625
|
-
#### State and Persistence
|
|
626
|
-
|
|
627
|
-
Institute state is written **only** to the **hardened JSON file** `State/<institute>.v5state.json` under the institute directory: the framework's only side effect is to hand 11 kinds of events to
|
|
628
|
-
`applyV5Event`, which purely folds them into a state, and then to write that whole snapshot **serially to disk** (one serialization chain per file). Therefore
|
|
629
|
-
|
|
630
|
-
- **Zero token cost**: these events **do not enter the model context** and do not consume members' conversation budget;
|
|
631
|
-
- **Recovery takes the same code path**: both cross-process restarts and resume after an in-process abort are covered by the "mandatory load before read", which is the same code either way;
|
|
632
|
-
- the whole class of problems caused by v4's direct writes to `State/*.json` — "corrupted silent overwrite / concurrent lost writes / stale cross-process snapshots" — is eliminated by construction.
|
|
633
|
-
|
|
634
|
-
**v5 no longer writes institute events into the host session log**: DSH's session persistence **refuses to load an entire session** whose log carries an event type it does not know
|
|
635
|
-
(unless the writer marked it `ignorable: true`, and `Session.append` cannot set that field) — which would make **your own session unopenable on the next resume**.
|
|
636
|
-
Everything except the state file (member output libraries, group chat, meeting minutes, debate records, roster mirror, task board mirror) is a **human-readable artifact**,
|
|
637
|
-
and breaking it by hand does not damage the institute.
|
|
638
|
-
|
|
639
|
-
#### How the Prompt Is Composed
|
|
640
|
-
|
|
641
|
-
A member's "persona" carries the **ten-section public charter** (roster and colleagues, general rules, knowledge base and progress format,
|
|
642
|
-
organization and coordination, voting rules, per-round rhythm, hiring and firing, task board, context discipline, stopping conditions), which is **frozen at onboarding** and persists with the session;
|
|
643
|
-
each round's prompt carries only a short **state block** (who I am / the round / m / the registered roster / my tasks / newly arrived messages), **this round's question**,
|
|
644
|
-
and the **receipt contract**. Every field in the receipt contract that the framework actually handles appears, trimmed by position
|
|
645
|
-
(temp workers have no `verdict`/`hire`/`fire`; non-academicians have no `assign`/`prioritize`/`nudge`/`convene_meeting`).
|
|
646
|
-
|
|
647
|
-
The framework treats "the text a member reads" as a product to be guaranteed: identity is **passed explicitly and never guessed**; a member is **written to the roster first, and only then** are its onboarding
|
|
648
|
-
prompts constructed; the charter snapshot is frozen at onboarding, and a session rebuild is framed as the literal marker `【会话重建 —— <role> <id>】` ("session rebuild") rather than "just onboarded"; no academician narrative appears when there is no academician;
|
|
649
|
-
message headers are labeled by **true origin** (institute office assignment ≠ academician assignment; supervision ≠ assignment); framework feedback has its own sender,
|
|
650
|
-
and **only one message is delivered per prompt**.
|
|
651
|
-
|
|
652
|
-
#### Directory Structure (Institute)
|
|
653
|
-
|
|
654
|
-
```
|
|
655
|
-
<session workspace>/VibeMath/Projects/<project>/Institutes/<institute>/
|
|
656
|
-
├─ Institutes.md # roster mirror (human-readable snapshot, do not edit by hand)
|
|
657
|
-
├─ Problems/<id>.md # original problem
|
|
658
|
-
├─ Problems/conclusion.md # conclusion record
|
|
659
|
-
├─ Members/<codename>/
|
|
660
|
-
│ ├─ Progress/progress.md # research log (the main basis for restoring state after compaction)
|
|
661
|
-
│ ├─ Propos/<id>.md # proposition
|
|
662
|
-
│ ├─ Methods/<id>.md # method / theory / tool
|
|
663
|
-
│ └─ Subproblems/<id>.md # subproblem
|
|
664
|
-
├─ Shared/
|
|
665
|
-
│ ├─ Chat/<date>.md # group chat log
|
|
666
|
-
│ ├─ Meetings/<mt-id>.md # meeting minutes (including the voting section)
|
|
667
|
-
│ ├─ Debates/<object>.md # debate record (each round's votes and reasons + average probability)
|
|
668
|
-
│ ├─ TaskBoard.md # task board mirror
|
|
669
|
-
│ └─ State-of-institute.md # snapshot of members' judgment on "whether it is solved"
|
|
670
|
-
├─ Verified/<type>/<id>.md # conclusion (read-only; only this can be treated as established)
|
|
671
|
-
└─ State/README.md # explains that "the files here are mirrors — do not hand-edit them"
|
|
672
|
-
```
|
|
673
|
-
|
|
674
|
-
#### Tool Surface
|
|
675
|
-
|
|
676
|
-
| Who | Tools |
|
|
677
|
-
|---|---|
|
|
678
|
-
| **Institute office / human** | `vibe_v5_configure` (configure first) → `vibe_v5_start` (start work); `vibe_v5_resume` / `pause` / `stop`; `vibe_v5_set` (adjust parameters, effective immediately); `vibe_v5_status` / `report` / `members`; `vibe_v5_message` / `meeting`; `vibe_v5_hire` / `fire` / `add_researcher` / `remove_researcher`; slash command `/v5` |
|
|
679
|
-
| **All members** | `vibe_v5_say` (group chat/direct message/to all voters), `vibe_v5_wait` (poll-free wait), `vibe_v5_record_progress`, `vibe_v5_record_proposition` / `_method` / `_subproblem`, `vibe_v5_read_library` (cross-read others' libraries, read-only), `vibe_v5_propose_verify`, `vibe_v5_verdict`, `vibe_v5_task_create` / `_list` / `_get` / `_update`, `vibe_v5_meeting` (propose) |
|
|
680
|
-
| **Academician** (also has the `academicianLeads` switch) | `vibe_v5_overview` (institute-wide overview), `vibe_v5_assign` (assignment, must state the reason and acceptance criteria), `vibe_v5_prioritize`, `vibe_v5_nudge` |
|
|
681
|
-
|
|
682
|
-
#### Key Differences from v4
|
|
683
|
-
|
|
684
|
-
- **There is a leader**: v4 has no central scheduling and everything emerges from discussion; v5 has an academician responsible for organization and assignment **inside the institute**
|
|
685
|
-
(**the framework still never assigns** —— the assigner is the academician, who is likewise bound by the m votes).
|
|
686
|
-
- **The truth gate changes from "all-unanimous" to "≥ m unanimous"** (switchable back to the v4 standard).
|
|
687
|
-
- **State is stored in the hardened JSON file** `State/<institute>.v5state.json` under the institute directory (serial writes, a mandatory load before read): recovery is simply that load-before-read (see above).
|
|
688
|
-
- **Three classes of positions + hireable temp workers**: the roster is mutable, and hiring/firing are real reversible operations.
|
|
689
|
-
- **No npm experimental package is introduced**: v5 is a single `.js` file within the preset, with zero dependencies.
|
|
690
|
-
- **Meetings and verification are strictly mutually exclusive** (queued in both directions).
|
|
691
|
-
|
|
692
|
-
See [the v5 specification](vibe-math-v5/实现方案.md) (written specification) and
|
|
693
|
-
[the v5 detail diagrams](vibe-math-v5/架构图.md) (all detail diagrams).
|
|
1
|
+
# Vibe Math V5 架构图
|
|
2
|
+
|
|
3
|
+
> **状态说明(round-3 补记)**:本文是**设计期文档**,写于 `math_computation`(数学计算工具)、
|
|
4
|
+
> `leanAsync`/`leanJobsMaxParallel`/`leanSearchPaths`(Lean 异步作业与复用)、`paperEditor` 与
|
|
5
|
+
> `paper.lock.json`(最终论文定稿/写锁)等新功能之前;**功能与参数的权威描述以 `docs/` 为准**
|
|
6
|
+
> (`docs/math-computation.md`、`docs/formal-verification.md`、`docs/final-paper.md`、`docs/test-timing.md`),
|
|
7
|
+
> 参数表以 README 的双语「共用参数 / 各预设专属参数」表为准。本文保留其原始设计意图,不再逐条追平。
|
|
8
|
+
|
|
9
|
+
> 本文件是 v5 的图源(GitHub 上 Mermaid 会**原生渲染**)。总览大图另有一张生成好的
|
|
10
|
+
> **SVG**:[`../示例图/框架图-v5.svg`](../示例图/框架图-v5.svg),由
|
|
11
|
+
> [`../docs/generate_framework_diagram_v5.mjs`](../docs/generate_framework_diagram_v5.mjs) 生成
|
|
12
|
+
> (零依赖,`node docs/generate_framework_diagram_v5.mjs`)。
|
|
13
|
+
> 文字规格见 [`实现方案.md`](实现方案.md)。
|
|
14
|
+
|
|
15
|
+
**一句话**:v5 = **一个所办**(对外接口,不研究不投票)+ **一所研究所**(院士 / 常驻研究员 / 临时工)
|
|
16
|
+
+ **一个只做媒介的框架**(中继 · 沉淀 · 计数 · 调度)。
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 1. 总览:三层 + 两个面
|
|
21
|
+
|
|
22
|
+
```mermaid
|
|
23
|
+
flowchart TB
|
|
24
|
+
subgraph L0["👤 所办(会话根代理 / 人)—— 对外接口"]
|
|
25
|
+
OFF["自然语言接口 + 汇报者<br/>不研究 · 不投票<br/>只汇报、转达人的指令<br/>代持平台要求的一次性创建权"]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
subgraph L1["🏛️ 研究所(所内自治:编制、组织与分派都在成员之间完成)"]
|
|
29
|
+
ACAD["院士 acad<br/>领头人 · 组织与协调中心<br/>L1 全所视图 / L2 分派 / L3 优先级<br/>L4 主持会议 / L5 督导 / L6 调人 / L7 对外"]
|
|
30
|
+
RES["常驻研究员 r-n(有表决权)<br/>continuable 持久会话 · 自主方向<br/>可自主雇佣/解雇自己的临时工"]
|
|
31
|
+
TMP["临时工 t-n(无表决权)<br/>为特定任务临时雇入<br/>可读/可想/可发言/可写自己的库"]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
subgraph L2["⚙️ 框架 vibe-v5 —— 只是媒介"]
|
|
35
|
+
MSG["消息中继(持久邮箱)<br/>群聊 / 私信 / 致全体表决者<br/>所办通知 / 分派 / 督办 / 框架提示"]
|
|
36
|
+
MTG["会议 / 辩论<br/>议程 · 名册对账 · 随机发言序<br/>与验证互斥 · 看门狗"]
|
|
37
|
+
TASK["任务板(CAS + DAG)<br/>版本号比较交换 · 依赖环检测"]
|
|
38
|
+
VOTE["m 票共识验证<br/>独立初评 → 公开辩论"]
|
|
39
|
+
CTX["上下文与活性<br/>阈值压缩 · 免轮询活动等待 · 心跳"]
|
|
40
|
+
STAFF["编制与雇佣<br/>真实解雇(释放子会话)"]
|
|
41
|
+
SCHED["调度器<br/>优先级 + 并发闸 maxParallel"]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
subgraph L3["💾 状态与产物"]
|
|
45
|
+
STATE["唯一权威状态源:加固 JSON 文件<br/>State/<研究所>.v5state.json<br/>12 类事件 · 纯折叠 applyV5Event"]
|
|
46
|
+
FS["人可读产物(镜像,勿手改)<br/>Members/<id>/* · Shared/* · Verified/ · Problems/ · State/README.md"]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
RULE{{"求真门槛<br/>布尔一致 且 布尔票 ≥ m = min(quorumCap, 有表决权人数)<br/>否则留库 + 平均概率 + 辩论录"}}
|
|
50
|
+
|
|
51
|
+
OFF -->|"vibe_v5_* 工具 / /v5 命令"| SCHED
|
|
52
|
+
SCHED -->|"status / report(自然语言汇报)"| OFF
|
|
53
|
+
SCHED -->|"每轮提示词:状态块 + 本轮问句"| ACAD
|
|
54
|
+
SCHED -->|"每轮提示词:状态块 + 本轮问句"| RES
|
|
55
|
+
SCHED -->|"每轮提示词:状态块 + 本轮问句"| TMP
|
|
56
|
+
ACAD -->|"JSON 回执"| SCHED
|
|
57
|
+
RES -->|"JSON 回执"| SCHED
|
|
58
|
+
TMP -->|"JSON 回执"| SCHED
|
|
59
|
+
ACAD -.->|"所内组织:分派 / 优先级 / 督办(虚线 = 不由框架执行)"| RES
|
|
60
|
+
ACAD -.->|"调配"| TMP
|
|
61
|
+
MSG --- SCHED
|
|
62
|
+
MTG --- SCHED
|
|
63
|
+
TASK --- SCHED
|
|
64
|
+
VOTE --- SCHED
|
|
65
|
+
CTX --- SCHED
|
|
66
|
+
STAFF --- SCHED
|
|
67
|
+
SCHED <-->|"commit 事件 / 折叠读状态"| STATE
|
|
68
|
+
SCHED <-->|"读写产物"| FS
|
|
69
|
+
VOTE --> RULE
|
|
70
|
+
RULE -->|"定论"| FS
|
|
71
|
+
|
|
72
|
+
classDef human fill:#f1eefc,stroke:#5b4bb8,stroke-width:1.5px,color:#2b2359
|
|
73
|
+
classDef house fill:#fdf5e2,stroke:#b26a00,stroke-width:1.5px,color:#6b4200
|
|
74
|
+
classDef frame fill:#eaf3fd,stroke:#0b6fb8,stroke-width:1.5px,color:#084d80
|
|
75
|
+
classDef data fill:#eef7f1,stroke:#1f7a52,stroke-width:1.5px,color:#125a3c
|
|
76
|
+
classDef gate fill:#fdeef0,stroke:#b3202c,stroke-width:2px,color:#7d1620
|
|
77
|
+
class OFF human
|
|
78
|
+
class ACAD,RES,TMP house
|
|
79
|
+
class MSG,MTG,TASK,VOTE,CTX,STAFF,SCHED frame
|
|
80
|
+
class STATE,FS data
|
|
81
|
+
class RULE gate
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 2. 成员生命周期
|
|
87
|
+
|
|
88
|
+
```mermaid
|
|
89
|
+
stateDiagram-v2
|
|
90
|
+
direction LR
|
|
91
|
+
[*] --> provisioning : newMember(分配代号,代号永不复用)
|
|
92
|
+
provisioning --> active : spawnMember 成功<br/>先落盘编制、再构造入职提示词
|
|
93
|
+
provisioning --> failed : startContinuable 抛错
|
|
94
|
+
active --> active : 一轮结束(subagent/end)→ 回执 → 调度
|
|
95
|
+
active --> dismissed : fire(真实释放子会话 + 收回任务 + 丢弃邮件)
|
|
96
|
+
dismissed --> [*]
|
|
97
|
+
failed --> [*] : 在 [未就位] 里对全所可见
|
|
98
|
+
|
|
99
|
+
note right of active
|
|
100
|
+
每轮:框架发「状态块 + 本轮问句」,
|
|
101
|
+
成员回一个 JSON(say/progress/record/
|
|
102
|
+
verdict/task_*/hire/fire/reject_assign/…)
|
|
103
|
+
end note
|
|
104
|
+
note right of dismissed
|
|
105
|
+
未完成的任务自动释放回板;
|
|
106
|
+
代号永不复用,重新雇佣会得到新代号
|
|
107
|
+
end note
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 3. 一轮唤醒的时序(唯一的推进驱动)
|
|
113
|
+
|
|
114
|
+
```mermaid
|
|
115
|
+
sequenceDiagram
|
|
116
|
+
autonumber
|
|
117
|
+
participant S as 调度器(框架代码)
|
|
118
|
+
participant M as 成员(continuable 子会话)
|
|
119
|
+
participant L as 状态文件(State/<研究所>.v5state.json)
|
|
120
|
+
|
|
121
|
+
S->>S: schedulePass:按优先级挑一个成员
|
|
122
|
+
S->>S: 构造本轮提示词(收件箱:先构造、后 ack —— 仅发送成功才 `await ackPending(`)
|
|
123
|
+
S->>M: 【轮次】+ 状态块(编制/m/我的任务/新消息)+ 回执契约
|
|
124
|
+
M->>M: 读同事的库 · 推导 · 写自己的 Progress/ 与卡片
|
|
125
|
+
M-->>S: subagent/end + 单个 JSON 回执
|
|
126
|
+
S->>L: commit 事件(整份快照串行写入;读前必先 load)
|
|
127
|
+
S->>S: handleReply:发言 / 入库 / 任务 / 提议 / 投票 / 雇佣
|
|
128
|
+
S->>S: 记 contextPct;必要时发压缩指令
|
|
129
|
+
S->>S: scheduleNext()(蹦床:同一时刻只有一个调度 pass)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
> 关键点:**成员的一轮结束是唯一的推进驱动**。没有轮询;`vibe_v5_wait` 是一次性活动等待,
|
|
133
|
+
> 心跳只是最后的兜底,且每次唤醒后**永远重新武装**,所以调度器不会永久冻结。
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 4. 共识验证状态机(m 票布尔一致)
|
|
138
|
+
|
|
139
|
+
```mermaid
|
|
140
|
+
stateDiagram-v2
|
|
141
|
+
[*] --> queued : 任何成员 propose_verify
|
|
142
|
+
queued --> initial : armNextVerify(会议进行中则排队等待)
|
|
143
|
+
initial --> debate : 所有表决者都答完<br/>但未定论且轮次 < verdictMaxRounds
|
|
144
|
+
debate --> debate : 重新投票(history 存上一轮)
|
|
145
|
+
initial --> true_ : 布尔票 ≥ m 且全为 1
|
|
146
|
+
initial --> false_ : 布尔票 ≥ m 且全为 0
|
|
147
|
+
debate --> true_
|
|
148
|
+
debate --> false_
|
|
149
|
+
initial --> undecided : 轮次用尽,或布尔票不足 m,或出现 1 与 0 分歧
|
|
150
|
+
debate --> undecided
|
|
151
|
+
true_ --> [*] : 写 Verified/卡 + 改写来源卡 + 辩论录
|
|
152
|
+
false_ --> [*] : 同上(结论为假)
|
|
153
|
+
undecided --> [*] : 留原库 + 全组平均概率 + 完整辩论录(不强行裁决)
|
|
154
|
+
|
|
155
|
+
note right of initial
|
|
156
|
+
票是 [0,1] 的数值:
|
|
157
|
+
恰好 1 = 断言为真;恰好 0 = 断言为假;
|
|
158
|
+
严格介于两者 = 弃权/存疑
|
|
159
|
+
(不计入 m,但计入平均)
|
|
160
|
+
end note
|
|
161
|
+
note left of undecided
|
|
162
|
+
看门狗:超过 2×activityTimeoutMs
|
|
163
|
+
没有新票 → 放弃该验证并回到自组织
|
|
164
|
+
end note
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**判定规则(`judgeVerdict`)**:任何一张反向布尔票都**阻塞**定论 —— 少数派无法靠别人弃权
|
|
168
|
+
把结论推过去。`quorumMode: "all-unanimous"` 可切回 v4 的"全体有表决权者一致"口径。
|
|
169
|
+
|
|
170
|
+
### 4.1 Lean 形式化验证(可调参数 `formalVerify`)
|
|
171
|
+
|
|
172
|
+
完整契约见 [`../docs/formal-verification.md`](../docs/formal-verification.md)。**它改变的不是"更严格一点",
|
|
173
|
+
而是审查对象本身**:m 票一致是**共识**(排除不了共同误解),Lean 通过是**机器核对**,
|
|
174
|
+
于是剩下的唯一不确定项缩小为"Lean 代码是否忠实于命题原文"。
|
|
175
|
+
|
|
176
|
+
```mermaid
|
|
177
|
+
stateDiagram-v2
|
|
178
|
+
direction LR
|
|
179
|
+
[*] --> none : 对象被记录 / 被提议验证
|
|
180
|
+
none --> attempted : lean_run 跑了但未通过(记录编译器输出)
|
|
181
|
+
none --> attempted : 回执 formal.decision='used'
|
|
182
|
+
attempted --> passed : lean_archive kind='proof' 且该文件运行 exit 0
|
|
183
|
+
attempted --> blocked : lean_archive kind='blocked'(note 必填)
|
|
184
|
+
none --> blocked : 同上
|
|
185
|
+
passed --> attempted : 回执 formal.decision='defect'(忠实性缺陷)<br/>清空 proof · 撤回 Verified/Lean/<id>.lean · 写 Formal/TODO.md · 公告
|
|
186
|
+
blocked --> attempted : 同上(缺陷优先于阻塞判断)
|
|
187
|
+
passed --> [*] : 归档到 Verified/Lean/<id>.lean
|
|
188
|
+
blocked --> [*] : 记入 Formal/Index.md 的难度判断列
|
|
189
|
+
|
|
190
|
+
note right of passed
|
|
191
|
+
验证提示词随之切换为
|
|
192
|
+
「你不需要重新检查推导,
|
|
193
|
+
任务是忠实性审查」
|
|
194
|
+
end note
|
|
195
|
+
note left of attempted
|
|
196
|
+
忠实性缺陷不是"命题为假"(契约 §4.1):
|
|
197
|
+
表决者不得投 0,只给 0 与 1 之间的弃权值;
|
|
198
|
+
require 档本轮因此不定论(formal-required),
|
|
199
|
+
encourage 档没有门禁,靠该弃权值阻止一致结论。
|
|
200
|
+
end note
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
```mermaid
|
|
204
|
+
flowchart TB
|
|
205
|
+
A["全票一致判真 / 判假"] --> B{"formalVerify 模式"}
|
|
206
|
+
B -->|"off"| OK["照常写 Verified/ 卡片"]
|
|
207
|
+
B -->|"encourage"| OK
|
|
208
|
+
B -->|"require"| C{"formal.status ∈ {passed, blocked}?"}
|
|
209
|
+
C -->|"是"| OK2["照常写卡片,并在卡片上记 - 形式化: …"]
|
|
210
|
+
C -->|"否"| D["★ 本次裁定不生效:记为 undecided<br/>原因 formal-required|写 Formal/TODO.md<br/>群聊公告|不写 Verified/ 卡片"]
|
|
211
|
+
D --> E["完成形式化(kind='proof')或记录阻塞(kind='blocked')后重新提议验证"]
|
|
212
|
+
E --> A
|
|
213
|
+
|
|
214
|
+
style D fill:#fdeef0,stroke:#b3202c,stroke-width:2px
|
|
215
|
+
style OK2 fill:#eef7f1,stroke:#1f7a52
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**三档**:`off`(默认,**真正的无操作**:不注入任何 Lean 文本、不设门禁、不改验证流程)|
|
|
219
|
+
`encourage`(按实现难度自行决定,不设门禁)|
|
|
220
|
+
`require`(真/假结论必须先有 Lean 通过或**显式、可审计**的阻塞记录)。
|
|
221
|
+
|
|
222
|
+
> `off` 的"无操作"约束的是**框架主动做的事**(提示词、门禁、验证流程、回执里的 formal 通道)。
|
|
223
|
+
> 三个 Lean 工具仍然无条件注册、任何档位下都可被代理或人**主动**调用,并且会照实执行与记录
|
|
224
|
+
> ——"调用是一个明确的动作,不会被静默忽略"。
|
|
225
|
+
|
|
226
|
+
**"根据实现难度决定不做"是被允许的,但必须说出来**:`blocked` 记录要求 `note` 非空 ——
|
|
227
|
+
决定权在代理,静默跳过不行。
|
|
228
|
+
|
|
229
|
+
**路径**:工作文件 `Formal/<对象id>.lean`|**归档证明 `Verified/Lean/<对象id>.lean`**(与定论卡片同处
|
|
230
|
+
`Verified/`)|可复用定义 `<VibeMath根>/Formal/Lib/`|已证引理 `<VibeMath根>/Formal/Proved/`。
|
|
231
|
+
跨项目复用是这套设计的核心收益,因此 Lean 路径守卫的边界是 **VibeMath 根**而不是研究所根
|
|
232
|
+
(爬出研究所但仍在 VibeMath 内是合法的,那正是全局库所在)。
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 5. 会议流程(与验证互斥)
|
|
237
|
+
|
|
238
|
+
```mermaid
|
|
239
|
+
flowchart TB
|
|
240
|
+
A["任何人 vibe_v5_meeting"] --> B{"院士或所办?"}
|
|
241
|
+
B -->|"否(含临时工)"| C["只能提议:框架转呈全体表决者<br/>署名 = 真实提议人"]
|
|
242
|
+
B -->|"是"| D{"已有验证进行中?"}
|
|
243
|
+
D -->|"是"| E["暂存 pendingMeeting<br/>(只保留第一条,后到者不覆盖)"]
|
|
244
|
+
D -->|"否"| F["真正召开:写纪要头 + 公告群聊"]
|
|
245
|
+
E -->|"验证清空后"| F
|
|
246
|
+
F --> G["按随机顺序逐个唤醒发言<br/>每人看到此前已发言者的意见"]
|
|
247
|
+
G --> H{"全部在册成员都发言了?"}
|
|
248
|
+
H -->|"否"| I["继续收集(跳过仍在忙的人)<br/>看门狗:2×activityTimeoutMs 无新发言 → 放弃"]
|
|
249
|
+
I --> H
|
|
250
|
+
H -->|"是"| J["收口:汇总表决 / 讨论结论<br/>检查是否全体认为已解决"]
|
|
251
|
+
J --> K["暂存会议补开(若有)"]
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**互斥的双向保证**(v2.2.2 起对称):
|
|
255
|
+
- `startMeeting`:验证进行中 → **会议暂存**;
|
|
256
|
+
- `armNextVerify`:会议进行中 → **验证排队**(此前只做了前一半,成员在会上提议验证会真的
|
|
257
|
+
并发启动第二个共识过程,进而饿死会议的看门狗时钟)。
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## 6. 调度优先级(`schedulePass`)
|
|
262
|
+
|
|
263
|
+
```mermaid
|
|
264
|
+
flowchart TB
|
|
265
|
+
S["一轮结束 / 提议 / 定时器到期 → scheduleNext()(蹦床:只有一个 pass 在跑)"] --> P1
|
|
266
|
+
P1{"有进行中的会议?"} -->|"是"| M["continueMeetingRound()<br/>缺人则继续问;齐了就收口"]
|
|
267
|
+
P1 -->|"否"| P2{"有进行中的验证?"}
|
|
268
|
+
P2 -->|"是"| V["continueVerifyRound()<br/>缺票则继续问;齐了就裁定"]
|
|
269
|
+
P2 -->|"否"| P3["armNextVerify():启动队列里的下一个验证"]
|
|
270
|
+
P3 --> P4{"有暂存会议?"}
|
|
271
|
+
P4 -->|"是"| P5["beginMeeting()"]
|
|
272
|
+
P4 -->|"否"| P6["按 maxParallel 填并发预算:<br/>① 已认领/被分派的在办任务(按 activityTimeoutMs 节流)<br/>② 加急邮件(私信/分派/督办/框架提示)<br/>③ 到期群聊摘要"]
|
|
273
|
+
P6 --> P7{"本所停滞超过 stallAutoMeetingMs<br/>且无人在跑?"}
|
|
274
|
+
P7 -->|"是"| P8["自动召集一次同步会议(只促成,不指派)"]
|
|
275
|
+
P7 -->|"否"| P9{"最久未动者已空闲 ≥ activityTimeoutMs?"}
|
|
276
|
+
P9 -->|"是"| P10["推一把:有在办任务 → 常规工作轮;否则 → 心跳轮"]
|
|
277
|
+
P9 -->|"否"| P11["armDigest() + armHeartbeat()"]
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## 7. 状态:纯折叠 + 唯一后端(加固 JSON 文件)
|
|
283
|
+
|
|
284
|
+
```mermaid
|
|
285
|
+
flowchart LR
|
|
286
|
+
subgraph EV["12 类事件"]
|
|
287
|
+
E["institute · member · task · message · delivered ·<br/>meeting · debate · verdict · formal · queue · counters · progress"]
|
|
288
|
+
end
|
|
289
|
+
EV --> FOLD["applyV5Event(纯函数折叠,只此一份)"]
|
|
290
|
+
FOLD --> ST["V5State<br/>{ institutes, order, diagnostics }"]
|
|
291
|
+
ST --> R1["读:先 ready()(load),再 state()"]
|
|
292
|
+
ST --> R2["未知/损坏事件 → 跳过 + 记入 diagnostics<br/>(可用性优先,绝不因一条坏事件卡死全场)"]
|
|
293
|
+
|
|
294
|
+
subgraph B1["唯一后端:加固 JSON 文件"]
|
|
295
|
+
P1["State/<研究所>.v5state.json<br/>事件只在内存里折叠,读前必先 load"]
|
|
296
|
+
P2["每次提交把整份快照经一条 promise 链<br/>串行写入:后写者不会用旧子集覆盖新状态"]
|
|
297
|
+
end
|
|
298
|
+
R1 --> B1
|
|
299
|
+
|
|
300
|
+
style FOLD fill:#eaf3fd,stroke:#0b6fb8
|
|
301
|
+
style P1 fill:#eef7f1,stroke:#1f7a52
|
|
302
|
+
style P2 fill:#eef7f1,stroke:#1f7a52
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**为什么不再用会话日志投影**:DSH 的会话持久化**拒绝加载**日志里带未知事件类型的会话 ——
|
|
306
|
+
除非写入方把它标成 `ignorable: true`,而 `Session.append` **无法设置**该字段。所以把 `vibe5/*`
|
|
307
|
+
事件追加进根会话,等于让**用户自己的会话无法恢复**。研究所状态因此只落在
|
|
308
|
+
`State/<研究所>.v5state.json` 这一个加固 JSON 文件里;`sessionProjections` 单元注册、投影后端与
|
|
309
|
+
`sessions.flush` 调用都已删除,插件也不再注入 `sessions`。
|
|
310
|
+
|
|
311
|
+
**为什么仍然安全**:v4 的 `State/*.json` 直写带来"损坏静默覆盖 / 并发丢写 / 跨进程陈旧快照"
|
|
312
|
+
一整类问题。v5 用同一份纯折叠 + 整份快照串行写入 + 写前必 load 消掉它们,跨进程与同进程
|
|
313
|
+
恢复**走同一条代码路径**(都是"读文件 → 折叠")。
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## 8. 提示词是怎么构成的(成员读到的文字 = 产品)
|
|
318
|
+
|
|
319
|
+
```mermaid
|
|
320
|
+
flowchart LR
|
|
321
|
+
subgraph P["人设 persona(入职时冻结,随会话持久化,压缩后依然有效)"]
|
|
322
|
+
CH["公共规章(十节)<br/>编制与同事 · 通用规章 · 资料库与 progress<br/>组织与协调 · 表决规则 · 每轮节奏<br/>雇佣解雇 · 任务板 · 上下文纪律 · 停止条件"]
|
|
323
|
+
end
|
|
324
|
+
subgraph R["每轮提示词(临时,短)"]
|
|
325
|
+
ST["状态块<br/>[状态] 你是 <代号>(职位)|轮次|m|表决者数<br/>[在册] … [未就位] …<br/>[任务板] … [新到的消息/通知] …"]
|
|
326
|
+
ASK["本轮问句(常规 / 心跳 / 会议 / 表决)<br/>+ 收件箱(**先构造、后 ack**:构造阶段只做去重注入 `inboxInjected`/`inboxSuppressed`;**仅发送成功才确认** `await ackPending(`;**同一轮内不重复 prepend**)"]
|
|
327
|
+
SPEC["回执契约(按职位裁剪)<br/>say / progress / record / propose_verify / verdict<br/>propose_meeting / task_* / reject_assign / input<br/>hire / fire / vote_solved / solved / contextPct / compacted"]
|
|
328
|
+
end
|
|
329
|
+
P --> MEM["成员(子会话)"]
|
|
330
|
+
R --> MEM
|
|
331
|
+
MEM --> OUT["单个 JSON 回执"]
|
|
332
|
+
|
|
333
|
+
style CH fill:#fdf5e2,stroke:#b26a00
|
|
334
|
+
style ST fill:#eaf3fd,stroke:#0b6fb8
|
|
335
|
+
style ASK fill:#eaf3fd,stroke:#0b6fb8
|
|
336
|
+
style SPEC fill:#eaf3fd,stroke:#0b6fb8
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**身份不变式(有测试与语料保证)**:
|
|
340
|
+
|
|
341
|
+
- 提示词里的身份 = 这条提示词**实际发给的成员**;题头、`[状态]`、人设资料库路径三者必须一致;
|
|
342
|
+
- 成员**先落盘进编制、再构造**它的入职提示词(否则会漏掉自己、并按加入前的编制算 m);
|
|
343
|
+
- 章程快照**冻结在入职时**(它写着"你入职时的在册编制"),重建会话时原样复用;
|
|
344
|
+
- 会话重建框为 `【会话重建】`,**不**自称"刚入职";
|
|
345
|
+
- 领袖叙事跟随真实编制:没有院士时,章程不得声称存在院士或承诺其派活;
|
|
346
|
+
- 框头按**真实来源**标注(所办分派 ≠ 院士分派;督办 ≠ 分派;致全体表决者 ≠ 私信);
|
|
347
|
+
- 框架反馈有独立发送者(`【框架提示】`),且**一次提示词只投递一条消息**。
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## 9. 任务板(compare-and-set + DAG)
|
|
352
|
+
|
|
353
|
+
```mermaid
|
|
354
|
+
flowchart LR
|
|
355
|
+
A["task_create<br/>subject / description / blocked_by / write_scopes / priority"] --> B["pending"]
|
|
356
|
+
B -->|"task_claim(全部依赖已完成才可认领)"| C["in_progress"]
|
|
357
|
+
C -->|"complete"| D["completed"]
|
|
358
|
+
C -->|"release"| B
|
|
359
|
+
D -->|"reopen"| B
|
|
360
|
+
B -->|"delete(有依赖者则拒绝)"| E["deleted"]
|
|
361
|
+
C -->|"reassign(仅院士/所办)"| C
|
|
362
|
+
F["任何修改都要带 expected_revision<br/>版本不符 → V5_TASK_STALE_REVISION"] -.-> A
|
|
363
|
+
G["owner 被解雇 → releaseTasksOf 自动收回"] -.-> B
|
|
364
|
+
|
|
365
|
+
style B fill:#eaf3fd,stroke:#0b6fb8
|
|
366
|
+
style C fill:#fdf5e2,stroke:#b26a00
|
|
367
|
+
style D fill:#eef7f1,stroke:#1f7a52
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## 10. 职权矩阵
|
|
373
|
+
|
|
374
|
+
| 动作 | 院士 | 常驻研究员 | 临时工 | 所办 |
|
|
375
|
+
|---|---|---|---|---|
|
|
376
|
+
| 发言 / 私信 / 致全体表决者 | ✅ | ✅ | ✅ | ✅(所办通知) |
|
|
377
|
+
| 写自己的成果库 / 认领任务 | ✅ | ✅ | ✅ | ❌(不是成员) |
|
|
378
|
+
| **表决**(进 `Verified/`) | ✅ 一票 | ✅ 一票 | ❌ | ❌ |
|
|
379
|
+
| 提议验证 / 提议开会 | ✅ | ✅ | ✅ | ✅(可直接召开) |
|
|
380
|
+
| **直接召开会议** | ✅ | ❌(只能提议) | ❌ | ✅ |
|
|
381
|
+
| **分派任务**(`vibe_v5_assign`) | ✅ | ❌ | ❌ | ✅ |
|
|
382
|
+
| 设定优先级(`vibe_v5_prioritize`) | ✅ | ❌ | ❌ | ✅ |
|
|
383
|
+
| 督导(`vibe_v5_nudge`) | ✅ | ❌ | ❌ | ✅ |
|
|
384
|
+
| **雇佣临时工** | ✅ | ✅(自己的) | ❌ | ✅ |
|
|
385
|
+
| **解雇临时工** | ✅(任何) | ✅(自己雇的) | ❌ | ✅ |
|
|
386
|
+
| 增聘 / 解聘**常驻研究员** | ❌(建议) | ❌(建议) | ❌ | ✅ |
|
|
387
|
+
| 暂停 / 恢复 / 停止 / 调参 | ❌ | ❌ | ❌ | ✅ |
|
|
388
|
+
|
|
389
|
+
> **分派不改变真假**:院士能分派工作、定优先级,但不能让任何断言因此变正确 ——
|
|
390
|
+
> 对象进 `Verified/` 仍然只能靠 m 票布尔一致。
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## 11. 目录结构与制品
|
|
395
|
+
|
|
396
|
+
```text
|
|
397
|
+
<会话工作区>/VibeMath/Projects/<项目>/Institutes/<研究所>/
|
|
398
|
+
├─ Institutes.md # 编制镜像(人读快照,勿手改)
|
|
399
|
+
├─ Problems/<id>.md # 原问题
|
|
400
|
+
├─ Problems/conclusion.md # 结题记录(全体有表决权者一致认为已解决时生成)
|
|
401
|
+
├─ Members/<代号>/
|
|
402
|
+
│ ├─ Progress/progress.md # 研究日志(叙述体,可追加;压缩后恢复状态的主要依据)
|
|
403
|
+
│ ├─ Propos/<id>.md # 命题
|
|
404
|
+
│ ├─ Methods/<id>.md # 方法 / 理论 / 工具
|
|
405
|
+
│ └─ Subproblems/<id>.md # 子问题
|
|
406
|
+
├─ Shared/
|
|
407
|
+
│ ├─ Chat/<日期>.md # 群聊记录
|
|
408
|
+
│ ├─ Meetings/<mt-id>.md # 会议纪要(含表决小节)
|
|
409
|
+
│ ├─ Debates/<对象>.md # 辩论录(各轮票与理由 + 平均概率)
|
|
410
|
+
│ ├─ TaskBoard.md # 任务板镜像
|
|
411
|
+
│ └─ State-of-institute.md # 各成员对"是否已解决"的判断快照
|
|
412
|
+
├─ Verified/<类型>/<id>.md # 定论(只读;只有它能被当作已确立)
|
|
413
|
+
└─ State/
|
|
414
|
+
├─ README.md # 说明"权威状态就是本目录的 <研究所>.v5state.json"
|
|
415
|
+
└─ <研究所>.v5state.json # 唯一权威状态源(纯折叠快照;读前必 load,整份串行写入)
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
**可信分层**:只有 `Verified/` 与标注"已验证·真/假"的卡片**绝对可信**;
|
|
419
|
+
`Progress/`、`Methods/`、未定论命题、他人推测都只是**经验参考**,引用时必须注明"未验证"。
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## 12. 不变式速查(这些都有测试守着)
|
|
424
|
+
|
|
425
|
+
| 不变式 | 由谁保证 |
|
|
426
|
+
|---|---|
|
|
427
|
+
| 提示词身份 = 收件人;题头/状态块/人设三者一致 | `prompt-v5-integrity.test.mjs`(逐条断言 + 语料) |
|
|
428
|
+
| 成员先落盘进编制、再构造入职提示词 | 同上 |
|
|
429
|
+
| 章程冻结在入职时;重建会话自称"重建" | 同上 |
|
|
430
|
+
| 无院士时不出现任何院士叙事 | 同上 |
|
|
431
|
+
| 框头署名 = 真实来源 | 同上 |
|
|
432
|
+
| 一次提示词不重复投递同一条消息 | 同上 |
|
|
433
|
+
| 回执契约涵盖框架真正处理的每个字段 | 同上 |
|
|
434
|
+
| 只有 ≥ m 张一致的布尔票才能定论 | `selfdrive-v5.mjs` / `e2e-v5-round2.test.mjs` |
|
|
435
|
+
| 反向布尔票阻塞结论 | 同上 |
|
|
436
|
+
| 临时工无表决权、不能雇佣 | 同上 |
|
|
437
|
+
| 只有院士/所办能分派、定优先级、督办 | 同上 |
|
|
438
|
+
| 会议与验证互斥(双向) | `prompt-v5-integrity.test.mjs` |
|
|
439
|
+
| `formalVerify` 默认 `off` 是**真正的无操作**;非法值只回退到 `off` | `formal-verify-v5.test.mjs` |
|
|
440
|
+
| Lean 通过后,审查对象切换为**忠实性**("你不需要重新检查推导") | `formal-verify-v5.test.mjs` |
|
|
441
|
+
| `require` 模式:无形式化记录的真/假结论被记为未定论 + 形式化待办,不写 `Verified/` | `formal-verify-v5.test.mjs` |
|
|
442
|
+
| 「因难度决定不做形式化」必须显式记录原因(`note` 非空) | `formal-verify-v5.test.mjs` |
|
|
443
|
+
| 忠实性缺陷**不得**记成"命题为假":撤回 `passed`、删除 `Verified/Lean/<id>.lean`、写待办,`require` 档不定论 | `formal-verify-v5.test.mjs` |
|
|
444
|
+
| 命题的证明归档到 `Verified/Lean/<id>.lean`;可复用定义归档到**跨项目** `Formal/Lib/` | `formal-verify-v5.test.mjs` |
|
|
445
|
+
| Lean 路径守卫按词法归一 `..`(字符串前缀检查会被穿越绕过) | `formal-verify-v5.test.mjs` |
|
|
446
|
+
| 解雇是真实的(释放子会话、收回任务) | `selfdrive-v5.mjs` |
|
|
447
|
+
| 跨进程恢复不丢研究所 | `e2e-v5-round2.test.mjs` |
|
|
448
|
+
| 每条不变式都有能让套件变红的探针 | `audit-v5-sensitivity.mjs` + [`../docs/AUDIT-CHECKLIST.md`](../docs/AUDIT-CHECKLIST.md) |
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
## 13. 从 README 移入的 v5 说明(原文保留)
|
|
454
|
+
|
|
455
|
+
> 本节内容原先在 README / README.en.md 的「Vibe Math V5(研究所体系)」小节里。为让 README 中四套架构的篇幅均衡,
|
|
456
|
+
> 这些段落移入本文件(README 只保留一句话摘要与指向本节的链接)。**文字未改写,仅在此保留**;
|
|
457
|
+
> 其中与本篇 §1–§12 重叠的部分是刻意保留的原文,便于对照。
|
|
458
|
+
|
|
459
|
+
### 13.1 中文原文(原 README.md)
|
|
460
|
+
|
|
461
|
+
#### 职位与职权
|
|
462
|
+
|
|
463
|
+
| 职位 | 代号 | 表决权 | 职权 |
|
|
464
|
+
|---|---|---|---|
|
|
465
|
+
| **院士**(领头人) | `acad` | ✅ 一票,**与他人等重** | **组织与协调中心**:建立全所视图(`overview`)、把原问题拆解成任务并**分派**(`assign`)、设定优先级(`prioritize`)、召集并主持会议(`convene`)、督导进度(`nudge`)、调配临时工、对外汇报。**不能单方面定论**,也不能自我扩张编制。 |
|
|
466
|
+
| **常驻研究员** | `r-<n>` | ✅ 一票 | 在自己的方向上深入钻研;**可自主雇佣/解雇自己的临时工**;向院士汇报进展、接受其组织与分派(**有据理反对权**)。 |
|
|
467
|
+
| **临时工** | `t-<n>` | ❌ | 为特定任务临时雇入:可读/可想/可发言/可写自己的成果库/可认领或被分派任务;由**雇主或院士**解雇。代号永不复用。 |
|
|
468
|
+
| **所办**(主助手) | —— | ❌ | **不参与研究、不投票**。只汇报、把人的话翻译成工具调用,并代持平台要求的创建权(建所/增聘常驻研究员)。 |
|
|
469
|
+
|
|
470
|
+
**分工一句话**:**组织由院士负责,但判断属于每个人自己** —— 院士分派的是**工作**,不是**结论**。
|
|
471
|
+
|
|
472
|
+
#### 求真规则(V5 的核心)
|
|
473
|
+
|
|
474
|
+
一个对象进入 `Verified/` 必须**同时**满足:
|
|
475
|
+
|
|
476
|
+
1. 至少有 **m = min(`quorumCap`, 在册有表决权人数)** 名有表决权者投出**布尔概率值**;
|
|
477
|
+
2. 这些票**全部**是 `1`(绝对为真)或**全部**是 `0`(绝对为假)。
|
|
478
|
+
|
|
479
|
+
票是 `[0,1]` 的数值:**严格介于 0 与 1 之间 = 弃权/存疑**(不计入 m,但计入全组平均概率)。
|
|
480
|
+
**任何一张反向布尔票都会阻塞定论** —— 少数派无法靠别人弃权把结论推过去。
|
|
481
|
+
未达门槛的对象**留在原库**,并附上全组平均概率与完整辩论录,**不强行裁决**。
|
|
482
|
+
|
|
483
|
+
表决两段式:先【独立初评】(彼此不可见),未定论再进入【公开辩论】后重投,轮次上限 `verdictMaxRounds`。
|
|
484
|
+
`quorumMode: "all-unanimous"` 可切回 v4 的"全体一致"口径。
|
|
485
|
+
|
|
486
|
+
#### 运行机制
|
|
487
|
+
|
|
488
|
+
- **通信**:群聊(扇出给每位其他成员)、私信、只投给有表决权者;消息**逐收件人持久化**,
|
|
489
|
+
先落盘再投递,群聊按 `chatDigestMs` / `chatDigestMax` 合批摘要(私信/会议/表决不合批)。
|
|
490
|
+
一切所内通信都经框架中继(DSH 的邻接限制不允许成员之间直接发消息),但**署名始终是真实发送者**。
|
|
491
|
+
- **会议与验证互斥**(双向):验证进行中会议请求会**暂存**;会议进行中提出的验证会**排队**——
|
|
492
|
+
两个共识过程永不同时进行,避免互相饿死看门狗时钟。会议按**随机发言序**逐个收集意见,
|
|
493
|
+
收口时汇总表决并检查是否全体认为已解决。
|
|
494
|
+
- **任务板**:compare-and-set(改前必须读到最新 `expected_revision`)+ 依赖 DAG(认领前必须全部依赖已完成,
|
|
495
|
+
环检测拒绝坏依赖)+ 写范围重叠告警;owner 被解雇时任务自动收回。
|
|
496
|
+
- **雇佣 / 解雇**:院士与常驻研究员都可雇**自己的**临时工,配额按人(`maxTempPerMember`)与全所
|
|
497
|
+
(`maxTempTotal`)双限;解雇是**真实的**——取消在途回合、释放常驻子会话、收回任务、丢弃未投递邮件。
|
|
498
|
+
- **活性**:主驱动是**一次性活动等待**(`vibe_v5_wait`,不轮询);调度器按优先级推进
|
|
499
|
+
(进行中的会议/验证 → 队列中的验证 → 暂存会议 → 在办任务 → 加急邮件 → 群聊摘要 → 停滞自动开会 → 兜底心跳),
|
|
500
|
+
并发受 `maxParallel` 闸门限制;任务板的"推一把"按 `activityTimeoutMs` **节流**。
|
|
501
|
+
- **看门狗**:会议/验证超过 2×`activityTimeoutMs` 没有新发言/新票 → 放弃它并回到自组织;
|
|
502
|
+
心跳**每次唤醒后都重新武装**,所以调度器不会永久冻结。
|
|
503
|
+
- **上下文**:达 `compactThreshold`(%)或累计 `compactAfterRounds` 轮时要求成员把工作状态浓缩进
|
|
504
|
+
`Progress/`;**规章在 persona 里**,压缩后依然有效,不需要每轮重申。
|
|
505
|
+
- **停止**:**仅当全体有表决权者都认为原问题已解决**才结题(写 `Problems/conclusion.md`)。
|
|
506
|
+
|
|
507
|
+
#### 状态与持久化
|
|
508
|
+
|
|
509
|
+
研究所状态只写在**研究所目录下的加固 JSON** `State/<研究所>.v5state.json` 里:框架的副作用只是把 11 类事件
|
|
510
|
+
交给 `applyV5Event` 纯折叠成状态,再把整份快照**串行落盘**(每条序列化链只服务一个文件)。因此
|
|
511
|
+
|
|
512
|
+
- **零 token 成本**:这些事件**不进模型上下文**,不占成员的对话预算;
|
|
513
|
+
- **恢复走同一条代码路径**:跨进程重启与同进程 abort 后 resume 都靠"读前必 load",两条路径是同一段代码;
|
|
514
|
+
- v4 的 `State/*.json` 直写带来的"损坏静默覆盖 / 并发丢写 / 跨进程陈旧快照"这一整类问题在构造上被消除。
|
|
515
|
+
|
|
516
|
+
**v5 不再把研究所事件写进宿主会话日志**:DSH 的会话持久化遇到日志里不认识的事件类型会**拒绝加载整个会话**
|
|
517
|
+
(除非写入方标记 `ignorable: true`,而 `Session.append` 无法设置该字段),那会让**你自己的会话在下次恢复时打不开**。
|
|
518
|
+
除状态文件之外的文件(成员成果库、群聊、会议纪要、辩论录、编制镜像、任务板镜像)都是**人可读产物**,
|
|
519
|
+
手工改坏不会破坏研究所。
|
|
520
|
+
|
|
521
|
+
#### 提示词是怎么构成的
|
|
522
|
+
|
|
523
|
+
成员的"人设"(persona)承载**十节公共规章**(编制与同事、通用规章、资料库与 progress 格式、
|
|
524
|
+
组织与协调、表决规则、每轮节奏、雇佣解雇、任务板、上下文纪律、停止条件),在**入职时冻结**并随会话持久化;
|
|
525
|
+
每轮提示词只携带短小的**状态块**(我是谁 / 轮次 / m / 在册名单 / 我的任务 / 新到的消息)、**本轮问句**
|
|
526
|
+
和**回执契约**。回执契约里框架真正处理的每个字段都会出现并按职位裁剪
|
|
527
|
+
(临时工没有 `verdict`/`hire`/`fire`;非院士没有 `assign`/`prioritize`/`nudge`/`convene_meeting`)。
|
|
528
|
+
|
|
529
|
+
框架把"成员读到的文字"当作产品来保证:身份**显式传递、绝不猜测**;成员**先落盘进编制、再构造**它的入职
|
|
530
|
+
提示词;章程快照冻结在入职时,会话重建会框为 `【会话重建】` 而不是"刚入职";没有院士时不出现任何院士叙事;
|
|
531
|
+
消息框头按**真实来源**标注(所办分派 ≠ 院士分派;督办 ≠ 分派);框架反馈有独立发送者,
|
|
532
|
+
且**一次提示词只投递一条消息**。
|
|
533
|
+
|
|
534
|
+
#### 目录结构(研究所)
|
|
535
|
+
|
|
536
|
+
```
|
|
537
|
+
<会话工作区>/VibeMath/Projects/<项目>/Institutes/<研究所>/
|
|
538
|
+
├─ Institutes.md # 编制镜像(人读快照,勿手改)
|
|
539
|
+
├─ Problems/<id>.md # 原问题
|
|
540
|
+
├─ Problems/conclusion.md # 结题记录
|
|
541
|
+
├─ Members/<代号>/
|
|
542
|
+
│ ├─ Progress/progress.md # 研究日志(压缩后恢复状态的主要依据)
|
|
543
|
+
│ ├─ Propos/<id>.md # 命题
|
|
544
|
+
│ ├─ Methods/<id>.md # 方法 / 理论 / 工具
|
|
545
|
+
│ └─ Subproblems/<id>.md # 子问题
|
|
546
|
+
├─ Shared/
|
|
547
|
+
│ ├─ Chat/<日期>.md # 群聊记录
|
|
548
|
+
│ ├─ Meetings/<mt-id>.md # 会议纪要(含表决小节)
|
|
549
|
+
│ ├─ Debates/<对象>.md # 辩论录(各轮票与理由 + 平均概率)
|
|
550
|
+
│ ├─ TaskBoard.md # 任务板镜像
|
|
551
|
+
│ └─ State-of-institute.md # 成员对"是否已解决"的判断快照
|
|
552
|
+
├─ Verified/<类型>/<id>.md # 定论(只读;只有它能被当作已确立)
|
|
553
|
+
└─ State/README.md # 说明"这里的文件是镜像,请勿手改"
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
#### 工具面
|
|
557
|
+
|
|
558
|
+
| 谁 | 工具 |
|
|
559
|
+
|---|---|
|
|
560
|
+
| **所办 / 人** | `vibe_v5_configure`(先配置)→ `vibe_v5_start`(开工);`vibe_v5_resume` / `pause` / `stop`;`vibe_v5_set`(调参,立即生效);`vibe_v5_status` / `report` / `members`;`vibe_v5_message` / `meeting`;`vibe_v5_hire` / `fire` / `add_researcher` / `remove_researcher`;斜杠命令 `/v5` |
|
|
561
|
+
| **全体成员** | `vibe_v5_say`(群聊/私信/致全体表决者)、`vibe_v5_wait`(免轮询等待)、`vibe_v5_record_progress`、`vibe_v5_record_proposition` / `_method` / `_subproblem`、`vibe_v5_read_library`(跨读他人库,只读)、`vibe_v5_propose_verify`、`vibe_v5_verdict`、`vibe_v5_task_create` / `_list` / `_get` / `_update`、`vibe_v5_meeting`(提议) |
|
|
562
|
+
| **院士**(另有 `academicianLeads` 开关) | `vibe_v5_overview`(全所视图)、`vibe_v5_assign`(分派,须写明理由与验收标准)、`vibe_v5_prioritize`、`vibe_v5_nudge` |
|
|
563
|
+
|
|
564
|
+
#### 与 v4 的关键差异
|
|
565
|
+
|
|
566
|
+
- **有领头人**:v4 无中央调度、一切靠讨论涌现;v5 在**所内**设有院士负责组织与分派
|
|
567
|
+
(**框架仍然绝不指派**——指派者是院士,同样受 m 票约束)。
|
|
568
|
+
- **求真门槛从"全体一致"改为"≥ m 一致"**(可切回 v4 口径)。
|
|
569
|
+
- **状态存于研究所目录下的加固 JSON** `State/<研究所>.v5state.json`(串行写、读前必 load):恢复就是"读之前先 load"(见上)。
|
|
570
|
+
- **三类职位 + 可雇用的临时工**:编制是可变的,雇佣/解雇是真实的可逆操作。
|
|
571
|
+
- **不引入任何 npm 实验包**:v5 是 preset 内的单个 `.js` 文件,零依赖。
|
|
572
|
+
- **会议与验证严格互斥**(双向排队)。
|
|
573
|
+
|
|
574
|
+
详见 [`vibe-math-v5/实现方案.md`](vibe-math-v5/实现方案.md)(文字规格)与
|
|
575
|
+
[`vibe-math-v5/架构图.md`](vibe-math-v5/架构图.md)(全部细节图)。
|
|
576
|
+
|
|
577
|
+
### 13.2 English original (moved from README.en.md)
|
|
578
|
+
|
|
579
|
+
#### Positions and Authority
|
|
580
|
+
|
|
581
|
+
| Position | Codename | Voting right | Authority |
|
|
582
|
+
|---|---|---|---|
|
|
583
|
+
| **Academician** (leader) | `acad` | ✅ one vote, **of equal weight with others** | **Center of organization and coordination**: build an institute-wide overview (`overview`), decompose the original problem into tasks and **assign** them (`assign`), set priorities (`prioritize`), convene and chair meetings (`convene`), supervise progress (`nudge`), move temp workers around, report outward. **Cannot unilaterally conclude**, and cannot expand the roster on its own. |
|
|
584
|
+
| **Resident researcher** | `r-<n>` | ✅ one vote | Digs deep in its own direction; **may autonomously hire/fire its own temp workers**; reports progress to the academician and accepts its organization and assignments (**has the right of reasoned objection**). |
|
|
585
|
+
| **Temp worker** | `t-<n>` | ❌ | Hired temporarily for a specific task: can read/think/speak/write its own output library/claim or be assigned tasks; fired by its **employer or the academician**. Codenames are never reused. |
|
|
586
|
+
| **Institute office** (main assistant) | —— | ❌ | **Does not take part in research and does not vote.** Only reports, translates the human's words into tool calls, and holds on the human's behalf the creation rights the platform requires (creating an institute / adding resident researchers). |
|
|
587
|
+
|
|
588
|
+
**Division of labor in one sentence**: **organization is the academician's responsibility, but judgment belongs to each person individually** —— what the academician assigns is **work**, not **conclusions**.
|
|
589
|
+
|
|
590
|
+
#### Truth Rules (the core of V5)
|
|
591
|
+
|
|
592
|
+
For an object to enter `Verified/` it must **simultaneously** satisfy:
|
|
593
|
+
|
|
594
|
+
1. At least **m = min(`quorumCap`, number of registered voting members)** voting members cast a **Boolean probability value**;
|
|
595
|
+
2. These votes are **all** `1` (absolutely true) or **all** `0` (absolutely false).
|
|
596
|
+
|
|
597
|
+
A vote is a numeric value in `[0,1]`: **strictly between 0 and 1 = abstention/doubt** (not counted toward m, but counted in the group's average probability).
|
|
598
|
+
**Any single opposing Boolean vote blocks a conclusion** —— the minority cannot push a conclusion through by having others abstain.
|
|
599
|
+
An object that falls short of the threshold **stays in its original library**, with the group's average probability and the complete debate record attached, and is **not forcibly ruled on**.
|
|
600
|
+
|
|
601
|
+
Voting has two stages: first [independent initial assessment] (mutually invisible), and if undecided, then [open debate] followed by a re-vote, with a round cap of `verdictMaxRounds`.
|
|
602
|
+
`quorumMode: "all-unanimous"` switches back to v4's "all-unanimous" standard.
|
|
603
|
+
|
|
604
|
+
#### Operating Mechanisms
|
|
605
|
+
|
|
606
|
+
- **Communication**: group chat (fanned out to every other member), direct message, votes cast only to members with voting rights; messages are **persisted per recipient**,
|
|
607
|
+
written to disk before delivery, and group chat is batched into digests by `chatDigestMs` / `chatDigestMax` (direct messages/meetings/votes are not batched).
|
|
608
|
+
All in-institute communication goes through the framework relay (DSH's adjacency restriction does not allow members to message each other directly), but **the signature is always the real sender**.
|
|
609
|
+
- **Meetings and verification are mutually exclusive** (in both directions): meeting requests while verification is under way are **held**; verification requested while a meeting is under way is **queued** ——
|
|
610
|
+
the two consensus processes never run at the same time, avoiding mutual starvation of the watchdog clocks. Meetings collect opinions one by one in a **random speaking order**,
|
|
611
|
+
and at closing they aggregate the votes and check whether everyone considers the problem solved.
|
|
612
|
+
- **Task board**: compare-and-set (the latest `expected_revision` must be read before a change) + dependency DAG (all dependencies must be complete before claiming;
|
|
613
|
+
cycle detection rejects bad dependencies) + write-scope overlap warnings; when an owner is fired, its tasks are automatically reclaimed.
|
|
614
|
+
- **Hiring / firing**: both academicians and resident researchers can hire **their own** temp workers, with a dual quota per member (`maxTempPerMember`) and institute-wide
|
|
615
|
+
(`maxTempTotal`); firing is **real** —— it cancels in-flight turns, releases the resident sub-session, reclaims tasks, and discards undelivered mail.
|
|
616
|
+
- **Liveness**: the main drive is a **one-shot activity wait** (`vibe_v5_wait`, no polling); the scheduler advances by priority
|
|
617
|
+
(in-progress meetings/verification → queued verification → held meetings → active tasks → urgent mail → group chat digest → auto-meeting on stall → fallback heartbeat),
|
|
618
|
+
and concurrency is gated by `maxParallel`; the task board's "nudge" is **throttled** by `activityTimeoutMs`.
|
|
619
|
+
- **Watchdog**: if a meeting/verification goes beyond 2×`activityTimeoutMs` with no new speech/new votes → abandon it and return to self-organization;
|
|
620
|
+
the heartbeat is **re-armed after every wake**, so the scheduler never freezes permanently.
|
|
621
|
+
- **Context**: upon reaching `compactThreshold` (%) or accumulating `compactAfterRounds` rounds, members are asked to condense their working state into
|
|
622
|
+
`Progress/`; **the charter lives in the persona**, remains in effect after compaction, and does not need to be restated every round.
|
|
623
|
+
- **Stopping**: the problem is concluded (**writing `Problems/conclusion.md`**) **only when all voting members consider the original problem solved**.
|
|
624
|
+
|
|
625
|
+
#### State and Persistence
|
|
626
|
+
|
|
627
|
+
Institute state is written **only** to the **hardened JSON file** `State/<institute>.v5state.json` under the institute directory: the framework's only side effect is to hand 11 kinds of events to
|
|
628
|
+
`applyV5Event`, which purely folds them into a state, and then to write that whole snapshot **serially to disk** (one serialization chain per file). Therefore
|
|
629
|
+
|
|
630
|
+
- **Zero token cost**: these events **do not enter the model context** and do not consume members' conversation budget;
|
|
631
|
+
- **Recovery takes the same code path**: both cross-process restarts and resume after an in-process abort are covered by the "mandatory load before read", which is the same code either way;
|
|
632
|
+
- the whole class of problems caused by v4's direct writes to `State/*.json` — "corrupted silent overwrite / concurrent lost writes / stale cross-process snapshots" — is eliminated by construction.
|
|
633
|
+
|
|
634
|
+
**v5 no longer writes institute events into the host session log**: DSH's session persistence **refuses to load an entire session** whose log carries an event type it does not know
|
|
635
|
+
(unless the writer marked it `ignorable: true`, and `Session.append` cannot set that field) — which would make **your own session unopenable on the next resume**.
|
|
636
|
+
Everything except the state file (member output libraries, group chat, meeting minutes, debate records, roster mirror, task board mirror) is a **human-readable artifact**,
|
|
637
|
+
and breaking it by hand does not damage the institute.
|
|
638
|
+
|
|
639
|
+
#### How the Prompt Is Composed
|
|
640
|
+
|
|
641
|
+
A member's "persona" carries the **ten-section public charter** (roster and colleagues, general rules, knowledge base and progress format,
|
|
642
|
+
organization and coordination, voting rules, per-round rhythm, hiring and firing, task board, context discipline, stopping conditions), which is **frozen at onboarding** and persists with the session;
|
|
643
|
+
each round's prompt carries only a short **state block** (who I am / the round / m / the registered roster / my tasks / newly arrived messages), **this round's question**,
|
|
644
|
+
and the **receipt contract**. Every field in the receipt contract that the framework actually handles appears, trimmed by position
|
|
645
|
+
(temp workers have no `verdict`/`hire`/`fire`; non-academicians have no `assign`/`prioritize`/`nudge`/`convene_meeting`).
|
|
646
|
+
|
|
647
|
+
The framework treats "the text a member reads" as a product to be guaranteed: identity is **passed explicitly and never guessed**; a member is **written to the roster first, and only then** are its onboarding
|
|
648
|
+
prompts constructed; the charter snapshot is frozen at onboarding, and a session rebuild is framed as the literal marker `【会话重建 —— <role> <id>】` ("session rebuild") rather than "just onboarded"; no academician narrative appears when there is no academician;
|
|
649
|
+
message headers are labeled by **true origin** (institute office assignment ≠ academician assignment; supervision ≠ assignment); framework feedback has its own sender,
|
|
650
|
+
and **only one message is delivered per prompt**.
|
|
651
|
+
|
|
652
|
+
#### Directory Structure (Institute)
|
|
653
|
+
|
|
654
|
+
```
|
|
655
|
+
<session workspace>/VibeMath/Projects/<project>/Institutes/<institute>/
|
|
656
|
+
├─ Institutes.md # roster mirror (human-readable snapshot, do not edit by hand)
|
|
657
|
+
├─ Problems/<id>.md # original problem
|
|
658
|
+
├─ Problems/conclusion.md # conclusion record
|
|
659
|
+
├─ Members/<codename>/
|
|
660
|
+
│ ├─ Progress/progress.md # research log (the main basis for restoring state after compaction)
|
|
661
|
+
│ ├─ Propos/<id>.md # proposition
|
|
662
|
+
│ ├─ Methods/<id>.md # method / theory / tool
|
|
663
|
+
│ └─ Subproblems/<id>.md # subproblem
|
|
664
|
+
├─ Shared/
|
|
665
|
+
│ ├─ Chat/<date>.md # group chat log
|
|
666
|
+
│ ├─ Meetings/<mt-id>.md # meeting minutes (including the voting section)
|
|
667
|
+
│ ├─ Debates/<object>.md # debate record (each round's votes and reasons + average probability)
|
|
668
|
+
│ ├─ TaskBoard.md # task board mirror
|
|
669
|
+
│ └─ State-of-institute.md # snapshot of members' judgment on "whether it is solved"
|
|
670
|
+
├─ Verified/<type>/<id>.md # conclusion (read-only; only this can be treated as established)
|
|
671
|
+
└─ State/README.md # explains that "the files here are mirrors — do not hand-edit them"
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
#### Tool Surface
|
|
675
|
+
|
|
676
|
+
| Who | Tools |
|
|
677
|
+
|---|---|
|
|
678
|
+
| **Institute office / human** | `vibe_v5_configure` (configure first) → `vibe_v5_start` (start work); `vibe_v5_resume` / `pause` / `stop`; `vibe_v5_set` (adjust parameters, effective immediately); `vibe_v5_status` / `report` / `members`; `vibe_v5_message` / `meeting`; `vibe_v5_hire` / `fire` / `add_researcher` / `remove_researcher`; slash command `/v5` |
|
|
679
|
+
| **All members** | `vibe_v5_say` (group chat/direct message/to all voters), `vibe_v5_wait` (poll-free wait), `vibe_v5_record_progress`, `vibe_v5_record_proposition` / `_method` / `_subproblem`, `vibe_v5_read_library` (cross-read others' libraries, read-only), `vibe_v5_propose_verify`, `vibe_v5_verdict`, `vibe_v5_task_create` / `_list` / `_get` / `_update`, `vibe_v5_meeting` (propose) |
|
|
680
|
+
| **Academician** (also has the `academicianLeads` switch) | `vibe_v5_overview` (institute-wide overview), `vibe_v5_assign` (assignment, must state the reason and acceptance criteria), `vibe_v5_prioritize`, `vibe_v5_nudge` |
|
|
681
|
+
|
|
682
|
+
#### Key Differences from v4
|
|
683
|
+
|
|
684
|
+
- **There is a leader**: v4 has no central scheduling and everything emerges from discussion; v5 has an academician responsible for organization and assignment **inside the institute**
|
|
685
|
+
(**the framework still never assigns** —— the assigner is the academician, who is likewise bound by the m votes).
|
|
686
|
+
- **The truth gate changes from "all-unanimous" to "≥ m unanimous"** (switchable back to the v4 standard).
|
|
687
|
+
- **State is stored in the hardened JSON file** `State/<institute>.v5state.json` under the institute directory (serial writes, a mandatory load before read): recovery is simply that load-before-read (see above).
|
|
688
|
+
- **Three classes of positions + hireable temp workers**: the roster is mutable, and hiring/firing are real reversible operations.
|
|
689
|
+
- **No npm experimental package is introduced**: v5 is a single `.js` file within the preset, with zero dependencies.
|
|
690
|
+
- **Meetings and verification are strictly mutually exclusive** (queued in both directions).
|
|
691
|
+
|
|
692
|
+
See [the v5 specification](vibe-math-v5/实现方案.md) (written specification) and
|
|
693
|
+
[the v5 detail diagrams](vibe-math-v5/架构图.md) (all detail diagrams).
|