dsh-vibe-math 2.3.15 → 2.4.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.
Files changed (40) hide show
  1. package/README.en.md +93 -87
  2. package/README.md +58 -53
  3. package/cordis.patch.yml +1123 -10
  4. package/docs/AUDIT-CHECKLIST.md +107 -43
  5. package/docs/COMPAT-AUDIT-ROUND2.md +3 -0
  6. package/docs/COMPAT-AUDIT-ROUND3.md +139 -0
  7. package/docs/generate_framework_diagram_v2_en.mjs +595 -0
  8. package/docs/generate_framework_diagram_v3_en.mjs +624 -0
  9. package/docs/generate_framework_diagram_v4.mjs +380 -125
  10. package/docs/generate_framework_diagram_v5.mjs +366 -108
  11. package/docs/release-notes/RELEASE-NOTES-2.3.16.md +165 -0
  12. package/docs/release-notes/RELEASE-NOTES-2.4.0.md +172 -0
  13. package/docs/test-timing.md +4 -3
  14. package/docs//346/236/266/346/236/204/345/233/276.md +3 -1
  15. package/installer.js +89 -21
  16. package/package.json +40 -9
  17. package/preset-declaration.js +62 -0
  18. package/prompt-corpus-v5/prompt-corpus-v5.json +7 -7
  19. package/prompt-corpus-v5/prompt-corpus-v5.md +8 -129
  20. package/scripts/build-preset-rows.mjs +146 -0
  21. package/tests/audit-installer-compat.test.mjs +9 -3
  22. package/tests/audit-preset-rows.test.mjs +185 -0
  23. package/tests/audit-v5-integrity.mjs +49 -3
  24. package/tests/e2e-v5-round2.test.mjs +137 -67
  25. package/tests/formal-verify-v5.test.mjs +43 -35
  26. package/tests/prompt-v5-integrity.test.mjs +49 -47
  27. package/tests/selfdrive-v5.mjs +42 -55
  28. package/vibe-math-v2/vibe-math-v2.js +6 -2
  29. package/vibe-math-v3/vibe-math-v3.js +6 -2
  30. package/vibe-math-v4/vibe-math-v4.js +191 -13
  31. package/vibe-math-v5/agent.cordis.yml +8 -8
  32. package/vibe-math-v5/preset.yml +1 -1
  33. package/vibe-math-v5/vibe-math-v5.js +215 -91
  34. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +56 -44
  35. package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +24 -22
  36. package//347/244/272/344/276/213/345/233/276//346/241/206/346/236/266/345/233/276-v2-en.svg +291 -0
  37. package//347/244/272/344/276/213/345/233/276//346/241/206/346/236/266/345/233/276-v3-en.svg +316 -0
  38. package//347/244/272/344/276/213/345/233/276//346/241/206/346/236/266/345/233/276-v4-en.svg +187 -0
  39. package//347/244/272/344/276/213/345/233/276//346/241/206/346/236/266/345/233/276-v5-en.svg +174 -0
  40. package//347/244/272/344/276/213/345/233/276//346/241/206/346/236/266/345/233/276-v5.svg +14 -14
package/README.en.md CHANGED
@@ -14,7 +14,7 @@ English | [中文](README.md)
14
14
  > - **`vibe-math-v2` (probability-driven · JSON data layer) ✅ Recommended**: `qs.json` problem list + `Propos/` proposition library + probability-driven scheduling + code heuristic scheduling;
15
15
  > - **`vibe-math-v3` (third generation · paper-style md + planner agent + method library) ✅ Recommended**: all knowledge is stored and extended in **Markdown paper/research-report form** (`Problems/` problem list + dependencies + source motivation, `Progress/` research log, `Propos/` proposition library, `Methods/` general theory invention library, `Verified/` absolutely trustworthy); before scheduling, the **planner agent** autonomously draws up a plan for the next N steps; theories/frameworks/tools/methods/ideas invented during solving are distilled by the **Method Keeper** into a reusable method system (as in inventing group theory or functional analysis).
16
16
  > - **`vibe-math-v4` (fourth generation · resident self-organizing collaborative research) 🧪 Experimental**: a group of **persistent resident subagents** **leave messages for one another + hold meetings**, and autonomously decide all task arrangements (no central scheduler); each accumulates its own progress/proposition/method/subproblem libraries and consults the others; verification is written to `Verified/` **only when all residents agree (true or false)**, otherwise it remains in the library with a probability attached; when the context reaches a threshold it automatically `/compact`s; it stops only when all agree that the original problem has been solved.
17
- > - **`vibe-math-v5` (fifth generation · institute system) 🧪 Experimental · Latest**: upgrades the residents into an **institute** — **academicians** (leaders / the organizing and coordinating center, responsible for decomposition and **assignment**, setting priorities, chairing meetings, and supervising progress) + **resident researchers** (with voting rights, able to autonomously hire/fire their own temp workers) + **temp workers** (no voting rights); it has a **public charter**, **group chat and meetings**, a **compare-and-set task board**, and **real firing**; a boolean agreement of **≥ m votes** is required to write to `Verified/` (opposing votes block, abstentions are not counted, and if the threshold is not met it remains in the library with an average probability attached); state is stored in **host-only projection units of the session log**, at zero token cost.
17
+ > - **`vibe-math-v5` (fifth generation · institute system) 🧪 Experimental · Latest**: upgrades the residents into an **institute** — **academicians** (leaders / the organizing and coordinating center, responsible for decomposition and **assignment**, setting priorities, chairing meetings, and supervising progress) + **resident researchers** (with voting rights, able to autonomously hire/fire their own temp workers) + **temp workers** (no voting rights); it has a **public charter**, **group chat and meetings**, a **compare-and-set task board**, and **real firing**; a boolean agreement of **≥ m votes** is required to write to `Verified/` (opposing votes block, abstentions are not counted, and if the threshold is not met it remains in the library with an average probability attached); state is written to the **hardened JSON file** `State/<institute>.v5state.json` under the institute directory (serial writes, a mandatory load before read) — **never into the host session log** — at zero token cost.
18
18
 
19
19
  After installing this plugin package (or manually copying the presets), **four** agent presets appear in DSH's preset selector.
20
20
 
@@ -22,30 +22,32 @@ After installing this plugin package (or manually copying the presets), **four**
22
22
 
23
23
  ## 🧩 Architecture Diagrams (v2 + v3 + v4 + v5)
24
24
 
25
- > Static architecture diagrams; for the complete process description see [docs/架构图.md](docs/架构图.md) (v2 in detail) and
26
- > [vibe-math-v5/架构图.md](vibe-math-v5/架构图.md) (the full set of v5 detail diagrams);
27
- > editable generation scripts: [v2](docs/generate_framework_diagram_v2.py) / [v3](docs/generate_framework_diagram_v3.py) (matplotlib → PNG),
25
+ > Static architecture diagrams; for the complete process description see [the v1-era architecture notes](docs/架构图.md) (historical: the layout changed from v2 on) and
26
+ > [the v5 detail diagrams](vibe-math-v5/架构图.md) (the full set of v5 detail diagrams);
27
+ > editable generation scripts: the Chinese v2/v3 posters come from the matplotlib scripts
28
+ > [v2](docs/generate_framework_diagram_v2.py) / [v3](docs/generate_framework_diagram_v3.py) (matplotlib → PNG); the English v2/v3 diagrams come from the
29
+ > zero-dependency Node scripts [v2-en](docs/generate_framework_diagram_v2_en.mjs) / [v3-en](docs/generate_framework_diagram_v3_en.mjs) (→ **SVG**);
28
30
  > [v4](docs/generate_framework_diagram_v4.mjs) / [v5](docs/generate_framework_diagram_v5.mjs)
29
- > (zero-dependency Node → **SVG**, `node docs/generate_framework_diagram_v4.mjs`).
31
+ > (zero-dependency Node → **SVG**, `node docs/generate_framework_diagram_v4.mjs`; add `--lang=en` for `示例图/框架图-v4-en.svg`).
30
32
  > SVG is used from v4 onward: plain text, diff-friendly, crisp at any zoom; when PNG is needed, screenshot with a headless browser (the command is at the top of the generation script).
31
33
 
32
34
  ### Vibe Math V2 (probability-driven · JSON data layer) ✅ Recommended
33
35
 
34
- ![Vibe Math V2 architecture diagram](示例图/框架图-v2.png)
36
+ ![Vibe Math V2 architecture diagram](示例图/框架图-v2-en.svg)
35
37
 
36
38
  **One-sentence pipeline**: `qs.json` takes problems by priority → Explorer splits out directions (if all are dead ends, re-derive) → one Solver per direction iterates over multiple rounds (lemmas go into `Propos/`, solutions go back to `qs.json`, all probabilities <1) → the scheduler picks r (proposition / proposition+proof·disproof / problem+solution) and dispatches ≥3 verifiers for independent review → debate → ruling → at probability=1 it automatically closes out (problem solved, proposition 1/0, priority set to `never`); state is written to disk throughout, `resume` continues from the checkpoint, and `reportMode` can report by file/push/both.
37
39
 
38
40
  ### Vibe Math V3 (paper-style md + planner agent + methods library) ✅ Recommended
39
41
 
40
- ![Vibe Math V3 architecture diagram](示例图/框架图-v3.png)
42
+ ![Vibe Math V3 architecture diagram](示例图/框架图-v3-en.svg)
41
43
 
42
44
  **One-sentence pipeline**: all knowledge is stored and continued as **Markdown papers/research reports** (`Problems/` problem list including dependencies and the source motivation of follow-up problems, `Progress/` research log continued by direction and by round, `Propos/` proposition library, `Methods/` general theory invention library, `Verified/` absolutely trustworthy) → before scheduling, the scheduler builds a state brief and calls the **planner agent**; the planner agent lays out the next N steps in one go (spawn solver/verifier/explorer/method-keeper, interrupt, promote, wait), which are executed after code validation (actions exceeding the concurrency limit are queued and consumed across ticks; a planning failure automatically falls back to the v2-style heuristic) → verifiers review independently → debate → **near-consensus ruling** (if on the same side and the mean is ≥0.85/≤0.15, take the mean, fixing v2's flat misjudgment) → at probability=1 it closes out and generates a `Verified/` card → the solver's `methods_used`/`new_inventions` reports are distilled/refined into the methods library by the **Method Keeper** (which can form system hierarchies and be reused across projects).
43
45
 
44
46
  ### Vibe Math V4 (resident self-organizing collaborative research) 🧪 Experimental
45
47
 
46
- ![Vibe Math V4 architecture diagram](示例图/框架图-v4.svg)
48
+ ![Vibe Math V4 architecture diagram](示例图/框架图-v4-en.svg)
47
49
 
48
- > The SVG above is generated by a zero-dependency script: `node docs/generate_framework_diagram_v4.mjs` (pure Node, no Python/matplotlib dependency;
50
+ > The SVG above is generated by a zero-dependency script: `node docs/generate_framework_diagram_v4.mjs --lang=en` (pure Node, no Python/matplotlib dependency;
49
51
  > generation estimates text width, and any line overflowing its container raises a warning and exits with code 1).
50
52
 
51
53
  **One-sentence pipeline**: initially N **resident subagents** are created (continuable, persistent context) which first brainstorm on their own and produce initial insights/directions → after that **all task arrangements are decided autonomously by them leaving messages for each other + holding collective meetings** (the framework only provides the message bus/meetings/task board/artifact persistence, and **never assigns tasks**); each resident persists valuable artifacts into **its own** `Progress/<id>/`, `Propos/<id>/`, `Methods/<id>/`, `Subproblems/<id>/` libraries according to **degree of value / planned motivation and use / its own probability estimate**, and they **can read each other's**; verification is initiated by **their own deliberation**, and only when **all residents agree (true or false)** is it written to `Verified/`, otherwise it stays in the library with a probability attached; when a resident's context reaches a threshold (66% by default) it automatically `/compact`s; they stop **only when all of them agree that the original problem is solved**; residents can be manually intervened with/added/shut down at any time, and checkpoint resume is supported.
@@ -60,11 +62,11 @@ After installing this plugin package (or manually copying the presets), **four**
60
62
  **One-sentence positioning**: upgrade v4's "a group of residents messaging each other" into an **institute** — with three classes of staff: **academician** (leader), **resident researcher**, and **temp worker**; with the institute's **public charter**; with **group chat and meetings**; with **autonomous hiring/firing**; and where
61
63
  **any conclusion must be given a Boolean probability of 1 or 0 unanimously by at least m voting members before it can be written to `Verified/`**.
62
64
 
63
- ![Vibe Math V5 architecture diagram](示例图/框架图-v5.svg)
65
+ ![Vibe Math V5 architecture diagram](示例图/框架图-v5-en.svg)
64
66
 
65
67
  > Image sources and all detail diagrams (member lifecycle, one-round sequence, consensus state machine, meeting flow, scheduling priority, state folding,
66
- > prompt composition, task board, authority matrix): [`vibe-math-v5/架构图.md`](vibe-math-v5/架构图.md).
67
- > The SVG above is generated by a zero-dependency script: `node docs/generate_framework_diagram_v5.mjs`.
68
+ > prompt composition, task board, authority matrix): [the v5 detail diagrams](vibe-math-v5/架构图.md).
69
+ > The SVG above is generated by a zero-dependency script: `node docs/generate_framework_diagram_v5.mjs --lang=en`.
68
70
 
69
71
  ```mermaid
70
72
  flowchart TB
@@ -77,7 +79,7 @@ flowchart TB
77
79
  subgraph FW["⚙️ Framework vibe-v5 —— only a medium (middleware), never assigns tasks"]
78
80
  M["Message relay · meetings/debates · task board CAS+DAG<br/>m-vote consensus verification · context and liveness · roster and hiring · scheduler"]
79
81
  end
80
- PROJ["💾 host-only session log projection cell (key vibeMathV5)<br/>11 kinds of events · pure fold applyV5Event · DSH handles checkpoint/restore"]
82
+ PROJ["💾 State/&lt;institute&gt;.v5state.json (hardened JSON, authoritative)<br/>11 kinds of events · pure fold applyV5Event · serial writes · recovery = load before read"]
81
83
  FS["📁 Members/&lt;id&gt;/* · Shared/* · Verified/ · Problems/"]
82
84
  RULE{{"Truth gate: Boolean unanimity and Boolean votes ≥ m = min(quorumCap, number of registered voting members)"}}
83
85
  OFF <-->|"vibe_v5_* / /v5 commands ↔ status / report"| M
@@ -139,16 +141,17 @@ Voting has two stages: first [independent initial assessment] (mutually invisibl
139
141
 
140
142
  #### State and Persistence
141
143
 
142
- Institute state lives in a **host-only projection cell of the session log** (key `vibeMathV5`): the framework's only side effect is appending 11 kinds of events to the
143
- session log, from which `applyV5Event` purely folds out the state. Therefore
144
+ 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
145
+ `applyV5Event`, which purely folds them into a state, and then to write that whole snapshot **serially to disk** (one serialization chain per file). Therefore
144
146
 
145
147
  - **Zero token cost**: these events **do not enter the model context** and do not consume members' conversation budget;
146
- - **Recovery takes the same code path**: both cross-process restarts and resume after an in-process abort are covered by DSH's checkpoint/restore;
148
+ - **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;
147
149
  - 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.
148
150
 
149
- If the host has no `sessionProjections` service, v5 automatically falls back to hardened JSON (`State/<研究所>.v5state.json`, the same fold,
150
- serial writes, and a mandatory load before read), and the installer's startup self-check reports this degradation. Files outside the projection (member output libraries, group chat, meeting minutes,
151
- debate records, roster mirror, task board mirror) are all **human-readable artifacts**, and breaking them by hand does not damage the institute.
151
+ **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
152
+ (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**.
153
+ Everything except the state file (member output libraries, group chat, meeting minutes, debate records, roster mirror, task board mirror) is a **human-readable artifact**,
154
+ and breaking it by hand does not damage the institute.
152
155
 
153
156
  #### How the Prompt Is Composed
154
157
 
@@ -159,18 +162,18 @@ and the **receipt contract**. Every field in the receipt contract that the frame
159
162
  (temp workers have no `verdict`/`hire`/`fire`; non-academicians have no `assign`/`prioritize`/`nudge`/`convene_meeting`).
160
163
 
161
164
  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
162
- prompts constructed; the charter snapshot is frozen at onboarding, and a session rebuild is framed as `【会话重建】` rather than "just onboarded"; no academician narrative appears when there is no academician;
165
+ 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;
163
166
  message headers are labeled by **true origin** (institute office assignment ≠ academician assignment; supervision ≠ assignment); framework feedback has its own sender,
164
167
  and **only one message is delivered per prompt**.
165
168
 
166
169
  #### Directory Structure (Institute)
167
170
 
168
171
  ```
169
- <会话工作区>/VibeMath/Projects/<项目>/Institutes/<研究所>/
172
+ <session workspace>/VibeMath/Projects/<project>/Institutes/<institute>/
170
173
  ├─ Institutes.md # roster mirror (human-readable snapshot, do not edit by hand)
171
174
  ├─ Problems/<id>.md # original problem
172
175
  ├─ Problems/conclusion.md # conclusion record
173
- ├─ Members/<代号>/
176
+ ├─ Members/<codename>/
174
177
  │ ├─ Progress/progress.md # research log (the main basis for restoring state after compaction)
175
178
  │ ├─ Propos/<id>.md # proposition
176
179
  │ ├─ Methods/<id>.md # method / theory / tool
@@ -182,7 +185,7 @@ and **only one message is delivered per prompt**.
182
185
  │ ├─ TaskBoard.md # task board mirror
183
186
  │ └─ State-of-institute.md # snapshot of members' judgment on "whether it is solved"
184
187
  ├─ Verified/<type>/<id>.md # conclusion (read-only; only this can be treated as established)
185
- └─ State/README.md # explains that "the authoritative state is in the session log projection, not here"
188
+ └─ State/README.md # explains that "the files here are mirrors — do not hand-edit them"
186
189
  ```
187
190
 
188
191
  #### Tool Surface
@@ -198,13 +201,13 @@ and **only one message is delivered per prompt**.
198
201
  - **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**
199
202
  (**the framework still never assigns** —— the assigner is the academician, who is likewise bound by the m votes).
200
203
  - **The truth gate changes from "all-unanimous" to "≥ m unanimous"** (switchable back to the v4 standard).
201
- - **State is stored in the session log's host-only projection cell**, with DSH responsible for checkpoint/recovery (see above).
204
+ - **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).
202
205
  - **Three classes of positions + hireable temp workers**: the roster is mutable, and hiring/firing are real reversible operations.
203
206
  - **No npm experimental package is introduced**: v5 is a single `.js` file within the preset, with zero dependencies.
204
207
  - **Meetings and verification are strictly mutually exclusive** (queued in both directions).
205
208
 
206
- See [`vibe-math-v5/实现方案.md`](vibe-math-v5/实现方案.md) (written specification) and
207
- [`vibe-math-v5/架构图.md`](vibe-math-v5/架构图.md) (all detail diagrams).
209
+ See [the v5 specification](vibe-math-v5/实现方案.md) (written specification) and
210
+ [the v5 detail diagrams](vibe-math-v5/架构图.md) (all detail diagrams).
208
211
 
209
212
  ---
210
213
 
@@ -229,9 +232,9 @@ See [`vibe-math-v5/实现方案.md`](vibe-math-v5/实现方案.md) (written spec
229
232
  - **Persistent self-organization (v4)**: at the start, N **persistent resident subagents** are created, after which **all task arrangements are decided by those subagents themselves through leaving messages for each other + holding meetings** (the framework only provides the message bus/meetings/task board, and never assigns tasks).
230
233
  - **Institute system (v5)**: on top of v4's self-organization, it introduces the **organizational form of a real research institute** — the **academician** (leader) is responsible for decomposition, **assignment**, prioritization, chairing meetings, and supervising progress; **resident researchers** have voting rights and can **autonomously hire/fire their own temp workers**; **temp workers** have no voting rights; all organizational actions are performed by **members of the institute**, and the framework still only acts as the medium. See the [Vibe Math V5](#vibe-math-v5-institute-system--experimental--latest) section above for details.
231
234
  - **Adjustable quorum (v5)**: for an object to enter `Verified/`, **≥ m = min(`quorumCap`, number of enrolled voters)** voters must cast a **consistent boolean vote** (all `1` or all `0`); **an opposing vote blocks**, and **abstentions do not count as votes but do count toward the average probability**; if the threshold is not reached, the object is **kept in the library with the average probability and the complete debate record**, without forcing an adjudication.
232
- - **Zero-token-cost state persistence (v5)**: the institute state is stored in a **host-only projection unit of the session log** and does not enter the model context; cross-process and same-process recovery go through the same code path.
235
+ - **Zero-token-cost state persistence (v5)**: the institute state is written to the **hardened JSON file under the institute directory** (`State/<institute>.v5state.json`) and does not enter the model context; cross-process and same-process recovery go through the same code path (a mandatory load before read).
233
236
  - **Genuinely reversible roster (v5)**: hiring creates a resident child session; firing cancels in-flight turns, releases the child session, reclaims its tasks, and discards undelivered mail; a codename is never reused.
234
- - **Human-readable mirror (v4/v5)**: the roster table, task board, meeting minutes, debate records, and closing records are all written to disk as Markdown and are readable by humans at any time; but **the authoritative state is not in these files** (in v5 it is in the projection unit), so manually corrupting them will not break the institute.
237
+ - **Human-readable mirror (v4/v5)**: the roster table, task board, meeting minutes, debate records, and closing records are all written to disk as Markdown and are readable by humans at any time; but **the authoritative state is not in these files** (in v5 it is `State/<institute>.v5state.json`), so manually corrupting them will not break the institute.
235
238
 
236
239
  ---
237
240
 
@@ -338,44 +341,44 @@ Two installation methods, choose either one (they can also coexist):
338
341
 
339
342
  ### Method A: one-click install as a plugin package (recommended, installs all four presets at once)
340
343
 
344
+ On the desktop app, install `dsh-vibe-math` from **Settings → Plugins**; on the command line, use a profile:
345
+
341
346
  ```sh
342
347
  dsh plugin --profile <your profile> add dsh-vibe-math
343
348
  # Or install directly from GitHub:
344
349
  dsh plugin --profile <your profile> add github:ChongCyrus/Vibe-Mathematics
345
350
  ```
346
351
 
347
- During installation the plugin automatically writes the four presets into `~/.dsh/.agent-presets/`: `vibe-math-v2/`, `vibe-math-v3/`, `vibe-math-v4/` and `vibe-math-v5/`.
348
352
  Then start a new session and pick **Vibe Math V3** (v3, **primary recommendation**), **Vibe Math V2** (v2, **primary recommendation**), **Vibe Math V4** (v4, resident self-organization) or **Vibe Math V5** (v5, institute system) in the preset picker — v2 and v3 are equally primary recommendations, choose according to your actual needs (see "How to choose").
349
- **After upgrading the package version, restart DSH; the managed files in these four preset directories will be replaced wholesale with the new version's bytes — including files you edited by hand.**
350
- This is intentional: a preset that is "half old version, half new version" will fail to mount or behave strangely, and you cannot tell from the outside. **The hand edits that get replaced are not lost**:
351
- the original text is first backed up to `~/.dsh/.agent-presets/.vibe-math-backup/<old version>/<preset>/`, and the file names are listed in the log (see the installer notes at the end for details).
352
- **If you want to customize a preset, do not edit these managed files** — make a copy (the copy action in the preset picker, or copy the directory yourself into a new id); that copy belongs to you and package updates will not touch it.
353
+ **The two DSH generations land in different places, and this package adapts to both**:
354
+
355
+ - **DSH ≥ 0.1.7 (current)**: agent presets are declared as composition rows. This package declares all four presets in `cordis.patch.yml` (each row hands that preset's full plugin list to the host's `agentPresets` service), and **writes nothing into `~/.dsh/.agent-presets/`** — that directory has not been read since 0.1.7.
356
+ - **DSH ≤ 0.1.6**: presets are still directories, and the installer writes the four presets into `~/.dsh/.agent-presets/` (`vibe-math-v2/` … `vibe-math-v5/`); the declaration rows in the same `cordis.patch.yml` register nothing on those versions, so older hosts **do not error** at boot.
353
357
 
354
- ### Method B: manual install as an agent preset
358
+ **After upgrading the package version, restart DSH: the managed content is replaced wholesale with the new version's bytes — including files you edited by hand.** This is intentional: a preset that is "half old version, half new version" will fail to mount or behave strangely, and you cannot tell from the outside. **The hand edits that get replaced are not lost**: in the directory form the original text is first backed up to `~/.dsh/.agent-presets/.vibe-math-backup/<old version>/<preset>/`, and the file names are listed in the log.
359
+ **If you want to customize a preset, do not edit managed content** — make a copy (the copy action in the preset picker, or declare it under a new id in your own bundle). Note: on current DSH, if you save your own declaration for the **same id**, this package skips registration and logs one line saying so — your declaration wins.
355
360
 
356
- 1. Copy the files from the corresponding directory of this repository into the preset directory:
361
+ ### Method B: manual declaration (customization / secondary development)
357
362
 
358
- ```
359
- C:\Users\<you>\.dsh\.agent-presets\vibe-math-v2\ ← copy agent.cordis.yml / preset.yml / vibe-math-v2.js from vibe-math-v2/
360
- C:\Users\<you>\.dsh\.agent-presets\vibe-math-v3\ ← copy agent.cordis.yml / preset.yml / vibe-math-v3.js from vibe-math-v3/
361
- C:\Users\<you>\.dsh\.agent-presets\vibe-math-v4\ ← copy agent.cordis.yml / preset.yml / vibe-math-v4.js from vibe-math-v4/
362
- C:\Users\<you>\.dsh\.agent-presets\vibe-math-v5\ ← copy agent.cordis.yml / preset.yml / vibe-math-v5.js from vibe-math-v5/
363
- ```
363
+ - **DSH ≥ 0.1.7**: put the whole of `vibe-math-vN/agent.cordis.yml` into a declaration row as its `plugins` — either copy the `dsh-vibe-math/preset-declaration` row from this package's `cordis.patch.yml`, or use the host's own `@deepseek-ai/dsh-agent-preset` row; install this bundle into your profile. Full rules: the DSH skill `editing-cordis-compositions`.
364
+ - **DSH ≤ 0.1.6**: copy `agent.cordis.yml` / `preset.yml` / `vibe-math-vN.js` from `vibe-math-vN/` into `~/.dsh/.agent-presets/vibe-math-vN/`.
364
365
 
365
- 2. Start a new session and select **"Vibe Math V2"** / **"Vibe Math V3"** / **"Vibe Math V4"** / **"Vibe Math V5"** in the preset picker.
366
- 3. Once the session starts it is ready to use: v2/v3 tools are `vibe_math_*`, v4 is `vibe_v4_*`, v5 is `vibe_v5_*`; typing `/vibe`, `/v4`, `/v5` in the input box gives autocompletion.
366
+ Then start a new session and select **"Vibe Math V2"** / **"Vibe Math V3"** / **"Vibe Math V4"** / **"Vibe Math V5"** in the preset picker; once the session starts it is ready to use: v2/v3 tools are `vibe_math_*`, v4 is `vibe_v4_*`, v5 is `vibe_v5_*`; typing `/vibe`, `/v4`, `/v5` in the input box gives autocompletion.
367
367
 
368
- > After modifying preset files you must **restart the DSH process** before starting a new session (a preset's standing mount is cached until the process exits).
368
+ > After changing a preset definition you must **restart the DSH process** before starting a new session (a preset's standing mount is cached until the process exits).
369
369
 
370
370
  ### DSH version adaptation and dependencies
371
371
 
372
- - **Form dependencies**: the four presets depend on DSH's standard **agent-preset mechanism** (`~/.dsh/.agent-presets/<id>/` + preset picker) and **bundle patch mechanism** (`cordis.patch.yml` injects the installer).
372
+ - **Form dependencies (two lines, one bundle covers both)**: the **bundle patch mechanism** (`cordis.patch.yml`; `dsh.bundle.patch` must stay a **string** — 0.1.5/0.1.6 pass that value straight into `path.join`, and an array breaks the profile boot); **DSH ≥ 0.1.7** uses **composition-row declarations** (the `agentPresets` service), **DSH ≤ 0.1.6** uses the `~/.dsh/.agent-presets/<id>/` directory + preset picker.
373
373
  - **Host plugin rows**: `agent.cordis.yml` references the `@deepseek-ai/dsh-*` plugin rows provided by the host (persona, agent-instructions, tool-bash/pwsh, tool-fs/fs-search, tool-jobs, skill-filesystem, tool-skill, tool-goal, plan-mode, compaction, subagent/workflow, ask-user, todo, web, etc., about 21 unique package names). Missing rows on the host cause the preset mount to fail (an error is reported when the session starts).
374
- - **Host service APIs**: the preset plugins consume `subagents` (startContinuable / **sendMessage** (continue/wake; `followup` is only a method of the `Agent` object, **not** a `subagents` service method) / interrupt / drainContinuableChildren (used by v5 for **real dismissal**)), `agents` (get/roots), `tools` (register/restrict), `commands` (register), `fs` (resolve/stat/readText/writeText/listDir), plus the **optional** `subprocess` / `sandboxPolicy` / `compaction` / `sessionProjections` / `sessions`. These API shapes evolve with DSH versions; this project **has checked and adapted to them item by item on `dsh-v0.1.5-rc.2`** (`dsh.testedVersion` in `package.json`). **Note: starting with DSH 0.1.2, `subagents.startContinuable`'s `agentOptions` / `toolFilter` require the host provider to declare the corresponding capability** (both the in-process spawn / fork providers support it; v4/v5's ability to specify member models/routes and tool permissions depends on this).
374
+ - **Host service APIs**: the preset plugins consume `subagents` (startContinuable / **sendMessage** (continue/wake; `followup` is only a method of the `Agent` object, **not** a `subagents` service method) / interrupt / drainContinuableChildren (used by v5 for **real dismissal**)), `agents` (get/roots), `tools` (register/restrict), `commands` (register), `fs` (resolve/stat/readText/writeText/listDir), plus the **optional** `subprocess` / `sandboxPolicy` / `compaction`. These API shapes evolve with DSH versions; this project **has checked and adapted to them item by item on `dsh-v0.2.0-rc.2`** (`dsh.testedVersion` in `package.json`), and is aligned with `0.1.5-rc.2` as well. **Note: starting with DSH 0.1.2, `subagents.startContinuable`'s `agentOptions` / `toolFilter` require the host provider to declare the corresponding capability** (both the in-process spawn / fork providers support it; v4/v5's ability to specify member models/routes and tool permissions depends on this).
375
+ - **v5 keeps its institute state only in `State/<institute>.v5state.json`** (hardened JSON, serial writes, a mandatory load before read). 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 (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**.
376
+ - **Live residents are capped by the host**: DSH ≥ 0.1.7 caps the **live continuable children** of each root agent (the `subagent` row's `maxActiveSubagents`, default 8). v4/v5 report a clear message when they hit the cap and defer that spawn to the next round, instead of letting the start loop crash halfway.
375
377
  > **2026 compatibility fix highlights** (see `docs/COMPAT-AUDIT-ROUND2.md` for details): ① `tools.restrict()` **throws on unregistered tool names**, and the filter is applied when a subagent is created, so the permission name table must contain only names actually registered in this deployment — v2/v3 previously hard-coded `web`/`fetch`/`bash` (of which `bash` is `disabled` on Windows), which caused "when you want to tighten permissions, the subagent can never start"; ② v4's real `/compact` previously looked up `agents.get()` in `subagent/end`, but that event fires only after the subagent **has already been removed from the registry**, making it dead code; it now captures the reference in `subagent/start`; ③ optional services are now read **lazily** instead of being snapshotted in `apply()` (otherwise mount order could leave `subprocess` permanently undefined and silently skip directory creation).
376
- - **DSH STORE compatibility declaration**: `dsh.compatibility.dshReleases` in `package.json` declares `compatible` / `incompatible` / `unknown` item by item for each complete DSH version (currently 8 versions from `0.1.2-alpha.4` … `0.1.5-rc.2` are declared `compatible`, with `0.1.5-rc.2` as the tested target); `engines.node` is `^22.19.0 || >=24.0.0`.
377
- - **Runtime self-check (capability + version dual check)**: on every start the installer (bundle plugin): **① makes a best-effort probe of the DSH version** (reads `@deepseek-ai/dsh/package.json` or the `DSH_VERSION` environment variable; DSH does not expose its version through a public service/context, so this is best effort and is skipped if the probe fails). If a version is detected and is not declared `compatible` in `dshReleases`, a clear notice is given; **② then runs a capability self-check against host services and key APIs** (this is the real mount gate): `subagents`/`agents`/`tools`/`commands`/`fs` are **required** (missing means a warning), while `subprocess`/`sandboxPolicy`/`compaction`/`sessionProjections`/`sessions` are **optional** (missing only prompts that "functionality will silently degrade" and does not affect mounting; when `sessionProjections` is missing, v5's institute state falls back to hardened JSON), and it also includes an `fs.resolve` return-shape check and a subagent `agentOptions`/`toolFilter` capability check. If a preset fails to mount, look first at the self-check warnings in the DSH log.
378
- - **Upgrade path**: after upgrading DSH there is no need to reinstall this package; to upgrade this package use `dsh plugin --profile <your profile> add dsh-vibe-math@latest` (`dsh plugin`'s `--profile` is mandatory; use `add` rather than `update`, because a profile may pin the version to an exact value, in which case `update` will not cross over), and after restarting DSH the installer updates the managed files of the four presets wholly to the new version (modified files are likewise replaced, with the original text first going to `<presetRoot>/.vibe-math-backup/`; see the "Installation" notes above).
378
+ - **DSH STORE compatibility declaration**: `dsh.compatibility.dshReleases` in `package.json` declares `compatible` / `incompatible` / `unknown` item by item for each complete DSH version (currently 11 versions from `0.1.2-alpha.4` … `0.2.0-rc.2` are declared `compatible`, with `0.2.0-rc.2` as the tested target); `engines.dsh` is `>=0.1.2-alpha.4 <0.1.3-0 || >=0.1.3-alpha.2 <0.1.5-0 || >=0.1.5-alpha.1 <0.1.6-0 || >=0.1.6-alpha.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0 || >=0.2.0-alpha.1 <0.3.0-0`; `engines.node` is `^22.19.0 || >=24.0.0`.
379
+ It also declares `peerDependencies` (`@deepseek-ai/dsh-base`, marked optional): DSH ≥ 0.1.7 compares the plugin's declared peer range against **its own version** and, when it does not match, **skips the whole bundle with a clear message** instead of mounting a preset that cannot run.
380
+ - **Runtime self-check (version + form + capabilities)**: on every start the installer (bundle plugin): **① probes the DSH version in priority order** — the `DSH_VERSION` environment variable → the `pluginManager` service's bundle list (the version of `@deepseek-ai/dsh-base` is the host version, 0.1.7+) → `getDshRuntimeVersion()` exported by `@deepseek-ai/dsh-app-boot` (a public API since 0.2.0) → `@deepseek-ai/dsh/package.json` (global 0.1.x installs), and the log names the **source**; when a detected version is not declared `compatible` in `dshReleases`, a clear notice is given. **② decides the preset form**: whether `@deepseek-ai/dsh-agent-preset` (or its registry) is mounted in the loader entry tree tells it whether this host uses "composition rows" or "directories", which decides whether it syncs `~/.dsh/.agent-presets/` — on the new host it skips that and logs that the old directory can safely be deleted. **③ runs the capability self-check** (the real mount gate): `subagents`/`agents`/`tools`/`commands`/`fs` are **required** (missing means a warning), while `subprocess`/`sandboxPolicy`/`compaction` are **optional** (missing only prompts that "functionality will silently degrade"), plus an `fs.resolve` return-shape check and a subagent `agentOptions`/`toolFilter` capability check. If a preset fails to mount, look first at the self-check warnings in the DSH log.
381
+ - **Upgrade path**: after upgrading DSH there is no need to reinstall this package; to upgrade this package use `dsh plugin --profile <your profile> add dsh-vibe-math@latest` (`dsh plugin`'s `--profile` is mandatory; use `add` rather than `update`, because a profile may pin the version to an exact value, in which case `update` will not cross over), and after restarting DSH the managed content is updated wholly to the new version (on the DSH ≤ 0.1.6 directory form: modified files are likewise replaced, with the original text first going to `<presetRoot>/.vibe-math-backup/`; on DSH ≥ 0.1.7 the presets come from the composition rows instead — see the "Installation" notes above).
379
382
 
380
383
  ---
381
384
 
@@ -400,7 +403,7 @@ the original text is first backed up to `~/.dsh/.agent-presets/.vibe-math-backup
400
403
  > - **organized self-organization** — like a real research institute, with a **leader (academician)** responsible for decomposition, assignment, prioritization, chairing meetings and supervising progress, but **judgment still belongs to each individual**;
401
404
  > - a **roster that can grow or shrink** — resident researchers + temp workers who can be **autonomously hired/dismissed** (temp workers have no voting rights, suitable for chores such as checking, trial computation and material organization);
402
405
  > - an **adjustable consistency threshold** — `m = min(quorumCap, number of voting members)` boolean-consistent votes settle the matter (easier to converge than "unanimity", while **opposing votes still block**, so a minority will not be drowned out by abstentions);
403
- > - **zero-token-cost state persistence** — the institute state is stored in a host-only projection unit of the session log and does not consume member context budget.
406
+ > - **zero-token-cost state persistence** — the institute state is written to a hardened JSON file under the institute directory and does not consume member context budget.
404
407
  >
405
408
  > **⚠️ `vibe-math-v2` and `vibe-math-v3` are mature primary architectures; `vibe-math-v4` and `vibe-math-v5` are experimental architectures,** all are selectable; the old `vibe-math-v1` has been removed (this package contains only v2/v3/v4/v5).
406
409
 
@@ -408,7 +411,7 @@ the original text is first backed up to `~/.dsh/.agent-presets/.vibe-math-backup
408
411
  |---|---|---|---|---|
409
412
  | Positioning | **Primary** (JSON data layer) | **Primary** (third generation) | **Experimental** (fourth generation) | **Experimental** (fifth generation) |
410
413
  | Core idea | Probability-driven: `qs.json` problems + `Propos/` proposition library, scheduled by "correctness probability / value" | **Paper-style md knowledge base + planner agent scheduling + general theory invention library** | **Persistent resident subagents self-organizing**: message each other + meetings decide all tasks, no central scheduling | **Institute**: the academician organizes and assigns, members research on their own; a conclusion requires **≥ m boolean-consistent votes**; temp workers can be hired as needed |
411
- | Data | `qs/qs.json` + `Propos/<category>_Propos.json` + `Reliable/` | `Problems/` + `Progress/` + `Propos/` + `Methods/` (all md, soft-spec anchors + free narration) + `Verified/` | `Problems/` + `Progress|Propos|Methods|Subproblems/<id>/` **owned by resident id** + `Shared/` (meetings/task board/debate) + `Verified/` | Same member-owned layout as v4, plus `Institutes.md` (roster mirror); **the authoritative state is in the session log projection**, and files are only mirrors and workspaces |
414
+ | Data | `qs/qs.json` + `Propos/<category>_Propos.json` + `Reliable/` | `Problems/` + `Progress/` + `Propos/` + `Methods/` (all md, soft-spec anchors + free narration) + `Verified/` | `Problems/` + `Progress|Propos|Methods|Subproblems/<id>/` **owned by resident id** + `Shared/` (meetings/task board/debate) + `Verified/` | Same member-owned layout as v4, plus `Institutes.md` (roster mirror); **the authoritative state is `State/<institute>.v5state.json`**, and the other files are only mirrors and workspaces |
412
415
  | Roles | explorer → per-direction solver → verifier | **planner (planner agent)** → explorer → per-direction solver → verifier → **method-keeper (method organization agent)** | **N resident researchers** (continuable), no fixed roles | **academician acad** (leader) + **resident researcher r-n** (with voting rights) + **temp worker t-n** (no voting rights, hireable and dismissible) + institute office (does not research and does not vote) |
413
416
  | Scheduling | Code heuristics (priority + probability) | **The planner agent produces an N-step plan** (executed after validation, falls back to heuristics on failure) | **No central scheduling**: tasks arise from residents messaging each other / holding meetings (the framework is only a medium and does not assign) | **The framework still does not assign**; the **academician** decomposes/assigns/prioritizes/supervises, and members may object with reasons; the framework only relays, keeps the task board, holds meetings and counts |
414
417
  | Closing rule | A solution/proof reaching probability `1` closes it; `never` is never scheduled | Same as v2 (near-consensus adjudication fixes flat misjudgment) | Writes to `Verified/` **only when all residents agree (true or false)**, otherwise leaves it in the library with a probability | Writes to `Verified/` **only when boolean votes ≥ m = min(`quorumCap`, number of voting members) and all are 1 or all are 0**; opposing votes block; abstentions do not count as votes but count toward the average; (can be switched back to the v4 criterion) |
@@ -447,10 +450,10 @@ The framework = **one main agent (assistant) + one code scheduler + one planner
447
450
  | Who judges | Each on its own; a conclusion is reached only when all agree | Each on its own; a conclusion is reached only on **≥ m voting members in boolean agreement** |
448
451
  | Coordination mechanism | messages + meetings | messages + meetings (strictly mutually exclusive with verification) + **compare-and-set task board** |
449
452
  | Roster | resident, can be spawned/closed | **can grow and shrink**: resident researchers are hired with the institute office's approval; temp workers are hired and fired autonomously by academicians/researchers |
450
- | State | `State/*.json` written directly | **session-log host-only projection cells** (zero token cost, handled by DSH checkpoint/restore) |
453
+ | State | `State/*.json` written directly | **`State/<institute>.v5state.json` hardened JSON** (zero token cost, serial writes, a mandatory load before read) |
451
454
 
452
- For the complete v5 architecture (including member lifecycle, one-round timeline, consensus state machine, meeting flow, scheduling priority, state folding, prompt composition, task board, authority matrix), see [`vibe-math-v5/架构图.md`](vibe-math-v5/架构图.md); for the textual specification see
453
- [`vibe-math-v5/实现方案.md`](vibe-math-v5/实现方案.md).
455
+ For the complete v5 architecture (including member lifecycle, one-round timeline, consensus state machine, meeting flow, scheduling priority, state folding, prompt composition, task board, authority matrix), see [the v5 detail diagrams](vibe-math-v5/架构图.md); for the textual specification see
456
+ [the v5 specification](vibe-math-v5/实现方案.md).
454
457
 
455
458
  ---
456
459
 
@@ -479,6 +482,7 @@ For the complete v5 architecture (including member lifecycle, one-round timeline
479
482
  ```
480
483
  <session workspace>/VibeMath/
481
484
  ├─ Methods/ # [global] cross-project general theory invention library (v3, promoted from project level)
485
+ ├─ Formal/ # object formalization workspace: Lib/ (reusable definitions) and Proved/ (proved lemmas)
482
486
  ├─ current.<session id>.json # current project per session (parallel sessions do not overwrite each other)
483
487
  ├─ vibe_math_setting.json # (optional, global fallback) default parameters JSONC, with comments
484
488
  └─ Projects/<project>/
@@ -522,16 +526,16 @@ For the complete v5 architecture (including member lifecycle, one-round timeline
522
526
  │ └─ State-of-institute.md # snapshot of members' judgment on "whether it is solved"
523
527
  ├─ Verified/<type>/<id>.md # conclusions (read-only; only these may be treated as established)
524
528
  └─ State/
525
- ├─ README.md # explains "the authoritative state is in the session-log projection, not here"
526
- └─ <institute>.v5state.json # fallback authoritative source only when the host lacks sessionProjections
529
+ ├─ README.md # explains that "the files here are mirrors — do not hand-edit them"
530
+ └─ <institute>.v5state.json # the authoritative state (hardened JSON, serial writes, a mandatory load before read)
527
531
  ```
528
532
 
529
533
  > Enabling Lean formal verification adds two more directories: this institute's `Formal/` (working files + index + formalization todos) and `Verified/Lean/`
530
534
  > (**archived proofs**), plus the **cross-project** `<VibeMath root>/Formal/{Lib,Proved}/` (reusable definitions and already-proved lemmas) — see
531
535
  > the "Lean formal verification" section above.
532
536
 
533
- **v5 iron rules**: ① the authoritative state lives in the **session log's host-only projection cells** (key `vibeMathV5`); in the table above, everything except
534
- `State/<institute>.v5state.json` (degraded fallback) is merely a **mirror/workspace**, and breaking it by hand-editing will not destroy the institute;
537
+ **v5 iron rules**: ① the authoritative state is written only to `State/<institute>.v5state.json` (hardened JSON, serial writes, a mandatory load before read);
538
+ in the table above, every other file is merely a **mirror/workspace**, and breaking it by hand-editing will not destroy the institute;
535
539
  ② members **write only their own library** (`Members/<own codename>/`), but may read anyone's library;
536
540
  ③ only `Verified/` and cards marked "verified·true/false" are **absolutely trusted**; everything else (including unverified assertions in `Methods/`) is merely experiential reference,
537
541
  and citations must be marked "unverified"; ④ entry into the library must state all three of **degree of value / motivation-purpose plan / own probability estimate**, none may be omitted.
@@ -545,13 +549,13 @@ and citations must be marked "unverified"; ④ entry into the library must state
545
549
  Because the main agent has built-in usage instructions, you **can simply speak in plain language**:
546
550
 
547
551
  ```
548
- 帮我用 Vibe Math 证明 √2 是无理数。
552
+ Use Vibe Math to prove that √2 is irrational.
549
553
  ```
550
554
 
551
555
  The main agent will automatically: `vibe_math_add_problem` to add the problem → `vibe_math_start` to start it → after that you can ask it for progress at any time.
552
556
 
553
557
  ```
554
- 现在进展怎么样了?
558
+ How is it going so far?
555
559
  ```
556
560
 
557
561
  The main agent will automatically call `vibe_math_status` / `vibe_math_report` and report the results back to you in plain language.
@@ -594,19 +598,19 @@ The main agent's role is to be your "translator". You only need to describe the
594
598
 
595
599
  | What you say | What the main agent does |
596
600
  |---|---|
597
- | “求解 / 证明 XXX” | `add_problem` + `start`, then report |
598
- | “现在进度怎么样 / 有哪些代理在跑” | `status` / `report` / `list_agents` and summarize |
599
- | “暂停 / 终止求解” | `pause` / `abort` |
600
- | “切到人工模式,我要逐步把关” | `set_mode manual`, then remind you with `list_decisions` whenever there is a decision |
601
- | “给 q1 的某个求解方向换个思路(比如改成构造性证明)” | `list_agents` to find the childId → `message_agent` to inject new instructions |
602
- | “中断某个卡住的子代理” | `interrupt_agent` |
601
+ | “Solve / prove XXX” | `add_problem` + `start`, then report |
602
+ | “What is the progress now / which agents are running?” | `status` / `report` / `list_agents` and summarize |
603
+ | “Pause / abort the proof” | `pause` / `abort` |
604
+ | “Switch to manual mode; I want to review each step” | `set_mode manual`, then remind you with `list_decisions` whenever there is a decision |
605
+ | “Give one of q1's directions a new angle (e.g. turn it into a constructive proof)” | `list_agents` to find the childId → `message_agent` to inject new instructions |
606
+ | “Interrupt a stuck subagent” | `interrupt_agent` |
603
607
 
604
608
  ### 2. Q&A-style parameter configuration (/vibe setup)
605
609
 
606
610
  You do not even need to remember parameter names. Say:
607
611
 
608
612
  ```
609
- 帮我配置一下参数。
613
+ Help me configure the parameters.
610
614
  ```
611
615
 
612
616
  The main agent will call `vibe_math_setup` to get the full parameter schema (each item includes a **description / options / suggestion / current value**),
@@ -620,7 +624,7 @@ You can also just run the command: `/vibe setup` (view the schema) → tell the
620
624
  - **Generate a template**: `/vibe template` (generated into the workspace) or `/vibe template project` (generated into the current project) —
621
625
  it produces a JSON template **with `//` comments and an item-by-item Chinese description**; after you edit it by hand, restart/resume to take effect.
622
626
  - **Save current values**: `/vibe save` writes the currently effective parameters back to that file.
623
- - **The only persistent source**: that file is the **only persistence layer** for parameters (project level takes precedence → when missing, fall back to the global `<工作区>/VibeMath/vibe_math_setting.json` → built-in defaults).
627
+ - **The only persistent source**: that file is the **only persistence layer** for parameters (project level takes precedence → when missing, fall back to the global `<workspace>/VibeMath/vibe_math_setting.json` → built-in defaults).
624
628
  `vibe_math_set_params` / `set_mode` **write back immediately** to the project-level file and persist, so no manual save is needed.
625
629
 
626
630
  ---
@@ -630,16 +634,16 @@ You can also just run the command: `/vibe setup` (view the schema) → tell the
630
634
  **Step 1 — Start with one sentence**
631
635
 
632
636
  ```
633
- 帮我用 Vibe Math 证明:√2 是无理数。
637
+ Use Vibe Math to prove: √2 is irrational.
634
638
  ```
635
639
 
636
- The main agent runs `vibe_math_add_problem {"id":"q1","description":"证明:√2 是无理数。","priority":0}`
640
+ The main agent runs `vibe_math_add_problem {"id":"q1","description":"Prove that √2 is irrational.","priority":0}`
637
641
  then runs `vibe_math_start`, and then tells you “started”.
638
642
 
639
643
  **Step 2 — Ask about progress**
640
644
 
641
645
  ```
642
- 进展如何?
646
+ How is the progress?
643
647
  ```
644
648
 
645
649
  The main agent runs `vibe_math_status` and reports in plain language: the number of currently active subagents, the units being verified, whether there are pending decisions, and so on.
@@ -647,7 +651,7 @@ The main agent runs `vibe_math_status` and reports in plain language: the number
647
651
  **Step 3 — Tune parameters by conversation (optional)**
648
652
 
649
653
  ```
650
- 我想让它用加权投票,并发数设成 6。
654
+ I want it to use weighted voting, with the concurrency limit set to 6.
651
655
  ```
652
656
 
653
657
  The main agent `vibe_math_set_params {"verdictMode":"weighted-vote","maxParallelThreshold":6}`,
@@ -656,7 +660,7 @@ and asks you whether to `vibe_math_save_settings` to save them.
656
660
  **Step 4 — Intervene midway (optional)**
657
661
 
658
662
  ```
659
- 切到人工模式,我要在每个关键节点把关。
663
+ Switch to manual mode; I want to check every key step.
660
664
  ```
661
665
 
662
666
  The main agent `vibe_math_set_mode {"mode":"manual"}`. Afterwards, at every key node it runs `vibe_math_list_decisions`
@@ -665,13 +669,13 @@ to get the decisions, explains them to you, and waits for you to `vibe_math_deci
665
669
  **Step 5 — Wrap up**
666
670
 
667
671
  ```
668
- 结束了吗?结论是什么?
672
+ Is it finished? What is the conclusion?
669
673
  ```
670
674
 
671
- The main agent `vibe_math_status`: in `qs.csv`, `q1` has been written back as `solved`, and the solution file is in `Verified/` and named
672
- `q1-的解法_<唯一标识>.csv`.
675
+ The main agent `vibe_math_status`: in `qs/qs.json`, `q1` has been written back with `已解决 = true` (`已解决` = solved) and its solution carries `正确概率 = 1` (`正确概率` = correctness probability); the resolved fact is indexed in
676
+ `Verified/<category>_Verified.json`.
673
677
 
674
- > The corresponding wrap-up in v2 is: `q1.已解决 = true` in `qs.json`, its solution `正确概率 = 1`, and the related proposition enters `Verified/`.
678
+ > v2 writes no CSV at all: solved problems live in `qs/qs.json`, and `Verified/<category>_Verified.json` is the resolved-fact index (a solution with `正确概率 = 1` closes its problem; a proof or disproof with `正确概率 = 1` sets the proposition estimate to `1`/`0`).
675
679
 
676
680
  ---
677
681
 
@@ -770,7 +774,7 @@ Adjustable via `vibe_v4_set` (persisted to `State/settings.json`):
770
774
 
771
775
  ### v5 (institute system · experimental) defaults
772
776
 
773
- Adjustable via `vibe_v5_set` (persisted in the session log projection):
777
+ Adjustable via `vibe_v5_set` (persisted in the institute state file `State/<institute>.v5state.json`):
774
778
 
775
779
  | Parameter | Default | Description |
776
780
  |---|---|---|
@@ -805,7 +809,7 @@ Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (star
805
809
 
806
810
  ## 📝 Checkpoint resume & manual intervention (two hard requirements)
807
811
 
808
- - **Checkpoint resume**: all state is persisted to disk (v2: `VibeMath_State/*.json`; v3: `State/*.json`; **v5: the host-only projection units of the session logs**), and every subagent is a DSH **continuable persistent session** (the conversation is saved automatically by DSH). After a restart, open a new session → `vibe_math_resume` / `vibe_v4_resume` / `vibe_v5_resume` resumes the run. v2/v3 additionally use a **process epoch** to distinguish "same-process pause → resume" (keeping live subagents running) from "cross-process restart" (cleaning up stale tasks). **v3's md knowledge base is itself a narrative breakpoint** — on resume the agent continues writing from the tail of the research log / problem card / proposition card; **in v5 this role is taken by the projection units** — cross-process and same-process recovery go through the same code path, and when member sessions are rebuilt they are re-seeded by "reading back your own Progress/" (rather than making them start over).
812
+ - **Checkpoint resume**: all state is persisted to disk (v2: `VibeMath_State/*.json`; v3: `State/*.json`; **v5: the hardened JSON `State/<institute>.v5state.json` under the institute directory**), and every subagent is a DSH **continuable persistent session** (the conversation is saved automatically by DSH). After a restart, open a new session → `vibe_math_resume` / `vibe_v4_resume` / `vibe_v5_resume` resumes the run. v2/v3 additionally use a **process epoch** to distinguish "same-process pause → resume" (keeping live subagents running) from "cross-process restart" (cleaning up stale tasks). **v3's md knowledge base is itself a narrative breakpoint** — on resume the agent continues writing from the tail of the research log / problem card / proposition card; **in v5 this role is taken by the state file** — recovery is simply "load before read", cross-process and same-process go through the same code path, and when member sessions are rebuilt they are re-seeded by "reading back your own Progress/" (rather than making them start over).
809
813
  - **Intervening mid-run**: `manual` mode suspends decisions at key points (v2: explorer/solver dispatch, verification verdicts; v3: the **plan approval gate** (after the planning agent produces a plan, it waits for your approve/reject), the verification verdict gate, and the **method promotion gate** (project methods → global library)); you can switch back to automatic at any time with `set_mode auto` (which automatically clears all pending decisions); you can `message_agent` / `interrupt_agent` any subagent. **v4/v5 are intervenable by nature**: leave a message for a member at any time (`vibe_v5_message`), convene a meeting, pause the whole institute, add or remove positions — members will see it on their next round.
810
814
  - **Progress reporting**: **event-driven** by default — reports are written only when an event such as an agent status update occurs (v2: `Progress_Logs/report.json`; v3: `Progress_Logs/report.json` + `Logs/报告.md`, a paper-style human-readable summary; `reportMode` can be `file`/`push`/`both`, and `push` wakes up resident agents to report proactively via `subagents.sendMessage(root agent, resident subagent, …)` — `followup` is **not** a method of the `subagents` service, it is only a method of the `Agent` object); scheduled automatic reporting (interval in milliseconds) starts only when `reportIntervalMs` is set to >0. **v4/v5 progress reporting is "self-reporting within the institute"**: members write their progress into their own `Progress/`, and state key conclusions in the group chat (in v5 there are also readers of the mirrors `Institutes.md` / `Shared/TaskBoard.md`, the meeting minutes, the debate records, and `Problems/conclusion.md`).
811
815
 
@@ -813,10 +817,10 @@ Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (star
813
817
 
814
818
  ## 📚 Specification documents
815
819
 
816
- - **v2 (probability-driven)**: [`vibe-math-v2/实现方案.md`](vibe-math-v2/实现方案.md)
817
- - **v3 (paper-style md + planning agent + method library)**: [`vibe-math-v3/实现方案.md`](vibe-math-v3/实现方案.md)
818
- - **v4 (resident self-organization)**: [`vibe-math-v4/实现方案.md`](vibe-math-v4/实现方案.md)
819
- - **v5 (institute system)**: [`vibe-math-v5/实现方案.md`](vibe-math-v5/实现方案.md) (text specification) · [`vibe-math-v5/架构图.md`](vibe-math-v5/架构图.md) (the full set of architecture diagrams)
820
+ - **v2 (probability-driven)**: [the v2 specification](vibe-math-v2/实现方案.md)
821
+ - **v3 (paper-style md + planning agent + method library)**: [the v3 specification](vibe-math-v3/实现方案.md)
822
+ - **v4 (resident self-organization)**: [the v4 specification](vibe-math-v4/实现方案.md)
823
+ - **v5 (institute system)**: [the v5 specification](vibe-math-v5/实现方案.md) (text specification) · [the v5 detail diagrams](vibe-math-v5/架构图.md) (the full set of architecture diagrams)
820
824
  - **v5 prompts and interaction corpus**: [`prompt-corpus-v5/prompt-corpus-v5.md`](prompt-corpus-v5/prompt-corpus-v5.md) (the verbatim text of every prompt the framework actually emits, so you can manually review whether identity/positions/interaction signatures are correct)
821
825
  - **Four sets of Lean prompt corpora**: [`prompt-corpus-v2/formal-verify-v2.md`](prompt-corpus-v2/formal-verify-v2.md) · [`prompt-corpus-v3/formal-verify-v3.md`](prompt-corpus-v3/formal-verify-v3.md) · [`prompt-corpus-v4/formal-verify-v4.md`](prompt-corpus-v4/formal-verify-v4.md) (each covering off / encourage / **require** / fidelity branches / work rounds / receipt contract; the workspace is normalized to `<WS>` and the VibeMath root to `<VIBEMATH>`)
822
826
  - **The persona source text of the four presets**: [`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md) (the prompts the main agent actually receives: which tools, which parameters, which slash subcommands; generated by `audit-persona-surface.test.mjs` and shipped with the package)
@@ -833,8 +837,9 @@ Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (star
833
837
  ## ⚠️ Known limitations (deliberate simplifications)
834
838
 
835
839
  **v2**:
836
- - The installer has **versioned auto-update**: on every DSH start it compares the package version against the record in `<presetRoot>/.vibe-math-installed.json` — **as soon as the version changes (or on the first run of an older installation with no record) it replaces the managed files wholesale, regardless of whether they were modified**; replaced hand-edited originals are first backed up to `<presetRoot>/.vibe-math-backup/<old version>/<preset>/` and listed in the log. Within the same version it **rewrites no files at all** (restarting DSH will not rewrite the presets, nor disturb the generation index it records by mtime), and missing files are restored at any time. To force a full reinstall: delete the `~/.dsh/.agent-presets/vibe-math-v2`, `vibe-math-v3`, `vibe-math-v4` and `vibe-math-v5` directories and restart DSH.
837
- - **These four directories are owned by the installer**: deleting any file in them or the whole directory only leads to it being restored on the next DSH start (which is exactly why the "force a full reinstall" above works). To get rid of them entirely, uninstall this package (`dsh plugin --profile <your profile> remove dsh-vibe-math`).
840
+ - **(DSH ≤ 0.1.6, the directory form)** The installer has **versioned auto-update**: on every DSH start it compares the package version against the record in `<presetRoot>/.vibe-math-installed.json` — **as soon as the version changes (or on the first run of an older installation with no record) it replaces the managed files wholesale, regardless of whether they were modified**; replaced hand-edited originals are first backed up to `<presetRoot>/.vibe-math-backup/<old version>/<preset>/` and listed in the log. Within the same version it **rewrites no files at all** (restarting DSH will not rewrite the presets, nor disturb the generation index it records by mtime), and missing files are restored at any time. To force a full reinstall: delete those four preset directories and restart DSH.
841
+ On DSH ≥ 0.1.7 the installer **writes none of these directories** (the composition rows of the "Installation" section above supply the presets); at startup it only logs that leftover copies can safely be deleted.
842
+ - **On DSH ≤ 0.1.6 these four directories are owned by the installer**: deleting any file in them or the whole directory only leads to it being restored on the next DSH start (which is exactly why the "force a full reinstall" above works). On DSH ≥ 0.1.7 they are neither read nor written any more, so you can simply delete them; to get rid of them entirely, uninstall this package (`dsh plugin --profile <your profile> remove dsh-vibe-math`).
838
843
  - A `flat` verdict directly rules `0.5` when the debate is inconsistent (high-confidence disagreement such as 0.9 vs 1 is also misjudged as 0.5 — **v3 has fixed this with the near-consensus rule**); `forced` weights by historical accuracy + confidence.
839
844
  - Problems/propositions with `never` priority are **never scheduled**, and do not block strict termination (they count as voluntarily abstaining).
840
845
  - The four preset files are mutually independent and can coexist; only one preset can be selected in a given session at a time.
@@ -859,8 +864,9 @@ Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (star
859
864
  and only after the meeting closes does it go through the full voting procedure.
860
865
  - **After `resume`, the round counter restarts from 1** (in-memory state, used only for throttling and compaction hints); the authoritative progress lives in the members' own `Progress/`.
861
866
  - **A member's charter is an onboarding snapshot**: upgrading this package will not rewrite the charters of members in an institute that is already running (they keep the version frozen at onboarding).
862
- If you need a new charter, open a new institute in a new session; the projection state and file tree need no migration.
863
- - **Installer behavior is the same as v2** (versioned auto-update; as soon as the version changes it replaces the managed files wholesale, backing up the originals first, and the `vibe-math-v5` directory is likewise managed).
867
+ If you need a new charter, open a new institute in a new session; the state file and file tree need no migration.
868
+ - **Installer behavior is the same as v2** (on the DSH ≤ 0.1.6 directory form: as soon as the version changes it replaces the managed files wholesale, backing up the originals first, and the `vibe-math-v5` directory is likewise managed;
869
+ on DSH ≥ 0.1.7 the installer writes no preset directory at all — the presets come from the composition rows).
864
870
  - **Lean formalization requires a Lean toolchain on the host**: the framework neither bundles nor downloads one; without a toolchain the three Lean tools truthfully return
865
871
  `LEAN_NOT_FOUND`, and formalization code can still be written down and archived, but verification cannot be executed.
866
872
  - **The gate in `require` mode is "shelving" rather than "deadlock"**: true/false conclusions that lack formalization are recorded as undecided + entered into the formalization to-do,