dsh-vibe-math 2.7.1 → 2.7.3

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 (114) hide show
  1. package/README.en.md +682 -690
  2. package/README.md +19 -27
  3. package/cordis.patch.yml +112 -16
  4. package/docs/AUDIT-CHECKLIST.md +744 -518
  5. package/docs/COMPAT-AUDIT-ROUND2.md +35 -9
  6. package/docs/COMPAT-AUDIT-ROUND3.md +154 -154
  7. package/docs/final-paper.md +172 -172
  8. package/docs/formal-verification.md +588 -588
  9. package/docs/math-computation.md +194 -163
  10. package/docs/parameter-schema.md +37 -0
  11. package/docs/release-notes/README.en.md +49 -0
  12. package/docs/release-notes/README.md +48 -0
  13. package/docs/release-notes/RELEASE-NOTES-2.7.2.en.md +72 -0
  14. package/docs/release-notes/RELEASE-NOTES-2.7.2.md +72 -0
  15. package/docs/release-notes/RELEASE-NOTES-2.7.3.en.md +67 -0
  16. package/docs/release-notes/RELEASE-NOTES-2.7.3.md +67 -0
  17. package/docs/release-notes/TEMPLATE.md +126 -0
  18. package/docs/status-report-fields.md +167 -0
  19. package/docs/test-timing.md +157 -154
  20. package/installer.js +27 -17
  21. package/package.json +55 -3
  22. package/prompt-corpus-persona/persona-corpus.json +9 -9
  23. package/prompt-corpus-persona/persona-corpus.md +225 -33
  24. package/prompt-corpus-v2/formal-verify-v2.json +305 -113
  25. package/prompt-corpus-v2/formal-verify-v2.md +2399 -279
  26. package/prompt-corpus-v3/formal-verify-v3.json +134 -110
  27. package/prompt-corpus-v3/formal-verify-v3.md +409 -141
  28. package/prompt-corpus-v4/formal-verify-v4.json +18 -18
  29. package/prompt-corpus-v4/formal-verify-v4.md +49 -44
  30. package/prompt-corpus-v5/prompt-corpus-v5.json +82 -82
  31. package/prompt-corpus-v5/prompt-corpus-v5.md +513 -259
  32. package/scripts/update-doc-counts.mjs +71 -0
  33. package/tests/audit-artifact-docs.mjs +72 -0
  34. package/tests/audit-artifact-docs.mutants.mjs +58 -0
  35. package/tests/audit-installer-assertions.mutants.mjs +63 -0
  36. package/tests/audit-installer-compat.test.mjs +52 -4
  37. package/tests/audit-installer-policy.test.mjs +41 -8
  38. package/tests/audit-math-computation-contract.mjs +107 -9
  39. package/tests/audit-math-computation-contract.mutants.mjs +106 -0
  40. package/tests/audit-math-computation-parity.mjs +164 -3
  41. package/tests/audit-math-computation-sensitivity.mjs +6 -4
  42. package/tests/audit-package-membership.mjs +57 -0
  43. package/tests/audit-package-membership.mutants.mjs +28 -0
  44. package/tests/audit-participant-set-parity.mjs +160 -0
  45. package/tests/audit-path-discipline.mjs +83 -0
  46. package/tests/audit-path-discipline.mutants.mjs +51 -0
  47. package/tests/audit-persona-sensitivity.mjs +14 -0
  48. package/tests/audit-persona-surface.mutants.mjs +69 -0
  49. package/tests/audit-persona-surface.test.mjs +63 -22
  50. package/tests/audit-prompt-duplication.mjs +143 -0
  51. package/tests/audit-prompt-duplication.mutants.mjs +50 -0
  52. package/tests/audit-prompt-invariants.mjs +43 -5
  53. package/tests/audit-readme-bilingual.test.mjs +152 -0
  54. package/tests/audit-readme-counts.mjs +95 -0
  55. package/tests/audit-readme-counts.mutants.mjs +52 -0
  56. package/tests/audit-registration.mjs +78 -0
  57. package/tests/audit-status-report-fields.mjs +172 -0
  58. package/tests/audit-status-report-fields.mutants.mjs +64 -0
  59. package/tests/audit-v3-registration-parity.mjs +156 -0
  60. package/tests/audit-v5-integrity.mjs +300 -13
  61. package/tests/audit-v5-lean-abstention.mjs +392 -0
  62. package/tests/audit-v5-lean-abstention.mutants.mjs +106 -0
  63. package/tests/audit-v5-prompt-duplication.mjs +88 -0
  64. package/tests/audit-v5-prompt-duplication.mutants.mjs +34 -0
  65. package/tests/audit-v5-sensitivity.mjs +15 -8
  66. package/tests/e2e-identity-a6.mutants.mjs +65 -0
  67. package/tests/e2e-v5-round2.test.mjs +566 -12
  68. package/tests/formal-verify-v2.test.mjs +91 -5
  69. package/tests/formal-verify-v3.mutants.mjs +117 -0
  70. package/tests/formal-verify-v3.test.mjs +85 -6
  71. package/tests/formal-verify-v4.mutants.mjs +152 -0
  72. package/tests/formal-verify-v4.test.mjs +628 -9
  73. package/tests/formal-verify-v5.test.mjs +68 -9
  74. package/tests/helpers/doc-counts-format.mjs +41 -0
  75. package/tests/helpers/math-computation-fake-seam.mjs +4 -0
  76. package/tests/math-computation-a1.mutants.mjs +72 -0
  77. package/tests/math-computation-archive-rerun.mutants.mjs +65 -0
  78. package/tests/math-computation-discovery.mutants.mjs +76 -0
  79. package/tests/math-computation-shared.test.mjs +396 -2
  80. package/tests/math-computation-v2.test.mjs +767 -0
  81. package/tests/math-computation-v3.test.mjs +759 -0
  82. package/tests/math-computation-v4.mutants.mjs +133 -0
  83. package/tests/math-computation-v4.test.mjs +739 -0
  84. package/tests/prompt-v5-integrity.test.mjs +13 -2
  85. package/tests/run-tests.mjs +139 -9
  86. package/tests/run-tests.mutants.mjs +70 -0
  87. package/tests/selfdrive-v5.mjs +53 -1
  88. package/tests/selfdrive-v5.mutants.mjs +132 -0
  89. package/tests/v2-fix-probes.mutants.mjs +100 -0
  90. package/tests/v2-fix-probes.test.mjs +1039 -0
  91. package/tests/v2-list-agents-and-next-step.mutants.mjs +106 -0
  92. package/tests/v3-fix-probes.mutants.mjs +95 -0
  93. package/tests/v3-fix-probes.test.mjs +891 -0
  94. package/tests/v5-institute-fixes.mutants.mjs +190 -0
  95. package/vibe-math-v2/agent.cordis.yml +62 -6
  96. package/vibe-math-v2/math-computation.js +229 -29
  97. package/vibe-math-v2/math-engines.js +12 -12
  98. package/vibe-math-v2/vibe-math-v2.js +458 -119
  99. package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +5 -1
  100. package/vibe-math-v3/agent.cordis.yml +72 -6
  101. package/vibe-math-v3/math-computation.js +229 -29
  102. package/vibe-math-v3/math-engines.js +12 -12
  103. package/vibe-math-v3/vibe-math-v3.js +482 -139
  104. package/vibe-math-v4/agent.cordis.yml +44 -8
  105. package/vibe-math-v4/math-computation.js +229 -29
  106. package/vibe-math-v4/math-engines.js +12 -12
  107. package/vibe-math-v4/vibe-math-v4.js +245 -52
  108. package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +2 -0
  109. package/vibe-math-v5/agent.cordis.yml +46 -12
  110. package/vibe-math-v5/math-computation.js +229 -29
  111. package/vibe-math-v5/math-engines.js +12 -12
  112. package/vibe-math-v5/vibe-math-v5.js +1307 -243
  113. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +1728 -1655
  114. package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +693 -693
@@ -484,4 +484,8 @@ v2 **没有会话投影**,所以记录与待办一起持久化在 v2 自己的
484
484
  `require` 档**必须**出现(那里门禁真的会搁置裁定)。
485
485
  - `kind='def'/'lemma'` 运行未通过时,工具返回值**不得**声称"可直接 import 复用"。
486
486
 
487
- 套件支持 `V2_PLUGIN` 环境变量指向变异副本,供灵敏度探针使用。
487
+ 套件支持 `V2_PLUGIN` 环境变量指向变异副本,供灵敏度探针使用。
488
+
489
+ ## 状态 / 报告字段:`verifyTasksView`(单一来源)
490
+
491
+ v2 的 **status 与 report 两个视图**里出现的验证任务列表由**同一个** helper `verifyTasksView(tasks)` 产出(`vibe-math-v2.js:2995`;调用点 `:2046` 与 `:4039`),因此两处字段必须**逐个字段一致**;任何"在某一侧顺手补一个字段"的改动都会让两个视图分叉。该一致性由 `tests/formal-verify-v2.test.mjs:1694-1698` 钉住(两侧取自同一 helper 且字段集合相等)。
@@ -56,6 +56,7 @@
56
56
  - vibe_math_index — rebuild State/index.json from the Markdown knowledge base.
57
57
  - vibe_math_method_add / vibe_math_method_list — manually add / list method cards (Methods/ + global).
58
58
  - vibe_math_lock_status — project lock occupancy (the lock is a renewed lease: while a session is running it never expires; taking it over needs override=true, or happens automatically once the owner's lease has clearly expired after a crash).
59
+ - vibe_math_claim_write / vibe_math_release_write — (member) 写共用 Markdown(含 Progress/<qid>/<dirId>.md)前先取该文件的写锁、写完立刻释放;锁被别的成员持有时报出持有者,不要硬写。
59
60
  Only ONE session may run a project: a second session is refused with PROJECT_LOCKED instead of silently writing the same knowledge base in parallel.
60
61
  - vibe_math_new_project / vibe_math_set_project / vibe_math_list_projects — per-project folders.
61
62
  - vibe_math_list_decisions / vibe_math_decide {id, action: approve|reject|override, verdict?} — resolve manual decisions.
@@ -69,7 +70,7 @@
69
70
 
70
71
  - math_computation {op: probe|run|receipt|install, engine, mode: code|file|expr, …} — 先 probe 预检引擎/包/许可,再调引擎计算并把脚本与输出归档成可复核回执;缺引擎/缺包只报告与给安装指引/计划;shell 兜底不算归档。
71
72
  - 替代必须声明(诚实性):当替代方案改变了**精确性或结论强度**时(精确符号解 → 数值近似、闭式解 → 采样/求积、改了精度/容差/假设、换了算法类),结论里**必须写明**,不得读起来像得到了原本(精确/所要求的)结果;拿不到精确结果就直说。
72
- - 归档→编辑→重跑:mode:'code' 的脚本原件在回执的 scriptPath(Computation/<id>/script.<ext>),你可以用普通文件工具打开并编辑它;编辑后用 mode:'file' 指向它重跑,会写出一份**新回执/新 attempt**(含新的 scriptHash)。**旧回执对修改后的代码无效**——报告里必须引用与当前代码哈希一致的那份回执;工具会在 scriptChanged / scriptChangedDuringRun 为 true 时显式告警。
73
+ - 归档→编辑→重跑:mode:'code' 的脚本原件在回执的 scriptPath(Computation/<id>/script.<ext>,**相对项目根**);**成员的文件工具是按会话 cwd 解析的**,所以读它要用**绝对路径** `receipt.scriptAbs`,或把 `receipt.cwd` 与 `receipt.scriptPath` 拼起来(回执两个字段都有)。要拿到"改过代码"的证据,请**编辑你最初运行的那个源文件**,再用 mode:'file' 指向**同一个源路径**重跑:归档 id 以**源路径**为键,因此这落在**同一归档**的 **attempt ≥ 2**,并给出 `scriptChanged:true` 与 `previousReceipt`(指向上一次)。**指向归档副本本身**(`receipt.scriptAbs` 那个路径)按设计是**另一份新归档**:新 id、attempt 1、没有 `previousReceipt`、`scriptChanged:false`;旧 attempt 绝不会被覆盖,但它**不是**"同一归档的新 attempt"——工具会用 `fileIsArchivedScript` 与 `ARCHIVED_SCRIPT_RERUN` 警告明确说明。**旧回执对修改后的代码无效**——报告里必须引用与当前代码哈希一致的那份回执;工具会在 scriptChanged / scriptChangedDuringRun 为 true 时显式告警。
73
74
 
74
75
  A /vibe slash command mirrors the main controls (/vibe start [override]|resume [override]|pause|abort|status|report|mode
75
76
  <auto|manual>|setup|save|template [global|project]|add <id> <desc>|add-proposition <id> <概述>|list-propositions|methods|index|plan|lock|project [list|new <name>|<name>]|decisions|agents|paper [lang=zh|en] [format=both|md|tex] [force]).
@@ -95,8 +96,15 @@
95
96
  match the proposition as stated) | 'require' (same, plus a gate: a true/false verdict is
96
97
  withheld as 未定论 with reason formal-required until the object is Lean-passed or carries an
97
98
  explicit, reasoned blocker record; the scheduler is never wedged by it).
98
- - Paths: work file Formal/<id>.lean; archived proof Verified/Lean/<id>.lean; reusable
99
- definitions VibeMath/Formal/Lib/; proved lemmas VibeMath/Formal/Proved/.
99
+ - Paths (every path here is resolved against the SESSION WORKING DIRECTORY, i.e. the cwd
100
+ printed at the end of this prompt; the project root is the `Data lives under …`
101
+ directory above):
102
+ institute work file `<project root>/Formal/<id>.lean`;
103
+ archived proof `<project root>/Verified/Lean/<id>.lean`;
104
+ reusable definitions `VibeMath/Formal/Lib/` (workspace-root relative);
105
+ proved lemmas `VibeMath/Formal/Proved/` (workspace-root relative);
106
+ short form `Formal/<id>.lean` (project-root relative) names the SAME file as
107
+ `<project root>/Formal/<id>.lean`.
100
108
  - The toolchain knobs leanCommand / leanArgs / leanTimeoutMs / leanAsync / leanInitiative / leanSearchPaths / leanJobsMaxParallel are tunable as well
101
109
  (e.g. leanCommand='lake' with leanArgs=['env','lean']); a missing Lean binary is
102
110
  reported as LEAN_NOT_FOUND and still lets the code be written and archived.
@@ -104,6 +112,31 @@
104
112
  formalization TODO (Formal/TODO.md). The framework never installs Lean and never judges
105
113
  fidelity for you.
106
114
  When the user asks about progress, call vibe_math_report and summarize in plain language.
115
+
116
+ DISCLOSURES (existing behaviour, not rules to follow):
117
+ - DISCLOSURE (existing behaviour): the FINAL PAPER flow can finish without you — when it hits
118
+ its round/token cap the framework force-finalises the paper (`forcedAfterCap`) and reaps an
119
+ in-flight writer that never came back; the activity log says so. You do not lose the paper,
120
+ you lose the chance to keep iterating on it.
121
+ - DISCLOSURE (existing behaviour): switching the mode to `auto` immediately resolves EVERY
122
+ pending decision as auto-decided (the activity log records "auto-resolved N pending
123
+ decision(s)"). Anything you leave pending will not wait for you.
124
+ - DISCLOSURE (existing behaviour): the framework itself pushes a progress update to the office
125
+ (reportMode / reportIntervalMs) — a summary you did not ask for can arrive at a round
126
+ boundary; it is a report, not a new instruction.
127
+ - DISCLOSURE (existing behaviour): a second session can TAKE OVER the project lock
128
+ (the activity log records "project lock taken over from session …") — another office may
129
+ resume the same project while you are away; the state file stays authoritative and is not
130
+ merged.
131
+ - DISCLOSURE (existing behaviour): the framework can adjust problem/proposition priorities
132
+ itself (priorityAdjust / proposPriorityAdjust) — the activity log records "priorities
133
+ auto-adjusted (…)"; a problem you deprioritised can come back on its own.
134
+ - DISCLOSURE (existing behaviour): when mathMode is `typed`, the shell fallback is refused
135
+ (the math tool returns REFUSED with reason=policy) instead of silently falling back.
136
+ - math_computation policy: mathComputation = off | auto | on (off = the math surface is
137
+ not mentioned in prompts at all); mathMode = typed | typed+shell (typed refuses the shell
138
+ fallback); mathEngines (cli / python / …); mathTimeoutMs; mathPackages + mathInstallScope
139
+ for preflight package installs (missing packages are reported with an install plan only).
107
140
  suffix: Your working directory is {{cwd}}.
108
141
  text: |-
109
142
  You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
@@ -148,6 +181,7 @@
148
181
  - vibe_math_index — rebuild State/index.json from the Markdown knowledge base.
149
182
  - vibe_math_method_add / vibe_math_method_list — manually add / list method cards (Methods/ + global).
150
183
  - vibe_math_lock_status — project lock occupancy (the lock is a renewed lease: while a session is running it never expires; taking it over needs override=true, or happens automatically once the owner's lease has clearly expired after a crash).
184
+ - vibe_math_claim_write / vibe_math_release_write — (member) 写共用 Markdown(含 Progress/<qid>/<dirId>.md)前先取该文件的写锁、写完立刻释放;锁被别的成员持有时报出持有者,不要硬写。
151
185
  Only ONE session may run a project: a second session is refused with PROJECT_LOCKED instead of silently writing the same knowledge base in parallel.
152
186
  - vibe_math_new_project / vibe_math_set_project / vibe_math_list_projects — per-project folders.
153
187
  - vibe_math_list_decisions / vibe_math_decide {id, action: approve|reject|override, verdict?} — resolve manual decisions.
@@ -161,7 +195,7 @@
161
195
 
162
196
  - math_computation {op: probe|run|receipt|install, engine, mode: code|file|expr, …} — 先 probe 预检引擎/包/许可,再调引擎计算并把脚本与输出归档成可复核回执;缺引擎/缺包只报告与给安装指引/计划;shell 兜底不算归档。
163
197
  - 替代必须声明(诚实性):当替代方案改变了**精确性或结论强度**时(精确符号解 → 数值近似、闭式解 → 采样/求积、改了精度/容差/假设、换了算法类),结论里**必须写明**,不得读起来像得到了原本(精确/所要求的)结果;拿不到精确结果就直说。
164
- - 归档→编辑→重跑:mode:'code' 的脚本原件在回执的 scriptPath(Computation/<id>/script.<ext>),你可以用普通文件工具打开并编辑它;编辑后用 mode:'file' 指向它重跑,会写出一份**新回执/新 attempt**(含新的 scriptHash)。**旧回执对修改后的代码无效**——报告里必须引用与当前代码哈希一致的那份回执;工具会在 scriptChanged / scriptChangedDuringRun 为 true 时显式告警。
198
+ - 归档→编辑→重跑:mode:'code' 的脚本原件在回执的 scriptPath(Computation/<id>/script.<ext>,**相对项目根**);**成员的文件工具是按会话 cwd 解析的**,所以读它要用**绝对路径** `receipt.scriptAbs`,或把 `receipt.cwd` 与 `receipt.scriptPath` 拼起来(回执两个字段都有)。要拿到"改过代码"的证据,请**编辑你最初运行的那个源文件**,再用 mode:'file' 指向**同一个源路径**重跑:归档 id 以**源路径**为键,因此这落在**同一归档**的 **attempt ≥ 2**,并给出 `scriptChanged:true` 与 `previousReceipt`(指向上一次)。**指向归档副本本身**(`receipt.scriptAbs` 那个路径)按设计是**另一份新归档**:新 id、attempt 1、没有 `previousReceipt`、`scriptChanged:false`;旧 attempt 绝不会被覆盖,但它**不是**"同一归档的新 attempt"——工具会用 `fileIsArchivedScript` 与 `ARCHIVED_SCRIPT_RERUN` 警告明确说明。**旧回执对修改后的代码无效**——报告里必须引用与当前代码哈希一致的那份回执;工具会在 scriptChanged / scriptChangedDuringRun 为 true 时显式告警。
165
199
 
166
200
  A /vibe slash command mirrors the main controls (/vibe start [override]|resume [override]|pause|abort|status|report|mode
167
201
  <auto|manual>|setup|save|template [global|project]|add <id> <desc>|add-proposition <id> <概述>|list-propositions|methods|index|plan|lock|project [list|new <name>|<name>]|decisions|agents|paper [lang=zh|en] [format=both|md|tex] [force]).
@@ -187,8 +221,15 @@
187
221
  match the proposition as stated) | 'require' (same, plus a gate: a true/false verdict is
188
222
  withheld as 未定论 with reason formal-required until the object is Lean-passed or carries an
189
223
  explicit, reasoned blocker record; the scheduler is never wedged by it).
190
- - Paths: work file Formal/<id>.lean; archived proof Verified/Lean/<id>.lean; reusable
191
- definitions VibeMath/Formal/Lib/; proved lemmas VibeMath/Formal/Proved/.
224
+ - Paths (every path here is resolved against the SESSION WORKING DIRECTORY, i.e. the cwd
225
+ printed at the end of this prompt; the project root is the `Data lives under …`
226
+ directory above):
227
+ institute work file `<project root>/Formal/<id>.lean`;
228
+ archived proof `<project root>/Verified/Lean/<id>.lean`;
229
+ reusable definitions `VibeMath/Formal/Lib/` (workspace-root relative);
230
+ proved lemmas `VibeMath/Formal/Proved/` (workspace-root relative);
231
+ short form `Formal/<id>.lean` (project-root relative) names the SAME file as
232
+ `<project root>/Formal/<id>.lean`.
192
233
  - The toolchain knobs leanCommand / leanArgs / leanTimeoutMs / leanAsync / leanInitiative / leanSearchPaths / leanJobsMaxParallel are tunable as well
193
234
  (e.g. leanCommand='lake' with leanArgs=['env','lean']); a missing Lean binary is
194
235
  reported as LEAN_NOT_FOUND and still lets the code be written and archived.
@@ -197,6 +238,31 @@
197
238
  fidelity for you.
198
239
  When the user asks about progress, call vibe_math_report and summarize in plain language.
199
240
 
241
+ DISCLOSURES (existing behaviour, not rules to follow):
242
+ - DISCLOSURE (existing behaviour): the FINAL PAPER flow can finish without you — when it hits
243
+ its round/token cap the framework force-finalises the paper (`forcedAfterCap`) and reaps an
244
+ in-flight writer that never came back; the activity log says so. You do not lose the paper,
245
+ you lose the chance to keep iterating on it.
246
+ - DISCLOSURE (existing behaviour): switching the mode to `auto` immediately resolves EVERY
247
+ pending decision as auto-decided (the activity log records "auto-resolved N pending
248
+ decision(s)"). Anything you leave pending will not wait for you.
249
+ - DISCLOSURE (existing behaviour): the framework itself pushes a progress update to the office
250
+ (reportMode / reportIntervalMs) — a summary you did not ask for can arrive at a round
251
+ boundary; it is a report, not a new instruction.
252
+ - DISCLOSURE (existing behaviour): a second session can TAKE OVER the project lock
253
+ (the activity log records "project lock taken over from session …") — another office may
254
+ resume the same project while you are away; the state file stays authoritative and is not
255
+ merged.
256
+ - DISCLOSURE (existing behaviour): the framework can adjust problem/proposition priorities
257
+ itself (priorityAdjust / proposPriorityAdjust) — the activity log records "priorities
258
+ auto-adjusted (…)"; a problem you deprioritised can come back on its own.
259
+ - DISCLOSURE (existing behaviour): when mathMode is `typed`, the shell fallback is refused
260
+ (the math tool returns REFUSED with reason=policy) instead of silently falling back.
261
+ - math_computation policy: mathComputation = off | auto | on (off = the math surface is
262
+ not mentioned in prompts at all); mathMode = typed | typed+shell (typed refuses the shell
263
+ fallback); mathEngines (cli / python / …); mathTimeoutMs; mathPackages + mathInstallScope
264
+ for preflight package installs (missing packages are reported with an install plan only).
265
+
200
266
  # ── agent-instructions ──────────────────────────────────────────────────────
201
267
 
202
268
  - id: agent-instructions