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.
- package/README.en.md +53 -14
- package/README.md +54 -14
- package/cordis.patch.yml +54 -17
- package/docs/AUDIT-CHECKLIST.md +26 -7
- package/docs/COMPAT-AUDIT-ROUND3.md +16 -1
- package/docs/final-paper.md +171 -0
- package/docs/release-notes/RELEASE-NOTES-2.5.0.md +173 -0
- package/docs/release-notes/RELEASE-NOTES-2.6.0.md +268 -0
- package/docs/test-timing.md +77 -40
- package/installer.js +225 -45
- package/package.json +6 -3
- package/preset-declaration.js +38 -7
- package/prompt-corpus-persona/persona-corpus.json +13 -13
- package/prompt-corpus-persona/persona-corpus.md +113 -39
- package/prompt-corpus-v2/formal-verify-v2.json +128 -92
- package/prompt-corpus-v2/formal-verify-v2.md +380 -142
- package/prompt-corpus-v3/formal-verify-v3.json +117 -81
- package/prompt-corpus-v3/formal-verify-v3.md +693 -1189
- package/prompt-corpus-v4/formal-verify-v4.json +38 -8
- package/prompt-corpus-v4/formal-verify-v4.md +157 -25
- package/prompt-corpus-v5/prompt-corpus-v5.json +17 -17
- package/prompt-corpus-v5/prompt-corpus-v5.md +32 -26
- package/tests/audit-installer-compat.test.mjs +70 -4
- package/tests/audit-installer-policy.test.mjs +229 -4
- package/tests/audit-persona-sensitivity.mjs +68 -8
- package/tests/audit-persona-surface.test.mjs +21 -8
- package/tests/audit-v5-sensitivity.mjs +47 -6
- package/tests/e2e-v5-round2.test.mjs +825 -1
- package/tests/formal-verify-v2.test.mjs +57 -2
- package/tests/formal-verify-v3.test.mjs +67 -2
- package/tests/formal-verify-v4.test.mjs +120 -4
- package/tests/prompt-v5-integrity.test.mjs +9 -3
- package/tests/run-tests.mjs +104 -23
- package/tests/selfdrive-v5.mjs +55 -4
- package/vibe-math-v2/agent.cordis.yml +20 -4
- package/vibe-math-v2/vibe-math-v2.js +1318 -106
- package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +20 -4
- package/vibe-math-v3/agent.cordis.yml +36 -14
- package/vibe-math-v3/vibe-math-v3.js +1348 -179
- package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +3 -3
- package/vibe-math-v4/agent.cordis.yml +36 -8
- package/vibe-math-v4/vibe-math-v4.js +1195 -57
- package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +91 -9
- package/vibe-math-v5/agent.cordis.yml +16 -8
- package/vibe-math-v5/vibe-math-v5.js +1628 -112
- package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +143 -41
|
@@ -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.
|
package/docs/test-timing.md
CHANGED
|
@@ -8,52 +8,81 @@
|
|
|
8
8
|
## 1. 怎么跑(并行是默认)
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
node tests/run-tests.mjs #
|
|
12
|
-
node tests/run-tests.mjs --only formal # 只跑名字含 formal
|
|
11
|
+
node tests/run-tests.mjs # 全部套件 + 全部探针(tests/ 下每个 .mjs),并行(并发 = min(4, CPU 核数);命令都从**仓库根**执行)
|
|
12
|
+
node tests/run-tests.mjs --only formal # 只跑名字含 formal 的项(套件与探针一起筛)
|
|
13
13
|
node tests/run-tests.mjs --concurrency=6 # 手动指定并发
|
|
14
|
-
node tests/
|
|
15
|
-
node tests/audit-persona-sensitivity.mjs # 11 条提示词面探针(串行,本身只要几秒)
|
|
16
|
-
node tests/audit-prompt-invariants.mjs # 静态:四套的提示词/工具面不变式 + 扫描器自检(< 0.1s)
|
|
17
|
-
node tests/audit-prompt-invariants.mjs --self-probe # 证明上面那 157 条不变式真的会变红(5 个自探针)
|
|
18
|
-
node tests/audit-spec-traceability.mjs # 静态:规格/README ↔ 代码可追溯(< 0.1s)
|
|
19
|
-
node tests/audit-v5-integrity.mjs # 静态:v5 完整性/理念门禁 + 扫描器解析级自检(≈0.5 s)
|
|
14
|
+
node tests/run-tests.mjs --json # 机器可读汇总(含 skippedNeedsArgs / devCheckout)
|
|
20
15
|
```
|
|
21
16
|
|
|
22
|
-
|
|
17
|
+
`run-tests.mjs` 的收集规则(Round B 起):`tests/` 下**每个** `.mjs` 都会被跑——
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
- `*.test.mjs` 是**套件**;其余 `.mjs` 是**探针/审计**(灵敏度变异、注册面、自驱动守卫);
|
|
20
|
+
- 只有登记在 runner 的 `NEEDS_ARGS` 里的脚本才会被跳过(当前只有 `audit-tool-exec.mjs`:它必须带
|
|
21
|
+
`<preset-js> <tool-name>` 才能跑)。跳过项**每次运行都会打印出来**;在开发检出(存在 `.git`)里
|
|
22
|
+
该登记失效会**直接报错退出**,所以改名不可能悄悄把一条守卫踢出发布门禁;
|
|
23
|
+
- 需要参数的变体登记在 `VARIANTS`:`audit-registration.mjs` 四个预设各跑一次(裸跑只查 v3)、
|
|
24
|
+
`audit-prompt-invariants.mjs --self-probe`、以及 `audit-v3-registration-parity.mjs --self-probe`
|
|
25
|
+
(这条**成功 = 退出码 1**:它注入真实变异并要求守卫变红,runner 用 `expectExit` 表达)。
|
|
26
|
+
|
|
27
|
+
### 1.1 随包发布 vs 仅仓库(`npm pack --dry-run --json`)
|
|
28
|
+
|
|
29
|
+
`package.json` 的 `files` 只发 `tests/` 的一个**子集**(发布物共 105 个文件,其中 `tests/` 18 项),
|
|
30
|
+
所以安装用户跑 `node tests/run-tests.mjs` 得到的是子集的结果——runner 会把缺失的跳过项打印出来,
|
|
31
|
+
不会静默少跑:
|
|
32
|
+
|
|
33
|
+
- **随包(18 项)**:`run-tests.mjs`、`audit-formal-sensitivity.mjs`、`audit-persona-sensitivity.mjs`、
|
|
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`、
|
|
36
|
+
`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
|
+
- **仅仓库(不发)**:其余 29 个套件(v2/v3/v4 的 e2e、`selfdrive-v3`/`v4`、v2/v3 修复探针、
|
|
39
|
+
`audit-fuzz-helpers` 之外的若干 `audit-*`……)与 7 个脚本(`audit-fuzz-helpers`、
|
|
40
|
+
`audit-registration`、`audit-roundtrip-idempotence`、`audit-tool-exec`、
|
|
41
|
+
`audit-v3-registration-parity`、`selfdrive-v3`、`selfdrive-v4`)。
|
|
42
|
+
- 因此**完整门禁只能在开发检出里跑**;发布物里的子集是"用户可自查"的一部分,不是全部证据。
|
|
43
|
+
(`audit-fuzz-helpers.mjs` 在 2.3.13 时曾随包发布;现在不在 `files` 里。)
|
|
44
|
+
|
|
45
|
+
## 2. 基线(本机:4 核 / Windows,实测)
|
|
25
46
|
|
|
26
47
|
| 脚本 | 串行(sum) | 并行(wall) | 实测输出 |
|
|
27
48
|
|---|---|---|---|
|
|
28
|
-
| `tests/run-tests.mjs
|
|
29
|
-
| `tests/audit-
|
|
30
|
-
| `tests/audit-
|
|
31
|
-
| `tests/audit-
|
|
32
|
-
| `tests/audit-
|
|
33
|
-
| `audit-
|
|
34
|
-
| `audit-
|
|
35
|
-
| `audit-
|
|
36
|
-
| `audit-
|
|
37
|
-
| `audit-
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
| `tests/run-tests.mjs`(**57 项** = 39 套件 + 18 探针/变体) | ≈ 629 s | **≈ 208 s**(并发 4,speed-up x3.02) | `TOTAL 57 PASS 57 FAIL 0 (suites 39 · probes 18)`;关键路径 = `audit-formal-sensitivity` 208 s |
|
|
50
|
+
| `tests/audit-formal-sensitivity.mjs`(49 探针,自带并发 4) | 803 s | **≈ 208 s** | 关键路径 = 12 个 v2 探针(每个 ≈42–60 s) |
|
|
51
|
+
| `tests/audit-v5-sensitivity.mjs`(39 探针,串行) | ≈ 101 s | — | 每条 = 一次被测套件重跑 |
|
|
52
|
+
| `tests/audit-persona-sensitivity.mjs`(16 探针) | ≈ 4.4 s | — | 本身很快,不需要并行 |
|
|
53
|
+
| `tests/audit-prompt-invariants.mjs`(157 条) | ≈ 1.9 s | — | 静态 |
|
|
54
|
+
| `tests/audit-prompt-invariants.mjs --self-probe`(5 探针) | ≈ 7.4 s | — | 每个探针 = 一次自我重跑 |
|
|
55
|
+
| `tests/audit-spec-traceability.mjs`(94 条) | ≈ 0.2 s | — | 静态 |
|
|
56
|
+
| `tests/audit-v5-integrity.mjs` | ≈ 0.6 s | — | 静态审计(含扫描器自检) |
|
|
57
|
+
| `tests/audit-registration.mjs`(4 个预设各一次) | ≈ 1.0 s | — | 裸跑只查 v3,所以 runner 跑四个变体 |
|
|
58
|
+
| `tests/audit-v3-registration-parity.mjs`(+ `--self-probe`) | ≈ 0.3 s | — | 自探针**成功 = exit 1**(变异后守卫必须变红) |
|
|
59
|
+
| `tests/prompt-v5-integrity.test.mjs` | ≈ 2.2 s | — | 虚拟时钟下生成 v5 语料(语料字节稳定;**stdout 里的会议成员顺序仍是运行间随机的**,只有落盘语料是逐字节确定的) |
|
|
60
|
+
| `tests/e2e-v5-round2.test.mjs` | ≈ 3.2 s | — | v5 e2e(含本轮新增的"预置快照不被覆盖""命名研究所被读取""失败轮次"三节) |
|
|
61
|
+
| `tests/host-failure-paths.test.mjs` | ≈ 6.3 s | — | 真实宿主的失败路径(`kind:'error'`、`/v4 set` 键校验、失败轮次不算进展) |
|
|
62
|
+
| `tests/v4-mailbox-stall.test.mjs` | ≈ 7.1 s | — | `sendMessage` 拒绝后必须重投并唤醒(control + treatment 各一个 host) |
|
|
63
|
+
| `tests/v2-fix-probes.test.mjs` | ≈ 8.6 s | — | v2 的 flat 等权均值 / ≥2 名验证者 / runShell 失败分支(26 条) |
|
|
64
|
+
| `tests/v2-path-escape.test.mjs` | ≈ 2.2 s | — | 验证日志路径逃逸(7 条) |
|
|
65
|
+
| `tests/v2-tool-cap.test.mjs` | ≈ 0.4 s | — | 能力表来自真实组合、*MaxToolCalls 只是提示(10 条) |
|
|
66
|
+
|
|
67
|
+
> 上表 `≈629 s / ≈208 s` 两列是 **56 项(38 套件)** 时的实测;第 39 个套件是随 final-paper 功能加入的
|
|
68
|
+
> `tests/v4-final-paper.test.mjs`,本表尚未单独计时,所以全量的绝对时间会比 208 s 略大——数字**形状**
|
|
69
|
+
> (`TOTAL 57 … suites 39 · probes 18`)以 runner 每次运行的输出为准。
|
|
44
70
|
|
|
45
71
|
单套件耗时(并行时的关键路径按此排序):
|
|
46
72
|
|
|
47
73
|
| 套件 | 耗时 | 备注 |
|
|
48
74
|
|---|---|---|
|
|
49
|
-
| `e2e-v4-fixes.test.mjs` | **≈
|
|
50
|
-
| `formal-verify-v2.test.mjs` | **≈
|
|
75
|
+
| `e2e-v4-fixes.test.mjs` | **≈ 104 s** | 9 个用例是**轮次采样**型(如 T13 采样 400 轮、T19/T25 多轮);时间 ≈ 轮数 × 框架自身的 40 ms 计时粒度 |
|
|
76
|
+
| `formal-verify-v2.test.mjs` | **≈ 43 s** | 曾为 186 s:见 §3 |
|
|
77
|
+
| `e2e-v3.test.mjs` | ≈ 21 s | |
|
|
51
78
|
| `e2e-regression.test.mjs` | ≈ 14 s | |
|
|
52
|
-
| `
|
|
53
|
-
| `e2e-d9-d13.test.mjs` | ≈ 13 s | |
|
|
54
|
-
|
|
|
55
|
-
|
|
56
|
-
|
|
79
|
+
| `formal-verify-v3.test.mjs` | ≈ 13 s | |
|
|
80
|
+
| `e2e-business.test.mjs` / `e2e-d9-d13.test.mjs` | ≈ 13 s | |
|
|
81
|
+
| 其余套件 | ≤ 10 s | 其中绝大多数 < 2 s |
|
|
82
|
+
|
|
83
|
+
> 优化前:全量回归 ≈ 5.5 min(串行,`formal-verify-v2` 单独 186 s);
|
|
84
|
+
> 探针脚本 ≈ **38 min**(49 条串行,其中 12 条 × `formal-verify-v2` 162 s)。
|
|
85
|
+
> 现在:**一套 `node tests/run-tests.mjs` ≈ 3.5 min 覆盖套件 + 探针**(探针单独跑仍是 ≈2.6 min)。
|
|
57
86
|
|
|
58
87
|
## 3. 已经做过的优化(别再重复踩)
|
|
59
88
|
|
|
@@ -68,9 +97,9 @@ node tests/audit-v5-integrity.mjs # 静态:v5 完整性/理念门
|
|
|
68
97
|
现在连续 100 次无待答 followup 就停(`V4_IDLE_POLLS` 可调)。
|
|
69
98
|
**再往下压就要砍采样深度了**——那 9 个慢用例(T13/T19/T22/T23/T25/T27/T2/T9/T20)是在
|
|
70
99
|
观察"多轮之后某个指令**没有**泄漏/重复",轮数是它们的不变式本体,不要再动。
|
|
71
|
-
3. **两个 runner
|
|
100
|
+
3. **两个 runner 并行**(Round A):探针 38 min → 2.6 min(sum 612 s,wall 154.6 s,x3.96);
|
|
72
101
|
全量回归 5.5 min → 1.9 min(sum 221.5 s,wall 111.5 s,x1.99)。
|
|
73
|
-
4. **虚拟时钟**(`prompt-v5-integrity.test.mjs
|
|
102
|
+
4. **虚拟时钟**(`prompt-v5-integrity.test.mjs`):v5 研究所由 `ctx.timeout` + `Date.now()`
|
|
74
103
|
驱动,真实时钟下"哪个成员被心跳/会议唤醒"取决于负载与毫秒差 → **随包语料每跑一次都变**(无法 diff,
|
|
75
104
|
真实缺陷会被淹没)。套件现在把 `ctx.timeout` 接到**虚拟时钟**、`sleep(n)` 推进虚拟时间:
|
|
76
105
|
套件 **7–9 s → 1.7 s**,且语料连续 6 次运行**字节一致**。语料写入端另加**全序排序**
|
|
@@ -79,13 +108,21 @@ node tests/audit-v5-integrity.mjs # 静态:v5 完整性/理念门
|
|
|
79
108
|
> 想给别的套件套用同一手法前请注意:若套件的等待助手用 `Date.now()` 做**超时判据**、又用
|
|
80
109
|
> `setInterval` 轮询(例如 `e2e-v4-fixes.test.mjs` 的 `waitFor`),冻结时钟会让判据永不超时;
|
|
81
110
|
> 那种情况必须连**轮询定时器**一起虚拟化,不能只改 `sleep`。
|
|
111
|
+
5. **语料里的随机 id 也要归一化**(Round B,`formal-verify-v4.test.mjs`):v4 的
|
|
112
|
+
`propose_task` 用 `Math.random` 造 `t-<8 位 hex>`,语料把 `[YOU CLAIMED TASK t-…]` 逐字写盘,
|
|
113
|
+
于是**每次跑测试都会改写随包语料**(`git status` 永远有 `prompt-corpus-v4/*`,且违反
|
|
114
|
+
`AUDIT-CHECKLIST` §2.4"连续两次哈希相同")。`scrub()` 现在把它归一化成 `<TASKID>`,并断言
|
|
115
|
+
"语料里既没有裸 id、也真的有 `<TASKID>`"。连续两次运行哈希相同(`d3381886…` / `e6c4e445…`)。
|
|
82
116
|
|
|
83
117
|
## 4. 并行安全(为什么可以并发)
|
|
84
118
|
|
|
85
119
|
- 每个套件/探针都自建 `mkdtempSync` 工作区,互不共享状态;
|
|
86
120
|
- **会写语料的套件必须给不同的语料目录**:`V2_CORPUS_DIR` / `V3_CORPUS_DIR` / `V4_CORPUS_DIR` /
|
|
87
121
|
`V5_CORPUS_DIR`。探针 runner 为**每个探针**分配独立目录,否则同一套件的并发实例会互相覆盖语料;
|
|
122
|
+
- `audit-v5-sensitivity.mjs` 现在**自己**把 `V5_CORPUS_DIR` 指向临时目录:被变异的插件绝不能把
|
|
123
|
+
自己的提示词倒进随包语料;
|
|
88
124
|
- `audit-persona-sensitivity.mjs` 用 `PERSONA_ROOT` 指向变异副本,且在覆盖模式下**不写**语料;
|
|
125
|
+
- `audit-formal-sensitivity.mjs` 同样给每个探针独立的 `V{2,3,4,5}_CORPUS_DIR`;
|
|
89
126
|
- `audit-prompt-invariants.mjs --self-probe` 用 `PROMPT_INVARIANTS_MUTATE`(JSON `[rel, from, to]`)
|
|
90
127
|
在**内存里**变异一个文件并自我重跑,**不碰磁盘**,因此可与任何东西并发;
|
|
91
128
|
变异串里不要用 NUL 分隔(环境变量不允许 NUL 字节)。
|
|
@@ -94,11 +131,11 @@ node tests/audit-v5-integrity.mjs # 静态:v5 完整性/理念门
|
|
|
94
131
|
|
|
95
132
|
| 目的 | 跑什么 | 预期 |
|
|
96
133
|
|---|---|---|
|
|
97
|
-
| 改了某个架构的插件 | `node tests/run-tests.mjs --only <vN>` + `node tests/audit-formal-sensitivity.mjs --only=vN` | 30 s –
|
|
98
|
-
| 改了提示词/人设 | `node tests/run-tests.mjs --only persona --only prompt` + `node tests/audit-persona-sensitivity.mjs` | ≈
|
|
99
|
-
| **改了任何工具的参数 schema / 参数处理** | `node tests/
|
|
100
|
-
|
|
|
101
|
-
| 只想快速看提示词/文档有没有漂移 | `node tests/audit-prompt-invariants.mjs && node tests/audit-spec-traceability.mjs` | **<
|
|
134
|
+
| 改了某个架构的插件 | `node tests/run-tests.mjs --only <vN>` + `node tests/audit-formal-sensitivity.mjs --only=vN` | 30 s – 3.5 min |
|
|
135
|
+
| 改了提示词/人设 | `node tests/run-tests.mjs --only persona --only prompt` + `node tests/audit-persona-sensitivity.mjs` | ≈ 20 s |
|
|
136
|
+
| **改了任何工具的参数 schema / 参数处理** | `node tests/run-tests.mjs --only audit-prompt-invariants --only formal` | ≈ 60 s(v2 套件占大头) |
|
|
137
|
+
| 改了 `tests/` 下的 runner/守卫 | `node tests/run-tests.mjs`(**必须**:它现在同时跑套件与探针,任何一条守卫变红都会让门禁失败) | **≈ 3.5 min** |
|
|
138
|
+
| 只想快速看提示词/文档有没有漂移 | `node tests/audit-prompt-invariants.mjs && node tests/audit-spec-traceability.mjs` | **< 3 s** |
|
|
102
139
|
| 只想知道"快不快" | `node tests/run-tests.mjs --json` | 读 `wallSeconds` / `slowest` |
|
|
103
140
|
|
|
104
141
|
**每次跑完都要看那几行 timing**:如果某个套件突然比基线慢很多,先怀疑新增的固定等待,
|