dsh-vibe-math 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.en.md +29 -29
  2. package/README.md +31 -30
  3. package/SECURITY.md +56 -0
  4. package/cordis.patch.yml +38 -15
  5. package/docs/AUDIT-CHECKLIST.md +518 -429
  6. package/docs/COMPAT-AUDIT-ROUND3.md +16 -1
  7. package/docs/release-notes/RELEASE-NOTES-2.4.1.md +129 -0
  8. package/docs/release-notes/RELEASE-NOTES-2.5.0.md +173 -0
  9. package/docs/test-timing.md +73 -40
  10. package/installer.js +225 -45
  11. package/package.json +6 -3
  12. package/preset-declaration.js +38 -7
  13. package/prompt-corpus-persona/persona-corpus.json +9 -9
  14. package/prompt-corpus-persona/persona-corpus.md +69 -23
  15. package/prompt-corpus-v2/formal-verify-v2.json +116 -92
  16. package/prompt-corpus-v2/formal-verify-v2.md +240 -93
  17. package/prompt-corpus-v3/formal-verify-v3.json +81 -81
  18. package/prompt-corpus-v3/formal-verify-v3.md +288 -1111
  19. package/prompt-corpus-v4/formal-verify-v4.json +38 -8
  20. package/prompt-corpus-v4/formal-verify-v4.md +157 -25
  21. package/prompt-corpus-v5/prompt-corpus-v5.json +17 -17
  22. package/prompt-corpus-v5/prompt-corpus-v5.md +32 -26
  23. package/tests/audit-installer-compat.test.mjs +70 -4
  24. package/tests/audit-installer-policy.test.mjs +229 -4
  25. package/tests/audit-persona-sensitivity.mjs +11 -4
  26. package/tests/audit-persona-surface.test.mjs +5 -1
  27. package/tests/audit-v5-sensitivity.mjs +47 -6
  28. package/tests/e2e-v5-round2.test.mjs +354 -0
  29. package/tests/formal-verify-v2.test.mjs +54 -2
  30. package/tests/formal-verify-v3.test.mjs +63 -2
  31. package/tests/formal-verify-v4.test.mjs +120 -4
  32. package/tests/run-tests.mjs +104 -23
  33. package/vibe-math-v2/agent.cordis.yml +11 -5
  34. package/vibe-math-v2/preset.yml +1 -1
  35. package/vibe-math-v2/vibe-math-v2.js +607 -160
  36. package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +20 -4
  37. package/vibe-math-v3/agent.cordis.yml +26 -10
  38. package/vibe-math-v3/vibe-math-v3.js +744 -305
  39. package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +5 -5
  40. package/vibe-math-v4/agent.cordis.yml +26 -6
  41. package/vibe-math-v4/vibe-math-v4.js +487 -89
  42. package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +91 -9
  43. package/vibe-math-v5/agent.cordis.yml +8 -4
  44. package/vibe-math-v5/vibe-math-v5.js +607 -160
  45. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +73 -40
package/README.en.md CHANGED
@@ -9,10 +9,10 @@ English | [中文](README.md)
9
9
  > A set of **agent presets** running inside **DeepSeek Harness** (`vibe-math-v2` / `vibe-math-v3` / `vibe-math-v4` / `vibe-math-v5`),
10
10
  > which use multi-agent collaboration to automatically solve mathematical problems and perform multi-agent cross-verification of the conclusions. All four presets share the foundational capabilities of "**checkpoint resume**,
11
11
  > **mid-run manual intervention**, **progress reporting**, and **natural-language driving**", but adopt four generations of different solving architectures:
12
- > **💡 `vibe-math-v2` and `vibe-math-v3` are recommended at the same level** — both are mature, usable, actively maintained recommended architectures; choose according to your actual needs (see "How to choose" below); `vibe-math-v4` is the "resident self-organizing collaborative research" architecture, and `vibe-math-v5` is the latest "institute system" (both are experimental).
12
+ > **💡 All four architectures are peers** — `vibe-math-v2` and `vibe-math-v3` are the **classic** architectures (mature, usable, actively maintained); `vibe-math-v4` is the "resident self-organizing collaborative research" architecture and `vibe-math-v5` is the latest "institute system" (both labelled experimental); choose according to your actual needs (see "How to choose" below).
13
13
  >
14
- > - **`vibe-math-v2` (probability-driven · JSON data layer) ✅ Recommended**: `qs.json` problem list + `Propos/` proposition library + probability-driven scheduling + code heuristic scheduling;
15
- > - **`vibe-math-v3` (third generation · paper-style md + planner agent + method library) ✅ Recommended**: all knowledge is stored and extended in **Markdown paper/research-report form** (`Problems/` problem list + dependencies + source motivation, `Progress/` research log, `Propos/` proposition library, `Methods/` general theory invention library, `Verified/` absolutely trustworthy); before scheduling, the **planner agent** autonomously draws up a plan for the next N steps; theories/frameworks/tools/methods/ideas invented during solving are distilled by the **Method Keeper** into a reusable method system (as in inventing group theory or functional analysis).
14
+ > - **`vibe-math-v2` (probability-driven · JSON data layer) · classic**: `qs.json` problem list + `Propos/` proposition library + probability-driven scheduling + code heuristic scheduling;
15
+ > - **`vibe-math-v3` (third generation · paper-style md + planner agent + method library) · classic**: all knowledge is stored and extended in **Markdown paper/research-report form** (`Problems/` problem list + dependencies + source motivation, `Progress/` research log, `Propos/` proposition library, `Methods/` general theory invention library, `Verified/` absolutely trustworthy); before scheduling, the **planner agent** autonomously draws up a plan for the next N steps; theories/frameworks/tools/methods/ideas invented during solving are distilled by the **Method Keeper** into a reusable method system (as in inventing group theory or functional analysis).
16
16
  > - **`vibe-math-v4` (fourth generation · resident self-organizing collaborative research) 🧪 Experimental**: a group of **persistent resident subagents** **leave messages for one another + hold meetings**, and autonomously decide all task arrangements (no central scheduler); each accumulates its own progress/proposition/method/subproblem libraries and consults the others; verification is written to `Verified/` **only when all residents agree (true or false)**, otherwise it remains in the library with a probability attached; when the context reaches a threshold it automatically `/compact`s; it stops only when all agree that the original problem has been solved.
17
17
  > - **`vibe-math-v5` (fifth generation · institute system) 🧪 Experimental · Latest**: upgrades the residents into an **institute** — **academicians** (leaders / the organizing and coordinating center, responsible for decomposition and **assignment**, setting priorities, chairing meetings, and supervising progress) + **resident researchers** (with voting rights, able to autonomously hire/fire their own temp workers) + **temp workers** (no voting rights); it has a **public charter**, **group chat and meetings**, a **compare-and-set task board**, and **real firing**; a boolean agreement of **≥ m votes** is required to write to `Verified/` (opposing votes block, abstentions are not counted, and if the threshold is not met it remains in the library with an average probability attached); state is written to the **hardened JSON file** `State/<institute>.v5state.json` under the institute directory (serial writes, a mandatory load before read) — **never into the host session log** — at zero token cost.
18
18
 
@@ -31,13 +31,13 @@ After installing this plugin package (or manually copying the presets), **four**
31
31
  > (zero-dependency Node → **SVG**, `node docs/generate_framework_diagram_v4.mjs`; add `--lang=en` for `示例图/框架图-v4-en.svg`).
32
32
  > SVG is used from v4 onward: plain text, diff-friendly, crisp at any zoom; when PNG is needed, screenshot with a headless browser (the command is at the top of the generation script).
33
33
 
34
- ### Vibe Math V2 (probability-driven · JSON data layer) ✅ Recommended
34
+ ### Vibe Math V2 (probability-driven · JSON data layer) · classic
35
35
 
36
36
  ![Vibe Math V2 architecture diagram](示例图/框架图-v2-en.svg)
37
37
 
38
38
  **One-sentence pipeline**: `qs.json` takes problems by priority → Explorer splits out directions (if all are dead ends, re-derive) → one Solver per direction iterates over multiple rounds (lemmas go into `Propos/`, solutions go back to `qs.json`, all probabilities <1) → the scheduler picks r (proposition / proposition+proof·disproof / problem+solution) and dispatches ≥3 verifiers for independent review → debate → ruling → at probability=1 it automatically closes out (problem solved, proposition 1/0, priority set to `never`); state is written to disk throughout, `resume` continues from the checkpoint, and `reportMode` can report by file/push/both.
39
39
 
40
- ### Vibe Math V3 (paper-style md + planner agent + methods library) ✅ Recommended
40
+ ### Vibe Math V3 (paper-style md + planner agent + methods library) · classic
41
41
 
42
42
  ![Vibe Math V3 architecture diagram](示例图/框架图-v3-en.svg)
43
43
 
@@ -79,7 +79,7 @@ flowchart TB
79
79
  subgraph FW["⚙️ Framework vibe-v5 —— only a medium (middleware), never assigns tasks"]
80
80
  M["Message relay · meetings/debates · task board CAS+DAG<br/>m-vote consensus verification · context and liveness · roster and hiring · scheduler"]
81
81
  end
82
- PROJ["💾 State/&lt;institute&gt;.v5state.json (hardened JSON, authoritative)<br/>11 kinds of events · pure fold applyV5Event · serial writes · recovery = load before read"]
82
+ PROJ["💾 State/&lt;institute&gt;.v5state.json (hardened JSON, authoritative)<br/>12 kinds of events · pure fold applyV5Event · serial writes · recovery = load before read"]
83
83
  FS["📁 Members/&lt;id&gt;/* · Shared/* · Verified/ · Problems/"]
84
84
  RULE{{"Truth gate: Boolean unanimity and Boolean votes ≥ m = min(quorumCap, number of registered voting members)"}}
85
85
  OFF <-->|"vibe_v5_* / /v5 commands ↔ status / report"| M
@@ -349,7 +349,7 @@ dsh plugin --profile <your profile> add dsh-vibe-math
349
349
  dsh plugin --profile <your profile> add github:ChongCyrus/Vibe-Mathematics
350
350
  ```
351
351
 
352
- Then start a new session and pick **Vibe Math V3** (v3, **primary recommendation**), **Vibe Math V2** (v2, **primary recommendation**), **Vibe Math V4** (v4, resident self-organization) or **Vibe Math V5** (v5, institute system) in the preset picker — v2 and v3 are equally primary recommendations, choose according to your actual needs (see "How to choose").
352
+ Then start a new session and pick **Vibe Math V2** (v2, classic), **Vibe Math V3** (v3, classic), **Vibe Math V4** (v4, resident self-organization) or **Vibe Math V5** (v5, institute system) in the preset picker — the four architectures are peers, choose according to your actual needs (see "How to choose").
353
353
  **The two DSH generations land in different places, and this package adapts to both**:
354
354
 
355
355
  - **DSH ≥ 0.1.7 (current)**: agent presets are declared as composition rows. This package declares all four presets in `cordis.patch.yml` (each row hands that preset's full plugin list to the host's `agentPresets` service), and **writes nothing into `~/.dsh/.agent-presets/`** — that directory has not been read since 0.1.7.
@@ -384,7 +384,7 @@ Then start a new session and select **"Vibe Math V2"** / **"Vibe Math V3"** / **
384
384
 
385
385
  ## 🧭 How to choose among the four presets
386
386
 
387
- > **💡 `vibe-math-v2` and `vibe-math-v3` are equally primary recommendations; choose according to your actual needs:**
387
+ > **💡 All four architectures are peers; choose according to your actual needs:**
388
388
  >
389
389
  > - **Choose `vibe-math-v2` (probability-driven · JSON data layer)** if you:
390
390
  > - prefer **structured JSON data** (`qs.json` / `Propos/<category>_Propos.json` / `Verified/` cards), convenient for programmatic retrieval and further processing;
@@ -402,14 +402,14 @@ Then start a new session and select **"Vibe Math V2"** / **"Vibe Math V3"** / **
402
402
  > - **Choose `vibe-math-v5` (institute system)** if you want:
403
403
  > - **organized self-organization** — like a real research institute, with a **leader (academician)** responsible for decomposition, assignment, prioritization, chairing meetings and supervising progress, but **judgment still belongs to each individual**;
404
404
  > - a **roster that can grow or shrink** — resident researchers + temp workers who can be **autonomously hired/dismissed** (temp workers have no voting rights, suitable for chores such as checking, trial computation and material organization);
405
- > - an **adjustable consistency threshold** — `m = min(quorumCap, number of voting members)` boolean-consistent votes settle the matter (easier to converge than "unanimity", while **opposing votes still block**, so a minority will not be drowned out by abstentions);
405
+ > - an **adjustable consistency threshold** — `m = min(quorumCap, number of voting members)` boolean-consistent votes settle the matter (because an opposing vote blocks, the effective threshold is still "every Boolean vote points the same way"; it differs only when fewer than `m` members cast a Boolean vote);
406
406
  > - **zero-token-cost state persistence** — the institute state is written to a hardened JSON file under the institute directory and does not consume member context budget.
407
407
  >
408
- > **⚠️ `vibe-math-v2` and `vibe-math-v3` are mature primary architectures; `vibe-math-v4` and `vibe-math-v5` are experimental architectures,** all are selectable; the old `vibe-math-v1` has been removed (this package contains only v2/v3/v4/v5).
408
+ > **⚠️ `vibe-math-v2` and `vibe-math-v3` are the classic architectures; `vibe-math-v4` and `vibe-math-v5` are experimental architectures,** all four are peers and all are selectable; the old `vibe-math-v1` has been removed (this package contains only v2/v3/v4/v5).
409
409
 
410
- | | **v2 (probability-driven · primary)** | **v3 (paper-style md · primary)** | **v4 (resident self-organization · experimental)** | **v5 (institute system · experimental)** |
410
+ | | **v2 (probability-driven · classic)** | **v3 (paper-style md · classic)** | **v4 (resident self-organization · experimental)** | **v5 (institute system · experimental)** |
411
411
  |---|---|---|---|---|
412
- | Positioning | **Primary** (JSON data layer) | **Primary** (third generation) | **Experimental** (fourth generation) | **Experimental** (fifth generation) |
412
+ | Positioning | **Classic** (JSON data layer) | **Classic** (third generation) | **Experimental** (fourth generation) | **Experimental** (fifth generation) |
413
413
  | Core idea | Probability-driven: `qs.json` problems + `Propos/` proposition library, scheduled by "correctness probability / value" | **Paper-style md knowledge base + planner agent scheduling + general theory invention library** | **Persistent resident subagents self-organizing**: message each other + meetings decide all tasks, no central scheduling | **Institute**: the academician organizes and assigns, members research on their own; a conclusion requires **≥ m boolean-consistent votes**; temp workers can be hired as needed |
414
414
  | Data | `qs/qs.json` + `Propos/<category>_Propos.json` + `Reliable/` | `Problems/` + `Progress/` + `Propos/` + `Methods/` (all md, soft-spec anchors + free narration) + `Verified/` | `Problems/` + `Progress|Propos|Methods|Subproblems/<id>/` **owned by resident id** + `Shared/` (meetings/task board/debate) + `Verified/` | Same member-owned layout as v4, plus `Institutes.md` (roster mirror); **the authoritative state is `State/<institute>.v5state.json`**, and the other files are only mirrors and workspaces |
415
415
  | Roles | explorer → per-direction solver → verifier | **planner (planner agent)** → explorer → per-direction solver → verifier → **method-keeper (method organization agent)** | **N resident researchers** (continuable), no fixed roles | **academician acad** (leader) + **resident researcher r-n** (with voting rights) + **temp worker t-n** (no voting rights, hireable and dismissible) + institute office (does not research and does not vote) |
@@ -420,12 +420,12 @@ Then start a new session and select **"Vibe Math V2"** / **"Vibe Math V3"** / **
420
420
  | Ad hoc capabilities | Automatic promotion of proposition "value/criticality" to the problem list; `reportMode file/push/both`; `priorityAdjust` | **Method library accumulation loop** (`methods_used`/`new_inventions` → Method Keeper); **plan approval gate/method promotion gate**; **project lock**; follow-up problem "source and motivation" as a first-class citizen | **Residents accumulate individually + read each other**; **unanimous verification**; **add/close residents at any time, intervene by message**; **checkpoint resume** | All v4 capabilities, plus: **real hiring/dismissal** (releases sub-sessions, reclaims tasks); **compare-and-set task board + dependency DAG**; **strict mutual exclusion between meetings and verification**; **roster mirror and conclusion records**; **zero-token-cost state** |
421
421
 
422
422
  All four support: checkpoint resume (`vibe_math_resume` / `vibe_v4_resume` / `vibe_v5_resume`), manual intervention and pause/resume,
423
- per-project isolation, subagent permission control, and natural-language driving. **v2 and v3 are both equally primary recommendations** — choose v2 if you prefer structured JSON data and deterministic scheduling,
423
+ per-project isolation, subagent permission control, and natural-language driving. **All four architectures are peers** — choose v2 if you prefer structured JSON data and deterministic scheduling,
424
424
  choose v3 if you prefer paper-style md, the planner agent and the theory invention library; v4 is fully self-organizing resident collaborative research, and v5 is an institute system with "a leader + a roster that can grow or shrink + an adjustable threshold".
425
425
 
426
426
  ---
427
427
 
428
- ## 🧠 Architecture and Division of Labor (v3 · third generation) ✅ recommended
428
+ ## 🧠 Architecture and Division of Labor (v3 · third generation) · classic
429
429
 
430
430
  The framework = **one main agent (assistant) + one code scheduler + one planner agent + six kinds of subagents**.
431
431
 
@@ -460,7 +460,7 @@ For the complete v5 architecture (including member lifecycle, one-round timeline
460
460
 
461
461
  ## 📁 Directory Structure
462
462
 
463
- ### v2 (probability-driven · recommended)
463
+ ### v2 (probability-driven · classic)
464
464
 
465
465
  ```
466
466
  <session workspace>/VibeMath/
@@ -477,7 +477,7 @@ For the complete v5 architecture (including member lifecycle, one-round timeline
477
477
  └─ VibeMath_State/ # scheduler-private persistent state (for checkpoint resume)
478
478
  ```
479
479
 
480
- ### v3 (paper-style md + planner agent + method library) ✅ recommended
480
+ ### v3 (paper-style md + planner agent + method library) · classic
481
481
 
482
482
  ```
483
483
  <session workspace>/VibeMath/
@@ -651,11 +651,11 @@ The main agent runs `vibe_math_status` and reports in plain language: the number
651
651
  **Step 3 — Tune parameters by conversation (optional)**
652
652
 
653
653
  ```
654
- I want it to use weighted voting, with the concurrency limit set to 6.
654
+ I want it to use forced verdict mode, with the concurrency limit set to 6.
655
655
  ```
656
656
 
657
- The main agent `vibe_math_set_params {"verdictMode":"weighted-vote","maxParallelThreshold":6}`,
658
- and asks you whether to `vibe_math_save_settings` to save them.
657
+ The main agent `vibe_math_set_params {"verdictMode":"forced","maxParallelThreshold":6}`,
658
+ and asks you whether to `vibe_math_save_settings` to save them. (`verdictMode` accepts only `flat|forced`; any other value is **not an error** — it is silently reverted to that architecture's default, `flat` in v2 and `forced` in v3.)
659
659
 
660
660
  **Step 4 — Intervene midway (optional)**
661
661
 
@@ -694,7 +694,7 @@ The main agent `vibe_math_status`: in `qs/qs.json`, `q1` has been written back w
694
694
 
695
695
  ## ⚙️ Parameter quick reference
696
696
 
697
- ### v2 (probability-driven · main recommendation) defaults
697
+ ### v2 (probability-driven · classic) defaults
698
698
 
699
699
  | Parameter | Default | Description |
700
700
  |---|---|---|
@@ -704,7 +704,7 @@ The main agent `vibe_math_status`: in `qs/qs.json`, `q1` has been written back w
704
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
705
  | `verifierCount` | 3 | Number of independent verifiers per verification target |
706
706
  | `debateMaxRounds` | 5 | Maximum number of rounds of verification debate (chat group) |
707
- | `verdictMode` | `flat` | `flat` = balanced mechanism (inconsistency judged 0.5) / `forced` = forced verdict (historical accuracy + rigor weighting) |
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
708
  | `reportMode` | `file` | `file` = write a report file / `push` = push a report to the main agent / `both` |
709
709
  | `promoteValueThreshold` | 0.7 | A proposition in Propos with "value/criticality" ≥ this value and undecided (0,1) is automatically added to qs.json |
710
710
  | `priorityAdjust` | `none` | `none` / `deadend-deprioritize` (deprioritize all dead ends) / `survival-map` (recompute by survival rate) |
@@ -732,12 +732,12 @@ Added/adjusted on top of all v2 parameters:
732
732
 
733
733
  | Parameter | Default | Description |
734
734
  |---|---|---|
735
- | `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), otherwise `forced` = weighted by historical accuracy + rigor / `flat` = balanced (0.5). Fixes the v2 flat problem of misjudging "0.9 vs 1" as 0.5 |
735
+ | `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) |
736
736
  | `planningHorizon` | 3 | Maximum number of actions in one plan by the planner agent ("the next n times") |
737
737
  | `plannerEnabled` | true | false = fully use the built-in heuristic scheduling (planner agent disabled) |
738
738
  | `plannerProvider` / `plannerModel` | empty | Planner agent model route (empty = inherit the root agent) |
739
739
  | `plannerPersona` | empty | Persona/requirements injected at the start of the planner agent prompt |
740
- | `planMinIntervalMs` | 30000 | Minimum interval between two planning calls (milliseconds); ignored when the system is idle and there is work |
740
+ | `planMinIntervalMs` | 30000 | Minimum interval between two planning calls (milliseconds); it applies to **every** planning call (empty plans included, and "idle but still work" — the idle bypass is gone) |
741
741
  | `plannerMaxFails` | 3 | The planner agent reaching this number of consecutive failures → automatic degradation to heuristics |
742
742
  | `methodKeepIntervalMs` | 0 | Method Keeper periodic consolidation interval (0 = event-driven) |
743
743
  | `methodKeepEvery` | 5 | Trigger one consolidation every N accumulated inventions/new propositions awaiting sedimentation |
@@ -825,8 +825,8 @@ Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (star
825
825
  - **Four sets of Lean prompt corpora**: [`prompt-corpus-v2/formal-verify-v2.md`](prompt-corpus-v2/formal-verify-v2.md) · [`prompt-corpus-v3/formal-verify-v3.md`](prompt-corpus-v3/formal-verify-v3.md) · [`prompt-corpus-v4/formal-verify-v4.md`](prompt-corpus-v4/formal-verify-v4.md) (each covering off / encourage / **require** / fidelity branches / work rounds / receipt contract; the workspace is normalized to `<WS>` and the VibeMath root to `<VIBEMATH>`)
826
826
  - **The persona source text of the four presets**: [`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md) (the prompts the main agent actually receives: which tools, which parameters, which slash subcommands; generated by `audit-persona-surface.test.mjs` and shipped with the package)
827
827
  - **Lean formal verification (a contract shared by the four architectures)**: [`docs/formal-verification.md`](docs/formal-verification.md)
828
- - **Test timing baseline and parallel run recipes**: [`docs/test-timing.md`](docs/test-timing.md) (`node tests/run-tests.mjs` runs all suites in parallel in ≈1.9 min; the probe scripts ≈2.6 min; every runner prints its elapsed time/speedup for choosing a strategy next time)
829
- - **Static prompt-surface consistency (persona ↔ tool registry ↔ slash command hint/usage)**: [`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs) (197 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) (11 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"
828
+ - **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 56` (38 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)
829
+ - **Static prompt-surface consistency (persona ↔ tool registry ↔ slash command hint/usage)**: [`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs) (196 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) (11 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"
830
830
  - **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")
831
831
  - **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`")
832
832
  - **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
@@ -840,16 +840,16 @@ Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (star
840
840
  - **(DSH ≤ 0.1.6, the directory form)** The installer has **versioned auto-update**: on every DSH start it compares the package version against the record in `<presetRoot>/.vibe-math-installed.json` — **as soon as the version changes (or on the first run of an older installation with no record) it replaces the managed files wholesale, regardless of whether they were modified**; replaced hand-edited originals are first backed up to `<presetRoot>/.vibe-math-backup/<old version>/<preset>/` and listed in the log. Within the same version it **rewrites no files at all** (restarting DSH will not rewrite the presets, nor disturb the generation index it records by mtime), and missing files are restored at any time. To force a full reinstall: delete those four preset directories and restart DSH.
841
841
  On DSH ≥ 0.1.7 the installer **writes none of these directories** (the composition rows of the "Installation" section above supply the presets); at startup it only logs that leftover copies can safely be deleted.
842
842
  - **On DSH ≤ 0.1.6 these four directories are owned by the installer**: deleting any file in them or the whole directory only leads to it being restored on the next DSH start (which is exactly why the "force a full reinstall" above works). On DSH ≥ 0.1.7 they are neither read nor written any more, so you can simply delete them; to get rid of them entirely, uninstall this package (`dsh plugin --profile <your profile> remove dsh-vibe-math`).
843
- - A `flat` verdict directly rules `0.5` when the debate is inconsistent (high-confidence disagreement such as 0.9 vs 1 is also misjudged as 0.5 — **v3 has fixed this with the near-consensus rule**); `forced` weights by historical accuracy + confidence.
843
+ - A `flat` verdict takes the **equal-weight mean** of the probabilities the verifiers report when the debate is inconsistent (it is no longer judged `0.5`; the early problem of misjudging a high-confidence disagreement such as 0.9 vs 1 as 0.5 is fixed in v2/v3); `forced` is weighted by historical accuracy + rigor, and accuracy is scored only when the object later receives a boolean verdict.
844
844
  - Problems/propositions with `never` priority are **never scheduled**, and do not block strict termination (they count as voluntarily abstaining).
845
845
  - The four preset files are mutually independent and can coexist; only one preset can be selected in a given session at a time.
846
846
 
847
847
  **v3**:
848
848
  - **Soft specification rather than zero specification**: the md knowledge base only enforces the 4–7 anchor lines at the head of an object (`- ID/类型/状态/概率/优先级/依赖/...`) and the entry title line (`### 解法/证明/证伪 N|标题|概率X|状态Y`), so that the scheduler can index reliably; the body is entirely free paper-style prose, and the scheduler never parses the body. Manually editing the anchors may cause index drift (the scheduler keeps the last valid index and warns).
849
- - **The planning agent is an enhancement, not a requirement**: when `plannerEnabled=false` or the planning agent fails repeatedly (`plannerMaxFails`), it automatically falls back to v2-style heuristic scheduling; the `planMinIntervalMs` cooldown takes effect while subagents are in flight (when the system is idle and there is work, it plans immediately).
849
+ - **The planning agent is an enhancement, not a requirement**: when `plannerEnabled=false` or the planning agent fails repeatedly (`plannerMaxFails`), it automatically falls back to v2-style heuristic scheduling; the `planMinIntervalMs` cooldown applies to **every** planning call — empty plans and "idle but still work" included (idleness no longer bypasses the cooldown, which is exactly what amplified the planner's per-tick spinning).
850
850
  - **Trust tiers in the method library**: a method card's `可信断言` may only link IDs that have entered `Verified/`; all other content of a method entry (including unverified strategies/intuitions/heuristics) is treated as **empirical reference** and must not be cited as a theorem.
851
851
  - **Project lock**: only one session may schedule a given project at a time (starting a second session reports "occupied by session X"); the lock is released automatically on pause/termination/when everything is resolved.
852
- - **Near-consensus verdicts**: when all verifier results fall on the same side and the mean is ≥0.85/≤0.15, the mean is taken (e.g. 0.9 vs 1 → 0.95); otherwise `forced` weighting / `flat` rules 0.5 — this fixes the problem in v2 where conclusions that were "mathematically correct but formally flawed" were misjudged as uncertain.
852
+ - **Near-consensus verdicts**: when all verifier results fall on the same side and the mean is ≥0.85/≤0.15, the mean is taken (e.g. 0.9 vs 1 → 0.95); otherwise `forced` takes the **equal-weight mean** of the votes and `flat` rules `0.5` — this fixes the problem in v2 where conclusions that were "mathematically correct but formally flawed" were misjudged as uncertain.
853
853
 
854
854
  **v5**:
855
855
  - **The framework never assigns tasks**: this is a hard design boundary, not a feature that has yet to be implemented. The creation and allocation of tasks belong to **institute self-governance**
@@ -857,7 +857,7 @@ Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (star
857
857
  - **`≥ m` agreement ≠ mathematically proved**: the quorum only guarantees that "a consistent judgment has been reached within the institute", not that the conclusion is really correct.
858
858
  The depth of truth-seeking rests on the members' own derivations and the paper trail in the debate records; objects that do not reach quorum are **kept in the library with their average probability attached** and are not forcibly ruled true or false.
859
859
  - **The consistency quorum is not "majority rule"**: any single opposing boolean vote blocks a conclusion, and abstention helps neither truth nor falsehood.
860
- To converge more easily, lower `quorumCap` or reduce the number of members with voting rights; for stricter behavior, switch to `quorumMode: "all-unanimous"`.
860
+ Under this rule (`m = min(quorumCap, number of voting members)`) **as soon as anyone casts a Boolean vote, the threshold is effectively "every Boolean vote points the same way"**: lowering `quorumCap` only lowers how many Boolean votes are required (`m`) and does **not** make convergence easier; for stricter behavior, switch to `quorumMode: "all-unanimous"` (which does not even allow abstentions).
861
861
  - **A member whose round never ends will not be forcibly released** (the same boundary as v4): the heartbeat re-arms it every time,
862
862
  so the scheduler will not freeze permanently; when manual intervention is needed, use `vibe_v5_fire` (temp worker) or have the institute office add or remove positions.
863
863
  - **Meetings and verification are strictly mutually exclusive**: while one is in progress, the other queues/is held. Therefore "concluding an object on the spot in a meeting" first queues,
package/README.md CHANGED
@@ -9,10 +9,10 @@
9
9
  > 运行在 **DeepSeek Harness** 内的一组 **agent preset**(`vibe-math-v2` / `vibe-math-v3` / `vibe-math-v4` / `vibe-math-v5`),
10
10
  > 用多代理协作自动求解数学问题并对结论做多代理交叉验证。四个预设共享「**断点续跑**、
11
11
  > **中途人工干预**、**进度汇报**、**自然语言驱动**」底座能力,但采用四代不同的求解架构:
12
- > **💡 `vibe-math-v2` 与 `vibe-math-v3` 同级主推**——两者都是成熟可用、正在维护的主推架构,根据你的实际需求自行选择(详见下方「怎么选」);`vibe-math-v4` 是「常驻自组织合作研究」架构,`vibe-math-v5` 是最新的「研究所体系」(两者均为实验性)。
12
+ > **💡 四个架构同级**——`vibe-math-v2` 与 `vibe-math-v3` 是**经典**架构(成熟可用、持续维护),`vibe-math-v4` 是「常驻自组织合作研究」架构、`vibe-math-v5` 是最新的「研究所体系」(两者均标注为实验性);根据你的实际需求自行选择(详见下方「怎么选」)。
13
13
  >
14
- > - **`vibe-math-v2`(概率驱动 · JSON 数据层)✅ 主推**:`qs.json` 问题清单 + `Propos/` 命题库 + 概率驱动调度 + 代码启发式调度;
15
- > - **`vibe-math-v3`(第三代 · 论文式 md + 规划代理 + 方法库)✅ 主推**:全部知识以 **Markdown 论文/研究报告式** 存储与续写(`Problems/` 问题清单+依赖+来源动机、`Progress/` 研究日志、`Propos/` 命题库、`Methods/` 通用理论发明库、`Verified/` 绝对可信);调度前由**规划代理**自主制定接下来 N 步计划;解决过程中发明的理论/框架/工具/方法/思想由 **Method Keeper** 沉淀为可复用方法体系(如发明群论、泛函分析那样)。
14
+ > - **`vibe-math-v2`(概率驱动 · JSON 数据层)· 经典**:`qs.json` 问题清单 + `Propos/` 命题库 + 概率驱动调度 + 代码启发式调度;
15
+ > - **`vibe-math-v3`(第三代 · 论文式 md + 规划代理 + 方法库)· 经典**:全部知识以 **Markdown 论文/研究报告式** 存储与续写(`Problems/` 问题清单+依赖+来源动机、`Progress/` 研究日志、`Propos/` 命题库、`Methods/` 通用理论发明库、`Verified/` 绝对可信);调度前由**规划代理**自主制定接下来 N 步计划;解决过程中发明的理论/框架/工具/方法/思想由 **Method Keeper** 沉淀为可复用方法体系(如发明群论、泛函分析那样)。
16
16
  > - **`vibe-math-v4`(第四代 · 常驻自组织合作研究)🧪 实验性**:一组**持久化常驻子代理**互相**留言 + 开会**,自主决定一切任务安排(无中央调度);各自沉淀进度/命题/方法/子问题库并互相查阅;验证**仅当全体常驻一致(真 或 假)**才写入 `Verified/`,否则留库附概率;上下文达阈值自动 `/compact`;仅当全体一致认为原问题已解决才停止。
17
17
  > - **`vibe-math-v5`(第五代 · 研究所体系)🧪 实验性 · 最新**:把常驻升级为一座**研究所**——**院士**(领头人 / 组织与协调中心,负责拆解与**分派**、定优先级、主持会议、督导进度)+ **常驻研究员**(有表决权,可自主雇佣/解雇自己的临时工)+ **临时工**(无表决权);有**公共规章**、**群聊与会议**、**compare-and-set 任务板**、**真实解雇**;**≥ m 票布尔一致**才写入 `Verified/`(反向票阻塞、弃权不计票、未达门槛留库附平均概率);状态存于研究所目录下的**加固 JSON** `State/<研究所>.v5state.json`(串行写、读前必 load),**不写入宿主会话日志**,零 token 成本。
18
18
 
@@ -30,13 +30,13 @@
30
30
  > (零依赖 Node → **SVG**,`node docs/generate_framework_diagram_v4.mjs`,加 `--lang=en` 生成英文版 `示例图/框架图-v4-en.svg`)。
31
31
  > v4 起改用 SVG:纯文本、diff 友好、任意缩放不糊;需要 PNG 时用无头浏览器截图(命令见生成脚本头部)。
32
32
 
33
- ### Vibe Math V2(概率驱动 · JSON 数据层)✅ 主推
33
+ ### Vibe Math V2(概率驱动 · JSON 数据层)· 经典
34
34
 
35
35
  ![Vibe Math V2 架构图](示例图/框架图-v2.png)
36
36
 
37
37
  **一句话流水线**:`qs.json` 按优先级取问题 → Explorer 拆方向(全死路则重派生)→ 每方向一个 Solver 多轮迭代(引理进 `Propos/`、解法回 `qs.json`,概率均 <1)→ 调度器选 r(命题 / 命题+证明·证伪 / 问题+解法)派 ≥3 验证器独立审查→辩论→裁决 → 概率=1 自动收口(问题 solved、命题 1/0,优先级置 `never`);全程状态落盘,`resume` 断点续跑,`reportMode` 可 file/push/both 汇报。
38
38
 
39
- ### Vibe Math V3(论文式 md + 规划代理 + 方法库)✅ 主推
39
+ ### Vibe Math V3(论文式 md + 规划代理 + 方法库)· 经典
40
40
 
41
41
  ![Vibe Math V3 架构图](示例图/框架图-v3.png)
42
42
 
@@ -79,7 +79,7 @@ flowchart TB
79
79
  subgraph FW["⚙️ 框架 vibe-v5 —— 只是媒介(middleware),绝不指派任务"]
80
80
  M["消息中继 · 会议/辩论 · 任务板 CAS+DAG<br/>m 票共识验证 · 上下文与活性 · 编制与雇佣 · 调度器"]
81
81
  end
82
- PROJ["💾 State/&lt;研究所&gt;.v5state.json(加固 JSON 权威源)<br/>11 类事件 · 纯折叠 applyV5Event · 串行写 · 恢复=读前必 load"]
82
+ PROJ["💾 State/&lt;研究所&gt;.v5state.json(加固 JSON 权威源)<br/>12 类事件 · 纯折叠 applyV5Event · 串行写 · 恢复=读前必 load"]
83
83
  FS["📁 Members/&lt;id&gt;/* · Shared/* · Verified/ · Problems/"]
84
84
  RULE{{"求真门槛:布尔一致 且 布尔票 ≥ m = min(quorumCap, 在册有表决权人数)"}}
85
85
  OFF <-->|"vibe_v5_* / /v5 命令 ↔ status / report"| M
@@ -349,7 +349,7 @@ dsh plugin --profile <你的 profile> add dsh-vibe-math
349
349
  dsh plugin --profile <你的 profile> add github:ChongCyrus/Vibe-Mathematics
350
350
  ```
351
351
 
352
- 之后新建会话,预设选择器里选择 **Vibe Math V3**(v3,**主推**)、**Vibe Math V2**(v2,**主推**)、**Vibe Math V4**(v4,常驻自组织)或 **Vibe Math V5**(v5,研究所体系)即可——v2 与 v3 同级主推,按实际需求自选(见「怎么选」)。
352
+ 之后新建会话,预设选择器里选择 **Vibe Math V2**(v2,经典)、**Vibe Math V3**(v3,经典)、**Vibe Math V4**(v4,常驻自组织)或 **Vibe Math V5**(v5,研究所体系)即可——四个架构同级,按实际需求自选(见「怎么选」)。
353
353
  **两个 DSH 世代的落点不同,本包自动适配**:
354
354
 
355
355
  - **DSH ≥ 0.1.7(当前)**:agent preset 由组合行声明。本包在 `cordis.patch.yml` 里声明四个 preset(每行把该 preset 的完整插件清单交给宿主的 `agentPresets` 服务注册),**不往 `~/.dsh/.agent-presets/` 写任何东西**——该目录自 0.1.7 起不再被读取。
@@ -378,13 +378,13 @@ dsh plugin --profile <你的 profile> add github:ChongCyrus/Vibe-Mathematics
378
378
  - **DSH STORE 兼容声明**:`package.json` 的 `dsh.compatibility.dshReleases` 对每个完整 DSH 版本逐项声明 `compatible` / `incompatible` / `unknown`(当前声明 `0.1.2-alpha.4` … `0.2.0-rc.2` 共 11 个版本为 `compatible`,实测目标为 `0.2.0-rc.2`);`engines.dsh` 为 `>=0.1.2-alpha.4 <0.1.3-0 || >=0.1.3-alpha.2 <0.1.5-0 || >=0.1.5-alpha.1 <0.1.6-0 || >=0.1.6-alpha.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0 || >=0.2.0-alpha.1 <0.3.0-0`;`engines.node` 为 `^22.19.0 || >=24.0.0`。
379
379
  另外声明了 `peerDependencies`(`@deepseek-ai/dsh-base`,并标为 optional):DSH ≥ 0.1.7 会用**宿主自己的版本**去比对插件声明的 peer 范围,不满足时**跳过整个 bundle 并给出明确提示**,而不是挂上一个跑不通的预设。
380
380
  - **运行时自检(版本 + 形态 + 能力)**:安装器(bundle 插件)每次启动时:**① 按优先级探测 DSH 版本**——`DSH_VERSION` 环境变量 → `pluginManager` 服务的 bundle 列表(`@deepseek-ai/dsh-base` 的版本即宿主版本,0.1.7+)→ `@deepseek-ai/dsh-app-boot` 导出的 `getDshRuntimeVersion()`(0.2.0+ 的公开 API)→ `@deepseek-ai/dsh/package.json`(全局 0.1.x 安装),日志会写明**来源**;探测到且未被 `dshReleases` 声明为 `compatible` 时给出明确提示。**② 判断 preset 形态**:从 loader 入口树里是否挂了 `@deepseek-ai/dsh-agent-preset`(或其 registry)判断本宿主是"组合行"还是"目录",据此决定是否同步 `~/.dsh/.agent-presets/`——新宿主上会跳过并在日志里说明旧目录可安全删除。**③ 能力自检**(真正的挂载门槛):`subagents`/`agents`/`tools`/`commands`/`fs` 为**必需**(缺失即 warning),`subprocess`/`sandboxPolicy`/`compaction` 为**可选**(缺失只提示"功能会静默降级"),另含 `fs.resolve` 返回形状检测与 subagent `agentOptions`/`toolFilter` capability 检测。preset 挂载失败时先看 DSH 日志里的自检 warning。
381
- - **升级路径**:DSH 升级后无需重装本包;升级本包用 `dsh plugin --profile <你的 profile> add dsh-vibe-math@latest`(`dsh plugin` 的 `--profile` 是必填项;用 `add` 而不是 `update`,因为 profile 里可能把版本钉成精确值,那时 `update` 不会跨过去),重启 DSH 后安装器会把四个 preset 的受管文件整体更新到新版本(改过的文件同样被替换,原文先进 `<presetRoot>/.vibe-math-backup/`;见上文「安装」说明)。
381
+ - **升级路径**:DSH 升级后无需重装本包;升级本包用 `dsh plugin --profile <你的 profile> add dsh-vibe-math@latest`(`dsh plugin` 的 `--profile` 是必填项;用 `add` 而不是 `update`,因为 profile 里可能把版本钉成精确值,那时 `update` 不会跨过去),重启 DSH 后(DSH ≤ 0.1.6 的目录形式下)安装器会把四个 preset 的受管文件整体更新到新版本(改过的文件同样被替换,原文先进 `<presetRoot>/.vibe-math-backup/`;DSH ≥ 0.1.7 的 preset 来自组合行,安装器不写任何文件)——见上文「安装」说明。
382
382
 
383
383
  ---
384
384
 
385
385
  ## 🧭 四个预设怎么选
386
386
 
387
- > **💡 `vibe-math-v2` 与 `vibe-math-v3` 同级主推,按你的实际需求自行选择:**
387
+ > **💡 四个架构同级,按你的实际需求自行选择:**
388
388
  >
389
389
  > - **选 `vibe-math-v2`(概率驱动 · JSON 数据层)**,如果你:
390
390
  > - 偏好**结构化 JSON 数据**(`qs.json` / `Propos/<分类>_Propos.json` / `Verified/` 卡),方便程序化检索与二次加工;
@@ -402,14 +402,14 @@ dsh plugin --profile <你的 profile> add github:ChongCyrus/Vibe-Mathematics
402
402
  > - **选 `vibe-math-v5`(研究所体系)**,如果你想要:
403
403
  > - **有组织的自组织**——现实研究所那样有**领头人(院士)**负责拆解、分派、定优先级、主持会议、督导进度,但**判断仍归每个人自己**;
404
404
  > - **可增减的编制**——常驻研究员 + 可**自主雇佣/解雇**的临时工(临时工无表决权,适合处理核对、试算、资料整理等杂活);
405
- > - **可调的一致性门槛**——`m = min(quorumCap, 有表决权人数)` 票布尔一致即定论(比"全体一致"更容易收敛,同时**反向票仍然阻塞**,少数派不会被弃权淹没);
405
+ > - **可调的一致性门槛**——`m = min(quorumCap, 有表决权人数)` 票布尔一致即定论(因为反向票阻塞,实际门槛仍是"全部布尔票同向";只有投出布尔票的人少于 `m` 时才不同);
406
406
  > - **零 token 成本的状态持久化**——研究所状态写在研究所目录下的加固 JSON 里,不占成员上下文预算。
407
407
  >
408
- > **⚠️ `vibe-math-v2` 与 `vibe-math-v3` 是成熟主推架构;`vibe-math-v4`、`vibe-math-v5` 是实验性架构,** 均可选择;老 `vibe-math-v1` 已被移除(本包仅含 v2/v3/v4/v5)。
408
+ > **⚠️ `vibe-math-v2` 与 `vibe-math-v3` 是经典架构;`vibe-math-v4`、`vibe-math-v5` 是实验性架构,** 四者同级、均可选择;老 `vibe-math-v1` 已被移除(本包仅含 v2/v3/v4/v5)。
409
409
 
410
- | | **v2(概率驱动 · 主推)** | **v3(论文式 md · 主推)** | **v4(常驻自组织 · 实验)** | **v5(研究所体系 · 实验)** |
410
+ | | **v2(概率驱动 · 经典)** | **v3(论文式 md · 经典)** | **v4(常驻自组织 · 实验)** | **v5(研究所体系 · 实验)** |
411
411
  |---|---|---|---|---|
412
- | 定位 | **主推**(JSON 数据层) | **主推**(第三代) | **实验性**(第四代) | **实验性**(第五代) |
412
+ | 定位 | **经典**(JSON 数据层) | **经典**(第三代) | **实验性**(第四代) | **实验性**(第五代) |
413
413
  | 核心思想 | 概率驱动:`qs.json` 问题 + `Propos/` 命题库,按「正确概率 / 价值」调度 | **论文式 md 知识库 + 规划代理调度 + 通用理论发明库** | **持久化常驻子代理自组织**:互相留言 + 开会决定一切任务,无中央调度 | **研究所**:院士做组织与分派,成员各自研究;**≥ m 票布尔一致**才定论;临时工可按需雇入 |
414
414
  | 数据 | `qs/qs.json` + `Propos/<分类>_Propos.json` + `Reliable/` | `Problems/` + `Progress/` + `Propos/` + `Methods/`(全部 md,软规范锚点 + 自由叙述)+ `Verified/` | `Problems/` + **按常驻 id 归属**的 `Progress|Propos|Methods|Subproblems/<id>/` + `Shared/`(会议/任务板/辩论)+ `Verified/` | 同 v4 的按成员归属布局,另加 `Institutes.md`(编制镜像);**权威状态在 `State/<研究所>.v5state.json`**,其余文件只是镜像与工作区 |
415
415
  | 角色 | explorer → 逐方向 solver → verifier | **planner(规划代理)** → explorer → 逐方向 solver → verifier → **method-keeper(方法整理代理)** | **N 个常驻研究者**(continuable),无固定角色 | **院士 acad**(领头人)+ **常驻研究员 r-n**(有表决权)+ **临时工 t-n**(无表决权,可雇可解雇)+ 所办(不研究不投票) |
@@ -420,12 +420,12 @@ dsh plugin --profile <你的 profile> add github:ChongCyrus/Vibe-Mathematics
420
420
  | 特设能力 | 命题「价值/关键性」自动晋升问题清单;`reportMode file/push/both`;`priorityAdjust` | **方法库沉淀循环**(`methods_used`/`new_inventions` → Method Keeper);**计划审批门/方法晋升门**;**项目锁**;后生问题「来源与动机」一等公民 | **常驻各自沉淀 + 互相阅读**;**全体一致验证**;**随时增开/关闭常驻、留言干预**;**断点续跑** | v4 的全部能力,另加:**真实雇佣/解雇**(释放子会话、收回任务);**compare-and-set 任务板 + 依赖 DAG**;**会议与验证严格互斥**;**编制镜像与结题记录**;**状态零 token 成本** |
421
421
 
422
422
  四者都支持:断点续跑(`vibe_math_resume` / `vibe_v4_resume` / `vibe_v5_resume`)、人工干预与暂停恢复、
423
- 按项目隔离、子代理权限调控、自然语言驱动。**v2 与 v3 均为同级主推**——偏好结构化 JSON 数据与确定性调度选 v2,
423
+ 按项目隔离、子代理权限调控、自然语言驱动。**四个架构同级**——偏好结构化 JSON 数据与确定性调度选 v2,
424
424
  偏好论文式 md、规划代理与理论发明库选 v3;v4 是完全自组织的常驻合作研究,v5 是"有领头人 + 可增减编制 + 可调门槛"的研究所体系。
425
425
 
426
426
  ---
427
427
 
428
- ## 🧠 架构与分工(v3 · 第三代)✅ 主推
428
+ ## 🧠 架构与分工(v3 · 第三代)· 经典
429
429
 
430
430
  框架 = **一个主代理(助手)+ 一个代码调度器 + 一个规划代理 + 六类子代理**。
431
431
 
@@ -461,7 +461,7 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
461
461
 
462
462
  ## 📁 目录结构
463
463
 
464
- ### v2(概率驱动 · 主推)
464
+ ### v2(概率驱动 · 经典)
465
465
 
466
466
  ```
467
467
  <会话工作区>/VibeMath/
@@ -478,7 +478,7 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
478
478
  └─ VibeMath_State/ # 调度器私有持久状态(断点恢复用)
479
479
  ```
480
480
 
481
- ### v3(论文式 md + 规划代理 + 方法库)✅ 主推
481
+ ### v3(论文式 md + 规划代理 + 方法库)· 经典
482
482
 
483
483
  ```
484
484
  <会话工作区>/VibeMath/
@@ -652,11 +652,11 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
652
652
  **Step 3 — 问答式调参(可选)**
653
653
 
654
654
  ```
655
- 我想让它用加权投票,并发数设成 6。
655
+ 我想让它用强制裁决模式(forced)跑,并发数设成 6。
656
656
  ```
657
657
 
658
- 主代理 `vibe_math_set_params {"verdictMode":"weighted-vote","maxParallelThreshold":6}`,
659
- 并问你是否 `vibe_math_save_settings` 保存。
658
+ 主代理 `vibe_math_set_params {"verdictMode":"forced","maxParallelThreshold":6}`,
659
+ 并问你是否 `vibe_math_save_settings` 保存。(`verdictMode` 只接受 `flat|forced`;写其它值**不报错**,会被静默回退成该架构的默认值——v2 是 `flat`、v3 是 `forced`。)
660
660
 
661
661
  **Step 4 — 中途干预(可选)**
662
662
 
@@ -695,7 +695,7 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
695
695
 
696
696
  ## ⚙️ 参数速查表
697
697
 
698
- ### v2(概率驱动 · 主推)默认值
698
+ ### v2(概率驱动 · 经典)默认值
699
699
 
700
700
  | 参数 | 默认 | 说明 |
701
701
  |---|---|---|
@@ -705,7 +705,7 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
705
705
  | `directionsPerSolver` | 1 | 每个 solver 提示词可见的方向总数(1 = 只看自己方向、互不干扰;N>1 = 自己 + 最多 N-1 个其他活跃方向摘要) |
706
706
  | `verifierCount` | 3 | 每个验证对象的独立验证器数量 |
707
707
  | `debateMaxRounds` | 5 | 验证辩论(交流群)最大轮数 |
708
- | `verdictMode` | `flat` | `flat` = 均衡机制(不一致判 0.5)/ `forced` = 强制裁决(历史准确率+严谨性加权) |
708
+ | `verdictMode` | `flat` | `flat` = 取各验证者报告概率的**等权平均**(不一致时不再一律判 0.5)/ `forced` = 强制裁决(按历史准确率+严谨性加权;准确率按模型追踪,且只在对象此后获得布尔裁决时计分) |
709
709
  | `reportMode` | `file` | `file` = 写报告文件 / `push` = 推送主代理汇报 / `both` |
710
710
  | `promoteValueThreshold` | 0.7 | Propos 中「价值/关键性」≥ 该值且未决(0,1) 的命题自动加入 qs.json |
711
711
  | `priorityAdjust` | `none` | `none` / `deadend-deprioritize`(全死路降优先级)/ `survival-map`(按存活率重算) |
@@ -733,12 +733,12 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
733
733
 
734
734
  | 参数 | 默认 | 说明 |
735
735
  |---|---|---|
736
- | `verdictMode` | `forced` | v3 先做**近共识判定**(全部结果同侧且均值 ≥0.85/≤0.15 取均值),否则 `forced`=按历史准确率+严谨性加权 / `flat`=均衡(0.5)。修复了 v2 flat 把"0.9 vs 1"误判成 0.5 的问题 |
736
+ | `verdictMode` | `forced` | v3 先做**近共识判定**(全部结果同侧且均值 ≥0.85/≤0.15 取均值)——这一步先于模式生效,所以 0.9 vs 1 在两种模式下都得到 ≈0.95;否则 `forced` 取各验证者概率的**等权平均**(不再按准确率加权;严格的 1/0 仍以绝对票生效),`flat` 则判 `0.5`(不一致即不确定) |
737
737
  | `planningHorizon` | 3 | 规划代理一次计划的最多动作数("接下来 n 次") |
738
738
  | `plannerEnabled` | true | false = 完全走内置启发式调度(规划代理禁用) |
739
739
  | `plannerProvider` / `plannerModel` | 空 | 规划代理模型路由(空 = 继承根代理) |
740
740
  | `plannerPersona` | 空 | 注入规划代理提示词开头的人格/要求 |
741
- | `planMinIntervalMs` | 30000 | 两次规划调用的最小间隔(毫秒);系统空闲且有工作时忽略 |
741
+ | `planMinIntervalMs` | 30000 | 两次规划调用的最小间隔(毫秒);对**每一次**规划调用都生效(含空计划、含"空闲但仍有工作",不再有空闲绕过) |
742
742
  | `plannerMaxFails` | 3 | 规划代理连续失败达此值 → 自动降级启发式 |
743
743
  | `methodKeepIntervalMs` | 0 | Method Keeper 定时整理间隔(0 = 事件驱动) |
744
744
  | `methodKeepEvery` | 5 | 每积累 N 个待沉淀发明/新命题触发一次整理 |
@@ -826,8 +826,8 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
826
826
  - **四套 Lean 提示词语料**:[`prompt-corpus-v2/formal-verify-v2.md`](prompt-corpus-v2/formal-verify-v2.md) · [`prompt-corpus-v3/formal-verify-v3.md`](prompt-corpus-v3/formal-verify-v3.md) · [`prompt-corpus-v4/formal-verify-v4.md`](prompt-corpus-v4/formal-verify-v4.md)(各自覆盖 off / encourage / **require** / 忠实性分支 / 工作轮 / 回执契约;工作区归一化为 `<WS>`、VibeMath 根为 `<VIBEMATH>`)
827
827
  - **四个预设的 persona 原文**:[`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md)(主代理实际收到的提示词:有哪些工具、哪些参数、哪些斜杠子命令;由 `audit-persona-surface.test.mjs` 生成,随包发布)
828
828
  - **Lean 形式化验证(四架构共用契约)**:[`docs/formal-verification.md`](docs/formal-verification.md)
829
- - **测试耗时基线与并行跑法**:[`docs/test-timing.md`](docs/test-timing.md)(`node tests/run-tests.mjs` 并行跑全部套件 ≈1.9 min;探针脚本 ≈2.6 min;每个 runner 都会打印耗时/加速比供下次选策略)
830
- - **静态提示词面一致性(persona ↔ 工具注册表 ↔ 斜杠命令 hint/usage)**:[`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs)(197 条断言,并生成 [`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md) 供人工复核)+ [`audit-persona-sensitivity.mjs`](tests/audit-persona-sensitivity.mjs)(11 条灵敏度探针)——守"注册的工具必须在 persona 里出现 / persona 里的名字必须真的注册 / `prefix` 与 `text` 两块逐行一致 / hint、usage、实际分支三处必须一致"
829
+ - **测试耗时基线与并行跑法**:[`docs/test-timing.md`](docs/test-timing.md)(`node tests/run-tests.mjs` 并行跑**全部套件 + 全部探针**:`TOTAL 56`(38 套件 + 18 探针/变体)≈3.5 min;哪 18 项随包发布、哪些仅仓库见该文档 §1.1;每个 runner 都会打印耗时/加速比供下次选策略)
830
+ - **静态提示词面一致性(persona ↔ 工具注册表 ↔ 斜杠命令 hint/usage)**:[`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs)(196 条断言,并生成 [`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md) 供人工复核)+ [`audit-persona-sensitivity.mjs`](tests/audit-persona-sensitivity.mjs)(11 条灵敏度探针)——守"注册的工具必须在 persona 里出现 / persona 里的名字必须真的注册 / `prefix` 与 `text` 两块逐行一致 / hint、usage、实际分支三处必须一致"
831
831
  - **全面检查必查清单**:[`AUDIT-CHECKLIST.md`](docs/AUDIT-CHECKLIST.md)(本仓库的强制审计流程;§1.9 专门查"工具参数 schema 收不收得下")
832
832
  - **提示词/交互不变式(四套一起,可一键复核)**:[`audit-prompt-invariants.mjs`](tests/audit-prompt-invariants.mjs)(157 条断言)——把"历史上真实发生过的提示词/工具面缺陷类别"逐条编码成静态不变式(缩写工具名、把忠实性缺陷投成 0、`defect` 只写在提示词里没实现、回执契约缺 `defect`、无 note 放行、字段名错、`off` 档回执仍能写状态、语料不确定、探针缺失、**工具的封闭 schema 收不下它自己文档里的参数**、**schema 声明了参数层却静默丢弃的键**)。加 `--self-probe` 会在内存里注入这些缺陷形状,要求对应不变式**变红**、未变异的对照跑**仍为绿**(5/5);脚本自身另带 X5–X8b 六条自检(注释扫描器必须认正则字面量——包括 `return /…/ ` 这种**关键字后面**的正则——字符串里的 `//` 必须保留、抹注释不改变行结构,以及"四套源码抹掉注释后仍必须能被 `node --check` 解析"这条解析级判据)
833
833
  - **规格 ↔ 代码可追溯(四套一起)**:[`audit-spec-traceability.mjs`](tests/audit-spec-traceability.mjs)(94 条断言)——`实现方案.md`/README 里承诺的工具必须真的注册;四个 Lean 参数必须同时被文档与代码接受
@@ -841,16 +841,16 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
841
841
  - **(DSH ≤ 0.1.6 的目录形式)** 安装器带**版本化自动更新**:每次 DSH 启动时对比包版本与 `<presetRoot>/.vibe-math-installed.json` 记录——**版本一变(或无记录的老安装首次运行)就整体替换受管文件,不看它是否被改过**;被替换的手改原文先备份到 `<presetRoot>/.vibe-math-backup/<旧版本>/<preset>/` 并在日志里列出。同一个版本内**不重写任何文件**(重启 DSH 不会改写 preset、也不会扰动它按 mtime 记的生成代际),缺失文件随时补回。想强制全量重装:删除那四个 preset 目录后重启 DSH。
842
842
  在 DSH ≥ 0.1.7 上安装器**不写这些目录**(预设由上文「安装」里的组合行提供),启动时只会提示旧副本可安全删除。
843
843
  - **在 DSH ≤ 0.1.6 上,这四个目录由安装器负责**:删掉其中任一文件或整个目录,只会在下次启动 DSH 时被补回(这正是上面"强制全量重装"可行的原因)。在 DSH ≥ 0.1.7 上它们不再被读取、也不再被写入,直接删掉即可;想彻底不要本包的预设,就卸载本包(`dsh plugin --profile <你的 profile> remove dsh-vibe-math`)。
844
- - `flat` 裁决在辩论不一致时直接判 `0.5`(高置信分歧如 0.9 vs 1 也会被误判 0.5——**v3 已用近共识规则修复**);`forced` 按历史准确率+置信度加权。
844
+ - `flat` 裁决在辩论不一致时取各验证者概率的**等权平均**(不再直接判 `0.5`;早期把高置信分歧 0.9 vs 1 误判为 0.5 的问题已在 v2/v3 修复);`forced` 按历史准确率+严谨性加权,且准确率只在对象此后获得布尔裁决时计分。
845
845
  - `never` 优先级的问题/命题**永不调度**,且不阻塞严格终止(视为主动弃权)。
846
846
  - 四个 preset 文件互相独立、可共存;同一会话同时只能选一个预设。
847
847
 
848
848
  **v3**:
849
849
  - **软规范而非零规范**:md 知识库只强制对象头部的 4~7 行锚点(`- ID/类型/状态/概率/优先级/依赖/...`)与条目标题行(`### 解法/证明/证伪 N|标题|概率X|状态Y`),供调度器可靠索引;正文完全自由论文式叙述,调度器从不解析正文。手工编辑锚点可能导致索引漂移(调度器会保留上次有效索引并告警)。
850
- - **规划代理是增强而非必需**:`plannerEnabled=false` 或规划代理连续失败(`plannerMaxFails`)时自动回退 v2 式启发式调度;`planMinIntervalMs` 冷却在有在途子代理时生效(系统空闲时有工作则立即规划)。
850
+ - **规划代理是增强而非必需**:`plannerEnabled=false` 或规划代理连续失败(`plannerMaxFails`)时自动回退 v2 式启发式调度;`planMinIntervalMs` 冷却对**每一次**规划调用生效——包括空计划和"空闲但仍有工作"的情形(空闲不再绕过冷却,那正是规划代理每 tick 空转的放大器)。
851
851
  - **方法库可信分层**:方法卡的 `可信断言` 只允许链接已进 `Verified/` 的 ID;方法条目的其余内容(含未验证的策略/直觉/启发式)一律视为**经验参考**,不得当定理引用。
852
852
  - **项目锁**:同一项目同一时刻只允许一个会话调度(第二个会话启动会提示"被会话 X 占用");锁在暂停/终止/全部解决时自动释放。
853
- - **近共识裁决**:全部验证器结果同侧且均值 ≥0.85/≤0.15 时取均值(如 0.9 vs 1 → 0.95),否则 `forced` 加权 / `flat` 判 0.5——修复了 v2 中"数学上正确但形式有瑕疵"的结论被误判为不确定的问题。
853
+ - **近共识裁决**:全部验证器结果同侧且均值 ≥0.85/≤0.15 时取均值(如 0.9 vs 1 → 0.95),否则 `forced` 取各票的**等权平均**、`flat` 判 `0.5`——修复了 v2 中"数学上正确但形式有瑕疵"的结论被误判为不确定的问题。
854
854
 
855
855
  **v5**:
856
856
  - **框架绝不指派任务**:这是设计上的硬边界,不是尚未实现的功能。任务的产生与分配属于**所内自治**
@@ -858,7 +858,8 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
858
858
  - **`≥ m` 一致 ≠ 数学上已证明**:门槛只保证"所内达成了一致判断",不保证结论真的正确。
859
859
  求真的纵深靠成员自己的推导与辩论录留痕;未达门槛的对象会**留库附平均概率**,不会被强行判真判假。
860
860
  - **一致性门槛不是"少数服从多数"**:任何一张反向布尔票都阻塞定论,弃权既不帮真也不帮假。
861
- 要更容易收敛就调低 `quorumCap` 或减少有表决权人数;要更严格可切 `quorumMode: "all-unanimous"`。
861
+ 因此在本口径下(`m = min(quorumCap, 有表决权人数)`)**只要有人投布尔票,门槛就等于"全部布尔票同向"**:
862
+ 调低 `quorumCap` 只是把"至少几张布尔票"降到 `m`,**不会让收敛更容易**;要更严格可切 `quorumMode: "all-unanimous"`(它连弃权都不允许)。
862
863
  - **一个回合永不结束的成员不会被强行释放**(与 v4 同一边界):心跳每次都会重新武装,
863
864
  所以调度器不会永久冻结;需要人工介入时用 `vibe_v5_fire`(临时工)或所办增删编制。
864
865
  - **会议与验证严格互斥**:一方进行中,另一方排队/暂存。因此"在会议上当场定论一个对象"会先排队,
package/SECURITY.md ADDED
@@ -0,0 +1,56 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ Security fixes are released for the latest published line. The previous line receives security fixes
6
+ only for the DSH host versions it was built against.
7
+
8
+ | Version | Supported | Notes |
9
+ |---|---|---|
10
+ | 2.4.x (latest) | ✅ | Current line — DSH 0.1.2-alpha.4 … 0.2.0-rc.2 |
11
+ | 2.3.x | ⚠️ security fixes only | Superseded by 2.4.x, which also covers DSH ≤ 0.1.6; **cannot run on DSH 0.2.x** |
12
+ | ≤ 2.2.x | ❌ | Please upgrade |
13
+
14
+ ## Reporting a vulnerability
15
+
16
+ Please **do not** open a public issue for a security problem. Use GitHub's private vulnerability
17
+ reporting on this repository (Security → Report a vulnerability), or contact the maintainer through
18
+ the profile linked from <https://github.com/ChongCyrus/Vibe-Mathematics>.
19
+
20
+ Please include: the affected version and DSH host version, a minimal reproduction, the impact you
21
+ believe it has, and whether you are willing to be credited.
22
+
23
+ We aim to acknowledge a report within 7 days and to ship a fix or a documented mitigation within 30
24
+ days for anything rated high or critical. If the report turns out to concern the DSH host itself
25
+ rather than this package, we will say so and point you at the right project.
26
+
27
+ ## What this package does (and what it does not)
28
+
29
+ Knowing the design makes reports much easier to triage:
30
+
31
+ - **What it is.** `dsh-vibe-math` is a DeepSeek Harness plugin bundle. It ships four agent presets
32
+ (v2/v3/v4/v5) and an installer. It runs **inside** the DSH host process with whatever permissions
33
+ the user granted that host — it does not add privileges of its own.
34
+ - **No dynamic code execution.** The package contains no `eval` and no `new Function`. Its behaviour
35
+ is fixed at install time; nothing in a session can inject code into it.
36
+ - **Filesystem.** The presets read and write only inside the session workspace (the project directory
37
+ that DSH hands to the session) — `VibeMath/…` — through the host's `fs` service, so the host's
38
+ sandbox policy applies there. The **installer** additionally syncs preset files for hosts it does
39
+ not detect as using composition rows (the DSH ≤ 0.1.6 directory line) into the legacy
40
+ `<DSH_HOME>/.agent-presets/` directory (default `~/.dsh/.agent-presets/`), including its
41
+ `.vibe-math-installed.json` state file and `.vibe-math-backup/` copies of replaced files. That sync
42
+ uses Node's own `fs` **inside the host process**, not the host `fs` service, so only the host's
43
+ OS-level sandbox applies to it.
44
+ - **No network, no credentials, no telemetry.** The package itself makes no outbound requests and
45
+ reads no secrets or tokens. Model traffic, if any, is the host's own LLM service.
46
+ - **Subprocesses.** The Lean toolchain and shell helpers are invoked only when a preset tool is
47
+ actually called, through the host's `subprocess` service under the host's sandbox policy.
48
+ - **Prompts are data.** The preset prompts, corpora and documentation are inert text shipped with
49
+ the package; the repository's own suites verify that model-facing text matches the implementation.
50
+
51
+ ## Verifying what you install
52
+
53
+ - Published tarballs: `npm view dsh-vibe-math dist.shasum dist.integrity`
54
+ - The release gate the maintainer runs before publishing lives outside this repository (it re-runs every
55
+ guard, the packaging checks, and the plugin-catalog compliance scan); the artifact hashes above are
56
+ the verifiable output of a release.