dsh-vibe-math 2.6.0 → 2.7.1

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 (59) hide show
  1. package/README.en.md +161 -389
  2. package/README.md +161 -390
  3. package/cordis.patch.yml +62 -14
  4. package/docs/AUDIT-CHECKLIST.md +2 -2
  5. package/docs/final-paper.md +1 -0
  6. package/docs/formal-verification.md +184 -29
  7. package/docs/math-computation.md +163 -0
  8. package/docs/release-notes/RELEASE-NOTES-2.7.0.en.md +151 -0
  9. package/docs/release-notes/RELEASE-NOTES-2.7.0.md +115 -0
  10. package/docs/release-notes/RELEASE-NOTES-2.7.1.en.md +86 -0
  11. package/docs/release-notes/RELEASE-NOTES-2.7.1.md +86 -0
  12. package/docs/test-timing.md +24 -12
  13. package/installer.js +7 -4
  14. package/package.json +21 -3
  15. package/prompt-corpus-persona/persona-corpus.json +12 -12
  16. package/prompt-corpus-persona/persona-corpus.md +128 -32
  17. package/prompt-corpus-v2/formal-verify-v2.json +182 -92
  18. package/prompt-corpus-v2/formal-verify-v2.md +2379 -55
  19. package/prompt-corpus-v3/formal-verify-v3.json +215 -53
  20. package/prompt-corpus-v3/formal-verify-v3.md +2147 -22
  21. package/prompt-corpus-v4/formal-verify-v4.json +14 -14
  22. package/prompt-corpus-v4/formal-verify-v4.md +267 -14
  23. package/prompt-corpus-v5/prompt-corpus-v5.json +62 -62
  24. package/prompt-corpus-v5/prompt-corpus-v5.md +631 -3
  25. package/tests/audit-math-computation-contract.mjs +204 -0
  26. package/tests/audit-math-computation-parity.mjs +198 -0
  27. package/tests/audit-math-computation-sensitivity.mjs +231 -0
  28. package/tests/audit-persona-sensitivity.mjs +4 -4
  29. package/tests/audit-persona-surface.test.mjs +38 -10
  30. package/tests/audit-v5-integrity.mjs +14 -0
  31. package/tests/e2e-v5-round2.test.mjs +459 -2
  32. package/tests/formal-verify-v2.test.mjs +362 -8
  33. package/tests/formal-verify-v3.test.mjs +355 -6
  34. package/tests/formal-verify-v4.test.mjs +295 -6
  35. package/tests/formal-verify-v5.test.mjs +9 -1
  36. package/tests/helpers/math-computation-fake-seam.mjs +163 -0
  37. package/tests/math-computation-shared.test.mjs +806 -0
  38. package/tests/prompt-v5-integrity.test.mjs +5 -5
  39. package/vibe-math-v2/agent.cordis.yml +22 -8
  40. package/vibe-math-v2/math-computation.js +1279 -0
  41. package/vibe-math-v2/math-engines.js +197 -0
  42. package/vibe-math-v2/vibe-math-v2.js +853 -40
  43. package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +6 -0
  44. package/vibe-math-v3/agent.cordis.yml +22 -8
  45. package/vibe-math-v3/math-computation.js +1279 -0
  46. package/vibe-math-v3/math-engines.js +197 -0
  47. package/vibe-math-v3/vibe-math-v3.js +844 -47
  48. package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +6 -0
  49. package/vibe-math-v4/agent.cordis.yml +38 -6
  50. package/vibe-math-v4/math-computation.js +1279 -0
  51. package/vibe-math-v4/math-engines.js +197 -0
  52. package/vibe-math-v4/vibe-math-v4.js +816 -31
  53. package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +6 -0
  54. package/vibe-math-v5/agent.cordis.yml +42 -6
  55. package/vibe-math-v5/math-computation.js +1279 -0
  56. package/vibe-math-v5/math-engines.js +197 -0
  57. package/vibe-math-v5/vibe-math-v5.js +1132 -37
  58. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +83 -3
  59. package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +251 -0
package/README.en.md CHANGED
@@ -20,6 +20,20 @@ After installing this plugin package (or manually copying the presets), **four**
20
20
 
21
21
  ---
22
22
 
23
+ ## 🧭 Navigation: I want to … → start here
24
+
25
+ - **Get started (first run)** → [Start in five minutes](#-start-in-five-minutes)
26
+ - **Which of the four presets to pick** → [How to choose among the four presets](#-how-to-choose-among-the-four-presets)
27
+ - **Positioning, flow and division of labour of the four** → [Architecture Diagrams](#-architecture-diagrams-v2--v3--v4--v5) · [Architecture and division of labour](#-architecture-and-division-of-labour-all-four-in-parallel)
28
+ - **New: the final paper (produced at closure)** → [Features](#-features) · [full contract](docs/final-paper.md)
29
+ - **Lean formal verification** → [Lean formal verification](#-lean-formal-verification-shared-by-the-four-architectures-adjustable-switch) · [full contract](docs/formal-verification.md)
30
+ - **What is in the directories** → [Directory structure](#-directory-structure)
31
+ - **Tuning parameters** → [Parameter quick reference](#-parameter-quick-reference)
32
+ - **Checkpoint resume / mid-run intervention** → [Checkpoint resume & manual intervention](#-checkpoint-resume--manual-intervention-two-hard-requirements)
33
+ - **Known limitations** → [Known limitations](#-known-limitations-deliberate-simplifications)
34
+
35
+ ---
36
+
23
37
  ## 🧩 Architecture Diagrams (v2 + v3 + v4 + v5)
24
38
 
25
39
  > Static architecture diagrams; for the complete process description see [the v1-era architecture notes](docs/架构图.md) (historical: the layout changed from v2 on) and
@@ -93,126 +107,15 @@ flowchart TB
93
107
  M --> RULE
94
108
  ```
95
109
 
96
- #### Positions and Authority
97
-
98
- | Position | Codename | Voting right | Authority |
99
- |---|---|---|---|
100
- | **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. |
101
- | **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**). |
102
- | **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. |
103
- | **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). |
104
-
105
- **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**.
106
-
107
- #### Truth Rules (the core of V5)
108
-
109
- For an object to enter `Verified/` it must **simultaneously** satisfy:
110
-
111
- 1. At least **m = min(`quorumCap`, number of registered voting members)** voting members cast a **Boolean probability value**;
112
- 2. These votes are **all** `1` (absolutely true) or **all** `0` (absolutely false).
113
-
114
- 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).
115
- **Any single opposing Boolean vote blocks a conclusion** —— the minority cannot push a conclusion through by having others abstain.
116
- 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**.
117
-
118
- 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`.
119
- `quorumMode: "all-unanimous"` switches back to v4's "all-unanimous" standard.
120
-
121
- #### Operating Mechanisms
122
-
123
- - **Communication**: group chat (fanned out to every other member), direct message, votes cast only to members with voting rights; messages are **persisted per recipient**,
124
- written to disk before delivery, and group chat is batched into digests by `chatDigestMs` / `chatDigestMax` (direct messages/meetings/votes are not batched).
125
- 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**.
126
- - **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** ——
127
- 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**,
128
- and at closing they aggregate the votes and check whether everyone considers the problem solved.
129
- - **Task board**: compare-and-set (the latest `expected_revision` must be read before a change) + dependency DAG (all dependencies must be complete before claiming;
130
- cycle detection rejects bad dependencies) + write-scope overlap warnings; when an owner is fired, its tasks are automatically reclaimed.
131
- - **Hiring / firing**: both academicians and resident researchers can hire **their own** temp workers, with a dual quota per member (`maxTempPerMember`) and institute-wide
132
- (`maxTempTotal`); firing is **real** —— it cancels in-flight turns, releases the resident sub-session, reclaims tasks, and discards undelivered mail.
133
- - **Liveness**: the main drive is a **one-shot activity wait** (`vibe_v5_wait`, no polling); the scheduler advances by priority
134
- (in-progress meetings/verification → queued verification → held meetings → active tasks → urgent mail → group chat digest → auto-meeting on stall → fallback heartbeat),
135
- and concurrency is gated by `maxParallel`; the task board's "nudge" is **throttled** by `activityTimeoutMs`.
136
- - **Watchdog**: if a meeting/verification goes beyond 2×`activityTimeoutMs` with no new speech/new votes → abandon it and return to self-organization;
137
- the heartbeat is **re-armed after every wake**, so the scheduler never freezes permanently.
138
- - **Context**: upon reaching `compactThreshold` (%) or accumulating `compactAfterRounds` rounds, members are asked to condense their working state into
139
- `Progress/`; **the charter lives in the persona**, remains in effect after compaction, and does not need to be restated every round.
140
- - **Stopping**: the problem is concluded (**writing `Problems/conclusion.md`**) **only when all voting members consider the original problem solved**.
141
-
142
- #### State and Persistence
143
-
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
146
-
147
- - **Zero token cost**: these events **do not enter the model context** and do not consume members' conversation budget;
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;
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.
150
-
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.
110
+ **One-sentence pipeline**: the institute office (session root / human) `configure → start`s the institute → the **academician** (center of organization and coordination) decomposes the original problem, **assigns** tasks, sets priorities, chairs meetings and supervises progress; **resident researchers** research on their own and hold the vote, and **temp workers** can be hired as needed (no vote, genuinely dismissible). **The framework is only a medium and never assigns tasks**; every conclusion needs **≥ m = min(`quorumCap`, number of registered voting members) Boolean votes, all on the same side**, before it is written to `Verified/` (an opposing vote blocks; abstentions do not count as votes but count toward the average; below the threshold the object stays in its library with its average probability); meetings and verification are **mutually exclusive in both directions**; state lives in the hardened JSON `State/<institute>.v5state.json` under the institute directory (zero token cost, serial writes, a mandatory load before read); the problem is concluded **only when all voting members consider it solved**.
155
111
 
156
- #### How the Prompt Is Composed
157
-
158
- A member's "persona" carries the **ten-section public charter** (roster and colleagues, general rules, knowledge base and progress format,
159
- 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;
160
- 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**,
161
- and the **receipt contract**. Every field in the receipt contract that the framework actually handles appears, trimmed by position
162
- (temp workers have no `verdict`/`hire`/`fire`; non-academicians have no `assign`/`prioritize`/`nudge`/`convene_meeting`).
163
-
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
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;
166
- message headers are labeled by **true origin** (institute office assignment ≠ academician assignment; supervision ≠ assignment); framework feedback has its own sender,
167
- and **only one message is delivered per prompt**.
168
-
169
- #### Directory Structure (Institute)
170
-
171
- ```
172
- <session workspace>/VibeMath/Projects/<project>/Institutes/<institute>/
173
- ├─ Institutes.md # roster mirror (human-readable snapshot, do not edit by hand)
174
- ├─ Problems/<id>.md # original problem
175
- ├─ Problems/conclusion.md # conclusion record
176
- ├─ Members/<codename>/
177
- │ ├─ Progress/progress.md # research log (the main basis for restoring state after compaction)
178
- │ ├─ Propos/<id>.md # proposition
179
- │ ├─ Methods/<id>.md # method / theory / tool
180
- │ └─ Subproblems/<id>.md # subproblem
181
- ├─ Shared/
182
- │ ├─ Chat/<date>.md # group chat log
183
- │ ├─ Meetings/<mt-id>.md # meeting minutes (including the voting section)
184
- │ ├─ Debates/<object>.md # debate record (each round's votes and reasons + average probability)
185
- │ ├─ TaskBoard.md # task board mirror
186
- │ └─ State-of-institute.md # snapshot of members' judgment on "whether it is solved"
187
- ├─ Verified/<type>/<id>.md # conclusion (read-only; only this can be treated as established)
188
- └─ State/README.md # explains that "the files here are mirrors — do not hand-edit them"
189
- ```
190
-
191
- #### Tool Surface
192
-
193
- | Who | Tools |
194
- |---|---|
195
- | **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` |
196
- | **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) |
197
- | **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` |
198
-
199
- #### Key Differences from v4
200
-
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**
202
- (**the framework still never assigns** —— the assigner is the academician, who is likewise bound by the m votes).
203
- - **The truth gate changes from "all-unanimous" to "≥ m unanimous"** (switchable back to the v4 standard).
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).
205
- - **Three classes of positions + hireable temp workers**: the roster is mutable, and hiring/firing are real reversible operations.
206
- - **No npm experimental package is introduced**: v5 is a single `.js` file within the preset, with zero dependencies.
207
- - **Meetings and verification are strictly mutually exclusive** (queued in both directions).
208
-
209
- See [the v5 specification](vibe-math-v5/实现方案.md) (written specification) and
210
- [the v5 detail diagrams](vibe-math-v5/架构图.md) (all detail diagrams).
112
+ > Positions and authority, the detailed truth rules, operating mechanisms, state and persistence, prompt composition, the institute directory, the tool surface, and the differences from v4: see [the v5 detail diagrams](vibe-math-v5/架构图.md) §13 "v5 notes moved from the README" (text preserved); parameters are in the [parameter quick reference](#-parameter-quick-reference), and the final paper in [`docs/final-paper.md`](docs/final-paper.md).
211
113
 
212
114
  ---
213
115
 
214
116
  ## ✨ Features
215
117
 
118
+ - **Final paper (on by default in all four presets)**: at closure the run writes a complete paper that **only organises evidence it already has**, and the paper phase runs **before** the run is marked complete; the artifacts are `Paper/<id>/{paper.md,paper.tex,paper.pdf,paper.meta.json,paper.log.md}`. Parameters: `finalPaper` (default `true`) / `paperFormat` (default `both`) / `paperLanguage` (default `zh`) / `paperCompilePdf` (default `true`) (plus `paperEditor` on v4/v5); the manual trigger is `/vN paper [lang=] [format=] [editor=] [force]`. A PDF needs a LaTeX engine on the host (`xelatex` preferred for Chinese); without one the tex+md are still delivered. Full contract and usage: [`docs/final-paper.md`](docs/final-paper.md).
216
119
  - **Multi-agent automatic solving**: the main agent hands the problem to the scheduler, which dispatches explorer / solver / verifier (v2/v3) plus subagents such as **planner (planning agent, v3)** and **method-keeper (method organizing agent, v3)** to solve collaboratively; **you do not need to operate node by node by hand**.
217
120
  - **Multi-agent cross-validation**: every conclusion goes to ≥3 "strict reviewers" for **independent review → debate (exchange group) → adjudication** (v3 defaults to **near-consensus adjudication**: if on the same side and the mean is ≥0.85/≤0.15, take the mean, so that "0.9 vs 1" is not misjudged as 0.5).
218
121
  - **Paper-style Markdown knowledge base (v3)**: the problem list (including dependencies between problems, and the causes and plans of descendant problems), research log, propositions, and method library are all written and continued in md paper/research-report style (when a direction is re-derived, the logs of the old direction are automatically archived and kept); **only `Verified/` and the objects that a verifier judged true/false are absolutely trustworthy**, and all other md (including unverified assertions in the method library) serve only as empirical reference.
@@ -242,96 +145,19 @@ See [the v5 specification](vibe-math-v5/实现方案.md) (written specification)
242
145
 
243
146
  **What it changes is not "being a bit stricter" but the object of review itself.** m agents agreeing that "this is right" is still **consensus** —
244
147
  it cannot rule out shared misunderstanding; passing Lean is **machine checking**. The only remaining uncertainty is thus reduced to a question a single person can review effectively:
148
+ **are the definitions / objects / conditions / assumptions / conclusions in the Lean code fully consistent with the original text of the proposition (fidelity)?**
245
149
 
246
- > **Are the definitions / objects / conditions / assumptions / conclusions in the Lean code fully consistent with the original text of the proposition?**
150
+ - **Switch `formalVerify` (same name in all four architectures, default `'off'`)**: `'off'` is a **true no-op** (no Lean content appears in the prompts, no formalization state is written, and the verification flow and gates are completely unchanged; the five tools stay registered and usable and the persona always lists them, otherwise the switch would be undiscoverable and could not be turned on); `'encourage'` is **encouraged but not mandatory** (decide by implementation difficulty whether to formalize; once Lean passes, the focus of review shifts to fidelity; **no gate**); `'require'` is **mandatory** — a true/false conclusion must satisfy "**Lean has passed**" or "**the blocking reason was explicitly recorded**", otherwise the adjudication does not take effect (recorded as undecided, reason `formal-required`, written into the "formalization TODO"). Related parameters: `leanCommand` (default `lean`), `leanArgs` (used with `lake env lean`), `leanTimeoutMs` (default 120s).
247
151
 
248
- | | Original verification work | Verification work after formalization passes |
249
- |---|---|---|
250
- | Object of review | The proposition itself (whether the derivation is correct) | **Fidelity**: whether the Lean code ↔ the original text of the proposition are consistent |
251
- | Strength of the conclusion | Consensus (may be jointly wrong) | Strict (already checked by the kernel), provided that fidelity holds |
252
- | By-product | None | A reusable Lean definition / lemma library |
152
+ - **⚠️ A fidelity defect ≠ the proposition is false (important)**: passing Lean only guarantees that "this piece of code passed the kernel"; it **does not guarantee that it says what the proposition means to say**. When a voter finds the Lean code and the original proposition inconsistent (too narrow / too broad / a different object / a missing condition): **do not vote 0** (0 means "the proposition is false" — that would record "the formalization does not qualify" as "the proposition was disproved", and under v5's all-0 consistency rule it would even write the proposition into `Verified/` marked **false**, so a mechanism meant for truth-seeking would fabricate a wrong negative conclusion); instead vote a value strictly between 0 and 1 (an abstention) and record the deviation with the receipt `formal:{decision:'defect', note:'<specific deviation>'}`. The framework then **revokes the "passed" state of this proof** (downgraded to `attempted`, `Verified/Lean/<id>.lean` deleted or rewritten as a "withdrawn" note if the host cannot delete it, and written into the "formalization TODO"), and under `require` this adjudication is not concluded (the `encourage` setting has no gate, so you must not claim the framework will force a shelving). Vote 0 only when the voter, **independently of this Lean code**, can also determine that the proposition is false (and can give independent reasons).
153
+ - **The receipt channel and three further hard requirements** (members who do not call the Lean tools can also leave a judgment; mandatory under `require`): the receipt field is `"formal": {"target":"<object id>", "decision":"used|blocked|defect", "file":"Formal/<object id>.lean", "note":"difficulty judgment/blocking reason/specific deviation"}`; when `decision='blocked'`/`'defect'`, **`note` is required** (if missing the whole entry is rejected), `used` only records the object as `attempted`, and under `off` this channel **is disabled** (otherwise `off` would not be a true no-op). Three more: tool names in the injected text are always given in **full** (`<prefix>_lean_archive`, not `lean_archive` — an abbreviation is not a registered name); before archiving a reusable definition/lemma **run it through first**, and if it does not run through it must not enter the library; when the **toolchain is missing** (`LEAN_NOT_FOUND` cannot resolve the executable / the host has no `subprocess` service), write the code down, archive it, and state "the host has no Lean toolchain" in `note` — this counts as an explicit blocking reason and the gate lets it through.
253
154
 
254
- ### Switch: `formalVerify` (same name in all four architectures, default `'off'`)
155
+ - **Where the artifacts go**: `<VibeMath root>/Formal/Lib|Proved/` are the **cross-project** reusable definitions and already-proved lemmas (each with an `Index.md`, to be checked before writing a new definition); inside a project, `Formal/<object id>.lean` is the object's working file (next to an `Index.md` and, under `require`, a `TODO.md`), and `Verified/Lean/<object id>.lean` is the **archived proof** (in v5 these live under `Projects/<project>/Institutes/<institute>/`).
255
156
 
256
- | Value | Meaning |
257
- |---|---|
258
- | **`'off'` (default)** | **No additional requirement whatsoever.** No Lean content appears in member prompts, no formalization state is written, and the verification flow and gates are completely unchanged (it is a **true no-op**, guarded by assertions and probes). The three tools are still registered and usable (calling them proactively works as usual); the main agent's persona **always** lists these three tools and four parameters — otherwise the switch would not be discoverable, and "off" could not be turned on |
259
- | `'encourage'` | **Encouraged but not mandatory**: at verification time, first judge the **implementation difficulty** of the object, and if it can be formalized within an acceptable amount of work, do that first; once Lean passes, the focus of review shifts to **fidelity**. In ordinary work, it is also encouraged to formalize and archive commonly used / potentially reusable objects, assumptions, and new definitions along the way. **No gate** |
260
- | `'require'` | **Mandatory**: a true/false conclusion must satisfy "**Lean has passed**" or "**the blocking reason has been explicitly recorded**", otherwise this adjudication **does not take effect** — it is recorded as undecided (reason `formal-required`), written into the "formalization TODO", announced in the group chat, and the object is kept in the library to be re-proposed after formalization |
261
-
262
- > "Explicitly record the blocking reason" in `require` is exactly where **"decide not to do it based on implementation difficulty"** lands: **the decision is the agent's,
263
- > but the decision must be spoken and auditable**, and silently skipping is not allowed. Related parameters also include `leanCommand` (default `lean`),
264
- > `leanArgs` (used with `lake env lean`), and `leanTimeoutMs` (default 120s).
265
-
266
- ### ⚠️ A fidelity defect ≠ the proposition is false (important)
267
-
268
- Passing Lean only guarantees that "this piece of code passed the kernel"; it **does not guarantee that it says what the proposition means to say**. So when a voter, checking item by item,
269
- finds that the Lean code and the original text of the proposition are inconsistent (written too narrowly / too broadly / a different object / a missing condition):
270
-
271
- - **Do not vote 0.** Voting 0 means "**the proposition is false**"; an incorrectly written formalization would make the framework record "the formalization does not qualify"
272
- as "the proposition was disproved", and under v5's all-0 consistency rule it would even write the proposition into `Verified/` marked **false** —
273
- a mechanism meant for truth-seeking would instead **fabricate a wrong negative conclusion**.
274
- - The correct approach: give a value strictly between 0 and 1 (recorded as an abstention) + use the receipt
275
- `formal:{decision:'defect', note:'<specific deviation>'}` to record the deviation. The framework then **revokes the "passed" state of this proof**
276
- (downgraded to `attempted`; `Verified/Lean/<id>.lean` is **deleted**, and if the host cannot delete it, it is rewritten as a "withdrawn" note,
277
- never leaving a withdrawn proof in the place where everyone looks for proofs; and it is written into the "formalization TODO"), and under the `require` setting
278
- **this adjudication is not concluded** (the `encourage` setting has no gate, so you must not claim that the framework will force a shelving — there it relies on voters abstaining to prevent a conclusion);
279
- vote again only after fixing the formalization and getting it to run through.
280
- - Vote 0 only when the voter, **independently of this Lean code**, can also determine that the proposition is false (and can give independent reasons).
281
-
282
- > **Receipt channel** (members who do not call the Lean tools can also leave a judgment; it is mandatory under the `require` setting):
283
- > `"formal": {"target":"<object id>", "decision":"used|blocked|defect", "file":"Formal/<object id>.lean", "note":"difficulty judgment/blocking reason/specific deviation"}`.
284
- > When `decision='blocked'`/`'defect'`, **`note` is required** (if missing, the whole entry is rejected); `used` only records the object as `attempted`;
285
- > under the `off` setting this channel **is disabled** (otherwise `off` would not be a true no-op).
286
-
287
- > Three further hard requirements injected into the prompt (contract §6): tool names are always given in **full** (`<prefix>lean_archive`, not
288
- > `lean_archive` — an abbreviation is not a registered name, and an agent copying it would call a nonexistent tool); before archiving a reusable definition/lemma, **run it through first** —
289
- > if it does not run through, it must not enter the library; when the **toolchain is missing** (`LEAN_NOT_FOUND` cannot resolve the executable / `NO_SUBPROCESS` the host has no
290
- > subprocess service), write the code down, archive it, and state "the host has no Lean toolchain" in `note` — this counts as an explicit blocking reason,
291
- > and the gate lets it through on that basis, so it will not stall just because Lean cannot be installed.
292
-
293
- ### Archive: where formalized code goes
157
+ - **The five tools (one set per architecture, prefix following each one's naming)**: `<prefix>_lean_run` executes Lean on the host `subprocess` service (with `leanAsync=true` it enqueues and returns `{async:{jobId,state}}`; otherwise it returns `{ok, exitCode, ms, stdout, stderr}` synchronously) and **never throws** (missing toolchain → `LEAN_NOT_FOUND`, timeout → `LEAN_TIMEOUT`, path escape → rejected); `<prefix>_lean_archive`: `kind='def'/'lemma'` archives into the **cross-project** `Formal/Lib|Proved` (identical content is deduplicated), `kind='proof'` writes `Formal/<target>.lean` and **only a `settled(ok)` job** writes `Verified/Lean/<target>.lean` and marks the object Lean-passed, `kind='blocked'` records an explicit difficulty judgment/blocking reason (**reason required**); `<prefix>_lean_lib` rebuilds and returns the three indexes, the per-object status and the background jobs — **check for duplicates and reuse before writing a new definition**; `<prefix>_lean_read` reads one archived file back verbatim (only `Formal/Lib|Proved`, 64KB cap); `<prefix>_lean_job` inspects or waits for a background compile (read-only). For example, v5 is `vibe_v5_lean_*`, v2/v3 are `vibe_math_lean_*`, and v4 is `vibe_v4_lean_*` (each with run / archive / lib / read / job).
158
+ - **Boundaries (intentional)**: the framework **does not bundle Lean** (no toolchain installation, no dependency downloads; when the toolchain is missing it degrades gracefully and records this faithfully); it **does not judge fidelity** (that is what agents/humans review and vote on; the framework is only responsible for **switching** the focus of review to fidelity); **Lean passing ≠ the proposition is true** — it only means "this piece of formalized code passed the kernel check".
294
159
 
295
- ```
296
- <VibeMath root>/
297
- ├─ Formal/ # ★ cross-project reusable library (shared by the four architectures)
298
- │ ├─ Lib/<name>.lean # reusable definitions / objects / assumptions (def / structure / notation)
299
- │ ├─ Lib/Index.md # name → file → category → summary (check here before writing a new definition)
300
- │ ├─ Proved/<name>.lean # established Lean propositions / lemmas (already machine-checked)
301
- │ └─ Proved/Index.md
302
- └─ Projects/<project>/ # (in v5, Projects/<project>/Institutes/<institute>/)
303
- ├─ Formal/
304
- │ ├─ <object id>.lean # formalization working file for this object
305
- │ ├─ Index.md # object → status → file → archived proof → run result → difficulty judgment
306
- │ └─ TODO.md # the "formalization TODO" under require mode
307
- └─ Verified/
308
- ├─ <original conclusion card>
309
- └─ Lean/<object id>.lean # ★ archived proof: the formalized code corresponding to this conclusion object
310
- ```
311
-
312
- ### Tools (three per architecture, prefix following each one's naming)
313
-
314
- | Tool | Purpose |
315
- |---|---|
316
- | `<prefix>_lean_run` | Execute Lean on the host `subprocess` service, returning `{ok, exitCode, ms, stdout, stderr}`. **Never throws**: missing toolchain → `LEAN_NOT_FOUND`, timeout → `LEAN_TIMEOUT`, path escape → rejected |
317
- | `<prefix>_lean_archive` | `kind='def'/'lemma'` → archive to the **cross-project** `Formal/Lib` or `Formal/Proved`; `kind='proof'` → write `Formal/<target>.lean`, and if it runs through, also write **`Verified/Lean/<target>.lean`** and mark the object as Lean-passed; `kind='blocked'` → record an explicit difficulty judgment/blocking reason (**reason required**) |
318
- | `<prefix>_lean_lib` | Rebuild and return the three indexes and the per-object formalization status — **check for duplicates and reuse directly before writing a new definition** |
319
-
320
- For example, v5 is `vibe_v5_lean_run` / `vibe_v5_lean_archive` / `vibe_v5_lean_lib`, v2/v3 are `vibe_math_lean_*`, and v4 is `vibe_v4_lean_*`.
321
-
322
- **Boundaries (intentional)**: the framework **does not bundle Lean** (it does not install a toolchain or download dependencies; when the toolchain is missing it degrades gracefully and records this faithfully);
323
- the framework **does not judge fidelity** (that is what agents/humans review and vote on; the framework is only responsible for **switching** the focus of review to fidelity);
324
- **Lean passing ≠ the proposition is true** — it only means "this piece of formalized code passed the kernel check".
325
-
326
- For the complete contract (parameters, paths, state transitions, prompt semantics, gate locations, index format, test requirements), see
327
- [`docs/formal-verification.md`](docs/formal-verification.md).
328
-
329
- > **The personas of all four presets (the prompt the main agent receives) fully list the three tools and four parameters above**,
330
- > and the two blocks `prefix` and `text` are identical line by line (only line 0 may differ). This layer is guarded by
331
- > [`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs) and
332
- > [`audit-persona-sensitivity.mjs`](tests/audit-persona-sensitivity.mjs) — when this feature was added, it was precisely
333
- > in the four presets that the defect "the tools were registered but the persona never listed them" was found (the same batch also found that the persona listed two
334
- > tools for adding/removing resident researchers too few, and that the `/v4`/`/v5` subcommand lists were inconsistent with the implementation; see the release notes shipped with the package).
160
+ For the complete contract (parameters, paths, state transitions, prompt semantics, gate locations, index format, test requirements), see [`docs/formal-verification.md`](docs/formal-verification.md). The personas (the prompt the main agent receives) of all four presets fully list these five tools and eight parameters, and the `prefix` and `text` blocks are identical line by line (only line 0 may differ); this layer is guarded by [`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs) and [`audit-persona-sensitivity.mjs`](tests/audit-persona-sensitivity.mjs) — when this feature was added, it was precisely in the four presets that the defect "the tools were registered but the persona never listed them" was found (see the release notes shipped with the package).
335
161
 
336
162
  ---
337
163
 
@@ -425,124 +251,80 @@ choose v3 if you prefer paper-style md, the planner agent and the theory inventi
425
251
 
426
252
  ---
427
253
 
428
- ## 🧠 Architecture and Division of Labor (v3 · third generation) · classic
254
+ ## 🧠 Architecture and division of labour (all four in parallel)
429
255
 
430
- The framework = **one main agent (assistant) + one code scheduler + one planner agent + six kinds of subagents**.
256
+ ### V2 (probability-driven · classic)
431
257
 
432
- | Role | Type | Responsibility |
433
- |---|---|---|
434
- | **Main agent** | LLM (the assistant in the session) | **Natural-language interface + reporter + assistant**. It **does not solve or schedule on its own**; it is only responsible for: translating your words into `vibe_math_*` tool calls, reporting progress, configuring parameters in Q&A form, and executing control commands. |
435
- | **Scheduler** | Plugin code (not a model) | The sole master control: maintains the md knowledge base index, builds the state brief, **validates and executes the planner agent's plan**, writes files, and advances the state machine. **Hard constraints (concurrency / idempotency / already-verified is never scheduled again / write ownership) are enforced by code**. |
436
- | **Planner (planner agent)** 🆕 | Subagent | Each time a dispatch is being prepared, it reads the state brief (problem + dependencies + survival rate, verifiable objects, active agents, concurrency budget, available methods, result of the last plan) and **autonomously chooses the optimal scheduling scheme, arranging the next N steps in one go** (spawn/continue/interrupt/promote/verify/method-keep/wait). It outputs a JSON plan, which the scheduler validates before executing; on failure it automatically falls back to heuristics. |
437
- | **Explorer subagent** | Subagent | Metacognitive brainstorming: constraint decomposition, boundary testing, similar-problem mapping, splitting the problem into multiple "widely divergent" solution directions (if all are dead ends, re-derive). Before starting work it first checks the `Methods/` method library. |
438
- | **Solver subagent** | Subagent | One dedicated solver per direction, **multiple iteration rounds within the same session**, producing lemmas (with proofs), sub-routes, survival probability, and a complete solution, and **reporting `methods_used` and `new_inventions`** (methods/tools/ideas newly invented in this round). |
439
- | **Verifier subagent** | Subagent | Each verification object gets ≥3 independent "harsh reviewers": independent review → debate (chat group) → **near-consensus verdict** (if on the same side with mean ≥0.85/≤0.15, take the mean; otherwise flat/forced). |
440
- | **Method Keeper (method-organizing agent)** 🆕 | Subagent | Periodically digests recent work and new-invention reports, **distills new method cards, merges fragments, improves the system structure (parent system/sub-methods), maintains trusted assertions**, and deposits the theories/frameworks/tools/methods/ideas invented during solving into the `Methods/` general theory invention library. |
258
+ The framework = **main agent + code scheduler + explorer / solver / verifier subagents**. The scheduler is the sole master control and the sole file writer (subagents only return structured JSON and never write files); it decides the next step by **code heuristics** over "correctness probability + value/criticality + priority"; each verification object goes to ≥3 independent "harsh reviewers" for review → debate → adjudication (a solution/proof reaching probability `1` closes it; `never` is never scheduled). **Pick it** if you prefer structured JSON (`qs.json` / `Propos/`) and predictable, deterministic scheduling that does not depend on a planner agent.
441
259
 
442
- > Division of labor in one sentence: **the main agent handles "talking to people", the planner agent handles "setting the plan", the scheduler handles "execution and boundary-keeping", subagents handle "thinking", and the Method Keeper handles "depositing inventions into theory".**
260
+ > Division of labour in one sentence: **the main agent handles "talking to people", the scheduler handles "execution and boundary-keeping", and the subagents handle "thinking".**
443
261
 
444
- ### Architecture and Division of Labor (v4 / v5)
262
+ ### V3 (paper-style md + planner agent + method library) · classic
445
263
 
446
- | | **v4 (resident self-organization)** | **v5 (institute system)** |
447
- |---|---|---|
448
- | Principal | N resident subagents (continuable) | academicians + resident researchers + temp workers (all continuable subagents) |
449
- | Who assigns tasks | **No one**: emerges on its own through mutual messages and meetings | **academicians** (institute members, equally bound by the voting rules); the framework still does not assign |
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** |
451
- | Coordination mechanism | messages + meetings | messages + meetings (strictly mutually exclusive with verification) + **compare-and-set task board** |
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 |
453
- | State | `State/*.json` written directly | **`State/<institute>.v5state.json` hardened JSON** (zero token cost, serial writes, a mandatory load before read) |
264
+ The framework = **main agent + code scheduler + planner agent + explorer / solver / verifier / method-keeper subagents**. Each time a dispatch is prepared, the **planner agent** reads the state brief (problem dependencies, survival rate, verifiable objects, concurrency budget, result of the last plan) and **autonomously draws up an N-step plan**, which the scheduler validates before executing (falling back to heuristics on failure); theories/frameworks/tools/methods/ideas invented during solving are reported via `methods_used`/`new_inventions` and distilled by the **Method Keeper** into new method cards in the `Methods/` general theory invention library. **Pick it** if you prefer a paper-style md knowledge base, want more flexible scheduling, and want a systematizable, cross-project method library.
265
+
266
+ > Division of labour in one sentence: **the main agent handles "talking to people", the planner agent handles "setting the plan", the scheduler handles "execution and boundary-keeping", the subagents handle "thinking", and the Method Keeper handles "depositing inventions into theory".**
267
+
268
+ ### V4 (resident self-organization · experimental)
454
269
 
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).
270
+ The principal is **N persistent resident subagents** (continuable): **there is no central scheduling and no leader** — task arrangements emerge from residents **messaging each other + holding meetings** (the framework only provides the message bus/meetings/task board and never assigns); each accumulates its own `Progress/Propos/Methods/Subproblems` library **owned by resident id** and may read the others'; verification is written to `Verified/` **only when all residents agree (true or false)**, otherwise it stays in the library with a probability; when the context reaches a threshold it automatically `/compact`s; it stops **only when all agree that the original problem is solved** (`vibe_v4_resume` resumes from a checkpoint). **Pick it** if you want fully self-organizing research and can accept the strict "unanimity before a conclusion" threshold.
271
+
272
+ ### V5 (institute system · experimental · latest)
273
+
274
+ It upgrades v4's residents into an **institute**: **academician** (leader / organizing and coordinating centre: decomposition, **assignment**, prioritization, chairing meetings, supervising progress) + **resident researchers** (voting rights, may autonomously hire/fire their own temp workers) + **temp workers** (no voting rights); **the framework still only relays, keeps the task board, holds meetings and counts — it never assigns tasks**. The conclusion threshold is **≥ m = min(`quorumCap`, number of enrolled voting members) boolean-consistent votes** (opposing votes block; abstentions do not count as votes but count toward the average; below the threshold the object stays in the library with its average probability); state lives in `State/<institute>.v5state.json` (zero token cost); meetings and verification are strictly mutually exclusive. **Pick it** if you want "organized self-organization", a roster that can grow or shrink, and an adjustable threshold.
275
+
276
+ For the complete v5 architecture (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 [the v5 specification](vibe-math-v5/实现方案.md).
457
277
 
458
278
  ---
459
279
 
460
280
 
461
281
  ## 📁 Directory Structure
462
282
 
283
+ > Only the **top-level and high-value paths** are listed; for the full meaning of every file see each preset's `实现方案.md` ([v2](vibe-math-v2/实现方案.md) · [v3](vibe-math-v3/实现方案.md) · [v4](vibe-math-v4/实现方案.md) · [v5](vibe-math-v5/实现方案.md)) and [the v5 detail diagrams](vibe-math-v5/架构图.md).
284
+
463
285
  ### v2 (probability-driven · classic)
464
286
 
465
287
  ```
466
- <session workspace>/VibeMath/
467
- ├─ current.json # current project
468
- ├─ vibe_math_setting.json # (optional, global fallback) default parameters JSONC, with comments
469
- └─ Projects/<project>/
470
- ├─ vibe_math_setting.json # default parameters for this project
471
- ├─ qs/qs.json # problem list: overview/solved/solution list (complete solution · correctness probability)/priority/progress
472
- ├─ Propos/<category>_Propos.json # proposition library: overview/boolean estimate/fine type/proof·disproof list/priority/value·criticality/progress
473
- ├─ Reliable/ # trusted references (read-only, placed by the user)
474
- ├─ Verified/ # concluded-fact index (propositions with boolean estimate = 0/1)
475
- ├─ Verification_logs/ # debate record of each verification round (for auditing)
476
- ├─ Progress_Logs/ # periodic progress reports report.json
477
- └─ VibeMath_State/ # scheduler-private persistent state (for checkpoint resume)
288
+ <VibeMath>/Projects/<project>/
289
+ ├─ qs/qs.json # problem list (overview/solved/solutions + correctness probability/priority)
290
+ ├─ Propos/<category>_Propos.json # proposition library (boolean estimate/proof·disproof/value·criticality)
291
+ ├─ Verified/ # concluded-fact index
292
+ ├─ Reliable/ # trusted references (read-only, placed by the user)
293
+ └─ VibeMath_State/ # scheduler-private persistent state (for checkpoint resume)
478
294
  ```
479
295
 
480
296
  ### v3 (paper-style md + planner agent + method library) · classic
481
297
 
482
298
  ```
483
- <session workspace>/VibeMath/
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)
486
- ├─ current.<session id>.json # current project per session (parallel sessions do not overwrite each other)
487
- ├─ vibe_math_setting.json # (optional, global fallback) default parameters JSONC, with comments
299
+ <VibeMath>/
300
+ ├─ Methods/ # [global] cross-project general theory invention library (promoted from project level)
301
+ ├─ Formal/{Lib,Proved}/ # cross-project reusable definitions / proved lemmas (Lean)
488
302
  └─ Projects/<project>/
489
- ├─ vibe_math_setting.json # default parameters for this project
490
- ├─ Problems/<id>.md # problem list: one md per problem (soft-spec anchor: ID/type/status/priority/dependencies/dependents/source/plan
491
- │ # + ## statement / ## source and motivation (later-born problems: generation flow/motivation/backfill plan) / ## solution candidates)
492
- ├─ Progress/<id>.md # aggregated research log index (per-direction summaries + lemma index + per-round records)
493
- ├─ Progress/<id>/<direction id>.md # one independent file per direction (written directly by self-organizing agents, no cross-direction concurrency conflict)
494
- ├─ Propos/<category>/<id>.md # proposition library: one md per proposition (statement/proof attempts/disproof attempts, soft-spec anchor + free narrative)
495
- ├─ Methods/<id>.md # [general theory invention library] method card: theoretical system/framework/tool/method/idea (with application records/improvement history/system hierarchy)
496
- ├─ Verified/命题/<id>.md # absolutely trusted: scheduler-generated verified proposition cards (read-only)
497
- ├─ Verified/问题/<id>.md # absolutely trusted: complete trusted solution cards for solved problems (read-only)
498
- ├─ Reliable/ # trusted references (read-only, placed by the user)
499
- ├─ Notes/ # free notes (not involved in scheduling)
500
- ├─ Logs/Verification/ # debate record of each verification round (for auditing)
501
- ├─ Logs/Plans/ # each scheduling plan + execution result (planner learning loop)
502
- ├─ Logs/报告.md # paper-style human-readable progress report
503
- └─ State/ # scheduler-private persistent state (agents/tasks/plans/verifier_accuracy/index/project lock/process epoch)
303
+ ├─ Problems/ Progress/ Propos/ Methods/ # paper-style md knowledge base (soft-spec anchors + free narration)
304
+ ├─ Verified/{命题,问题}/ # absolutely trusted (read-only)
305
+ ├─ Logs/{Verification,Plans}/ Logs/报告.md # debate records / scheduling plans / paper-style progress report
306
+ └─ State/ # index, project lock, process epoch
504
307
  ```
505
308
 
506
- **Iron rule (v2 general)**: the scheduler is the **sole file writer** (subagents only return structured JSON and never write files).
507
- **v3 iron rule**: only `Verified/` and objects judged true/false by the verifier are **absolutely trusted**; all other md (unconcluded propositions, research logs, unverified assertions in the method library) serve only as experiential reference; the scheduler parses only soft-spec anchor lines and entry title lines, and never parses body prose. **v3 allows agents to write md directly** (self-organizing agents locate their own files, e.g. a solver writes `Progress/<id>/<direction id>.md`, a new lemma is written to `Propos/<category>/<id>.md`, and the method-organizing agent writes `Methods/<id>.md`); concurrency safety relies on **write locks** — before writing any file call `vibe_math_claim_write`, after writing call `vibe_math_release_write` (only one agent may write a given file at a time); the content stays in the md, and lightweight metadata is reported to the scheduler via `vibe_math_sync_meta`.
508
-
509
- ### v5 (institute system · experimental)
309
+ ### v4 / v5 (resident self-organization / institute system · experimental)
510
310
 
511
311
  ```
512
- <session workspace>/VibeMath/Projects/<project>/Institutes/<institute>/
513
- ├─ Institutes.md # roster mirror (human-readable snapshot: codename/position/status/employer/direction/round/context%)
514
- ├─ Problems/<id>.md # original problem
515
- ├─ Problems/conclusion.md # conclusion record (generated when all those with voting rights agree it is solved)
516
- ├─ Members/<codename>/
517
- │ ├─ Progress/progress.md # research log (narrative, appendable; the main basis for restoring state after compaction)
518
- │ ├─ Propos/<id>.md # proposition (with proof attempts/disproof attempts)
519
- │ ├─ Methods/<id>.md # method / theory / tool (with definition notation/application records/improvement history)
520
- │ └─ Subproblems/<id>.md # subproblem
521
- ├─ Shared/
522
- │ ├─ Chat/<date>.md # group chat record (including institute founding/hiring/firing/meetings/votes/conclusion announcements)
523
- │ ├─ Meetings/<mt-id>.md # meeting minutes (each member's speech + vote subsection)
524
- │ ├─ Debates/<object>.md # debate record (each round's votes and reasons + whole-group mean probability)
525
- │ ├─ TaskBoard.md # task board mirror
526
- │ └─ State-of-institute.md # snapshot of members' judgment on "whether it is solved"
527
- ├─ Verified/<type>/<id>.md # conclusions (read-only; only these may be treated as established)
528
- └─ State/
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)
312
+ <VibeMath>/Projects/<project>/
313
+ ├─ Progress|Propos|Methods|Subproblems/<resident id>/ # v4: owned by resident id
314
+ └─ Institutes/<institute>/ # v5
315
+ ├─ Members/<codename>/{Progress,Propos,Methods,Subproblems}/
316
+ ├─ Shared/{Chat,Meetings,Debates}/ Shared/TaskBoard.md Institutes.md
317
+ ├─ Verified/<type>/<id>.md # conclusions (read-only)
318
+ └─ State/<institute>.v5state.json # ★ authoritative state (hardened JSON, serial writes, mandatory load before read)
531
319
  ```
532
320
 
533
- > Enabling Lean formal verification adds two more directories: this institute's `Formal/` (working files + index + formalization todos) and `Verified/Lean/`
534
- > (**archived proofs**), plus the **cross-project** `<VibeMath root>/Formal/{Lib,Proved}/` (reusable definitions and already-proved lemmas) — see
535
- > the "Lean formal verification" section above.
536
-
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;
539
- ② members **write only their own library** (`Members/<own codename>/`), but may read anyone's library;
540
- ③ only `Verified/` and cards marked "verified·true/false" are **absolutely trusted**; everything else (including unverified assertions in `Methods/`) is merely experiential reference,
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.
321
+ **Iron rules (all four)**: the v2/v3 scheduler is the **sole file writer** (v3 also lets agents write md directly, with `vibe_math_claim_write`/`vibe_math_release_write` guaranteeing that only one writer touches a file at a time); only `Verified/` and cards marked "verified·true/false" are **absolutely trusted**, and all other md (including unverified assertions in `Methods/`) is merely experiential reference; in v5 the authoritative state is written only to `State/<institute>.v5state.json`, every other file above is only a **mirror/workspace** (hand-editing it will not break the institute), members **write only their own library**, and an entry must state **degree of value / motivation-purpose plan / own probability estimate**. With Lean enabled there are additionally the institute's `Formal/` (working files + index + formalization TODO) and `Verified/Lean/` (archived proofs), plus the **cross-project** `<VibeMath root>/Formal/{Lib,Proved}/` — see the "Lean formal verification" section above.
542
322
 
543
323
  ---
544
324
 
545
- ## ⚡ Quick Start
325
+ ## ⚡ Start in five minutes
326
+
327
+ > One main line: **start in plain language → ask about progress at any time → (optionally) tune parameters / intervene → wrap up**. At closure all four presets **produce a final paper by default** (`Paper/<id>/`, see "Features" above and [`docs/final-paper.md`](docs/final-paper.md)). Pick whichever of the three usages below you like; you do not need to read them all.
546
328
 
547
329
  ### Method A: Direct conversation (recommended, the least effort)
548
330
 
@@ -588,11 +370,9 @@ Call the tools directly in the conversation (arguments are JSON):
588
370
 
589
371
  Slash commands (equivalent to the tools): `/vibe start|resume|pause|abort|status|report|mode <auto|manual>|setup|save|template [global|project]|add <id> <desc>|add-proposition <id> <概述>|list-propositions|project [list|new <name>|<name>]|decisions|agents` (v3 additionally has `methods|index|plan|lock`)
590
372
 
591
- ---
592
-
593
- ## 🎓 Tutorial: Let the Main Agent Do the Work for You
373
+ ### 🎓 Let the main agent do the work for you (no need to memorize commands)
594
374
 
595
- ### 1. Natural-language driven (no need to memorize commands)
375
+ #### 1. Natural-language driven (no need to memorize commands)
596
376
 
597
377
  The main agent's role is to be your "translator". You only need to describe the **goal**, and it will choose and call the tools itself:
598
378
 
@@ -605,7 +385,7 @@ The main agent's role is to be your "translator". You only need to describe the
605
385
  | “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
386
  | “Interrupt a stuck subagent” | `interrupt_agent` |
607
387
 
608
- ### 2. Q&A-style parameter configuration (/vibe setup)
388
+ #### 2. Q&A-style parameter configuration (/vibe setup)
609
389
 
610
390
  You do not even need to remember parameter names. Say:
611
391
 
@@ -619,7 +399,7 @@ and finally ask whether to save them as defaults with `vibe_math_save_settings`.
619
399
 
620
400
  You can also just run the command: `/vibe setup` (view the schema) → tell the main agent which ones you want to change → `/vibe save` (save as defaults).
621
401
 
622
- ### 3. Configuration file (vibe_math_setting.json)
402
+ #### 3. Configuration file (vibe_math_setting.json)
623
403
 
624
404
  - **Generate a template**: `/vibe template` (generated into the workspace) or `/vibe template project` (generated into the current project) —
625
405
  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.
@@ -627,9 +407,7 @@ You can also just run the command: `/vibe setup` (view the schema) → tell the
627
407
  - **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).
628
408
  `vibe_math_set_params` / `set_mode` **write back immediately** to the project-level file and persist, so no manual save is needed.
629
409
 
630
- ---
631
-
632
- ## 🌱 Beginner example walkthrough (using “prove √2 is irrational” as the example)
410
+ ### 🌱 Complete example: prove √2 is irrational
633
411
 
634
412
  **Step 1 — Start with one sentence**
635
413
 
@@ -677,9 +455,11 @@ The main agent `vibe_math_status`: in `qs/qs.json`, `q1` has been written back w
677
455
 
678
456
  > 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`).
679
457
 
680
- ---
458
+ **Step 6 — the final paper is produced automatically at closure (on by default)**
459
+
460
+ All four presets default to `finalPaper=true`: once the respective closure signal fires, the paper phase starts **before the run is marked complete** (in v2/v3 a dedicated "paper writer" subagent organises the existing evidence; in v4/v5 the team co-authors, cross-reviews, and the editor finalises on unanimous agreement). The artifacts are `Paper/<id>/{paper.md,paper.tex,paper.pdf,paper.meta.json,paper.log.md}`: `paper.tex` / `paper.pdf` are produced only when `paperFormat` includes tex and the host detects a LaTeX engine (`xelatex` preferred for Chinese; with no engine only md/tex are delivered, and the wrap-up is never blocked). Trigger it manually with `/vibe paper` (v2/v3), `/v4 paper` or `/v5 paper`, optionally with `lang=` / `format=` / `editor=` / `force`; the full contract is in [`docs/final-paper.md`](docs/final-paper.md).
681
461
 
682
- ## 🖼️ Real usage example (long screenshot)
462
+ ### 🖼️ Real usage example (long screenshot)
683
463
 
684
464
  > The screenshot is very long, so it is **collapsed** by default here: the full long image is loaded only after you click “Expand” below, so that it does not fill the page and block the surrounding text.
685
465
 
@@ -694,54 +474,89 @@ The main agent `vibe_math_status`: in `qs/qs.json`, `q1` has been written back w
694
474
 
695
475
  ## ⚙️ Parameter quick reference
696
476
 
697
- ### v2 (probability-driven · classic) defaults
477
+ ### Shared parameters (accepted by ≥2 presets)
698
478
 
699
- | Parameter | Default | Description |
700
- |---|---|---|
701
- | `mode` | `auto` | `auto` / `manual` |
702
- | `maxParallelThreshold` | 4 | Global maximum number of concurrent subagent rounds (before a new dispatch, active must be < threshold) |
703
- | `solverMaxRounds` | 3 | Maximum number of iteration rounds per solving direction (agent_self_iteration cap) |
704
- | `directionsPerSolver` | 1 | Total number of directions visible to each solver prompt (1 = only its own direction, no mutual interference; N>1 = its own plus summaries of up to N-1 other active directions) |
705
- | `verifierCount` | 3 | Number of independent verifiers per verification target |
706
- | `debateMaxRounds` | 5 | Maximum number of rounds of verification debate (chat group) |
707
- | `verdictMode` | `flat` | `flat` = the **equal-weight mean** of the probabilities the verifiers report (an inconsistency is no longer judged 0.5) / `forced` = forced verdict (weighted by historical accuracy + rigor; accuracy is tracked per model and scored only when the object later receives a boolean verdict) |
708
- | `reportMode` | `file` | `file` = write a report file / `push` = push a report to the main agent / `both` |
709
- | `promoteValueThreshold` | 0.7 | A proposition in Propos with "value/criticality" ≥ this value and undecided (0,1) is automatically added to qs.json |
710
- | `priorityAdjust` | `none` | `none` / `deadend-deprioritize` (deprioritize all dead ends) / `survival-map` (recompute by survival rate) |
711
- | `proposPriorityAdjust` | `none` | Dynamic adjustment of proposition priority: `none` / `progress-graded` (recompute by proximity to a conclusion + amount of proof/disproof material; the closer to a conclusion, the higher the priority for verification) |
712
- | `provider` / `model` | empty | Subagent model (empty = inherit the root agent) |
713
- | `solverPersona` / `verifierPersona` / `explorerPersona` | empty | Persona/requirements injected at the start of the solver/verifier/explorer prompt |
714
- | `knowledgeContext` | empty | Shared knowledge/data model description (empty = built-in full version: object/attribute definitions, probability semantics, folder purposes, output completeness requirements; non-empty = overrides and is injected into all subagent prompts) |
715
- | `solverToolAllow` / `solverToolDeny` | `[]` | Tools allowed/denied for the solver |
716
- | `verifierToolAllow` / `verifierToolDeny` | `[]` | Tools allowed/denied for the verifier |
717
- | `solverAllowNetwork` / `verifierAllowNetwork` | empty | Network tool switch (web_search/web/fetch): empty = inherit everything; `true` = add to the existing allow list when one is present; `false` = deny |
718
- | `solverAllowScripts` / `verifierAllowScripts` | empty | Script tool switch (bash/pwsh): same as above |
719
- | `solverMaxToolCalls` / `verifierMaxToolCalls` | 0 | Maximum external tool calls per round (0 = unlimited) |
720
- | `reportIntervalMs` | 0 | 0 = event-driven only (write/push only when there is a state update); >0 = timed automatic reporting (milliseconds) |
721
- | `tickIntervalMs` | 2000 | Scheduler heartbeat interval (milliseconds) |
722
- | `activityLogCap` | 100 | Number of activity log entries retained (the report displays at most 30) |
723
- | `maxExplorerRetries` | 3 | Upper limit on re-dispatching after an explorer fails to split directions |
724
- | `formalVerify` | `'off'` | **Lean formal verification switch**: `'off'` no additional requirement (default)|`'encourage'` encouraged (during verification, decide for yourself whether to formalize based on implementation difficulty)|`'require'` mandatory (a true/false conclusion must first have a "Lean passed" or an explicit blocking record, otherwise it is recorded as undecided and enters the formalization todo list). Any illegal value falls back to `'off'` |
725
- | `leanCommand` | `'lean'` | The Lean executable to run (e.g. `'lake'`) |
726
- | `leanArgs` | `[]` | Additional arguments inserted before the file name (e.g. `['env','lean']` together with `leanCommand='lake'`) |
727
- | `leanTimeoutMs` | `120000` | Upper limit for a single Lean run (milliseconds) |
728
- | `finalPaper` | `true` | **Final paper**: written automatically at closure (`false` disables only the automatic trigger; the manual command still works). Full contract: `docs/final-paper.md` |
729
- | `paperFormat` | `both` | Which text versions to produce: `both` (md+tex) / `md` (skips compilation and must not warn about a missing tex) / `tex` |
730
- | `paperLanguage` | `zh` | Paper language: `zh` (ctexart, engine prefers xelatex) / `en` (article, pdflatex first) |
731
- | `paperCompilePdf` | `true` | Compile `paper.pdf` when a LaTeX engine is detected; with no engine or a failed compile, tex+md are still delivered and a warning is logged |
732
- | `paperLatexCommand` | `''` | Force one LaTeX engine executable (empty = auto-detect per language: xelatex→latexmk→pdflatex→lualatex→tectonic) |
479
+ > Each preset's **complete parameter set = every row of this table whose "Applies to" column names that preset ∪ that preset's own preset-specific table** (v2 has no preset-specific parameters).
480
+ > For parameter details and gate locations see [`docs/formal-verification.md`](docs/formal-verification.md) and [`docs/final-paper.md`](docs/final-paper.md).
481
+
482
+ | Parameter | Default | Applies to | Description (including per-preset differences) |
483
+ |---|---|---|---|
484
+ | `mode` | `auto` | v2·v3 | `auto` / `manual` (manual suspends decisions at key nodes and waits for your approve/reject/override) |
485
+ | `maxParallelThreshold` | 4 | v2·v3 | Global maximum number of concurrent subagent rounds (before a new dispatch, active must be < threshold) |
486
+ | `solverMaxRounds` | 3 | v2·v3 | Maximum number of iteration rounds per solving direction (agent_self_iteration cap) |
487
+ | `directionsPerSolver` | 1 | v2·v3 | Total number of directions visible to each solver prompt (1 = only its own direction, no mutual interference; N>1 = its own plus summaries of up to N-1 other active directions) |
488
+ | `verifierCount` | 3 | v2·v3 | Number of independent verifiers per verification target |
489
+ | `debateMaxRounds` | 5 | v2·v3 | Maximum number of rounds of verification debate (chat group) |
490
+ | `verdictMode` | v2 `flat`; v3 `forced` | v2·v3 | **The default differs per preset.** v2 `flat` = the **equal-weight mean** of the probabilities the verifiers report (an inconsistency is no longer judged 0.5); v2 `forced` = forced verdict (weighted by historical accuracy + rigor; accuracy is tracked per model and scored only when the object later receives a boolean verdict). v3 `forced` = first a **near-consensus determination** (all results on the same side with a mean ≥0.85/≤0.15 takes the mean — this runs BEFORE the mode, so 0.9 vs 1 yields ≈0.95 in either mode), otherwise the **equal-weight mean** of the reported probabilities (no accuracy weighting; strict 1/0 still act as absolute votes), while `flat` rules `0.5` (a disagreement is undecided) |
491
+ | `reportMode` | `file` | v2·v3 | `file` = write a report file / `push` = push a report to the main agent / `both` |
492
+ | `promoteValueThreshold` | 0.7 | v2·v3 | A proposition in Propos with "value/criticality" ≥ this value and undecided (0,1) is automatically added to qs.json |
493
+ | `priorityAdjust` | `none` | v2·v3 | `none` / `deadend-deprioritize` (deprioritize all dead ends) / `survival-map` (recompute by survival rate) |
494
+ | `proposPriorityAdjust` | `none` | v2·v3 | Dynamic adjustment of proposition priority: `none` / `progress-graded` (recompute by proximity to a conclusion + amount of proof/disproof material; the closer to a conclusion, the higher the priority for verification) |
495
+ | `provider` / `model` | empty | all four | Model route (empty = inherit the root agent). **Per preset**: v2/v3 = subagent model (v3's planner agent has its own `plannerProvider`/`plannerModel` in the preset-specific table); v4 = **resident LLM route** (previously declared but unused, actually wired up in v1.4.1); v5 = member LLM route (empty = inherit the institute office/main agent route) |
496
+ | `solverPersona` / `verifierPersona` / `explorerPersona` | empty | v2·v3 | Persona/requirements injected at the start of the solver/verifier/explorer prompt |
497
+ | `knowledgeContext` | empty | v2·v3 | Shared knowledge/data model description (empty = built-in full version: object/attribute definitions, probability semantics, folder purposes, output completeness requirements; non-empty = overrides and is injected into all subagent prompts) |
498
+ | `solverToolAllow` / `solverToolDeny` | `[]` | v2·v3 | Tools allowed/denied for the solver |
499
+ | `verifierToolAllow` / `verifierToolDeny` | `[]` | v2·v3 | Tools allowed/denied for the verifier |
500
+ | `solverAllowNetwork` / `verifierAllowNetwork` | empty | v2·v3 | Network tool switch (web_search/web/fetch): empty = inherit everything; `true` = add to the existing allow list when one is present; `false` = deny |
501
+ | `solverAllowScripts` / `verifierAllowScripts` | empty | v2·v3 | Script tool switch (bash/pwsh): same as above |
502
+ | `solverMaxToolCalls` / `verifierMaxToolCalls` | 0 | v2·v3 | Maximum external tool calls per round (0 = unlimited) |
503
+ | `reportIntervalMs` | 0 | v2·v3 | 0 = event-driven only (write/push only when there is a state update); >0 = timed automatic reporting (milliseconds) |
504
+ | `mathComputation` | `auto` | all four | Math-computation tier: `off` (a true no-op: no probing, no execution, nothing injected into prompts) / `auto` (works once an engine is detected) / `on`. See [`docs/math-computation.md`](docs/math-computation.md) |
505
+ | `mathMode` | `typed+shell` | all four | **Prompt policy only** (the plugin cannot enforce it): `typed+shell` lets the prompt fall back to the host shell when the tool cannot run, but such conclusions must be marked "not tool-archived" and only tool-routed runs count as reproducible supporting material; `typed` never mentions the shell and also disables `engine:'cli'` |
506
+ | `mathEngines` | `[python, r, octave, julia, matlab, maple, wolfram, cli]` | all four | Allowed engines and detection order. The three commercial ones (matlab/maple/wolfram) are detected and licence-checked only and are **never installed**; removing `cli` closes the generic escape hatch |
507
+ | `mathTimeoutMs` | `60000` | all four | Per-run budget in milliseconds (minimum 1000); on timeout the process is terminated |
508
+ | `mathPackages` | `[]` | all four | Packages/toolboxes required by default; a missing one is reported with an install plan - it is **never installed automatically** |
509
+ | `mathInstallScope` | `user` | all four | Install scope; `system` must be given **explicitly on every call and is never remembered** (most managers have no system template, in which case the request is refused) |
510
+
511
+ > **Archive = evidence**: every run writes `Computation/<id>/` and the receipt carries `scriptPath` + `scriptHash`; the script original may be opened/edited, but after editing you MUST re-run it with `mode:'file'` to get a NEW receipt - **an old receipt does not represent edited code** (`scriptChanged` / `scriptChangedDuringRun` warn explicitly). Archives are append-only and over-cap behaviour is warn-only, never delete. See [`docs/math-computation.md`](docs/math-computation.md) §4.1.
512
+
513
+ > **Declare substitutions**: when an alternative changes **exactness or conclusion strength** (exact solution -> numerical approximation, closed form -> sampling/quadrature, changed precision/tolerances/assumptions, a different algorithm class), the conclusion MUST say so and must not read as if the original result had been obtained; if the exact result is unavailable, say so plainly (rule line `MATH_SUBSTITUTION_RULE_LINE`, injected into all four personas and prompts).
514
+
515
+ > **Install and versions**: `op:'install'` dispatches on the **detected python environment** - conda/mamba (`-c conda-forge`), uv (`uv pip …`) or the documented pip fallback (ambiguous cases carry `managerAssumed`); R/Octave/Julia are **user-scope only** (`system` => `MATH_REFUSED` with a per-engine reason). **Version solving belongs to the package manager**: the tool only checks presence by base name and passes `pkg==1.2` (conda `pkg=1.2`) through verbatim; unsafe or unknown syntax => `unsupported-version-syntax`. See [`docs/math-computation.md`](docs/math-computation.md) §5.1-5.3.
516
+ > **Engine discovery**: PATH first, and **only as a last resort** the runtimes DSH ships itself (`<DSH_HOME or user home>/.dsh/dsh-runtimes/*/dependencies/<engine>/`, tree name **globbed**); a found engine reports its **real version** and **no** install guidance is emitted - guidance appears only when nothing usable exists, and it targets **the engine you asked for**. `op:'probe'` reports the requested engine; `mathEngineOverride` **only overrides argv templates and cannot name an executable**, so it is not a discovery escape hatch (use PATH, the DSH runtime, or `engine:'cli'` + `cli.command`). With `engine:'cli'`: the package precheck runs for `cli.command`'s family (unknown family => skipped with a `PACKAGE_PRECHECK_SKIPPED` warning), `mode:'code'` **appends the archived script to argv** (so the code really runs instead of a REPL), and the version is the real one. See §5.4.
517
+ | `tickIntervalMs` | 2000 | v2·v3 | Scheduler heartbeat interval (milliseconds) |
518
+ | `activityLogCap` | 100 | v2·v3 | Number of activity log entries retained (the report displays at most 30) |
519
+ | `maxExplorerRetries` | 3 | v2·v3 | Upper limit on re-dispatching after an explorer fails to split directions |
520
+ | `maxParallel` | 3 | v4·v5 | Upper limit on simultaneously awakened residents (v4) / members (v5) (framework-side concurrency gate, not an assignment) |
521
+ | `activityTimeoutMs` | 120000 | v4·v5 | v4: idle heartbeat interval (only on timeout is a **self-driven** CHECKPOINT wakeup triggered, pushing residents to keep making progress; a failed wakeup automatically re-arms the heartbeat, ensuring the group never permanently stalls); v5: idle fallback heartbeat interval (the main driver is a one-shot activity wait, not polling; the task board's "nudge" is also throttled by it) |
522
+ | `stallAutoMeetingMs` | 360000 | v4·v5 | **Stall auto sync meeting threshold** (tiered keep-alive B): when the team is idle with no new artifacts for longer than this duration, the framework automatically convenes a sync meeting so the members decide the next route/division of labor themselves (the framework only facilitates, it does not assign) |
523
+ | `verdictMaxRounds` | 3 | v4·v5 | Maximum number of rounds of debate (v4) / public debate (v5) after independent initial assessment in verification |
524
+ | `compactThreshold` | 66 | v4·v5 | Context share (0–100) that triggers soft compaction: v4 = resident context share reaching this value triggers soft compaction (self-report instruction); v5 = a member reaching this value triggers compaction (condensing the working state into `Progress/`) |
525
+ | `compactAfterRounds` | 8 | v4·v5 | Trigger one soft compaction every N accumulated rounds (uncompacted) |
526
+ | `meetingKeepEvery` | 5 | v4·v5 | Automatically trigger one sync meeting every N accumulated new artifacts |
527
+ | `toolAllow` / `toolDeny` | `[]` | v4·v5 | **Resident / resident-staff tool permissions** (scoped `tools.restrict()` via `startContinuable`'s `toolFilter`; empty = inherit all tools; ⚠️ an empty `allow:[]` rejects all tools); v5's temp workers have their own `tempToolAllow`/`tempToolDeny` |
528
+ | `formalVerify` | `'off'` | all four | **Lean formal verification switch**: `'off'` no additional requirement (default)|`'encourage'` encouraged (during verification, decide for yourself whether to formalize based on implementation difficulty)|`'require'` mandatory (a true/false conclusion must first have a "Lean passed" or an explicit blocking record, otherwise it is recorded as undecided and enters the formalization todo list). Any illegal value falls back to `'off'` |
529
+ | `leanCommand` | `'lean'` | all four | The Lean executable to run (e.g. `'lake'`) |
530
+ | `leanArgs` | `[]` | all four | Additional arguments inserted before the file name (e.g. `['env','lean']` together with `leanCommand='lake'`) |
531
+ | `leanTimeoutMs` | `120000` | all four | Upper limit for a single Lean run (milliseconds); the async queue reuses it as the per-compile budget |
532
+ | `leanAsync` | `true` | all four | Lean compile mode: `true` (default) = background queue — `lean_run` / `lean_archive{run:true}` enqueue and return `async.jobId` immediately without blocking the member; `false` = synchronous await (the previous semantics, verbatim) |
533
+ | `leanJobsMaxParallel` | `1` | all four | Background-compile concurrency cap (default 1 = serial; raise it to compile in parallel) |
534
+ | `leanInitiative` | `'normal'` | all four | **Daily formalization eagerness**: `off` / `normal` (default, formalize along the way) / `eager` (more proactive). A **separate knob** from `formalVerify` (which only says how strong verification must be) |
535
+ | `leanSearchPaths` | `[]` | all four | Extra Lean search roots (injected first; the automatic `<VibeMath root>` is added after them; nothing is injected when `leanArgs` already sets `--search-path`/`-R`/`--root`) |
536
+ | `finalPaper` | `true` | all four | **Final paper**: written automatically at closure (`false` disables only the automatic trigger; the manual command still works). Full contract: `docs/final-paper.md` |
537
+ | `paperFormat` | `both` | all four | Which text versions to produce: `both` (md+tex) / `md` (skips compilation and must not warn about a missing tex) / `tex` |
538
+ | `paperLanguage` | `zh` | all four | Paper language: `zh` (ctexart, engine prefers xelatex) / `en` (article, pdflatex first) |
539
+ | `paperCompilePdf` | `true` | all four | Compile `paper.pdf` when a LaTeX engine is detected; with no engine or a failed compile, tex+md are still delivered and a warning is logged |
540
+ | `paperLatexCommand` | `''` | all four | Force one LaTeX engine executable (empty = auto-detect per language: xelatex→latexmk→pdflatex→lualatex→tectonic) |
541
+ | `paperEditor` | v4 `office`; v5 `academician` | v4·v5 | Who finalises. v4: `office` (the session root / human side, default) or `resident:<id>` (if that resident has left, it degrades to office and the meta/log say so); v5: `academician` (default, the only editor an unattended run can reach) or `office` (manual `/v5 paper editor=office` only, and only after consulting the whole institute) |
542
+
543
+ - **Async is the default**: with `leanAsync=true` compilation runs on a background queue and `lean_run` / `lean_archive{run:true}` return immediately; `leanAsync=false` is the synchronous wait.
544
+ - **Only a settled compile counts as passed**: a job must be `settled` with exit 0 **and** have an unchanged content hash and build context during the compile before it may set `passed` / write `Verified/Lean/<id>.lean`; everything else (queued / failed / timeout / interrupted / changed content or context) stays `attempted`.
545
+
546
+ ### v2 (probability-driven · classic) preset-specific parameters
547
+
548
+ v2 has **no preset-specific parameters**: its complete parameter set is every row of the table above whose "Applies to" column names v2. Adjust them at runtime with `vibe_math_set_params` (or `/vibe set`); they persist in the project-level `vibe_math_setting.json` (falling back to the global `<workspace>/VibeMath/vibe_math_setting.json` → built-in defaults when absent).
733
549
 
734
550
  #### Final paper
735
551
 
736
552
  All four presets have it **on by default**: after the closure signal fires and **before the run is marked complete**, the run enters the paper phase. In v2 a dedicated "paper writer" subagent assembles the concluded evidence into `Paper/<project>/{paper.md,paper.tex,paper.meta.json,paper.log.md}` (plus `paper.pdf` only when an engine is detected). Manual: `/vibe paper [lang=zh|en] [format=both|md|tex] [force]`. A PDF needs a LaTeX engine on the host (`xelatex` preferred for Chinese); with no engine or a failed compile the tex+md are still delivered with only a logged warning — the finalisation is never blocked and an existing pdf is never overwritten. Full contract: `docs/final-paper.md`.
737
553
 
738
- ### v3 (paper-style md + planner agent + method library) defaults
554
+ ### v3 (paper-style md + planner agent + method library) preset-specific parameters
739
555
 
740
- Added/adjusted on top of all v2 parameters:
556
+ v3 accepts **all** of v2's parameters (the rows above whose "Applies to" column names v3) and adds:
741
557
 
742
558
  | Parameter | Default | Description |
743
559
  |---|---|---|
744
- | `verdictMode` | `forced` | v3 first makes a **near-consensus determination** (all results on the same side with a mean ≥0.85/≤0.15 takes the mean) — this runs BEFORE the mode, so 0.9 vs 1 yields ≈0.95 in either mode; otherwise `forced` takes the **equal-weight mean** of the reported probabilities (no accuracy weighting; strict 1/0 still act as absolute votes), while `flat` rules `0.5` (a disagreement is undecided) |
745
560
  | `planningHorizon` | 3 | Maximum number of actions in one plan by the planner agent ("the next n times") |
746
561
  | `plannerEnabled` | true | false = fully use the built-in heuristic scheduling (planner agent disabled) |
747
562
  | `plannerProvider` / `plannerModel` | empty | Planner agent model route (empty = inherit the root agent) |
@@ -754,55 +569,31 @@ Added/adjusted on top of all v2 parameters:
754
569
  | `indexAutoRebuild` | true | Automatically rebuild `State/index.json` after each disk write (false = manual `vibe_math_index`) |
755
570
  | `projectLockTimeoutMs` | 60000 | Project lock wait timeout (only one session may schedule a given project at any one time) |
756
571
  | `methodKeeperPersona` | empty | Persona/requirements injected at the start of the method consolidation agent prompt |
757
- | `formalVerify` | `'off'` | **Lean formal verification switch**: `'off'` no additional requirement (default)|`'encourage'` encouraged (during verification, decide for yourself whether to formalize based on implementation difficulty)|`'require'` mandatory (a true/false conclusion must first have a "Lean passed" or an explicit blocking record, otherwise it is recorded as undecided and enters the formalization todo list). Any illegal value falls back to `'off'` |
758
- | `leanCommand` | `'lean'` | The Lean executable to run (e.g. `'lake'`) |
759
- | `leanArgs` | `[]` | Additional arguments inserted before the file name (e.g. `['env','lean']` together with `leanCommand='lake'`) |
760
- | `leanTimeoutMs` | `120000` | Upper limit for a single Lean run (milliseconds) |
761
- | `finalPaper` | `true` | **Final paper**: written automatically at closure (`false` disables only the automatic trigger; the manual command still works). Full contract: `docs/final-paper.md` |
762
- | `paperFormat` | `both` | Which text versions to produce: `both` (md+tex) / `md` (skips compilation and must not warn about a missing tex) / `tex` |
763
- | `paperLanguage` | `zh` | Paper language: `zh` (ctexart, engine prefers xelatex) / `en` (article, pdflatex first) |
764
- | `paperCompilePdf` | `true` | Compile `paper.pdf` when a LaTeX engine is detected; with no engine or a failed compile, tex+md are still delivered and a warning is logged |
765
- | `paperLatexCommand` | `''` | Force one LaTeX engine executable (empty = auto-detect per language: xelatex→latexmk→pdflatex→lualatex→tectonic) |
766
572
 
767
573
  #### Final paper
768
574
 
769
575
  v3 uses the same switch and the same ordering as v2 (strict termination; the writer is spawned **before** the scheduler stops): a dedicated "paper writer" subagent produces `Paper/<project>/{paper.md,paper.tex,paper.meta.json,paper.log.md}` (plus `paper.pdf` when an engine is detected). Manual: `/vibe paper [lang=zh|en] [format=both|md|tex] [force]`. No engine or a failed compile still delivers tex+md, logs a warning and never blocks the finalisation. Full contract: `docs/final-paper.md`.
770
576
 
771
- ### v4 (resident self-organization · experimental) defaults
577
+ ### v4 (resident self-organization · experimental) preset-specific parameters
772
578
 
773
- Adjustable via `vibe_v4_set` (persisted to `State/settings.json`):
579
+ Adjustable via `vibe_v4_set` (persisted to `State/settings.json`); shared parameters are in the table above, and v4 additionally has:
774
580
 
775
581
  | Parameter | Default | Description |
776
582
  |---|---|---|
777
583
  | `residentCount` | 4 | Resident count (can be increased/decreased via `vibe_v4_add_member`) |
778
- | `compactThreshold` | 66 | Reaching this resident context share triggers soft compaction (self-report instruction) |
779
- | `compactAfterRounds` | 8 | Trigger one soft compaction every N accumulated rounds per resident (uncompacted) |
780
- | `meetingKeepEvery` | 5 | Automatically trigger one sync meeting every N accumulated new artifacts |
781
- | `maxParallel` | 3 | Upper limit on simultaneously awakened residents (framework-side concurrency gate, not an assignment) |
782
- | `activityTimeoutMs` | 120000 | Idle heartbeat interval (only on timeout is a **self-driven** CHECKPOINT wakeup triggered, pushing residents to keep making progress; a failed wakeup automatically re-arms the heartbeat, ensuring the group never permanently stalls) |
783
- | `stallAutoMeetingMs` | 360000 | **Stall auto sync meeting threshold** (tiered keep-alive B): when the team is idle with no new artifacts for longer than this duration, the framework automatically convenes a sync meeting so the residents decide the next route/division of labor themselves (the framework only facilitates, it does not assign) |
784
- | `verdictMaxRounds` | 3 | Maximum number of rounds of debate after independent initial assessment in verification |
785
- | `provider` / `model` | empty | **Resident LLM route** (empty = residents inherit the main agent's provider/model; previously declared but unused, actually wired up in v1.4.1) |
786
584
  | `residentPersona` | empty | Persona/requirements injected at the start of each resident prompt |
787
- | `toolAllow` / `toolDeny` | `[]` | **Resident tool permissions** (scoped `tools.restrict()` via `startContinuable`'s `toolFilter`; empty = inherit all tools; ⚠️ an empty `allow:[]` rejects all tools) |
788
- | `formalVerify` | `'off'` | **Lean formal verification switch**: `'off'` no additional requirement (default)|`'encourage'` encouraged (during verification, decide for yourself whether to formalize based on implementation difficulty)|`'require'` mandatory (a true/false conclusion must first have a "Lean passed" or an explicit blocking record, otherwise it is recorded as undecided and enters the formalization todo list). Any illegal value falls back to `'off'` |
789
- | `leanCommand` | `'lean'` | The Lean executable to run (e.g. `'lake'`) |
790
- | `leanArgs` | `[]` | Additional arguments inserted before the file name (e.g. `['env','lean']` together with `leanCommand='lake'`) |
791
- | `leanTimeoutMs` | `120000` | Upper limit for a single Lean run (milliseconds) |
792
- | `finalPaper` | `true` | **Final paper**: written automatically at closure (`false` disables only the automatic trigger; the manual command still works). Full contract: `docs/final-paper.md` |
793
- | `paperFormat` | `both` | Which text versions to produce: `both` (md+tex) / `md` (skips compilation and must not warn about a missing tex) / `tex` |
794
- | `paperLanguage` | `zh` | Paper language: `zh` (ctexart, engine prefers xelatex) / `en` (article, pdflatex first) |
795
- | `paperCompilePdf` | `true` | Compile `paper.pdf` when a LaTeX engine is detected; with no engine or a failed compile, tex+md are still delivered and a warning is logged |
796
- | `paperLatexCommand` | `''` | Force one LaTeX engine executable (empty = auto-detect per language: xelatex→latexmk→pdflatex→lualatex→tectonic) |
797
- | `paperEditor` | `office` | Who finalises: `office` (the session root / human side, default) or `resident:<id>` (if that resident has left, it degrades to office and the meta/log say so) |
798
585
 
799
586
  #### Final paper
800
587
 
801
- On by default; v4 enters the paper phase after the closing meeting casts its unanimous stop vote and **before** the run is marked complete. Team flow: each resident writes its own part → merge (deduplicate, unify terms and notation) → at least one **cross-review** round → the editor named by `paperEditor` (default `office`, or `resident:<id>`) turns it into the final draft → the paper is finalised only on **unanimous "deliverable"** (objections keep iterating; past the round cap a warning is recorded and the disagreement goes into the appendix). Manual: `/v4 paper [lang=] [format=] [editor=office|resident:<id>] [force]`. Output: `Paper/<run id>/{paper.md,paper.tex,paper.meta.json,paper.log.md}` (plus `paper.pdf` when an engine is available). Full contract: `docs/final-paper.md`.
588
+ On by default; v4 enters the paper phase after the closing meeting casts its unanimous stop vote and **before** the run is marked complete. Team flow: each resident writes its own part → merge (deduplicate, unify terms and notation) → at least one **cross-review** round → the editor named by `paperEditor` (default `office`, or `resident:<id>`) turns it into the final draft → the paper is finalised only on **unanimous "deliverable"** (objections keep iterating; past the round cap a warning is recorded and the disagreement goes into the appendix). Manual: `/v4 paper [lang=] [format=] [editor=office|resident:<id>] [force]`. Output: `Paper/<run id>/{paper.md,paper.tex,paper.meta.json,paper.log.md,paper.lock.json}` (plus `paper.pdf` when an engine is available; `paper.lock.json` is the directory's write lock, serialising concurrent rewrites/recompiles). Full contract: `docs/final-paper.md`.
589
+
590
+ **v4-only tool `vibe_v4_formal_report` (documented in round 3)**: it reports "which propositions/methods have formal support and how strong it is" back to the resident team. That is part of v4's **team-autonomy** flow - residents must align on which settled conclusion may be cited - so it exists **only in v4** (v2/v3 use the dedicated solver/verifier architecture, where formal status travels through `vibe_math_lean_*` plus the verification logs; v5 carries it through the academician review path `vibe_v5_propose_verify`/`vibe_v5_verdict` and `vibe_v5_status`). Both v4 persona blocks require members to use it, and v4's `status`/`report` aggregate its output.
591
+
592
+ > **Status-surface asymmetry (documented in round 3)**: v2/v3's `vibe_math_status` returns a **parameter block** (current `math*`/`lean*` values), while v4's `vibe_v4_status` and v5's `vibe_v5_status` return their own status/member/institute views **without** a parameter block (use the closed `vibe_v4_set`/`vibe_v5_set` schema, or the fields those statuses already expose). This is by design; this round chose to **document it** rather than add a params block to v4/v5.
802
593
 
803
- ### v5 (institute system · experimental) defaults
594
+ ### v5 (institute system · experimental) preset-specific parameters
804
595
 
805
- Adjustable via `vibe_v5_set` (persisted in the institute state file `State/<institute>.v5state.json`):
596
+ Adjustable via `vibe_v5_set` (persisted in the institute state file `State/<institute>.v5state.json`); shared parameters are in the table above, and v5 additionally has:
806
597
 
807
598
  | Parameter | Default | Description |
808
599
  |---|---|---|
@@ -812,30 +603,11 @@ Adjustable via `vibe_v5_set` (persisted in the institute state file `State/<inst
812
603
  | `researcherCount` | 3 | Number of resident researchers (at institute founding) |
813
604
  | `quorumCap` | 3 | Upper limit of m; actually **m = min(quorumCap, number of enrolled voting members)** |
814
605
  | `quorumMode` | `'m-unanimous'` | v5 calibration; switching to `'all-unanimous'` returns to v4's "all unanimous" |
815
- | `verdictMaxRounds` | 3 | Maximum number of rounds of public debate after independent initial assessment |
816
606
  | `maxTempPerMember` | 3 | Upper limit on temp workers **simultaneously** enrolled per academician/researcher (counted by enrollment, not cumulative — so swapping people is not restricted) |
817
607
  | `maxTempTotal` | 12 | Upper limit on temp workers simultaneously enrolled across the whole institute |
818
- | `compactThreshold` | 66 | Reaching this member context share (0–100) triggers compaction |
819
- | `compactAfterRounds` | 8 | Or trigger one soft compaction every N accumulated rounds |
820
- | `maxParallel` | 3 | Upper limit on simultaneously awakened members (framework-side concurrency gate) |
821
- | `activityTimeoutMs` | 120000 | Idle fallback heartbeat interval (the main driver is a one-shot activity wait, not polling) |
822
- | `stallAutoMeetingMs` | 360000 | Threshold for automatically convening a sync meeting on stall |
823
608
  | `chatDigestMs` / `chatDigestMax` | 45000 / 12 | Time window and entry cap for batching group chat digests (direct messages/meetings/votes are not batched) |
824
- | `meetingKeepEvery` | 5 | Automatically initiate one sync meeting every N accumulated new artifacts |
825
- | `provider` / `model` | empty | Member LLM route (empty = inherit the institute office/main agent route) |
826
- | `toolAllow` / `toolDeny` | `[]` | Resident staff tool permissions (⚠️ an empty `allow:[]` rejects all tools) |
827
609
  | `tempToolAllow` / `tempToolDeny` | `[]` | Temp worker tool permissions (narrower than residents) |
828
610
  | `staffPersona` | empty | Persona/requirements appended before each member charter |
829
- | `formalVerify` | `'off'` | **Lean formal verification switch**: `'off'` no additional requirement (default)|`'encourage'` encouraged (during verification, decide for yourself whether to formalize based on implementation difficulty)|`'require'` mandatory (a true/false conclusion must first have a "Lean passed" or an explicit blocking record, otherwise it is recorded as undecided and enters the formalization todo list). Any illegal value falls back to `'off'` |
830
- | `leanCommand` | `'lean'` | The Lean executable to run (e.g. `'lake'`) |
831
- | `leanArgs` | `[]` | Additional arguments inserted before the file name (e.g. `['env','lean']` together with `leanCommand='lake'`) |
832
- | `leanTimeoutMs` | `120000` | Upper limit for a single Lean run (milliseconds) |
833
- | `finalPaper` | `true` | **Final paper**: written automatically at closure (`false` disables only the automatic trigger; the manual command still works). Full contract: `docs/final-paper.md` |
834
- | `paperFormat` | `both` | Which text versions to produce: `both` (md+tex) / `md` (skips compilation and must not warn about a missing tex) / `tex` |
835
- | `paperLanguage` | `zh` | Paper language: `zh` (ctexart, engine prefers xelatex) / `en` (article, pdflatex first) |
836
- | `paperCompilePdf` | `true` | Compile `paper.pdf` when a LaTeX engine is detected; with no engine or a failed compile, tex+md are still delivered and a warning is logged |
837
- | `paperLatexCommand` | `''` | Force one LaTeX engine executable (empty = auto-detect per language: xelatex→latexmk→pdflatex→lualatex→tectonic) |
838
- | `paperEditor` | `academician` | Who finalises: `academician` (default, the only editor an unattended run can reach) or `office` (manual `/v5 paper editor=office` only, and only after consulting the whole institute) |
839
611
 
840
612
  #### Final paper
841
613
 
@@ -865,7 +637,7 @@ Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (star
865
637
  - **Lean formal verification (a contract shared by the four architectures)**: [`docs/formal-verification.md`](docs/formal-verification.md)
866
638
  - **Final paper (a contract shared by the four architectures)**: [`docs/final-paper.md`](docs/final-paper.md) (the five parameters plus `paperEditor` on v4/v5, the "paper phase before the run is marked complete" ordering, the `Paper/<id>/` artifacts and the nine-section skeleton, LaTeX detection with repair-then-degrade, the v4/v5 team co-authoring flow and the v5 office-consultation rule)
867
639
  - **Test timing baseline and parallel run recipes**: [`docs/test-timing.md`](docs/test-timing.md) (`node tests/run-tests.mjs` runs **every suite AND every probe** in parallel: `TOTAL 57` (39 suites + 18 probes/variants) in ≈3.5 min; which 18 of them ship in the package and which are repository-only is in §1.1 of that document; every runner prints its elapsed time/speedup so the next strategy can be chosen from data)
868
- - **Static prompt-surface consistency (persona ↔ tool registry ↔ slash command hint/usage)**: [`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs) (208 assertions, and generates [`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md) for manual review) + [`audit-persona-sensitivity.mjs`](tests/audit-persona-sensitivity.mjs) (16 sensitivity probes) — guarding "every registered tool must appear in the persona / every name in the persona must really be registered / the `prefix` and `text` blocks must match line by line / hint, usage, and the actual branch must agree in all three places"
640
+ - **Static prompt-surface consistency (persona ↔ tool registry ↔ slash command hint/usage)**: [`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs) (260 assertions, and generates [`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md) for manual review) + [`audit-persona-sensitivity.mjs`](tests/audit-persona-sensitivity.mjs) (16 sensitivity probes) — guarding "every registered tool must appear in the persona / every name in the persona must really be registered / the `prefix` and `text` blocks must match line by line / hint, usage, and the actual branch must agree in all three places"
869
641
  - **Mandatory checklist for a full review**: [`AUDIT-CHECKLIST.md`](docs/AUDIT-CHECKLIST.md) (this repository's mandatory audit process; §1.9 specifically checks "whether the tool parameter schema can accommodate them")
870
642
  - **Prompt/interaction invariants (all four sets together, re-checkable in one command)**: [`audit-prompt-invariants.mjs`](tests/audit-prompt-invariants.mjs) (157 assertions) — encoding, one by one, "the classes of prompt/tool-surface defects that have really occurred historically" as static invariants (abbreviated tool names, projecting a fidelity defect as 0, `defect` written only in the prompt but not implemented, a receipt contract missing `defect`, passing without a note, wrong field names, the `off` tier still being able to write state in its receipt, uncertain corpora, missing probes, **a tool's closed schema that cannot accommodate the parameters in its own documentation**, **keys that the schema declares at the parameter level but silently drops**). Adding `--self-probe` injects these defect shapes in memory and requires the corresponding invariants to **turn red** while the unmutated control run **stays green** (5/5); the script itself additionally carries six self-checks X5–X8b (the comment scanner must recognize regex literals — including regexes **after a keyword** such as `return /…/` — `//` inside strings must be preserved, stripping comments must not change line structure, and the parse-level criterion that "the four sets of source, with comments stripped, must still parse under `node --check`")
871
643
  - **Specification ↔ code traceability (all four sets together)**: [`audit-spec-traceability.mjs`](tests/audit-spec-traceability.mjs) (94 assertions) — tools promised in `实现方案.md`/README must really be registered; the four Lean parameters must be accepted by both the documentation and the code