dsh-vibe-math 2.5.0 → 2.7.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 (59) hide show
  1. package/README.en.md +175 -369
  2. package/README.md +175 -370
  3. package/cordis.patch.yml +78 -22
  4. package/docs/AUDIT-CHECKLIST.md +3 -3
  5. package/docs/final-paper.md +172 -0
  6. package/docs/formal-verification.md +184 -29
  7. package/docs/math-computation.md +121 -0
  8. package/docs/release-notes/RELEASE-NOTES-2.6.0.md +268 -0
  9. package/docs/release-notes/RELEASE-NOTES-2.7.0.en.md +151 -0
  10. package/docs/release-notes/RELEASE-NOTES-2.7.0.md +115 -0
  11. package/docs/test-timing.md +25 -9
  12. package/installer.js +7 -4
  13. package/package.json +21 -3
  14. package/prompt-corpus-persona/persona-corpus.json +16 -16
  15. package/prompt-corpus-persona/persona-corpus.md +164 -52
  16. package/prompt-corpus-v2/formal-verify-v2.json +128 -92
  17. package/prompt-corpus-v2/formal-verify-v2.md +1574 -108
  18. package/prompt-corpus-v3/formal-verify-v3.json +137 -53
  19. package/prompt-corpus-v3/formal-verify-v3.md +1406 -100
  20. package/prompt-corpus-v4/formal-verify-v4.json +14 -14
  21. package/prompt-corpus-v4/formal-verify-v4.md +247 -14
  22. package/prompt-corpus-v5/prompt-corpus-v5.json +62 -62
  23. package/prompt-corpus-v5/prompt-corpus-v5.md +570 -3
  24. package/tests/audit-math-computation-contract.mjs +191 -0
  25. package/tests/audit-math-computation-parity.mjs +169 -0
  26. package/tests/audit-math-computation-sensitivity.mjs +231 -0
  27. package/tests/audit-persona-sensitivity.mjs +64 -11
  28. package/tests/audit-persona-surface.test.mjs +53 -16
  29. package/tests/audit-v5-integrity.mjs +14 -0
  30. package/tests/e2e-v5-round2.test.mjs +923 -3
  31. package/tests/formal-verify-v2.test.mjs +295 -6
  32. package/tests/formal-verify-v3.test.mjs +275 -4
  33. package/tests/formal-verify-v4.test.mjs +295 -6
  34. package/tests/formal-verify-v5.test.mjs +9 -1
  35. package/tests/helpers/math-computation-fake-seam.mjs +135 -0
  36. package/tests/math-computation-shared.test.mjs +504 -0
  37. package/tests/prompt-v5-integrity.test.mjs +14 -8
  38. package/tests/selfdrive-v5.mjs +55 -4
  39. package/vibe-math-v2/agent.cordis.yml +36 -14
  40. package/vibe-math-v2/math-computation.js +936 -0
  41. package/vibe-math-v2/math-engines.js +156 -0
  42. package/vibe-math-v2/vibe-math-v2.js +1653 -48
  43. package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +6 -0
  44. package/vibe-math-v3/agent.cordis.yml +30 -12
  45. package/vibe-math-v3/math-computation.js +936 -0
  46. package/vibe-math-v3/math-engines.js +156 -0
  47. package/vibe-math-v3/vibe-math-v3.js +1623 -53
  48. package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +6 -0
  49. package/vibe-math-v4/agent.cordis.yml +44 -8
  50. package/vibe-math-v4/math-computation.js +936 -0
  51. package/vibe-math-v4/math-engines.js +156 -0
  52. package/vibe-math-v4/vibe-math-v4.js +1592 -37
  53. package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +6 -0
  54. package/vibe-math-v5/agent.cordis.yml +46 -10
  55. package/vibe-math-v5/math-computation.js +936 -0
  56. package/vibe-math-v5/math-engines.js +156 -0
  57. package/vibe-math-v5/vibe-math-v5.js +2233 -42
  58. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +153 -4
  59. package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +251 -0
@@ -0,0 +1,268 @@
1
+ # dsh-vibe-math 2.6.0 — 发布说明(中文)
2
+
3
+ > 上一版:2.5.0。本版新增**最终论文(final paper)**功能:四个预设默认在收口时自动撰写一篇只整理
4
+ > 已有证据的完整论文,且论文阶段发生在"标记完成"**之前**。既有参数默认值、数据格式与目录结构未变,
5
+ > DSH 支撑窗口不变,无需迁移。
6
+
7
+ ---
8
+
9
+ ## 概览
10
+
11
+ - 新增**最终论文**:默认开启(`finalPaper=true`)。收口信号命中后、**run 被标记完成之前**进入 paper 阶段。
12
+ - 产物固定在 `Paper/<id>/`:`paper.md`、`paper.tex`、`paper.pdf`(仅在宿主检测到 LaTeX 引擎并编译成功时)、
13
+ `paper.meta.json`、`paper.log.md`。
14
+ - v4/v5 为**团队合写**:各自写自己的部分 → 合并 → 交叉互审 → 定稿代表定稿 → 全体明确"可交付"才定稿;
15
+ v5 的定稿代表默认院士,所办仅在手动路径下可用,且必须先与全所交流并开会。
16
+ - 编译失败**先修复、后降级**:没有引擎或编译不通过时仍交付 tex+md,只记日志告警,不阻塞定稿,
17
+ 也绝不覆盖已有的 `paper.pdf`。
18
+ - 随功能修掉若干问题:v5 自动触发的心跳停摆、v2/v3 写手卡死可能永久阻塞、v3 随包语料的时间戳非确定性、
19
+ 以及一处会被空过的论文判定检查。
20
+ - 契约文档 `docs/final-paper.md` 随包发布;双语 README 补齐参数与用法。
21
+
22
+ ## 变更
23
+
24
+ ### 1. 新功能:最终论文(四套一致,默认开启)
25
+
26
+ - **触发**:各预设用自己的收口信号(v2 严格终止、v3 完整收口、v4 一致性会议的一致停止票、
27
+ v5 每次解题票上的"已解决"判定)。命中后进入 paper 阶段,**论文完成或降级结束之后才把这次 run
28
+ 标记为完成**——否则会议/唤醒机制已被禁用,团队合写无法进行。
29
+ - **手动**:`/vibe paper [lang=zh|en] [format=both|md|tex] [force]`(v2/v3)、
30
+ `/v4 paper [… editor=office|resident:<id>] [force]`、`/v5 paper [… editor=office|academician] [force]`。
31
+ 命令行覆盖只作用于本次(不写回持久参数);`force` 重写已定稿的论文;参数非法返回 `kind:'error'`;
32
+ `finalPaper=false` 只关闭自动触发,手动命令仍可用并在返回里说明"自动已关闭"。
33
+ - **幂等**:同一 run 只写一次(`finalizedAt` + 逐产物存在性检查),重复触发只补写缺失的产物。
34
+ - **内容骨架(9 节,四套一致)**:① 标题、作者、日期与摘要 ② 引言与问题背景 ③ 原问题的完整解法
35
+ ④ 已检验通过的命题(含判定为真的估计值与证据来源)⑤ 已解决的子问题 / 中间成果
36
+ ⑥ 创造或发现的有价值之物(方法、理论、思想、经验、数学理解)⑦ 规律总结 ⑧ 讨论、局限与展望
37
+ ⑨ 附录:证据与文件索引。论文只整理已有证据、**不得编造**;未决与被否证的条目必须显式标注。
38
+
39
+ ### 2. 参数
40
+
41
+ - `finalPaper`(默认 `true`,四套):收口时自动撰写最终论文;`false` 只关闭自动触发。
42
+ - `paperFormat`(默认 `both`,四套):`both`(md+tex)/ `md`(只写 md,跳过编译且不报"缺 tex")/ `tex`。
43
+ - `paperLanguage`(默认 `zh`,四套):`zh`(LaTeX 用 `ctexart`,引擎优先 `xelatex`)/
44
+ `en`(`article`,引擎优先 `pdflatex`)。
45
+ - `paperCompilePdf`(默认 `true`,四套):检测到 LaTeX 时是否编译 `paper.pdf`。
46
+ - `paperLatexCommand`(默认空,四套):优先尝试指定的引擎可执行文件;解析不到时按"未检测到"降级。
47
+ - `paperEditor`(仅 v4/v5):v4 默认 `office`(会话根 / 人类侧),可选 `resident:<id>`
48
+ (指定成员已离职则降级回 office 并在 meta/log 记明);v5 默认 `academician`,`office` 仅手动路径可用。
49
+
50
+ ### 3. 产物、LaTeX 检测与降级
51
+
52
+ - **目录与文件**:`Paper/<id>/`,id 经各预设既有的归一化函数处理(含路径穿越防护);内容为
53
+ `paper.md`、`paper.tex`、`paper.pdf`、`paper.meta.json`(参数、触发原因、编译状态与引擎、`finalizedAt`、
54
+ v5 的咨询计数等)、`paper.log.md`(谁写了什么、谁提了什么意见、如何采纳)。
55
+ - **检测顺序**:`xelatex` → `latexmk` → `pdflatex` → `lualatex` → `tectonic`(中文优先 xelatex,
56
+ 英文 pdflatex 优先);`paperLatexCommand` 非空时优先尝试它,之后回到标准顺序。
57
+ - **编译**:在论文目录内执行、`-interaction=nonstopmode`、跑两遍;失败**先修复**(重跑 → 换引擎 →
58
+ 最小模板),到上限后**降级**:保留 tex+md,`paper.meta.json` 记 `not-detected` / `failed`,
59
+ 记日志并上报,不阻塞定稿、不抛错。
60
+ - **不覆盖既有 PDF**:宿主 fs 只支持文本写,`paper.pdf` 只能由编译器子进程产生,插件只做存在性校验;
61
+ 无引擎、编译持续失败、`format=md force` 三种形态都逐字节保留已有 `paper.pdf` 并在 meta 里记明原因。
62
+ - `paperFormat=md` 时不产出 tex,因此跳过编译,且不得产生"缺 tex 无法编译"的警告。
63
+
64
+ ### 4. 团队合写与定稿代表(v4 / v5)
65
+
66
+ - **流程**:各成员写自己负责的部分 → 合并(去重、统一术语与记号)→ 至少一轮**交叉互审** →
67
+ 定稿代表梳理成最终稿 → 全体明确"可交付"才定稿;有异议则继续迭代(有轮次上限,超限记警告并把
68
+ 分歧写进附录)。全过程写入 `paper.log.md`。
69
+ - **v4**:`paperEditor` 默认 `office`,可选 `resident:<id>`。
70
+ - **v5**:自动流程**固定用 `academician`**(所办是根会话,没有唤醒路径);`office` 只能通过手动
71
+ `/v5 paper editor=office` 选择,此时所办**必须**先与全所交流(至少 1 条所办消息)并至少召开一次会议,
72
+ 把结论写进定稿说明,然后调用 `vibe_v5_finalize_paper`;缺一即被拒(`V5_PAPER_CONSULT_REQUIRED`)。
73
+
74
+ ### 5. 本轮修复
75
+
76
+ - **v5 自动触发的心跳停摆**:paper 分支在重新武装心跳之前返回,被节流的提问会永久卡住(新增的
77
+ 自动触发守卫当场抓出)。现在 paper 的每个等待步骤都会重新武装心跳。
78
+ - **v2/v3 写手卡死**:新增写手判决与回收——心跳会回收"已停滞或已不在注册表"的写手并自动重派
79
+ (有上限),随后给出明确的 `/vibe paper force` 提示;`force` 在 10 分钟窗口内返回可操作的错误
80
+ (含子代理 id),超过窗口则回收并重新派发;被回收的写手若稍后返回会被记录,而不是静默丢弃。
81
+ - **既有 PDF 不被覆盖**(见 §3):无引擎、编译持续失败、`format=md force` 三种形态都验证了
82
+ `paper.pdf` 逐字节保留。
83
+ - **"不得编造"契约**:论文唤醒提示词明确要求只整理已有证据、不得编造、未决与被否证的条目必须
84
+ 显式标注;把措辞改成"可以编造"会立刻被守卫挡住。
85
+ - **v3 语料确定性**:paper 摘要嵌入的证据索引含毫秒时间戳文件名,两个语料 scrubber 增加时间戳归一化,
86
+ 连续两次运行的随包语料逐字节一致。
87
+ - **守卫**:自动触发(论文写完之前不得标记完成)、既有 pdf 保留与"不得编造"契约都有可证伪的检查
88
+ (把对应逻辑改坏会立刻变红);原先可被空过的论文判定检查一并修正。
89
+
90
+ ### 6. 文档与契约
91
+
92
+ - 新增并随包发布 `docs/final-paper.md`:合并用户确认的规格与设计审计修订,写明各预设真实的收口信号、
93
+ 触发时序、产物、9 节骨架、LaTeX 检测与降级、团队流程与 v5 咨询门。
94
+ - 双语 README:四套各补 5 个参数行(v4/v5 另有第 6 个 `paperEditor`)与"最终论文 / Final paper"小节。
95
+ - `docs/test-timing.md` 与 `docs/AUDIT-CHECKLIST.md` 的套件/探针计数更正为 **57 = 39 套件 + 18 探针**,
96
+ 人设灵敏度探针更正为 13 条;npm 描述加入最终论文说明。
97
+
98
+ ## 兼容性
99
+
100
+ - **DSH 支撑窗口不变**:`0.1.2-alpha.4 … 0.2.0-rc.2`;组合行(≥0.1.7)与目录(≤0.1.6)两条线都保留。
101
+ - **既有参数默认值未变**;新增的最终论文参数默认开启(`finalPaper=true`),要关掉自动触发设
102
+ `finalPaper=false`(手动命令仍可用)。
103
+ - **数据与目录结构不变**:状态文件、项目布局与既有镜像位置照旧;`Paper/<id>/` 只是新增的产物目录,
104
+ 无需迁移。
105
+ - **提示词**:新增最终论文参数与 `/vN paper` 的说明,并写明"论文完成后才算完成";随包语料已按当前
106
+ 四套重新生成。
107
+
108
+ ## 升级
109
+
110
+ ```sh
111
+ npm i dsh-vibe-math@latest
112
+ ```
113
+
114
+ 桌面版在「设置 → 插件」里更新;命令行 profile 用 `dsh plugin --profile <你的 profile> add dsh-vibe-math@latest`,随后重启 DSH。
115
+
116
+ ---
117
+
118
+ # dsh-vibe-math 2.6.0 — Release Notes (English)
119
+
120
+ > Previous: 2.5.0. This release adds the **final paper**: each of the four presets writes a complete paper
121
+ > at closure that only organises evidence it already has, and the paper phase runs **before** the run is
122
+ > marked complete. Existing parameter defaults, data formats and the directory layout are unchanged, the
123
+ > supported DSH window is unchanged, and no migration is needed.
124
+
125
+ ---
126
+
127
+ ## Overview
128
+
129
+ - **Final paper** is new and **on by default** (`finalPaper=true`). Once the closure signal fires and
130
+ **before the run is marked complete**, the run enters the paper phase.
131
+ - The artifacts live in `Paper/<id>/`: `paper.md`, `paper.tex`, `paper.pdf` (only when the host has a
132
+ LaTeX engine and the compile succeeds), `paper.meta.json` and `paper.log.md`.
133
+ - v4/v5 co-author the paper **as a team**: each member writes its own part → merge → cross-review →
134
+ the editor finalises → the paper is finalised only when everyone agrees it is deliverable. In v5 the
135
+ default editor is the academician; the institute office is available only on the manual path and must
136
+ first consult the whole institute and convene a meeting.
137
+ - A failed compile is **repaired first, degraded second**: with no engine or a failing compile the tex+md
138
+ are still delivered with a logged warning, the finalisation is never blocked, and an existing
139
+ `paper.pdf` is never overwritten.
140
+ - The release also fixes: a v5 automatic-trigger heartbeat stall, v2/v3 writers that could hang and block
141
+ forever, non-determinism in the v3 shipped corpus, and a paper verdict check that could pass vacuously.
142
+ - The contract document `docs/final-paper.md` ships with the package, and both READMEs now document the
143
+ parameters and usage.
144
+
145
+ ## Changes
146
+
147
+ ### 1. New feature: the final paper (all four presets, on by default)
148
+
149
+ - **Trigger**: each preset uses its own closure signal (v2 strict termination, v3 full closure, v4 the
150
+ closing meeting's unanimous stop vote, v5 the "solved" decision on each solve vote). The run then enters
151
+ the paper phase, and **the run is marked complete only after the paper is finalised or has degraded** —
152
+ otherwise the meeting/wake mechanisms are already disabled and team co-authoring cannot run.
153
+ - **Manual**: `/vibe paper [lang=zh|en] [format=both|md|tex] [force]` (v2/v3),
154
+ `/v4 paper [… editor=office|resident:<id>] [force]`, `/v5 paper [… editor=office|academician] [force]`.
155
+ Command-line overrides apply to that invocation only (they are not written back to the persisted
156
+ parameters); `force` rewrites an already-finalised paper; an invalid argument returns `kind:'error'`;
157
+ `finalPaper=false` disables only the automatic trigger, and the manual command still works and says so.
158
+ - **Idempotent**: one paper per run (`finalizedAt` plus a per-artifact existence check); a repeated
159
+ trigger only fills in missing artifacts.
160
+ - **The nine-section skeleton (identical in all four presets)**: ① title, authors, date and abstract
161
+ ② introduction and problem background ③ the complete solution of the original problem ④ the verified
162
+ propositions (with the estimated truth values and their evidence) ⑤ solved sub-problems / intermediate
163
+ results ⑥ methods, theories, ideas, useful experience and mathematical understanding created or
164
+ discovered ⑦ patterns distilled from the above ⑧ discussion, limitations and outlook ⑨ appendix:
165
+ evidence and file index. The paper only organises existing evidence and **must not fabricate**;
166
+ unresolved and refuted items must be marked explicitly.
167
+
168
+ ### 2. Parameters
169
+
170
+ - `finalPaper` (default `true`, all four): write the final paper automatically at closure; `false` disables
171
+ only the automatic trigger.
172
+ - `paperFormat` (default `both`, all four): `both` (md+tex) / `md` (markdown only; skips compilation and
173
+ does not warn about a missing tex) / `tex`.
174
+ - `paperLanguage` (default `zh`, all four): `zh` (`ctexart`, engine prefers `xelatex`) /
175
+ `en` (`article`, engine prefers `pdflatex`).
176
+ - `paperCompilePdf` (default `true`, all four): compile `paper.pdf` when a LaTeX engine is detected.
177
+ - `paperLatexCommand` (default empty, all four): try this engine executable first; if it cannot be
178
+ resolved, degrade as "not detected".
179
+ - `paperEditor` (v4/v5 only): v4 defaults to `office` (the session root / human side) and also accepts
180
+ `resident:<id>` (if that member has left, it degrades back to office and the meta/log say so);
181
+ v5 defaults to `academician`, and `office` is available only on the manual path.
182
+
183
+ ### 3. Artifacts, LaTeX detection and degradation
184
+
185
+ - **Layout**: `Paper/<id>/`, with the id normalised by each preset's existing helper (including path
186
+ traversal protection). It contains `paper.md`, `paper.tex`, `paper.pdf`, `paper.meta.json` (parameters,
187
+ trigger, compile status and engine, `finalizedAt`, the v5 consultation counts) and `paper.log.md`
188
+ (who wrote what, who raised which review point, and how it was adopted).
189
+ - **Detection order**: `xelatex` → `latexmk` → `pdflatex` → `lualatex` → `tectonic` (`xelatex` first for
190
+ Chinese, `pdflatex` first for English). A non-empty `paperLatexCommand` is tried first, then the standard
191
+ order.
192
+ - **Compilation**: run inside the paper directory with `-interaction=nonstopmode`, twice; on failure it is
193
+ **repaired first** (rerun → switch engine → minimal template) and only then **degraded**: tex+md are
194
+ kept, `paper.meta.json` records `not-detected` / `failed`, a warning is logged and reported, the
195
+ finalisation is not blocked and nothing is thrown.
196
+ - **An existing PDF is never overwritten**: the host fs only supports text writes, so `paper.pdf` can only
197
+ be produced by the compiler subprocess and the plugin merely checks that it exists. With no engine, with
198
+ a persistently failing compile, and with `format=md force`, an existing `paper.pdf` is kept byte for byte
199
+ and the meta records why.
200
+ - With `paperFormat=md` no tex is produced, so compilation is skipped and no "cannot compile without tex"
201
+ warning may appear.
202
+
203
+ ### 4. Team co-authoring and the editor (v4 / v5)
204
+
205
+ - **Flow**: each member writes its own part → merge (deduplicate, unify terms and notation) → at least one
206
+ **cross-review** round → the editor turns it into the final draft → the paper is finalised only when
207
+ everyone agrees it is deliverable; objections keep iterating (bounded, after which a warning is recorded
208
+ and the disagreement goes into the appendix). The whole process is written to `paper.log.md`.
209
+ - **v4**: `paperEditor` defaults to `office`, and also accepts `resident:<id>`.
210
+ - **v5**: the automatic flow **always uses `academician`** (the office is the root session and has no wake
211
+ path). `office` is available only through the manual `/v5 paper editor=office`, and that path requires
212
+ the office to consult the whole institute first (at least one office message) and to convene at least one
213
+ meeting, to state the conclusion in the finalisation note, and then to call `vibe_v5_finalize_paper`;
214
+ without both counts it is refused (`V5_PAPER_CONSULT_REQUIRED`).
215
+
216
+ ### 5. Fixes in this release
217
+
218
+ - **v5 automatic-trigger heartbeat stall**: the paper branch returned before re-arming the heartbeat, so a
219
+ throttled ask could hang forever (the new automatic-trigger guard caught it). Every waiting step of the
220
+ paper flow now re-arms the heartbeat.
221
+ - **v2/v3 hung writers**: a new writer verdict and reaper — the heartbeat reaps writers that have stalled
222
+ or left the registry and re-dispatches them (bounded), after which it points at `/vibe paper force`;
223
+ `force` returns an actionable error inside the 10-minute window (including the subagent id) and reaps and
224
+ re-dispatches past it; a reaped writer that returns later is recorded instead of being dropped silently.
225
+ - **An existing PDF is never overwritten** (see §3): with no engine, with a persistently failing compile
226
+ and with `format=md force`, the file is verified to be kept byte for byte.
227
+ - **The "must not fabricate" contract**: the paper wake-up prompts now require that only existing evidence
228
+ is organised, that nothing may be fabricated, and that unresolved or refuted items are marked explicitly;
229
+ rewording that to "may fabricate" is caught by the guards immediately.
230
+ - **v3 corpus determinism**: the paper summary embedded an evidence index with a millisecond-timestamped
231
+ log name; both corpus scrubbers now normalise the timestamp, so two consecutive runs produce
232
+ byte-identical shipped corpora.
233
+ - **Guards**: the automatic trigger (the run must not be marked complete before the paper is written), the
234
+ preservation of an existing pdf and the "must not fabricate" contract all have falsifiable checks (break
235
+ the corresponding logic and they go red); a paper verdict check that used to pass vacuously was corrected
236
+ as well.
237
+
238
+ ### 6. Documentation and the contract
239
+
240
+ - `docs/final-paper.md` is new and ships with the package: it merges the user-approved specification with
241
+ the design-audit amendments and states each preset's real closure signal, the ordering, the artifacts,
242
+ the nine-section skeleton, detection and degradation, the team flow and the v5 consultation gate.
243
+ - Both READMEs gain the five parameter rows per preset (plus the sixth, `paperEditor`, on v4/v5) and a
244
+ "final paper" section.
245
+ - The suite/probe counts in `docs/test-timing.md` and `docs/AUDIT-CHECKLIST.md` are corrected to
246
+ **57 = 39 suites + 18 probes**, and the persona sensitivity probes to 13; the npm description mentions
247
+ the final paper.
248
+
249
+ ## Compatibility
250
+
251
+ - **Supported DSH window unchanged**: `0.1.2-alpha.4 … 0.2.0-rc.2`; both the composition-row (≥ 0.1.7) and
252
+ directory (≤ 0.1.6) lines are kept.
253
+ - **Existing parameter defaults are unchanged**; the new final-paper parameters default to on
254
+ (`finalPaper=true`) — set `finalPaper=false` to disable the automatic trigger (the manual command still
255
+ works).
256
+ - **No data or layout change**: the state file, the project layout and the existing mirror locations are
257
+ unchanged; `Paper/<id>/` is only a new artifact directory, and no migration is needed.
258
+ - **Prompts**: the final-paper parameters and `/vN paper` are documented, and the prompts state that the
259
+ run is complete only after the paper. The shipped corpora were regenerated for the current four presets.
260
+
261
+ ## Upgrade
262
+
263
+ ```sh
264
+ npm i dsh-vibe-math@latest
265
+ ```
266
+
267
+ Desktop updates through Settings → Plugins; a CLI profile uses
268
+ `dsh plugin --profile <your profile> add dsh-vibe-math@latest`, then restart DSH.
@@ -0,0 +1,151 @@
1
+ # dsh-vibe-math 2.7.0 — Release Notes (English)
2
+
3
+ > Previous release: 2.6.0. This release adds two capabilities: **incremental Lean formalisation
4
+ > (async compilation + `import` reuse)** and the **`math_computation` tool** (one shared
5
+ > implementation for all four presets). Existing parameter defaults, data formats and directory
6
+ > structure are **unchanged** (the release only adds parameters and directories), the DSH support
7
+ > window is unchanged, and no migration is needed.
8
+
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ - **Incremental Lean formalisation**: `leanAsync` (default `true`) compiles on a per-session
14
+ background queue and returns as soon as the job is queued; new `leanJobsMaxParallel`
15
+ (default `1`), `leanInitiative` (`off|normal|eager`, default `normal`) and `leanSearchPaths`
16
+ (default `[]`). New read-only tools `lean_read` / `lean_job`; jobs are mirrored to
17
+ `Formal/Jobs/<jobId>.json`.
18
+ - **`math_computation` (new tool)**: `op:'probe'` pre-checks engines/packages/licences, `op:'run'`
19
+ computes, and every run is archived as a reviewable receipt; `op:'install'` is a two-step
20
+ plan-then-confirm flow and `op:'receipt'` re-checks a receipt read-only.
21
+ - **Engines**: `python` / `r` / `octave` / `julia` / `matlab` / `maple` / `wolfram` / `cli`.
22
+ The three commercial ones are **detected and licence-checked only and are never installed**;
23
+ `cli` is on by default (two documented ways to disable it).
24
+ - **Archive → edit → re-run**: receipts carry `scriptPath`/`scriptHash`; after editing a script you
25
+ must re-run it with `mode:'file'`, because an old receipt is not evidence for edited code
26
+ (`scriptChanged` / `scriptChangedDuringRun` warn explicitly).
27
+ - **Six new parameters**: `mathComputation` / `mathMode` / `mathEngines` / `mathTimeoutMs` /
28
+ `mathPackages` / `mathInstallScope` (the bilingual README table and `docs/math-computation.md`
29
+ are authoritative).
30
+ - This release went through **four independent audit rounds** plus a **real-host packaging/boot
31
+ certification on the frozen commit**; the gate is `TOTAL 65 PASS 65 FAIL 0`
32
+ (44 suites + 21 probes).
33
+
34
+ ## Changes
35
+
36
+ ### 1. Incremental Lean formalisation + async compilation + `import` reuse
37
+
38
+ - **New parameters** (identical in all four presets; every default preserves existing behaviour):
39
+ - `leanAsync`: default `true`. `true` = compile on a **per-session background queue** and return
40
+ as soon as it is queued; `false` = synchronous `await` (the old semantics).
41
+ - `leanJobsMaxParallel`: default `1` (serial). Concurrency cap for background compilations.
42
+ - `leanInitiative`: `off | normal | eager`, default `normal`. **How eager the staff are about
43
+ formalising during normal work.**
44
+ - `leanSearchPaths`: default `[]`. Extra `--search-path` roots; when non-empty they are injected
45
+ **first** and the automatic root is injected **after** them.
46
+ - **Queue state machine**: jobs move through explicit states, and **only `settled(ok)` counts as
47
+ passed** - "queued" or "compiling" never counts as proved.
48
+ - **`import` reuse**: the compile command automatically injects `--search-path <VibeMath root>`, so
49
+ `import Formal.Lib.<name>` / `Formal.Proved.<name>` work directly (cross-project reuse of archived
50
+ definitions and lemmas).
51
+ - **New read-only tools**: `lean_read` (read archive/library content) and `lean_job` (job status).
52
+ Both are **read-only** and never trigger a compilation.
53
+ - **Job mirror**: every job keeps a mirror at `Formal/Jobs/<jobId>.json`, so a restart can re-queue
54
+ or explicitly interrupt it.
55
+ - **Honest note**: `leanInitiative` and `formalVerify` are **two independent axes**.
56
+ `formalVerify:'off'` disables the **verification stage**; it does not swallow the initiative axis:
57
+ `off + normal` ⇒ no Lean text at all; `off + eager` ⇒ **only** the daily line (the proactivity
58
+ prompt) appears, while the verification stage stays off.
59
+
60
+ ### 2. The new `math_computation` tool
61
+
62
+ - **Six frozen parameters** (the names cannot change; identical spelling across the four presets,
63
+ the bilingual README table and the contract doc):
64
+ | Parameter | Default | Meaning |
65
+ |---|---|---|
66
+ | `mathComputation` | `auto` | `off` (a true no-op) / `auto` (works once an engine is detected) / `on` |
67
+ | `mathMode` | `typed+shell` | **Prompt policy**: `typed` never mentions the shell and disables `engine:'cli'` |
68
+ | `mathEngines` | `[python,r,octave,julia,matlab,maple,wolfram,cli]` | Allowed set and probe order; removing `cli` closes the escape hatch |
69
+ | `mathTimeoutMs` | `60000` | Per-run budget (minimum 1000); on timeout the process is **actively terminated** |
70
+ | `mathPackages` | `[]` | Packages required by default; a missing one is reported with a plan, **never auto-installed** |
71
+ | `mathInstallScope` | `user` | Install scope; `system` must be passed explicitly every time and is **never remembered** |
72
+ - **`op`**: `probe` (engines/versions/packages/licences), `run` (`mode: code|file|expr`),
73
+ `receipt` (read-only re-check), `install` (two-step).
74
+ - **Failure codes (11, frozen)**: `MATH_NOT_AVAILABLE`, `MATH_ENGINE_NOT_FOUND`,
75
+ `MATH_ENGINE_LICENSE_REQUIRED`, `MATH_ENGINE_UNUSABLE`, `MATH_MISSING_PACKAGES`, `MATH_TIMEOUT`,
76
+ `MATH_NONZERO_EXIT`, `MATH_ENGINE_BAD_ARGV`, `MATH_REFUSED`, `MATH_INVALID_ARGUMENT`,
77
+ `MATH_NO_SUBPROCESS`; each carries a machine-readable `next` (`user-install` / `agent-install` /
78
+ `vendor` / `enable` / `engine-override` / `reason` / `note`).
79
+ - **Deterministic receipts**: `runId` is derived only from preset + project + engine + mode + key +
80
+ sorted packages and contains **no wall clock**; `argv` is echoed **both** in the receipt and in the
81
+ return value (copy it to re-run); full `stdout`/`stderr` land on disk while the return value is
82
+ capped at 64 KB.
83
+ - **Engines**: `python`/`r`/`octave`/`julia` are free; `matlab`/`maple`/`wolfram` are **commercial** -
84
+ detected and licence-checked only, **never installed** (vendor guidance only); `cli` runs the
85
+ command you name, still under the tool's timeout, output caps, cwd and receipt.
86
+ - **Two installation routes**: ① user self-install (per-OS commands + official links); ② agent
87
+ install via `plan → planToken → confirm` (the token binds the plan content, so a changed plan
88
+ invalidates it). Scope defaults to **user**; `system` must be confirmed **every time**; each
89
+ execution writes an audit file `Computation/installs/<planToken>.json` (exact commands, exit codes,
90
+ before/after versions and **uninstall templates**). Package installation has **no universal
91
+ rollback** - the tool guarantees verifiable commands/versions plus uninstall templates, not
92
+ automatic rollback.
93
+ - **`cli` is on by default** (it is no broader than the host shell the model already has, but it adds
94
+ receipts and limits); two documented ways to disable it: `mathMode:'typed'`, or removing `'cli'`
95
+ from `mathEngines` - both return `MATH_REFUSED`.
96
+ - **Archive → edit → re-run (integrity rules)**:
97
+ - the return value and the receipt both carry `scriptPath`/`scriptHash`; the script original can be
98
+ opened and edited;
99
+ - re-run it with `mode:'file'` after editing ⇒ a **new receipt** (new attempt, new hash); **an old
100
+ receipt is not evidence for edited code**;
101
+ - `scriptChanged` (the current file differs from the previous receipt) and
102
+ `scriptChangedDuringRun` (the file changed while the run was in flight) **warn explicitly** and
103
+ are recorded in the receipt;
104
+ - archives are **append-only** (`Computation/<id>/`, attempt n≥2 under `attempts/<n>/`) and
105
+ existing files are **never overwritten**;
106
+ - the retention caps (20 attempts / 200 runs) **warn only and never delete**; unknown parameter
107
+ keys in a hand-edited state file are **reported** (`diagnostics`) instead of being dropped
108
+ silently.
109
+
110
+ ### 3. Honest boundaries (please read)
111
+
112
+ - **Engine execution is verified only through a fake subprocess seam**: no real python/R/octave/julia/
113
+ matlab/maple/wolfram was run on this machine; real-engine verification needs a machine with those
114
+ engines installed (the **static** surface - templates, licence probes, install plans - is pinned by
115
+ guards).
116
+ - **The plugin cannot enforce network or write restrictions**: the host's `subprocess.spawn` has
117
+ **no policy slot** (its `env` layer only scrubs credentials/`DSH_*` names and cannot restrict
118
+ network or disk access); real enforcement needs host sandbox support and is **recorded as a pending
119
+ upstream requirement**.
120
+ - **Commercial templates are marked `VERIFY`**: the CLI templates for Maple (especially), MATLAB and
121
+ Wolfram change between versions, so their descriptors carry a `VERIFY` flag; every run echoes the
122
+ real argv, and a usage/option error returns `MATH_ENGINE_BAD_ARGV` with a `mathEngineOverride`
123
+ hint instead of a bare `MATH_NONZERO_EXIT`. Machines with licences should verify those three
124
+ templates themselves.
125
+ - **SageMath is P2**: this release only has the descriptor placeholder; it is not wired in.
126
+ - **The two comparison experiments are given as run-books** (sync vs async compilation; without vs
127
+ with `import` reuse): these notes contain **no fabricated numbers** and do not claim that a
128
+ real-Lean-corpus comparison was completed.
129
+
130
+ ### 4. Review and verification
131
+
132
+ This release went through **four independent audit rounds** (adversarial re-falsification, cross
133
+ audit, user on-ramp, fresh-lens review) and a **real-host packaging/boot certification on the frozen
134
+ commit**; the gate is `TOTAL 65 PASS 65 FAIL 0` (**44 suites + 21 probes**), plus 22 module-level
135
+ mutation probes that each require a *named* assertion to turn red.
136
+
137
+ ## Compatibility
138
+
139
+ - Existing parameter defaults, data formats and directory structure are **unchanged**; every new
140
+ parameter defaults to "does not change existing behaviour" (`leanAsync=true` merely moves
141
+ compilation to a background queue, `leanInitiative='normal'` keeps the previous proactivity).
142
+ - New directories `Computation/` and `Formal/Jobs/`; the host's text write **creates missing parent
143
+ directories**, so nothing has to be pre-created by hand.
144
+ - The DSH support window is unchanged (the `>=0.1.7` patch row and the `<=0.1.6` directory row both
145
+ ship the shared module).
146
+
147
+ ## Upgrade
148
+
149
+ - Upgrade directly: **no migration** - no parameter was renamed and no state-file format changed.
150
+ - To turn the new capabilities off: `mathComputation:'off'` (a true no-op), `leanAsync:false` (back to
151
+ synchronous compilation), `leanInitiative:'off'` (no proactive formalisation).
@@ -0,0 +1,115 @@
1
+ # dsh-vibe-math 2.7.0 — 发布说明(中文)
2
+
3
+ > 上一版:2.6.0。本版新增两块能力:**Lean 增量形式化(异步编译 + `import` 复用)** 与
4
+ > **`math_computation` 数学计算工具**(四套预设共享同一实现)。既有参数默认值、数据格式与目录结构
5
+ > **未变**(只是新增参数与目录),DSH 支撑窗口不变,无需迁移。
6
+
7
+ ---
8
+
9
+ ## 概览
10
+
11
+ - **Lean 增量形式化**:`leanAsync`(默认 `true`)把编译放后台队列,入队即返回;新增并发上限
12
+ `leanJobsMaxParallel`(默认 `1`)、日常主动性 `leanInitiative`(`off|normal|eager`,默认 `normal`)
13
+ 与额外搜索路径 `leanSearchPaths`(默认 `[]`)。新增只读工具 `lean_read` / `lean_job`,
14
+ 作业镜像写 `Formal/Jobs/<jobId>.json`。
15
+ - **`math_computation`(新工具)**:先用 `op:'probe'` 预检引擎/包/许可,再 `op:'run'` 计算,
16
+ 每次执行都归档成可复核回执;`op:'install'` 走"计划 → 确认"两段式,`op:'receipt'` 只读复核。
17
+ - **引擎**:`python` / `r` / `octave` / `julia` / `matlab` / `maple` / `wolfram` / `cli`。
18
+ 商业三家**只探测与查许可,永不代装**;`cli` 默认开启(两个文档化的关闭路径)。
19
+ - **归档→编辑→重跑**:回执带 `scriptPath`/`scriptHash`;改动脚本后必须用 `mode:'file'` 重跑,
20
+ 旧回执对修改后的代码无效(`scriptChanged` / `scriptChangedDuringRun` 显式告警)。
21
+ - **六个新参数**:`mathComputation` / `mathMode` / `mathEngines` / `mathTimeoutMs` / `mathPackages` /
22
+ `mathInstallScope`(README 双语参数表与 `docs/math-computation.md` 为准)。
23
+ - 本版经过**四轮独立审查** + 冻结提交上的**真机打包/启动认证**;门禁 `TOTAL 65 PASS 65 FAIL 0`
24
+ (44 套件 + 21 探针)。
25
+
26
+ ## 变更
27
+
28
+ ### 1. Lean 增量形式化 + 异步编译 + `import` 复用
29
+
30
+ - **新参数**(四套一致,默认值即"安全且不改变既有行为"):
31
+ - `leanAsync`:默认 `true`。`true` = 编译进**每会话后台队列**,入队即返回;`false` = 同步 `await`(旧语义)。
32
+ - `leanJobsMaxParallel`:默认 `1`(串行)。后台编译的并发上限。
33
+ - `leanInitiative`:`off | normal | eager`,默认 `normal`。**日常流程中的形式化主动性**。
34
+ - `leanSearchPaths`:默认 `[]`。额外的 `--search-path` 根;非空时**先**注入它们,**再**注入自动根。
35
+ - **队列状态机**:作业有明确的状态迁移;**只有 `settled(ok)` 才算 passed**——"入队成功/正在编译"
36
+ 一律不计入通过,也不会被当成已证。
37
+ - **`import` 复用**:编译命令自动注入 `--search-path <VibeMath 根>`,因此
38
+ `import Formal.Lib.<name>` 与 `Formal.Proved.<name>` 可以直接工作(跨项目复用已归档的定义/引理)。
39
+ - **新只读工具**:`lean_read`(读归档/库内容)与 `lean_job`(查作业状态),都是**只读**,不会触发编译。
40
+ - **作业镜像**:每个作业在 `Formal/Jobs/<jobId>.json` 留一份镜像,进程重启后可恢复或显式中断。
41
+ - **诚实说明**:`leanInitiative` 与 `formalVerify` 是**两条独立的轴**。
42
+ `formalVerify:'off'` 关闭的是**验证阶段**,不会吞掉主动性轴:
43
+ `off + normal` ⇒ 一个字都不提 Lean;`off + eager` ⇒ **只**出现日线(主动性提示),验证段仍然关闭。
44
+
45
+ ### 2. 新工具 `math_computation`
46
+
47
+ - **六个冻结参数**(名字不可改;四套、README 双语表、契约文档拼写一致):
48
+ | 参数 | 默认 | 说明 |
49
+ |---|---|---|
50
+ | `mathComputation` | `auto` | `off`(真 no-op)/ `auto`(探测到才工作)/ `on` |
51
+ | `mathMode` | `typed+shell` | **提示词策略**:`typed` 不提 shell 且禁用 `engine:'cli'` |
52
+ | `mathEngines` | `[python,r,octave,julia,matlab,maple,wolfram,cli]` | 允许/探测顺序;去掉 `cli` 即关闭逃生口 |
53
+ | `mathTimeoutMs` | `60000` | 单次上限(最小 1000);超时**主动终止**进程 |
54
+ | `mathPackages` | `[]` | 默认要求的包;缺包只报告 + 给计划,**不自动装** |
55
+ | `mathInstallScope` | `user` | 安装作用域;`system` 必须每次显式指定、**不被记住** |
56
+ - **`op`**:`probe`(预检引擎/版本/包/许可)、`run`(`mode: code|file|expr`)、`receipt`(只读复核)、
57
+ `install`(两段式安装)。
58
+ - **失败码(11 个,冻结)**:`MATH_NOT_AVAILABLE`、`MATH_ENGINE_NOT_FOUND`、`MATH_ENGINE_LICENSE_REQUIRED`、
59
+ `MATH_ENGINE_UNUSABLE`、`MATH_MISSING_PACKAGES`、`MATH_TIMEOUT`、`MATH_NONZERO_EXIT`、
60
+ `MATH_ENGINE_BAD_ARGV`、`MATH_REFUSED`、`MATH_INVALID_ARGUMENT`、`MATH_NO_SUBPROCESS`;
61
+ 每个都带机读 `next`(`user-install` / `agent-install` / `vendor` / `enable` / `engine-override` /
62
+ `reason` / `note`)。
63
+ - **确定性回执**:`runId` 只由"预设 + 项目 + 引擎 + 模式 + 键 + 排序后的包"决定,**不含墙钟**;
64
+ `argv` 在回执与返回体里**双回显**(可照抄复跑);`stdout`/`stderr` 全量落盘、返回体截 64KB。
65
+ - **引擎**:`python`/`r`/`octave`/`julia` 为自由引擎;`matlab`/`maple`/`wolfram` 为**商业**——
66
+ 只做探测与许可检查,**永不代装**(只给厂商指引);`cli` 用你指定的命令执行,仍受本工具的超时、
67
+ 输出上限、cwd 与回执约束。
68
+ - **两条安装路径**:① 用户自装(逐 OS 命令 + 官方链接);② 代理代装 `plan → planToken → confirm`
69
+ (token 绑定计划内容,内容变了即失效)。默认 **user 作用域**,`system` **每次都要显式确认**;
70
+ 每次执行写审计 `Computation/installs/<planToken>.json`(含确切命令、退出码、before/after
71
+ 与**卸载命令模板**)。包安装**没有通用回滚**——工具保证的是"命令与版本可核验 + 卸载模板",
72
+ 不做自动回滚。
73
+ - **`cli` 默认开启**(它不比模型本来就有的宿主 shell 更大,但多了回执与上限);两个关闭路径:
74
+ `mathMode:'typed'`,或把 `'cli'` 从 `mathEngines` 移除——两者都返回 `MATH_REFUSED`。
75
+ - **归档→编辑→重跑(完整性保证)**:
76
+ - 返回体与回执都带 `scriptPath`/`scriptHash`;脚本原件可以打开/编辑;
77
+ - 编辑后用 `mode:'file'` 重跑 ⇒ **新回执**(新 attempt、新哈希);**旧回执不代表修改后的代码**;
78
+ - `scriptChanged`(与上一份回执的哈希不一致)、`scriptChangedDuringRun`(运行期间被改动)都会
79
+ **显式告警**并写进回执;
80
+ - 归档是**追加式**的(`Computation/<id>/`,第 n≥2 次进 `attempts/<n>/`),已有文件**永不覆盖**;
81
+ - 保留上限(20 attempt / 200 run)**只告警、永不自动删除**;手改状态文件里的未知参数键会被
82
+ **报告**(`diagnostics`),不静默丢弃。
83
+
84
+ ### 3. 诚实边界(务必读)
85
+
86
+ - **引擎执行只用假 subprocess seam 验证**:本机**没有**跑过真实的 python/R/octave/julia/matlab/
87
+ maple/wolfram;真机验证需要一台装有这些引擎的机器(模板、许可探测与安装计划的**静态面**已被守卫冻结)。
88
+ - **插件不能强制禁网/限权**:宿主 `subprocess.spawn` **没有 policy 槽**(`env` 层只做凭据/`DSH_*`
89
+ 清洗,不能限制网络或写盘);真强制需要宿主 sandbox 支持,**列为待上游需求**。
90
+ - **商业模板标 `VERIFY`**:Maple(尤甚)、MATLAB、Wolfram 的 CLI 模板随版本变化,描述符带 `VERIFY`
91
+ 标记;每次运行都回显实际 argv,用法/选项错会返回 `MATH_ENGINE_BAD_ARGV` 并提示用
92
+ `mathEngineOverride` 覆盖模板(而不是裸 `MATH_NONZERO_EXIT`)。有许可的机器应自行验证这三个模板。
93
+ - **SageMath 属于 P2**:本版只有描述符占位,不接入。
94
+ - **两个对照实验以 run-book 形式给出**(同步 vs 异步编译;不使用 vs 使用 `import` 复用):
95
+ 本说明**不含**任何编造的实测数字,也不声称已完成真实 Lean 语料的对比。
96
+
97
+ ### 4. 审查与验证
98
+
99
+ 本版经过 **四轮独立审查**(对抗性再证伪、交叉审计、用户上手路径、新视角复审),
100
+ 并在**冻结提交上**完成**真机打包/启动认证**;门禁为 `TOTAL 65 PASS 65 FAIL 0`
101
+ (**44 套件 + 21 探针**),另有 22 个模块级变异探针要求"具名断言变红"。
102
+
103
+ ## 兼容性
104
+
105
+ - 既有参数默认值、数据格式与目录结构**未变**;新增参数都取"不改变既有行为"的默认值
106
+ (`leanAsync=true` 只是把编译改为后台队列,`leanInitiative='normal'` 保持原有主动性)。
107
+ - 新增目录 `Computation/` 与 `Formal/Jobs/`;宿主的文本写会**自动创建缺失的父目录**,
108
+ 无需预先手工建目录。
109
+ - DSH 支撑窗口不变(`>=0.1.7` 的 patch 行 + `<=0.1.6` 的目录行两条安装线都随包发布共享模块)。
110
+
111
+ ## 升级
112
+
113
+ - 直接升级即可,**无需迁移**:没有改名的参数、没有改格式的状态文件。
114
+ - 想关闭新能力:`mathComputation:'off'`(真 no-op)、`leanAsync:false`(回到同步编译)、
115
+ `leanInitiative:'off'`(不主动形式化)。
@@ -26,17 +26,20 @@ node tests/run-tests.mjs --json # 机器可读汇总(含 skippedN
26
26
 
27
27
  ### 1.1 随包发布 vs 仅仓库(`npm pack --dry-run --json`)
28
28
 
29
- `package.json` 的 `files` 只发 `tests/` 的一个**子集**(发布物共 102 个文件,其中 `tests/` 18 项),
29
+ `package.json` 的 `files` 只发 `tests/` 的一个**子集**(发布物共 **119** 个文件,其中 `tests/` **23** 项),
30
30
  所以安装用户跑 `node tests/run-tests.mjs` 得到的是子集的结果——runner 会把缺失的跳过项打印出来,
31
31
  不会静默少跑:
32
32
 
33
- - **随包(18 项)**:`run-tests.mjs`、`audit-formal-sensitivity.mjs`、`audit-persona-sensitivity.mjs`、
33
+ - **随包(23 项)**:`run-tests.mjs`、`audit-formal-sensitivity.mjs`、`audit-persona-sensitivity.mjs`、
34
34
  `audit-prompt-invariants.mjs`、`audit-spec-traceability.mjs`、`audit-v5-integrity.mjs`、
35
- `audit-v5-sensitivity.mjs`、`selfdrive-v5.mjs`;套件 **10** 个:`audit-installer-compat`、
35
+ `audit-v5-sensitivity.mjs`、`selfdrive-v5.mjs`、`audit-math-computation-parity.mjs`、
36
+ `audit-math-computation-contract.mjs`、`audit-math-computation-sensitivity.mjs`、
37
+ `helpers/math-computation-fake-seam.mjs`;套件 **11** 个:`audit-installer-compat`、
36
38
  `audit-installer-policy`、`audit-persona-surface`、`audit-preset-rows`、`e2e-v5-round2`、
37
- `formal-verify-v2`、`formal-verify-v3`、`formal-verify-v4`、`formal-verify-v5`、`prompt-v5-integrity`。
38
- - **仅仓库(不发)**:其余 28 个套件(v2/v3/v4 的 e2e、`selfdrive-v3`/`v4`、v2/v3 修复探针、
39
- `audit-fuzz-helpers` 之外的若干 `audit-*`……)与 7 个脚本(`audit-fuzz-helpers`、
39
+ `formal-verify-v2`、`formal-verify-v3`、`formal-verify-v4`、`formal-verify-v5`、`prompt-v5-integrity`、
40
+ `math-computation-shared`。
41
+ - **仅仓库(不发)**:其余 33 个套件(v2/v3/v4 的 e2e、`selfdrive-v3`/`v4`、v2/v3 修复探针、
42
+ `math-computation-v2|v3|v4|v5`、`audit-fuzz-helpers` 之外的若干 `audit-*`……)与 7 个脚本(`audit-fuzz-helpers`、
40
43
  `audit-registration`、`audit-roundtrip-idempotence`、`audit-tool-exec`、
41
44
  `audit-v3-registration-parity`、`selfdrive-v3`、`selfdrive-v4`)。
42
45
  - 因此**完整门禁只能在开发检出里跑**;发布物里的子集是"用户可自查"的一部分,不是全部证据。
@@ -46,10 +49,10 @@ node tests/run-tests.mjs --json # 机器可读汇总(含 skippedN
46
49
 
47
50
  | 脚本 | 串行(sum) | 并行(wall) | 实测输出 |
48
51
  |---|---|---|---|
49
- | `tests/run-tests.mjs`(**56 项** = 38 套件 + 18 探针/变体) | ≈ 629 s | **≈ 208 s**(并发 4,speed-up x3.02) | `TOTAL 56 PASS 56 FAIL 0 (suites 38 · probes 18)`;关键路径 = `audit-formal-sensitivity` 208 s |
50
- | `tests/audit-formal-sensitivity.mjs`(49 探针,自带并发 4) | 803 s | **≈ 208 s** | 关键路径 = 12 个 v2 探针(每个 ≈42–60 s) |
52
+ | `tests/run-tests.mjs`(**65 项** = 44 套件 + 21 探针/变体) | ≈ 424 s | **≈ 121 s**(并发 4,speed-up x3.51) | `TOTAL 65 PASS 65 FAIL 0 (suites 44 · probes 21)`;实测 `wall 120.7s · sum 424.2s`,关键路径 = `e2e-v4-fixes`(≈ 98 s) |
53
+ | `tests/audit-formal-sensitivity.mjs`(49 探针,自带并发 4;v2 12 / v3 12 / v4 12 / v5 13) | ≈ 1035 s | **260.7 s**(实测,x3.97) | 关键路径 = v2/v3 的 `require` 探针(各 ≈75 s);全 49 条按预期变红、0 问题 |
51
54
  | `tests/audit-v5-sensitivity.mjs`(39 探针,串行) | ≈ 101 s | — | 每条 = 一次被测套件重跑 |
52
- | `tests/audit-persona-sensitivity.mjs`(11 探针) | ≈ 4.4 s | — | 本身很快,不需要并行 |
55
+ | `tests/audit-persona-sensitivity.mjs`(16 探针) | ≈ 4.4 s | — | 本身很快,不需要并行 |
53
56
  | `tests/audit-prompt-invariants.mjs`(157 条) | ≈ 1.9 s | — | 静态 |
54
57
  | `tests/audit-prompt-invariants.mjs --self-probe`(5 探针) | ≈ 7.4 s | — | 每个探针 = 一次自我重跑 |
55
58
  | `tests/audit-spec-traceability.mjs`(94 条) | ≈ 0.2 s | — | 静态 |
@@ -63,6 +66,19 @@ node tests/run-tests.mjs --json # 机器可读汇总(含 skippedN
63
66
  | `tests/v2-fix-probes.test.mjs` | ≈ 8.6 s | — | v2 的 flat 等权均值 / ≥2 名验证者 / runShell 失败分支(26 条) |
64
67
  | `tests/v2-path-escape.test.mjs` | ≈ 2.2 s | — | 验证日志路径逃逸(7 条) |
65
68
  | `tests/v2-tool-cap.test.mjs` | ≈ 0.4 s | — | 能力表来自真实组合、*MaxToolCalls 只是提示(10 条) |
69
+ | `tests/math-computation-v2.test.mjs` | ≈ 1.7 s | — | v2 接线:六参数/双注册层/回执/归档→编辑→重跑/跨会话隔离(含 mutant 说明在文件头) |
70
+ | `tests/math-computation-v3.test.mjs` | ≈ 1.7 s | — | v3 同上(dual-layer + `TOOL_DESC` 描述 parity) |
71
+ | `tests/math-computation-v4.test.mjs` | ≈ 2.5 s | — | v4:每会话一个模块实例 + 隔离断言 + `vibe_v4_set` 闭集 + 单点注册 |
72
+ | `tests/math-computation-v5.test.mjs` | ≈ 1.4 s | — | v5:闭集 `vibe_v5_set`、研究所根回执、会话隔离(7 个 mutant) |
73
+ | `tests/math-computation-shared.test.mjs` | ≈ 0.1 s | — | 共享模块契约(参数/失败码/argv/回执/归档/并发/override/路径守卫),走假 subprocess seam |
74
+ | `tests/audit-math-computation-parity.mjs` | ≈ 0.1 s | — | 四份副本字节一致 + canonical 一致 + 两条安装线 + 描述符不变式(44 条) |
75
+ | `tests/audit-math-computation-contract.mjs` | ≈ 0.2 s | — | 跨预设接线(含 set-schema **属性级**检查与 defaults 漂移检查) |
76
+ | `tests/audit-math-computation-sensitivity.mjs` | ≈ 25 s | — | 21 个模块级变异,每条都要求具名断言变红(控制组必须绿) |
77
+
78
+ > 上表 `run-tests` 的 `≈424 s / ≈121 s` 两列是 **65 项(44 套件 + 21 探针)** 时的实测(2026 年 math_computation
79
+ > P1/P2a + 审计修复轮之后)。`audit-formal-sensitivity`(49 探针,实测 wall 260.7 s)与 `e2e-v4-fixes`(≈ 98 s)
80
+ > 是两条最长的独立路径;两者都不在 `run-tests` 的默认集合里时,整轮 wall 由 `e2e-v4-fixes` 决定。
81
+ > 数字**形状**(`TOTAL 65 … suites 44 · probes 21`)以 runner 每次运行的输出为准。
66
82
 
67
83
  单套件耗时(并行时的关键路径按此排序):
68
84
 
package/installer.js CHANGED
@@ -54,24 +54,27 @@ export const PRESETS = [
54
54
  {
55
55
  src: 'vibe-math-v2',
56
56
  dst: 'vibe-math-v2',
57
- files: ['agent.cordis.yml', 'preset.yml', 'vibe-math-v2.js', '实现方案.md'],
57
+ // math-computation.js + math-engines.js are PER-PRESET copies of the shared module (they must be
58
+ // listed here: on the <=0.1.6 line only these files are copied into .agent-presets/<id>/, and the
59
+ // preset JS imports them relatively). guard: tests/audit-math-computation-parity.mjs
60
+ files: ['agent.cordis.yml', 'preset.yml', 'vibe-math-v2.js', '实现方案.md', 'math-computation.js', 'math-engines.js'],
58
61
  },
59
62
  {
60
63
  src: 'vibe-math-v3',
61
64
  dst: 'vibe-math-v3',
62
- files: ['agent.cordis.yml', 'preset.yml', 'vibe-math-v3.js', '实现方案.md'],
65
+ files: ['agent.cordis.yml', 'preset.yml', 'vibe-math-v3.js', '实现方案.md', 'math-computation.js', 'math-engines.js'],
63
66
  },
64
67
  {
65
68
  src: 'vibe-math-v4',
66
69
  dst: 'vibe-math-v4',
67
- files: ['agent.cordis.yml', 'preset.yml', 'vibe-math-v4.js', '实现方案.md'],
70
+ files: ['agent.cordis.yml', 'preset.yml', 'vibe-math-v4.js', '实现方案.md', 'math-computation.js', 'math-engines.js'],
68
71
  },
69
72
  {
70
73
  src: 'vibe-math-v5',
71
74
  dst: 'vibe-math-v5',
72
75
  // 架构图.md belongs here for the same reason 实现方案.md does: the installer's policy is to put
73
76
  // the preset's documentation next to the preset, and the shipped v5 directory carries both.
74
- files: ['agent.cordis.yml', 'preset.yml', 'vibe-math-v5.js', '实现方案.md', '架构图.md'],
77
+ files: ['agent.cordis.yml', 'preset.yml', 'vibe-math-v5.js', '实现方案.md', '架构图.md', 'math-computation.js', 'math-engines.js'],
75
78
  },
76
79
  ]
77
80