dsh-vibe-math 2.4.1 → 2.6.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 (46) hide show
  1. package/README.en.md +53 -14
  2. package/README.md +54 -14
  3. package/cordis.patch.yml +54 -17
  4. package/docs/AUDIT-CHECKLIST.md +26 -7
  5. package/docs/COMPAT-AUDIT-ROUND3.md +16 -1
  6. package/docs/final-paper.md +171 -0
  7. package/docs/release-notes/RELEASE-NOTES-2.5.0.md +173 -0
  8. package/docs/release-notes/RELEASE-NOTES-2.6.0.md +268 -0
  9. package/docs/test-timing.md +77 -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 +13 -13
  14. package/prompt-corpus-persona/persona-corpus.md +113 -39
  15. package/prompt-corpus-v2/formal-verify-v2.json +128 -92
  16. package/prompt-corpus-v2/formal-verify-v2.md +380 -142
  17. package/prompt-corpus-v3/formal-verify-v3.json +117 -81
  18. package/prompt-corpus-v3/formal-verify-v3.md +693 -1189
  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 +68 -8
  26. package/tests/audit-persona-surface.test.mjs +21 -8
  27. package/tests/audit-v5-sensitivity.mjs +47 -6
  28. package/tests/e2e-v5-round2.test.mjs +825 -1
  29. package/tests/formal-verify-v2.test.mjs +57 -2
  30. package/tests/formal-verify-v3.test.mjs +67 -2
  31. package/tests/formal-verify-v4.test.mjs +120 -4
  32. package/tests/prompt-v5-integrity.test.mjs +9 -3
  33. package/tests/run-tests.mjs +104 -23
  34. package/tests/selfdrive-v5.mjs +55 -4
  35. package/vibe-math-v2/agent.cordis.yml +20 -4
  36. package/vibe-math-v2/vibe-math-v2.js +1318 -106
  37. package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +20 -4
  38. package/vibe-math-v3/agent.cordis.yml +36 -14
  39. package/vibe-math-v3/vibe-math-v3.js +1348 -179
  40. package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +3 -3
  41. package/vibe-math-v4/agent.cordis.yml +36 -8
  42. package/vibe-math-v4/vibe-math-v4.js +1195 -57
  43. package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +91 -9
  44. package/vibe-math-v5/agent.cordis.yml +16 -8
  45. package/vibe-math-v5/vibe-math-v5.js +1628 -112
  46. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +143 -41
@@ -156,6 +156,12 @@ const wakeKindOf = (prompt) => {
156
156
  if (/【研究所会议/.test(prompt)) return 'meeting'
157
157
  if (/【求真表决/.test(prompt)) return 'verify'
158
158
  if (/【心跳检查/.test(prompt)) return 'checkpoint'
159
+ // The final paper is a phase of its own (it runs BEFORE the run is marked complete):
160
+ // each member writes its own part, cross-reviews another member's part, and the
161
+ // academician finalises.
162
+ if (/【最终论文·撰写/.test(prompt)) return 'paper-write'
163
+ if (/【最终论文·互审/.test(prompt)) return 'paper-review'
164
+ if (/【最终论文·定稿/.test(prompt)) return 'paper-final'
159
165
  return 'normal'
160
166
  }
161
167
  const memberLabelOf = (childId) => { const s = spawns.find(x => x.childId === childId); const m = s ? /vibe5 (\S+) /.exec(s.label) : null; return m ? m[1] : '' }
@@ -193,6 +199,20 @@ async function answerWake(w) {
193
199
  reply = { verdict: { target, verdict: v, reason: who + ' 的判断:' + (v === 1 ? '成立' : v === 0 ? '不成立' : '不确定') }, contextPct: 20 }
194
200
  } else if (kind === 'meeting') {
195
201
  reply = { input: who + ':我的意见已写在 Progress/ 里。', vote_solved: solvePlan === true, solved: solvePlan === true, contextPct: 20 }
202
+ } else if (kind === 'paper-write') {
203
+ reply = {
204
+ paper_part: {
205
+ title: who + ' 的贡献', solution: who + ':原问题的完整解法——最小反例归约(仅写有证据的部分)。',
206
+ methods: who + ' 的方法与经验:归约 + 边界情形枚举。', rules: who + ' 归纳的规律:先最小反例,再边界。',
207
+ limits: who + ' 的局限:部分边界情形仍未定论(已显式标注)。',
208
+ evidence: ['Members/' + who + '/Propos/p-' + who + '.md'],
209
+ }, contextPct: 20,
210
+ }
211
+ } else if (kind === 'paper-review') {
212
+ const om = /待审部分(([^)]*))/.exec(prompt)
213
+ reply = { paper_review: { of: om ? om[1] : '', deliverable: true, comments: who + ':证据与表决记录一致,术语清楚,可交付。' }, contextPct: 20 }
214
+ } else if (kind === 'paper-final') {
215
+ reply = { paper_final: { decision: 'deliverable', note: who + ':已核对合并稿与互审意见,统一了术语与符号,可定稿。', conclusion: '原问题在题设范围内得证。' }, contextPct: 20 }
196
216
  } else {
197
217
  reply = { progress: who + ':本轮继续推进最小反例路线。', solved: false, contextPct: 20 }
198
218
  }
@@ -430,16 +450,47 @@ assert(sNo.autoDone === false && sNo.running === true, 'a non-unanimous solve vo
430
450
  solvePlan = true
431
451
  const m2 = await callTool('vibe_v5_meeting', { agenda: '再次表决是否已解决', kind: 'solve-vote' }, childAgent(childOf('acad')))
432
452
  assert(m2.ok === true, 'the second solve-vote meeting is requested (' + JSON.stringify(m2).slice(0, 100) + ')')
453
+ // ★ docs/final-paper.md §3: the unanimous solve vote does NOT flip the completion flags any more. The
454
+ // final-paper phase runs FIRST (after phase='solved' the machinery refuses to wake members,
455
+ // convene meetings or dispatch an end, so the co-writing could never run). This loop must
456
+ // therefore land on "paper active, run still alive" — that IS the contract, and the loop
457
+ // below proves the run concludes only once the paper is finalised.
458
+ let sPaper = null
433
459
  for (let i = 0; i < 60; i++) {
434
460
  const s = await callTool('vibe_v5_status', {})
461
+ if (s.paper && s.paper.status !== 'finalized') { sPaper = s; break }
435
462
  if (s.autoDone) break
436
463
  await drainWakes(6)
437
464
  await sleep(15)
438
465
  }
439
- const sDone = await callTool('vibe_v5_status', {})
440
- assert(sDone.autoDone === true, 'a unanimous solve vote from every voting member DOES stop the institute — ' +
441
- JSON.stringify({ autoDone: sDone.autoDone, running: sDone.running, meeting: sDone.meeting, parked: sDone.parkedMeeting, solveVotes: sDone.solveVotes }))
442
- assert(sDone.running === false, 'scheduling halted after the unanimous solve vote')
466
+ assert(!!sPaper, 'the unanimous solve vote enters the FINAL PAPER phase before completion — ' +
467
+ JSON.stringify({ autoDone: (sPaper || {}).autoDone, paper: (sPaper || {}).paper }))
468
+ assert(sPaper && sPaper.autoDone === false && sPaper.running === true,
469
+ 'the run stays ALIVE while the paper phase runs (a concluded run refuses the wakes it needs)')
470
+ assert(sPaper && sPaper.paper && sPaper.paper.status === 'writing' && sPaper.paper.editor === 'academician',
471
+ 'the automatic paper is in its writing stage with the academician as the default editor (' + JSON.stringify(sPaper && sPaper.paper && { status: sPaper.paper.status, editor: sPaper.paper.editor }) + ')')
472
+ // Drive the paper to completion: parts -> cross-review -> academician finalises -> the run is
473
+ // marked complete and the conclusion record is written.
474
+ let sDone = sPaper
475
+ for (let i = 0; i < 160; i++) {
476
+ sDone = await callTool('vibe_v5_status', {})
477
+ if (sDone.autoDone) break
478
+ await drainWakes(8)
479
+ await sleep(15)
480
+ }
481
+ assert(sDone.autoDone === true, 'the run is marked complete once the final paper is finalised — ' +
482
+ JSON.stringify({ autoDone: sDone.autoDone, running: sDone.running, paper: sDone.paper && { status: sDone.paper.status, compile: sDone.paper.compile } }))
483
+ assert(sDone.running === false, 'scheduling halted after the paper was finalised')
484
+ assert(sDone.paper && sDone.paper.status === 'finalized', 'status reports the paper as finalised (' + JSON.stringify(sDone.paper && sDone.paper.status) + ')')
485
+ const paperDir = join(WS, 'VibeMath', 'Projects', 'default', 'Institutes', 'institute', 'Paper', 'institute')
486
+ const paperMd = existsSync(join(paperDir, 'paper.md')) ? readFileSync(join(paperDir, 'paper.md'), 'utf8') : ''
487
+ const paperTex = existsSync(join(paperDir, 'paper.tex')) ? readFileSync(join(paperDir, 'paper.tex'), 'utf8') : ''
488
+ const paperMeta = existsSync(join(paperDir, 'paper.meta.json')) ? JSON.parse(readFileSync(join(paperDir, 'paper.meta.json'), 'utf8')) : null
489
+ assert(/## 1\. /.test(paperMd) && /## 9\. /.test(paperMd), '★ the delivered paper carries the 9-section skeleton')
490
+ assert(/\\documentclass/.test(paperTex) && /\\begin\{document\}/.test(paperTex), '★ the tex version is produced as well')
491
+ assert(!!paperMeta && paperMeta.compile && paperMeta.compile.status === 'not-detected',
492
+ '★ no LaTeX on this host: the meta records compile=not-detected and the md+tex are still delivered (' + JSON.stringify(paperMeta && paperMeta.compile) + ')')
493
+ assert(existsSync(join(paperDir, 'paper.log.md')), 'the paper log records who wrote and reviewed what')
443
494
  const concl = existsSync(join(WS, 'VibeMath', 'Projects', 'default', 'Institutes', 'institute', 'Problems', 'conclusion.md'))
444
495
  assert(concl, 'a conclusion record was written on completion')
445
496
 
@@ -28,7 +28,7 @@
28
28
  - vibe_math_status / vibe_math_report — read scheduler status / full progress report (report also writes Progress_Logs/report.json).
29
29
  - vibe_math_pause / vibe_math_abort — pause / abort (abort interrupts all children).
30
30
  - vibe_math_set_mode {mode: manual|auto} — switch manual / auto control.
31
- - vibe_math_set_params {...} — tune any parameter (see vibe_math_setup for the full schema; e.g. reportMode file|push|both, promoteValueThreshold, verdictMode flat|forced, formalVerify off|encourage|require).
31
+ - vibe_math_set_params {...} — tune any parameter (see vibe_math_setup for the full schema; e.g. reportMode file|push|both, promoteValueThreshold, verdictMode flat|forced, formalVerify off|encourage|require, finalPaper true|false, paperFormat both|md|tex, paperLanguage zh|en, paperCompilePdf true|false, paperLatexCommand <engine>).
32
32
  - vibe_math_setup / vibe_math_save_settings / vibe_math_template — guided configuration / persist defaults / generate template.
33
33
  - vibe_math_new_project / vibe_math_set_project / vibe_math_list_projects — per-project folders.
34
34
  - vibe_math_list_decisions / vibe_math_decide {id, action: approve|reject|override, verdict?} — resolve manual decisions.
@@ -37,13 +37,21 @@
37
37
  verification (execute / archive / list the reuse library). The scheduler's child agents
38
38
  use them too; they work in every mode.
39
39
 
40
- A /vibe slash command mirrors the main controls. Data lives under {{cwd}}/VibeMath/Projects/<project>/
40
+ Final paper: strict termination writes Paper/<project>/{paper.md,paper.tex,paper.pdf,paper.meta.json,paper.log.md}
41
+ automatically — a dedicated paper-writing child assembles the solved material (finalPaper=false disables only that
42
+ automatic run). /vibe paper [lang=zh|en] [format=both|md|tex] [force] writes or rewrites it by hand. md/tex follow
43
+ paperFormat; a PDF is produced only when a LaTeX engine is detected and paperCompilePdf is true.
44
+ A /vibe slash command mirrors the main controls (/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|paper [lang=zh|en] [format=both|md|tex] [force]).
45
+ Data lives under {{cwd}}/VibeMath/Projects/<project>/
41
46
  (qs/qs.json, Propos/<分类>_Propos.json, Reliable/, Verified/, Verification_logs/, Progress_Logs/, VibeMath_State/)
42
47
  and survives restarts via vibe_math_resume.
43
48
 
44
49
  Key rules to remember when reporting: a problem is "solved" when one of its solutions reaches
45
50
  正确概率 = 1; a proposition reaches 布尔估计 = 1/0 when a proof/refutation in its lists reaches
46
51
  正确概率 = 1; Propos propositions with 价值/关键性 ≥ promoteValueThreshold auto-promote to qs.json.
52
+ Closure rule (identical across the presets): the 1/0 values above are written ONLY by the scheduler,
53
+ after ≥2 independent verifier agents settle the object (one lone reviewer can never conclude), and
54
+ Verified/ is written by that same scheduler path — an agent's own self-reported 1 is never a conclusion.
47
55
  When the user asks about progress, call vibe_math_report and summarize in plain language.
48
56
 
49
57
  Configuration highlights (all tunable via vibe_math_set_params / the settings file):
@@ -91,7 +99,7 @@
91
99
  - vibe_math_status / vibe_math_report — read scheduler status / full progress report (report also writes Progress_Logs/report.json).
92
100
  - vibe_math_pause / vibe_math_abort — pause / abort (abort interrupts all children).
93
101
  - vibe_math_set_mode {mode: manual|auto} — switch manual / auto control.
94
- - vibe_math_set_params {...} — tune any parameter (see vibe_math_setup for the full schema; e.g. reportMode file|push|both, promoteValueThreshold, verdictMode flat|forced, formalVerify off|encourage|require).
102
+ - vibe_math_set_params {...} — tune any parameter (see vibe_math_setup for the full schema; e.g. reportMode file|push|both, promoteValueThreshold, verdictMode flat|forced, formalVerify off|encourage|require, finalPaper true|false, paperFormat both|md|tex, paperLanguage zh|en, paperCompilePdf true|false, paperLatexCommand <engine>).
95
103
  - vibe_math_setup / vibe_math_save_settings / vibe_math_template — guided configuration / persist defaults / generate template.
96
104
  - vibe_math_new_project / vibe_math_set_project / vibe_math_list_projects — per-project folders.
97
105
  - vibe_math_list_decisions / vibe_math_decide {id, action: approve|reject|override, verdict?} — resolve manual decisions.
@@ -100,13 +108,21 @@
100
108
  verification (execute / archive / list the reuse library). The scheduler's child agents
101
109
  use them too; they work in every mode.
102
110
 
103
- A /vibe slash command mirrors the main controls. Data lives under {{cwd}}/VibeMath/Projects/<project>/
111
+ Final paper: strict termination writes Paper/<project>/{paper.md,paper.tex,paper.pdf,paper.meta.json,paper.log.md}
112
+ automatically — a dedicated paper-writing child assembles the solved material (finalPaper=false disables only that
113
+ automatic run). /vibe paper [lang=zh|en] [format=both|md|tex] [force] writes or rewrites it by hand. md/tex follow
114
+ paperFormat; a PDF is produced only when a LaTeX engine is detected and paperCompilePdf is true.
115
+ A /vibe slash command mirrors the main controls (/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|paper [lang=zh|en] [format=both|md|tex] [force]).
116
+ Data lives under {{cwd}}/VibeMath/Projects/<project>/
104
117
  (qs/qs.json, Propos/<分类>_Propos.json, Reliable/, Verified/, Verification_logs/, Progress_Logs/, VibeMath_State/)
105
118
  and survives restarts via vibe_math_resume.
106
119
 
107
120
  Key rules to remember when reporting: a problem is "solved" when one of its solutions reaches
108
121
  正确概率 = 1; a proposition reaches 布尔估计 = 1/0 when a proof/refutation in its lists reaches
109
122
  正确概率 = 1; Propos propositions with 价值/关键性 ≥ promoteValueThreshold auto-promote to qs.json.
123
+ Closure rule (identical across the presets): the 1/0 values above are written ONLY by the scheduler,
124
+ after ≥2 independent verifier agents settle the object (one lone reviewer can never conclude), and
125
+ Verified/ is written by that same scheduler path — an agent's own self-reported 1 is never a conclusion.
110
126
  When the user asks about progress, call vibe_math_report and summarize in plain language.
111
127
 
112
128
  Configuration highlights (all tunable via vibe_math_set_params / the settings file):