dsh-vibe-math 2.7.3 → 2.8.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 (101) hide show
  1. package/LICENSE +21 -21
  2. package/README.en.md +682 -682
  3. package/README.md +683 -683
  4. package/docs/AUDIT-CHECKLIST.md +755 -744
  5. package/docs/COMPAT-AUDIT-ROUND2.md +351 -351
  6. package/docs/COMPAT-AUDIT-ROUND3.md +154 -154
  7. package/docs/audit-methodology.md +93 -0
  8. package/docs/final-paper.md +172 -172
  9. package/docs/formal-verification.md +613 -588
  10. package/docs/generate_framework_diagram_v2.py +114 -114
  11. package/docs/generate_framework_diagram_v3.py +127 -127
  12. package/docs/math-computation.md +195 -194
  13. package/docs/release-notes/README.en.md +1 -0
  14. package/docs/release-notes/README.md +1 -0
  15. package/docs/release-notes/RELEASE-NOTES-2.0.22.md +112 -112
  16. package/docs/release-notes/RELEASE-NOTES-2.1.0.md +143 -143
  17. package/docs/release-notes/RELEASE-NOTES-2.2.0.md +266 -266
  18. package/docs/release-notes/RELEASE-NOTES-2.2.1.md +43 -43
  19. package/docs/release-notes/RELEASE-NOTES-2.2.2.md +88 -88
  20. package/docs/release-notes/RELEASE-NOTES-2.3.0.md +207 -207
  21. package/docs/release-notes/RELEASE-NOTES-2.3.1.md +134 -134
  22. package/docs/release-notes/RELEASE-NOTES-2.3.10.md +105 -105
  23. package/docs/release-notes/RELEASE-NOTES-2.3.11.md +57 -57
  24. package/docs/release-notes/RELEASE-NOTES-2.3.12.md +80 -80
  25. package/docs/release-notes/RELEASE-NOTES-2.3.2.md +145 -145
  26. package/docs/release-notes/RELEASE-NOTES-2.3.3.md +115 -115
  27. package/docs/release-notes/RELEASE-NOTES-2.3.4.md +69 -69
  28. package/docs/release-notes/RELEASE-NOTES-2.3.5.md +63 -63
  29. package/docs/release-notes/RELEASE-NOTES-2.3.6.md +66 -66
  30. package/docs/release-notes/RELEASE-NOTES-2.3.7.md +59 -59
  31. package/docs/release-notes/RELEASE-NOTES-2.3.8.md +45 -45
  32. package/docs/release-notes/RELEASE-NOTES-2.3.9.md +70 -70
  33. package/docs/release-notes/RELEASE-NOTES-2.8.0.en.md +65 -0
  34. package/docs/release-notes/RELEASE-NOTES-2.8.0.md +65 -0
  35. package/docs/release-playbook.md +103 -0
  36. package/docs/slv-playbook.md +117 -0
  37. package/docs/test-timing.md +158 -157
  38. package/docs//346/236/266/346/236/204/345/233/276.md +77 -77
  39. package/installer.js +792 -792
  40. package/package.json +13 -3
  41. package/prompt-corpus-v2/formal-verify-v2.json +2 -2
  42. package/prompt-corpus-v2/formal-verify-v2.md +4 -0
  43. package/prompt-corpus-v3/formal-verify-v3.json +7 -7
  44. package/prompt-corpus-v3/formal-verify-v3.md +14 -0
  45. package/prompt-corpus-v5/prompt-corpus-v5.json +61 -61
  46. package/prompt-corpus-v5/prompt-corpus-v5.md +122 -0
  47. package/scripts/clean-temp.mjs +234 -0
  48. package/tests/audit-engine-faces.mjs +298 -0
  49. package/tests/audit-formal-sensitivity.mjs +345 -342
  50. package/tests/audit-installer-compat.test.mjs +256 -256
  51. package/tests/audit-math-computation-sensitivity.mjs +1 -1
  52. package/tests/audit-persona-sensitivity.mjs +323 -323
  53. package/tests/audit-persona-surface.test.mjs +431 -431
  54. package/tests/audit-prompt-duplication.mutants.mjs +3 -2
  55. package/tests/audit-prompt-invariants.mjs +589 -546
  56. package/tests/audit-registration.mjs +78 -78
  57. package/tests/audit-spec-traceability.mjs +193 -193
  58. package/tests/audit-status-report-fields.mjs +172 -172
  59. package/tests/audit-v5-integrity.mjs +795 -795
  60. package/tests/audit-v5-sensitivity.mjs +433 -432
  61. package/tests/e2e-v5-round2.test.mjs +2453 -2426
  62. package/tests/formal-verify-v2.test.mjs +1806 -1800
  63. package/tests/formal-verify-v3.test.mjs +1757 -1750
  64. package/tests/formal-verify-v4.test.mjs +2114 -2106
  65. package/tests/formal-verify-v5.test.mjs +774 -767
  66. package/tests/math-computation-discovery.mutants.mjs +3 -3
  67. package/tests/math-computation-shared.test.mjs +122 -5
  68. package/tests/math-computation-v2.test.mjs +14 -2
  69. package/tests/math-computation-v3.test.mjs +14 -2
  70. package/tests/math-computation-v4.test.mjs +739 -739
  71. package/tests/prompt-v5-integrity.test.mjs +1291 -1291
  72. package/tests/run-tests.mjs +393 -332
  73. package/tests/selfdrive-v5.mjs +560 -560
  74. package/tests/temp-hygiene.mutants.mjs +80 -0
  75. package/tests/v2-fix-probes.mutants.mjs +4 -0
  76. package/tests/v2-fix-probes.test.mjs +1034 -1033
  77. package/tests/v2v3-interrupt.mutants.mjs +111 -0
  78. package/tests/v3-fix-probes.mutants.mjs +99 -95
  79. package/tests/v3-fix-probes.test.mjs +891 -890
  80. package/tests/v4-final-paper.mutants.mjs +108 -0
  81. package/tests/v5-institute-fixes.mutants.mjs +218 -190
  82. package/vibe-math-v2/agent.cordis.yml +376 -376
  83. package/vibe-math-v2/math-computation.js +17 -15
  84. package/vibe-math-v2/preset.yml +2 -2
  85. package/vibe-math-v2/v2/347/232/204/351/242/235/345/244/226/350/246/201/346/261/202.txt +21 -21
  86. package/vibe-math-v2/vibe-math-v2.js +5078 -5011
  87. package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +486 -486
  88. package/vibe-math-v3/agent.cordis.yml +420 -420
  89. package/vibe-math-v3/math-computation.js +17 -15
  90. package/vibe-math-v3/preset.yml +2 -2
  91. package/vibe-math-v3/vibe-math-v3.js +6215 -6149
  92. package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +649 -649
  93. package/vibe-math-v4/agent.cordis.yml +438 -438
  94. package/vibe-math-v4/math-computation.js +17 -15
  95. package/vibe-math-v4/preset.yml +2 -2
  96. package/vibe-math-v4/vibe-math-v4.js +4490 -4422
  97. package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +1015 -1015
  98. package/vibe-math-v5/math-computation.js +17 -15
  99. package/vibe-math-v5/vibe-math-v5.js +93 -11
  100. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +1728 -1728
  101. package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +693 -693
@@ -1,59 +1,59 @@
1
- # dsh-vibe-math 2.3.7 — 权威锚点必须自洽:手改过的状态文件不得劫持 id 映射
2
-
3
- > 上一版:2.3.6。本版是 round 8:把 2.3.6 新引入的"记录里持久化权威 `objectId`"这条机制**自己**审一遍。
4
- > 无破坏性变更,默认仍为 `formalVerify: 'off'`。
5
-
6
- ---
7
-
8
- ## 1. 2.3.6 引入的新机制里有一个可被污染的锚点
9
-
10
- 2.3.6 让 `formalObjectIdOf` 在任务表不可用时读记录里的 `objectId`(跨 resume 生效)。但**状态文件是
11
- 可编辑的**(`VibeMath_State/formal.json`,仓库里本来就有"文件被改坏也要能继续"的守卫测试):
12
-
13
- - 如果某条记录的 `objectId` 自己就是 **r 形**(`r-pX`),那么"验证 id → 对象 id"会映射到**它自己**;
14
- - 于是 `putFormalBothIds('r-pX', …)` 认为"两侧就是同一个 id",**只写验证侧**,对象侧仍然 `passed`
15
- —— 又回到"成对关系只做一半"的静默错位(门禁/卡片/提示词各读一侧)。
16
-
17
- **触发路径**(实测):**工作轮回执**(explorer/solver 的回执同样带 `formal` 字段)在**没有验证任务**
18
- 在内存里时走到"读记录锚点"这条兜底路径。以手改过的状态文件复现:修前该用例的断言变红
19
- (对象侧不降级),修后全绿。
20
-
21
- ## 2. 修法:锚点必须**自洽**才可用
22
-
23
- - `formalObjectIdOf` 读记录锚点时,要求 `formalObjectIdOfIsOwner(v)` 为真 —— 即该值**不以 `r-` 开头**、
24
- 不可能再被解析成别的 id;
25
- - 写入锚点的两处(`syncVerificationTarget`、`putFormalBothIds`)同样只在**确实是对象 id** 时写入,
26
- 不给未来留下污染源。
27
-
28
- > 说明(如实记录):写入侧的两道守卫**目前无法用用例证明其必要性**——现有写入者手里的值都来自
29
- > `formalObjectIdOf`,本身就不会是 r 形(我一度写了一个"归档写在 rId 上会污染锚点"的用例,实测发现它
30
- > **恒真**,已删除并换成下面这个真正敏感的用例)。因此这两道守卫按**纵深防御**保留并如此标注;
31
- > 真正被证明有效的是**读取侧**的守卫。
32
-
33
- ## 3. 新增断言(`formal-verify-v2.test.mjs` 第 14d 节,+5 条)
34
-
35
- - 状态文件里的 `r-pX` 记录带 `objectId: 'r-pX'`(手改出来的 r 形锚点),对象 `pX` 是 `passed`;
36
- - 一个**工作轮回执**(没有验证任务,因此走记录锚点这条路径)点名 `r-pX` 报 `defect`;
37
- - 断言:**对象侧必须被降级**(锚点被拒绝而不是被信任)、验证侧同样降级。
38
-
39
- **灵敏度实测**(`_oneoff/probe-v2-anchor-guard.mjs`):把读取侧的守卫去掉 → 该用例立刻变红
40
- (`exit=1`,失败断言正是这一条),装回 → 全绿。即这条守卫是**承重**的,不是摆设。
41
-
42
- ## 4. 验收(实测)
43
-
44
- | 项 | 2.3.6 | 2.3.7 |
45
- |---|---|---|
46
- | `formal-verify-v2.test.mjs` | 348 | **353** |
47
- | 读取侧守卫探针 | — | **红/绿各一次,符合预期** |
48
- | 全量并行回归 | 23/23 | 23/23 |
49
- | 49 条 formal 探针 | 全红 | 全红 |
50
- | 四套语料确定性 | 字节稳定 | 字节稳定 |
51
- | closing verification | 18/18 | 18/18 |
52
-
53
- ## 5. 升级
54
-
55
- ```
56
- npm i dsh-vibe-math@latest
57
- ```
58
-
59
- 无迁移。本版只改 v2 的锚点校验与断言;`off` 档行为不变,其余三套预设与上一版逐字节相同。
1
+ # dsh-vibe-math 2.3.7 — 权威锚点必须自洽:手改过的状态文件不得劫持 id 映射
2
+
3
+ > 上一版:2.3.6。本版是 round 8:把 2.3.6 新引入的"记录里持久化权威 `objectId`"这条机制**自己**审一遍。
4
+ > 无破坏性变更,默认仍为 `formalVerify: 'off'`。
5
+
6
+ ---
7
+
8
+ ## 1. 2.3.6 引入的新机制里有一个可被污染的锚点
9
+
10
+ 2.3.6 让 `formalObjectIdOf` 在任务表不可用时读记录里的 `objectId`(跨 resume 生效)。但**状态文件是
11
+ 可编辑的**(`VibeMath_State/formal.json`,仓库里本来就有"文件被改坏也要能继续"的守卫测试):
12
+
13
+ - 如果某条记录的 `objectId` 自己就是 **r 形**(`r-pX`),那么"验证 id → 对象 id"会映射到**它自己**;
14
+ - 于是 `putFormalBothIds('r-pX', …)` 认为"两侧就是同一个 id",**只写验证侧**,对象侧仍然 `passed`
15
+ —— 又回到"成对关系只做一半"的静默错位(门禁/卡片/提示词各读一侧)。
16
+
17
+ **触发路径**(实测):**工作轮回执**(explorer/solver 的回执同样带 `formal` 字段)在**没有验证任务**
18
+ 在内存里时走到"读记录锚点"这条兜底路径。以手改过的状态文件复现:修前该用例的断言变红
19
+ (对象侧不降级),修后全绿。
20
+
21
+ ## 2. 修法:锚点必须**自洽**才可用
22
+
23
+ - `formalObjectIdOf` 读记录锚点时,要求 `formalObjectIdOfIsOwner(v)` 为真 —— 即该值**不以 `r-` 开头**、
24
+ 不可能再被解析成别的 id;
25
+ - 写入锚点的两处(`syncVerificationTarget`、`putFormalBothIds`)同样只在**确实是对象 id** 时写入,
26
+ 不给未来留下污染源。
27
+
28
+ > 说明(如实记录):写入侧的两道守卫**目前无法用用例证明其必要性**——现有写入者手里的值都来自
29
+ > `formalObjectIdOf`,本身就不会是 r 形(我一度写了一个"归档写在 rId 上会污染锚点"的用例,实测发现它
30
+ > **恒真**,已删除并换成下面这个真正敏感的用例)。因此这两道守卫按**纵深防御**保留并如此标注;
31
+ > 真正被证明有效的是**读取侧**的守卫。
32
+
33
+ ## 3. 新增断言(`formal-verify-v2.test.mjs` 第 14d 节,+5 条)
34
+
35
+ - 状态文件里的 `r-pX` 记录带 `objectId: 'r-pX'`(手改出来的 r 形锚点),对象 `pX` 是 `passed`;
36
+ - 一个**工作轮回执**(没有验证任务,因此走记录锚点这条路径)点名 `r-pX` 报 `defect`;
37
+ - 断言:**对象侧必须被降级**(锚点被拒绝而不是被信任)、验证侧同样降级。
38
+
39
+ **灵敏度实测**(`_oneoff/probe-v2-anchor-guard.mjs`):把读取侧的守卫去掉 → 该用例立刻变红
40
+ (`exit=1`,失败断言正是这一条),装回 → 全绿。即这条守卫是**承重**的,不是摆设。
41
+
42
+ ## 4. 验收(实测)
43
+
44
+ | 项 | 2.3.6 | 2.3.7 |
45
+ |---|---|---|
46
+ | `formal-verify-v2.test.mjs` | 348 | **353** |
47
+ | 读取侧守卫探针 | — | **红/绿各一次,符合预期** |
48
+ | 全量并行回归 | 23/23 | 23/23 |
49
+ | 49 条 formal 探针 | 全红 | 全红 |
50
+ | 四套语料确定性 | 字节稳定 | 字节稳定 |
51
+ | closing verification | 18/18 | 18/18 |
52
+
53
+ ## 5. 升级
54
+
55
+ ```
56
+ npm i dsh-vibe-math@latest
57
+ ```
58
+
59
+ 无迁移。本版只改 v2 的锚点校验与断言;`off` 档行为不变,其余三套预设与上一版逐字节相同。
@@ -1,45 +1,45 @@
1
- # dsh-vibe-math 2.3.8 — 把 round 7/8 的结论写进契约与审计清单(文档版)
2
-
3
- > 上一版:2.3.7。本版**只改文档**(无代码、无预设字节变化):把 2.3.6/2.3.7 发现的边界与规则写进
4
- > 共享契约与强制审计流程,免得下一轮审计重新把它当"新问题"或按另一种方式改。
5
-
6
- ---
7
-
8
- ## 1. 契约 §4:补两条边界
9
-
10
- - **记录与归档文件同生共死(框架侧),但外部文件操作不会自动改记录**:框架撤回证明时记录降级与文件
11
- 撤回是**同一次操作**;反过来,**外部**删掉 `Verified/Lean/<id>.lean` **不会**自动把记录降级——
12
- `passed` 是状态文件里的权威状态,门禁查询是只读的,不会在每次取记录时做文件存在性探测(那会把门禁
13
- 变成 fs I/O,并在网络盘/权限异常时引入新的失败模式)。人工动过文件后请一并修正记录或重新归档。
14
- - **v2 的 id 映射同理**:记录里持久化的 `objectId` 是权威锚点,但必须**自洽**(不以 `r-` 开头)才被
15
- 采纳,否则回退到后缀解析——状态文件可编辑,里面的"权威值"要先校验。
16
-
17
- ## 2. `AUDIT-CHECKLIST` §1.10:补一条检查项
18
-
19
- > **从用户可编辑的状态文件里读出来的"权威值"是否先做了自洽校验?**
20
- > 真实事故(2.3.7):某条记录的 `objectId` 被写成 r 形时,"验证 id → 对象 id"映射到它自己,
21
- > "两套 id 一起写"退化成只写验证侧、对象侧仍是 `passed`。
22
-
23
- (§1.10 是 2.3.6 新增的章节「id 映射不许猜」,本版把它与 2.3.7 的教训合并成完整检查项。)
24
-
25
- ## 3. v2 实现方案 §9.3:同步自洽条件
26
-
27
- `formalObjectIdOf` 的权威度顺序里,第 ② 级(记录里的 `objectId`)补上"读出时要求自洽"的条件。
28
-
29
- ## 4. 验收
30
-
31
- | 项 | 结果 |
32
- |---|---|
33
- | 代码/预设字节变化 | **无**(四套 `.js` 与 2.3.7 逐字节相同) |
34
- | 全量并行回归 | 23/23 |
35
- | 静态守卫 | invariants 157/0(self-probe 5/5)、traceability 94/0、v5-integrity clean |
36
- | 四套语料确定性 | 字节稳定 |
37
- | closing verification | 18/18 |
38
-
39
- ## 5. 升级
40
-
41
- ```
42
- npm i dsh-vibe-math@latest
43
- ```
44
-
45
- 无迁移、无行为变更。
1
+ # dsh-vibe-math 2.3.8 — 把 round 7/8 的结论写进契约与审计清单(文档版)
2
+
3
+ > 上一版:2.3.7。本版**只改文档**(无代码、无预设字节变化):把 2.3.6/2.3.7 发现的边界与规则写进
4
+ > 共享契约与强制审计流程,免得下一轮审计重新把它当"新问题"或按另一种方式改。
5
+
6
+ ---
7
+
8
+ ## 1. 契约 §4:补两条边界
9
+
10
+ - **记录与归档文件同生共死(框架侧),但外部文件操作不会自动改记录**:框架撤回证明时记录降级与文件
11
+ 撤回是**同一次操作**;反过来,**外部**删掉 `Verified/Lean/<id>.lean` **不会**自动把记录降级——
12
+ `passed` 是状态文件里的权威状态,门禁查询是只读的,不会在每次取记录时做文件存在性探测(那会把门禁
13
+ 变成 fs I/O,并在网络盘/权限异常时引入新的失败模式)。人工动过文件后请一并修正记录或重新归档。
14
+ - **v2 的 id 映射同理**:记录里持久化的 `objectId` 是权威锚点,但必须**自洽**(不以 `r-` 开头)才被
15
+ 采纳,否则回退到后缀解析——状态文件可编辑,里面的"权威值"要先校验。
16
+
17
+ ## 2. `AUDIT-CHECKLIST` §1.10:补一条检查项
18
+
19
+ > **从用户可编辑的状态文件里读出来的"权威值"是否先做了自洽校验?**
20
+ > 真实事故(2.3.7):某条记录的 `objectId` 被写成 r 形时,"验证 id → 对象 id"映射到它自己,
21
+ > "两套 id 一起写"退化成只写验证侧、对象侧仍是 `passed`。
22
+
23
+ (§1.10 是 2.3.6 新增的章节「id 映射不许猜」,本版把它与 2.3.7 的教训合并成完整检查项。)
24
+
25
+ ## 3. v2 实现方案 §9.3:同步自洽条件
26
+
27
+ `formalObjectIdOf` 的权威度顺序里,第 ② 级(记录里的 `objectId`)补上"读出时要求自洽"的条件。
28
+
29
+ ## 4. 验收
30
+
31
+ | 项 | 结果 |
32
+ |---|---|
33
+ | 代码/预设字节变化 | **无**(四套 `.js` 与 2.3.7 逐字节相同) |
34
+ | 全量并行回归 | 23/23 |
35
+ | 静态守卫 | invariants 157/0(self-probe 5/5)、traceability 94/0、v5-integrity clean |
36
+ | 四套语料确定性 | 字节稳定 |
37
+ | closing verification | 18/18 |
38
+
39
+ ## 5. 升级
40
+
41
+ ```
42
+ npm i dsh-vibe-math@latest
43
+ ```
44
+
45
+ 无迁移、无行为变更。
@@ -1,70 +1,70 @@
1
- # dsh-vibe-math 2.3.9 — v4 架构图重绘为 SVG(零依赖生成器 + README 展示)
2
-
3
- > 上一版:2.3.8。本版把 v4 的架构图从"matplotlib 生成的位图"换成**零依赖 Node 生成的 SVG**,
4
- > 与 v5 同一套版式语言,并把它纳入随包发布(README 里的图在 GitHub 与 npm 上都能正常显示)。
5
- > 无代码行为变更,四套预设字节未变。
6
-
7
- ---
8
-
9
- ## 1. 为什么换
10
-
11
- | | 旧(`框架图-v4.png` + `generate_framework_diagram_v4.py`) | 新(`框架图-v4.svg` + `generate_framework_diagram_v4.mjs`) |
12
- |---|---|---|
13
- | 生成方式 | Python + matplotlib | **纯 Node,零依赖**(本仓库运行时自带 Node) |
14
- | 产物 | 位图,缩放糊、无法 diff | 纯文本 SVG,任意缩放、可评审、diff 友好 |
15
- | 信息量 | 5 个方框 + 若干小字 | 分带:定论门槛 / 常驻层 / 框架六面 / 数据面 / 哲学红线 + 图例 |
16
- | 版式校验 | 无(只能靠眼睛) | 生成时**估算文字宽度**,任何一行溢出容器即 WARN + 退出码 1 |
17
- | 随包发布 | 否(npm 上 README 图裂) | **是**(`files` 收录,GitHub 与 npm 均可显示) |
18
-
19
- 旧文件已删除(需要时可从 git 历史取);`README.md` 的图源链接与说明同步更新,
20
- `docs/generate_framework_diagram_v5.mjs` 头部注释里的"v2/v3/v4 用 matplotlib"也改成"v2/v3"。
21
-
22
- ## 2. 新图覆盖的内容(全部与实现逐项核对过)
23
-
24
- - **定论门槛**:全体一致为真(全 1)/ 一致为假(全 0)→ 写入 `Verified/`;
25
- **没有** forced / flat / 近共识收口;分歧 → 公开辩论重评;仍未全票 → 留库 + 平均概率 + 辩论录。
26
- - **常驻层**:`continuable` 持久会话、独立上下文、自主方向、只写自己的库 / 跨读他人库(只读)、
27
- 唤醒 = `subagents.sendMessage`、一轮 = 一次完整思考;起始 brainstorm 产出各自方向;全票"已解决"才停。
28
- - **框架六面**(逐条对齐代码/规格):
29
- - 消息总线·邮件箱:`vibe_v4_message(to|all)` → 入目标邮箱 → 空闲则唤醒;常驻之间不直接互调;
30
- - 会议 / 辩论:`vibe_v4_meeting(agenda)` → 全体发言 → `Shared/meetings/<id>.md` → 广播结论;
31
- 看门狗防死锁;与验证**互斥**(排队,不抢占);
32
- - 任务板(只搬运):提议/认领写在回执里 → `Shared/taskboard.md`;框架不决定谁做什么;
33
- - 共识验证(全票):回执字段 `propose_verify` → FIFO 排队 → 独立初评(互不可见)→ 公开辩论重评
34
- (最多 `verdictMaxRounds` 轮,默认 3);
35
- - 上下文 / compact:`contextPct ≥ compactThreshold`(默认 66)触发 DSH `/compact`,
36
- `compactAfterRounds` 默认 8,压缩后重申核心规则;
37
- - 活性 / 并发 / 恢复:`activityTimeoutMs` 心跳、`maxParallel` 并发闸、停滞 `stallAutoMeetingMs`
38
- (默认 6 min)自动开会、`resume` 用 `residents.json` + `progress.md` 重种化。
39
- - **回执字段**(**按代码里真正的解析字段列**,不是照抄记忆):
40
- `summary / solved / input / vote / propose_verify / propose_task / claim_task / task_done / voteSolved / formal / contextPct`。
41
- (核对时发现我第一版图里写了 `reject_assign` 与 `vote_solved` —— 前者是 **v5** 的字段、后者是拼错的
42
- 驼峰名,v4 实际是 `voteSolved`;已改正。)
43
- - **数据面**(真实路径核对过):
44
- `Progress/<r-id>/progress.md`、`Propos/<r-id>/<p-id>.md`、`Methods/<r-id>/<m-id>.md`、
45
- `Subproblems/<r-id>/<s-id>.md`(每条记录必填 价值程度 / 动机用途计划 / 自身概率估计);
46
- `Shared/meetings|debates`、`Shared/taskboard.md`、`Shared/meetings/brainstorm.md`、
47
- `Verified/命题|问题/<id>.md`、`Problems/<id>.md`;
48
- `State/residents.json`、`mailboxes.json`、`taskboard.json`、`decisions.json`、`session.json`、
49
- `settings.json`、`formal.json`;`fileOwner` 写锁 / `projectLock` / `processEpoch` / `abort → resume`。
50
- - **哲学红线**:框架绝不指派 / 定论必须全体一致 / 只有 `Verified/` 绝对可信 / 常驻不直接互调 /
51
- 人工干预不改变自组织。
52
-
53
- ## 3. 验收
54
-
55
- | 项 | 结果 |
56
- |---|---|
57
- | 生成器 | `node docs/generate_framework_diagram_v4.mjs` → `示例图/框架图-v4.svg`(23501 字节),**0 条溢出告警** |
58
- | 渲染校验 | 无头 Chrome 截图 1760×1300 逐带人工核对(无重叠、无截断;左侧控制通道不穿过常驻) |
59
- | 全量并行回归 | 23/23 |
60
- | 静态守卫 | invariants 157/0(self-probe 5/5)、traceability 94/0、v5-integrity clean、persona-surface 197/0 |
61
- | closing verification | 18/18(含"包内所有声明文件存在") |
62
- | 发布产物自证 | registry 取回 tarball 比对 sha1 + 包内跑随包套件(见发布记录) |
63
-
64
- ## 4. 升级
65
-
66
- ```
67
- npm i dsh-vibe-math@latest
68
- ```
69
-
70
- 无迁移。README 里的 v4 图现在读 `示例图/框架图-v4.svg`。
1
+ # dsh-vibe-math 2.3.9 — v4 架构图重绘为 SVG(零依赖生成器 + README 展示)
2
+
3
+ > 上一版:2.3.8。本版把 v4 的架构图从"matplotlib 生成的位图"换成**零依赖 Node 生成的 SVG**,
4
+ > 与 v5 同一套版式语言,并把它纳入随包发布(README 里的图在 GitHub 与 npm 上都能正常显示)。
5
+ > 无代码行为变更,四套预设字节未变。
6
+
7
+ ---
8
+
9
+ ## 1. 为什么换
10
+
11
+ | | 旧(`框架图-v4.png` + `generate_framework_diagram_v4.py`) | 新(`框架图-v4.svg` + `generate_framework_diagram_v4.mjs`) |
12
+ |---|---|---|
13
+ | 生成方式 | Python + matplotlib | **纯 Node,零依赖**(本仓库运行时自带 Node) |
14
+ | 产物 | 位图,缩放糊、无法 diff | 纯文本 SVG,任意缩放、可评审、diff 友好 |
15
+ | 信息量 | 5 个方框 + 若干小字 | 分带:定论门槛 / 常驻层 / 框架六面 / 数据面 / 哲学红线 + 图例 |
16
+ | 版式校验 | 无(只能靠眼睛) | 生成时**估算文字宽度**,任何一行溢出容器即 WARN + 退出码 1 |
17
+ | 随包发布 | 否(npm 上 README 图裂) | **是**(`files` 收录,GitHub 与 npm 均可显示) |
18
+
19
+ 旧文件已删除(需要时可从 git 历史取);`README.md` 的图源链接与说明同步更新,
20
+ `docs/generate_framework_diagram_v5.mjs` 头部注释里的"v2/v3/v4 用 matplotlib"也改成"v2/v3"。
21
+
22
+ ## 2. 新图覆盖的内容(全部与实现逐项核对过)
23
+
24
+ - **定论门槛**:全体一致为真(全 1)/ 一致为假(全 0)→ 写入 `Verified/`;
25
+ **没有** forced / flat / 近共识收口;分歧 → 公开辩论重评;仍未全票 → 留库 + 平均概率 + 辩论录。
26
+ - **常驻层**:`continuable` 持久会话、独立上下文、自主方向、只写自己的库 / 跨读他人库(只读)、
27
+ 唤醒 = `subagents.sendMessage`、一轮 = 一次完整思考;起始 brainstorm 产出各自方向;全票"已解决"才停。
28
+ - **框架六面**(逐条对齐代码/规格):
29
+ - 消息总线·邮件箱:`vibe_v4_message(to|all)` → 入目标邮箱 → 空闲则唤醒;常驻之间不直接互调;
30
+ - 会议 / 辩论:`vibe_v4_meeting(agenda)` → 全体发言 → `Shared/meetings/<id>.md` → 广播结论;
31
+ 看门狗防死锁;与验证**互斥**(排队,不抢占);
32
+ - 任务板(只搬运):提议/认领写在回执里 → `Shared/taskboard.md`;框架不决定谁做什么;
33
+ - 共识验证(全票):回执字段 `propose_verify` → FIFO 排队 → 独立初评(互不可见)→ 公开辩论重评
34
+ (最多 `verdictMaxRounds` 轮,默认 3);
35
+ - 上下文 / compact:`contextPct ≥ compactThreshold`(默认 66)触发 DSH `/compact`,
36
+ `compactAfterRounds` 默认 8,压缩后重申核心规则;
37
+ - 活性 / 并发 / 恢复:`activityTimeoutMs` 心跳、`maxParallel` 并发闸、停滞 `stallAutoMeetingMs`
38
+ (默认 6 min)自动开会、`resume` 用 `residents.json` + `progress.md` 重种化。
39
+ - **回执字段**(**按代码里真正的解析字段列**,不是照抄记忆):
40
+ `summary / solved / input / vote / propose_verify / propose_task / claim_task / task_done / voteSolved / formal / contextPct`。
41
+ (核对时发现我第一版图里写了 `reject_assign` 与 `vote_solved` —— 前者是 **v5** 的字段、后者是拼错的
42
+ 驼峰名,v4 实际是 `voteSolved`;已改正。)
43
+ - **数据面**(真实路径核对过):
44
+ `Progress/<r-id>/progress.md`、`Propos/<r-id>/<p-id>.md`、`Methods/<r-id>/<m-id>.md`、
45
+ `Subproblems/<r-id>/<s-id>.md`(每条记录必填 价值程度 / 动机用途计划 / 自身概率估计);
46
+ `Shared/meetings|debates`、`Shared/taskboard.md`、`Shared/meetings/brainstorm.md`、
47
+ `Verified/命题|问题/<id>.md`、`Problems/<id>.md`;
48
+ `State/residents.json`、`mailboxes.json`、`taskboard.json`、`decisions.json`、`session.json`、
49
+ `settings.json`、`formal.json`;`fileOwner` 写锁 / `projectLock` / `processEpoch` / `abort → resume`。
50
+ - **哲学红线**:框架绝不指派 / 定论必须全体一致 / 只有 `Verified/` 绝对可信 / 常驻不直接互调 /
51
+ 人工干预不改变自组织。
52
+
53
+ ## 3. 验收
54
+
55
+ | 项 | 结果 |
56
+ |---|---|
57
+ | 生成器 | `node docs/generate_framework_diagram_v4.mjs` → `示例图/框架图-v4.svg`(23501 字节),**0 条溢出告警** |
58
+ | 渲染校验 | 无头 Chrome 截图 1760×1300 逐带人工核对(无重叠、无截断;左侧控制通道不穿过常驻) |
59
+ | 全量并行回归 | 23/23 |
60
+ | 静态守卫 | invariants 157/0(self-probe 5/5)、traceability 94/0、v5-integrity clean、persona-surface 197/0 |
61
+ | closing verification | 18/18(含"包内所有声明文件存在") |
62
+ | 发布产物自证 | registry 取回 tarball 比对 sha1 + 包内跑随包套件(见发布记录) |
63
+
64
+ ## 4. 升级
65
+
66
+ ```
67
+ npm i dsh-vibe-math@latest
68
+ ```
69
+
70
+ 无迁移。README 里的 v4 图现在读 `示例图/框架图-v4.svg`。
@@ -0,0 +1,65 @@
1
+ # dsh-vibe-math 2.8.0 — Release Notes
2
+
3
+ > Previous release: 2.7.3. This is a **feature release**: all four presets now ship explicit guidance for "no LaTeX engine was detected", and the explicit-engine semantics were corrected (v4/v5 used to silently fall back to a different engine). Parameter names and defaults and the directory layout are **unchanged**, the data format is **additive only**, the DSH support window is unchanged, and **no migration is needed**.
4
+
5
+ ## Overview
6
+
7
+ - An explicit `paperLatexCommand` now means "**use only this**": if it cannot be resolved the run degrades as "not detected" instead of quietly switching engines. All four presets and the documentation now agree.
8
+ - The named warning for a missing engine is **actionable**: it says PATH and the documented common TeX roots were probed, and how to pin an absolute path.
9
+ - The four presets tell the agent the **four steps** (bounded probe → write the absolute path into `paperLatexCommand` and re-detect → ask the user once → otherwise degrade as before) and the **three hard boundaries** (never auto-install, never write outside the workspace, never treat "not detected" as a failure).
10
+ - Paper metadata records `triedPaths`: which paths this detection actually probed (on success and on failure).
11
+ - A "host refused to interrupt" failure now carries an executable next step and is covered by a regression guard.
12
+ - People who run the test suites themselves get a steadier gate: lower default concurrency, stale test scratch directories swept at start-up, the roomier drive preferred for temp files, and a read-only warning when a leftover process is suspected.
13
+ - Repository line endings are unified on LF: from this version on, the npm package is **byte-reproducible** against the tag.
14
+
15
+ ## Added
16
+
17
+ - The paper compile metadata (`paper.meta.json`, `compile` section) gains **`triedPaths`** (array of strings: the union of candidate paths probed during this detection).
18
+ - All four presets gained a "missing engine guidance" block in their prompts (one canonical text, byte-identical across presets). v5 injects it as `paperHintBlock(lang)`.
19
+ - The interrupt tool's failure response gains `next: { kind: 'reason', tool: 'vibe_math_abort', hint }`, matching the other failure diagnostics.
20
+ - A shipped test utility, `scripts/clean-temp.mjs`: lists suspected leftover processes (`--ps`, read-only) and sweeps stale test scratch directories (`--dry-run` / `--age-hours=N`).
21
+
22
+ ## Changed
23
+
24
+ - **Explicit-engine semantics unified**: a non-empty `paperLatexCommand` is used **alone**; if it cannot be resolved then `compile.status = 'not-detected'` and only `paper.tex` and `paper.md` are delivered. v4/v5 used to append that command to the candidate list and **fall back to another engine** when it was unusable; they now match v2/v3 and the existing wording of `docs/final-paper.md`.
25
+ - **Wording of the missing-engine warning**: "未检测到 LaTeX 引擎(…):只产出 tex+md…**已探测 PATH 与文档化的常见 TeX 根;可用 `paperLatexCommand` 指定绝对路径。**"
26
+ - **Test-gate defaults** (affects only people running the suites): default concurrency `min(4, cpus)` → **`min(2, cpus)`**; at start-up, scratch directories older than 6 hours whose name prefix comes from the suites themselves are swept; the temp root prefers `D:\_tmp` (falling back without error when unavailable); a suspected leftover process produces a **read-only** warning and is never terminated automatically. Override with `--concurrency=N`, `--no-temp-hygiene`, `--temp-dry-run`.
27
+ - The repository gained `.gitattributes`: text files are always LF (binaries marked explicitly). Previously the working tree mixed CRLF and LF while `npm pack` reads the working tree, so the package could contain CRLF.
28
+
29
+ ## Fixed
30
+
31
+ - Symptom: setting `paperLatexCommand` to a **non-existent path** still produced a PDF compiled by another engine on the system (users believed the pinned engine was used). It now degrades as "not detected" with an actionable warning. Guards: `tests/v4-final-paper.test.mjs`, `tests/e2e-v5-round2.test.mjs`.
32
+ - Symptom: when no engine was detected, the run only said "not detected" and the user could not tell **where it had looked**. `triedPaths` now records the paths actually probed and the warning states the scope. Guards: `tests/v2-fix-probes.test.mjs`, `tests/v3-fix-probes.test.mjs`, `tests/v4-final-paper.test.mjs`, `tests/e2e-v5-round2.test.mjs`.
33
+ - Symptom: the "missing engine" guidance was absent or inconsistent across the four presets. All four now carry the same canonical text, with a byte-identity check. Guard: `tests/audit-prompt-invariants.mjs` (invariant I15).
34
+ - Regression coverage strengthened (**behaviour unchanged**): the "host refused to interrupt" failure path is now guarded (`VIBE_MATH_INTERRUPT_FAILED` + `next.tool = 'vibe_math_abort'`). Guards: `tests/v2v3-interrupt.mutants.mjs` plus the corresponding assertions in the two math suites.
35
+ - Test-infrastructure fix: a suite killed by a timeout cannot clean up after itself, so scratch directories accumulated for weeks (measured: 240k entries at the temp root). The gate now sweeps stale ones at start-up. Guards: `scripts/clean-temp.mjs --self-test`, `tests/temp-hygiene.mutants.mjs`.
36
+ - Test-timing fix: a few suites ended before the event they assert on when the gate ran jobs in parallel (green standalone, intermittently red in the gate). Those loops now stop on a wall-clock deadline, wait windows have a floor, and per-suite budgets are set from measurements. Guards: `tests/run-tests.mutants.mjs` (5/5) and the suites' own assertions.
37
+
38
+ ## Compatibility & Migration
39
+
40
+ - Breaking changes: **none**. Parameter names and defaults and the directory layout are unchanged; `triedPaths` is additive and older `paper.meta.json` files remain readable.
41
+ - Behaviour to note: if you previously pointed `paperLatexCommand` at a value that does not resolve and relied on the **fallback** to a working engine, this version degrades as "not detected" instead. That is the correction that matches `docs/final-paper.md`. Leave the parameter empty to get automatic detection.
42
+ - Migration: none needed.
43
+ - The DSH support window is unchanged (see `engines.dsh` in `package.json`).
44
+
45
+ ## Known Limitations
46
+
47
+ - **TeX installed in a non-standard location is still not auto-discovered**: the default probe covers PATH and the documented common install roots. If yours lives elsewhere (for example a TeX Live tree at a custom directory under a drive root), set an absolute path in `paperLatexCommand`; on this machine the default probe does not find it.
48
+ - The shipped suites **do not cover host-level behaviour**: "the caller is dropped after an interrupt" can only be observed on a real host and is not asserted in-repo.
49
+ - One known small wart in v4: the finalisation note for "not detected / compile failed" can be empty (the note is assembled before the compile result is known). It does not affect finalisation or the degrade path, and it is recorded for a fix.
50
+ - On machines without Lean / LaTeX, the related suites **skip loudly** rather than passing silently.
51
+ - This version did not re-run a full research workflow on a real host; the engine-probe surface was exercised in both "engine present" and "engine absent" states.
52
+
53
+ ## Verification
54
+
55
+ - `node tests/run-tests.mjs` — all green (**105** items: 44 suites + 61 probes).
56
+ - `node scripts/update-doc-counts.mjs --check` — exits 0 (documented derived counts match the repository).
57
+ - Cross-preset prompt identity: `node tests/audit-prompt-invariants.mjs` (invariant I15) and `node tests/audit-prompt-invariants.mjs --self-probe` (11/11).
58
+ - Explicit-engine semantics: `node tests/v4-final-paper.test.mjs`, `node tests/e2e-v5-round2.test.mjs`, and `node tests/v4-final-paper.mutants.mjs` (2/2 named reds).
59
+ - Interrupt-failure diagnostics: `node tests/v2v3-interrupt.mutants.mjs` (2/2 named reds).
60
+ - Test-environment guards: `node scripts/clean-temp.mjs --self-test`, `node tests/temp-hygiene.mutants.mjs` (4/4 named reds).
61
+ - Packaging consistency: the `npm pack --dry-run` listing matches `package.json#files` (declared but missing = 0), and the packaged text files use LF throughout.
62
+
63
+ ## Dependencies
64
+
65
+ - No new runtime dependencies; the DSH support window is unchanged.
@@ -0,0 +1,65 @@
1
+ # dsh-vibe-math 2.8.0 — 发布说明
2
+
3
+ > 上一版本:2.7.3。本版是**功能版**:四套预设新增「检测不到 LaTeX 引擎时怎么办」的明确指引,并修正显式指定引擎的回退语义(此前 v4/v5 会静默改用另一个引擎)。四套预设的参数名与默认值、目录结构**未变**,数据格式**仅新增一个字段**,DSH 支撑窗口不变,**无需迁移**。
4
+
5
+ ## 概述
6
+
7
+ - 显式 `paperLatexCommand` 现在是「**指定即只用它**」:解析不到就按「未检测到」降级,不再悄悄改用别的引擎;四套预设与文档口径完全一致。
8
+ - 检测不到引擎时的具名警告变得**可行动**:说明已探测 PATH 与文档化的常见 TeX 根,并给出指定绝对路径的方法。
9
+ - 四套预设的提示词明确告诉代理**四步做法**(有界自查 → 把绝对路径写入 `paperLatexCommand` 并重测 → 问用户一次 → 否则照旧降级)与**三条硬边界**(不自动安装、不写工作区之外、不把「未检测到」当失败)。
10
+ - 论文元数据新增 `triedPaths`:记录本次检测**实际探测过哪些路径**(成功与失败都记录)。
11
+ - 「宿主拒绝中断」的错误带上可执行的下一步,并纳入回归防护。
12
+ - 自行运行测试套件的人会看到更稳的门禁:默认并发降低、启动时自动清扫陈旧的测试临时目录、临时根优先使用更宽裕的盘、发现疑似遗留进程时只读告警。
13
+ - 仓库行尾统一为 LF:从本版起 npm 包内容与标签**逐字节可复现**。
14
+
15
+ ## 新增
16
+
17
+ - 论文编译元数据 `paper.meta.json` 的 `compile` 段新增 **`triedPaths`**(字符串数组,本次检测过程中探测过的候选路径并集)。
18
+ - 四套预设的提示词新增「引擎缺失指引」块(同一段规范文本,逐字一致)。v5 以 `paperHintBlock(lang)` 注入成员提示词。
19
+ - 中断工具失败响应新增 `next: { kind: 'reason', tool: 'vibe_math_abort', hint }`,与其它失败诊断同形。
20
+ - 随包测试工具 `scripts/clean-temp.mjs`:列出疑似遗留进程(`--ps`,只读)与清扫陈旧测试临时目录(`--dry-run` / `--age-hours=N`)。
21
+
22
+ ## 变更
23
+
24
+ - **显式引擎语义统一**:`paperLatexCommand` 非空时**只用它**;解析不到 ⇒ `compile.status = 'not-detected'`,只交付 `paper.tex` 与 `paper.md`。v4/v5 此前会把该命令并入候选表,在它不可用时**回落到别的引擎**,现与 v2/v3 以及 `docs/final-paper.md` 的既有口径一致。
25
+ - **未检测到引擎的警告文案**:「未检测到 LaTeX 引擎(…):只产出 tex+md…**已探测 PATH 与文档化的常见 TeX 根;可用 `paperLatexCommand` 指定绝对路径。**」
26
+ - **测试门禁的默认值**(仅影响自行运行套件的人):默认并发 `min(4, cpus)` → **`min(2, cpus)`**;启动时清扫 `mtime` 早于 6 小时、且前缀取自套件自身的陈旧临时目录;临时根优先指向 `D:\_tmp`(不可用时回退,不报错);发现疑似遗留进程时**只读告警**,绝不自动结束进程。可用 `--concurrency=N`、`--no-temp-hygiene`、`--temp-dry-run` 等开关覆盖。
27
+ - 仓库新增 `.gitattributes`:文本文件一律 LF(二进制显式标记)。此前工作区 CRLF/LF 混合,而 `npm pack` 读工作区,包内可能出现 CRLF。
28
+
29
+ ## 修复
30
+
31
+ - 症状:把 `paperLatexCommand` 设成一个**不存在的路径**,v4/v5 仍会用系统里另一个引擎编译出 PDF(用户以为指定的引擎生效了)。现在按「未检测到」降级,并给出可行动警告。守卫:`tests/v4-final-paper.test.mjs`、`tests/e2e-v5-round2.test.mjs`。
32
+ - 症状:检测不到引擎时只报「未检测到」,用户不知道**找过哪里**。现在 `triedPaths` 记录实际探测路径,警告说明探测范围。守卫:`tests/v2-fix-probes.test.mjs`、`tests/v3-fix-probes.test.mjs`、`tests/v4-final-paper.test.mjs`、`tests/e2e-v5-round2.test.mjs`。
33
+ - 症状:四套预设的「引擎缺失」指引缺失或彼此不一致。现在四套都有同一段规范文本,并有逐字一致性检查。守卫:`tests/audit-prompt-invariants.mjs`(不变量 I15)。
34
+ - 回归防护补强(**行为未变**):把「宿主拒绝中断」这条失败路径纳入守卫(`VIBE_MATH_INTERRUPT_FAILED` + `next.tool = 'vibe_math_abort'`)。守卫:`tests/v2v3-interrupt.mutants.mjs` 与两个数学套件的对应断言。
35
+ - 测试基础设施修复:套件被超时终止时无法自清,导致临时目录长期累积(实测顶层曾达 24 万项)。现在每次门禁启动自动清扫陈旧目录。守卫:`scripts/clean-temp.mjs --self-test`、`tests/temp-hygiene.mutants.mjs`。
36
+ - 测试时序修复:个别套件在并行负载下会在「所等事件发生之前」结束(单跑全绿、门禁偶发红)。现在相关循环以墙钟截止、等待窗口设有下限,并有按实测定值的超时预算。守卫:`tests/run-tests.mutants.mjs`(5/5)及上述套件自身的断言。
37
+
38
+ ## 兼容性与迁移
39
+
40
+ - 破坏性变更:**无**。参数名与默认值、目录结构未变;`triedPaths` 是纯新增字段,旧 `paper.meta.json` 仍可读。
41
+ - 需要注意的行为变化:若你此前**故意**把 `paperLatexCommand` 指向不可用的值并依赖「回落到可用引擎」,本版会改为按「未检测到」降级——这是与 `docs/final-paper.md` 一致的修正。想要自动选择引擎,请把该参数留空。
42
+ - 迁移:无需迁移。
43
+ - DSH 支撑窗口不变(见 `package.json` 的 `engines.dsh`)。
44
+
45
+ ## 已知限制
46
+
47
+ - **非标准位置的 TeX 仍不会被自动发现**:默认探测只覆盖 PATH 与文档化的常见安装根。装在其它的目录(例如把 TeX Live 装在盘符根下的自定义目录)请用 `paperLatexCommand` 指定绝对路径;本机实测非标准位置默认探测不到。
48
+ - 随包套件**不覆盖宿主层行为**:「中断后调用方被丢弃」这类行为需要真机才能观察,未纳入随包断言。
49
+ - v4 的收尾备注存在一个已知小问题:最终文稿的「未检测到/编译失败」备注字段可能为空(备注在编译结果确定之前组装)。不影响定稿与降级行为,已记录待修。
50
+ - 缺少 Lean / LaTeX 等引擎的机器上,相关套件会**响亮跳过**,不会静默通过。
51
+ - 本版未在真机重跑完整研究流程;引擎探测面覆盖「有引擎」与「无引擎」两种情形。
52
+
53
+ ## 验证方式
54
+
55
+ - `node tests/run-tests.mjs` —— 全部通过(**105** 项:44 套件 + 61 探针)。
56
+ - `node scripts/update-doc-counts.mjs --check` —— 退出 0(文档派生计数与仓库一致)。
57
+ - 跨预设提示词逐字一致:`node tests/audit-prompt-invariants.mjs`(不变量 I15)与 `node tests/audit-prompt-invariants.mjs --self-probe`(11/11)。
58
+ - 显式引擎语义:`node tests/v4-final-paper.test.mjs`、`node tests/e2e-v5-round2.test.mjs`,以及 `node tests/v4-final-paper.mutants.mjs`(2/2 具名红)。
59
+ - 中断失败诊断:`node tests/v2v3-interrupt.mutants.mjs`(2/2 具名红)。
60
+ - 测试环境卫兵:`node scripts/clean-temp.mjs --self-test`、`node tests/temp-hygiene.mutants.mjs`(4/4 具名红)。
61
+ - 打包一致性:`npm pack --dry-run` 的清单与 `package.json#files` 一致(声明了但缺失 = 0),且包内文本行尾统一为 LF。
62
+
63
+ ## 依赖
64
+
65
+ - 无新增运行时依赖;DSH 支撑窗口不变。
@@ -0,0 +1,103 @@
1
+ # 发布手册:从版本一致性到 npm 与 GitHub Release
2
+
3
+ > 本文件记录**实际执行过**的发布流程(以 2.7.3 为例),供下一次发布照做。
4
+ > 面向读者:维护者。命令都可直接复制;标注"需核对"的地方不要跳。
5
+ > 权威守卫:`tests/audit-market-metadata.test.mjs`(市场元数据与随包清单)。
6
+
7
+ ## 0. 发布前的一次性判断
8
+
9
+ 先确定**版本类型**(补丁 / 功能)与**版本号**,再动任何文件。定了就不再改——版本一致性检查遍布多处,中途改号会到处漏。
10
+
11
+ ## 1. 版本一致性:三处必须同时改
12
+
13
+ | 位置 | 字段 | 检查者 |
14
+ |---|---|---|
15
+ | `package.json` | `version` | 全部守卫的基准 |
16
+ | `package-lock.json` | **顶层 `version`** 与 **`packages[""].version`** | `tests/audit-market-metadata.test.mjs` 断言顶层与 `package.json` 一致(历史上曾漂移) |
17
+ | 发布说明 | `docs/release-notes/RELEASE-NOTES-<版本>.md` 与 `.en.md` | 市场守卫断言"覆盖当前版本(两种语言)" |
18
+
19
+ ```bash
20
+ node -e "const p=require('./package.json'),l=require('./package-lock.json');console.log(p.version,l.version,l.packages[''].version)"
21
+ ```
22
+
23
+ - **两份发布说明都必须写**,且**都要登记**在 `package.json#files`(守卫会检查"当前版本的两份都在清单里")。
24
+ - 发布说明结构由 `docs/release-notes/TEMPLATE.md` 规定:**10 个章节、中英同序**,无内容的章节保留标题写 `无。` / `None.`;每条修复/变更要点名**钉住它的守卫**。
25
+
26
+ ## 2. 清单与市场字段
27
+
28
+ - `package.json#files`:新增的随包文件(**包括**两份发布说明与新文档)都要登记;发布后要用 tarball 复核"声明了但缺失 = 0"。
29
+ - `dsh.compatNote`:**用户可见的清单文本**,必须提到**当前版本号**(历史上曾在改版本后仍描述上一版)。
30
+ - 以下字段**只应保持"已验证范围"**,发布时不要顺手改:
31
+ - `engines.dsh`(顶层,市场读它)与 `dsh.engines.dsh`(生态形状)——两者必须**逐字一致**;
32
+ - 每个 `@deepseek-ai/*` 的 `peerDependencies`:与 `engines.dsh` **同范围**,且 `peerDependenciesMeta` 里标记为 **optional**;
33
+ - `dsh.compatibility` 里标为 `compatible` 的每个版本都必须被 `engines.dsh` 的链**覆盖**;
34
+ - `screenshots.json` 与 README 里的图片引用(市场读取仓库里的 `screenshots.json`,**不从 npm 读**;README 不得指向已不存在的图)。
35
+ - 若某次发布确实要动兼容范围,先改**单一来源**再让两条声明一致,并同步更新市场数据。
36
+
37
+ ## 3. 提交前:门禁与派生计数
38
+
39
+ ```bash
40
+ node tests/run-tests.mjs # 必须全绿:TOTAL <n> PASS <n> FAIL 0
41
+ node scripts/update-doc-counts.mjs # 让文档里的派生计数收敛
42
+ node scripts/update-doc-counts.mjs --check # 退出 0 = 已收敛
43
+ ```
44
+
45
+ - 任何**新增作业**(新套件/新变异族/新 `--self-probe` 变体)都会改变派生计数:先跑 updater,再跑门禁,否则文档计数守卫会按设计变红。
46
+ - **派生工件随源改动一起提交**:改了预设源/规范后,`cordis.patch.yml` 与随包语料等派生文件必须在**同一个提交**里重新生成(生成器脚本以仓库为准),不要拆成两个提交。
47
+ - 改动了文档/计数后**再跑一次** `--check`,确保最后一次改动也收敛。
48
+
49
+ ## 4. 提交、打标签、推送
50
+
51
+ ```bash
52
+ git add <path-exact 文件...> # 逐路径精确暂存,避免带入无关改动
53
+ git commit -m "<版本号>:<一句话要点>"
54
+ git tag -a v<版本> -m "<版本> <要点>" # 注解标签
55
+ git push origin <branch> --follow-tags
56
+ ```
57
+
58
+ - 提交信息写**用户可见的变化**,不要写内部工作词汇。
59
+ - 打标签前确认工作区干净、门禁刚跑过且全绿。
60
+
61
+ ## 5. 发布到 npm
62
+
63
+ ```bash
64
+ npm publish # 按 package.json 的 version 发布
65
+ ```
66
+
67
+ - **`gh release create` 是独立的一步**,不是 `npm publish` 的一部分:
68
+
69
+ ```bash
70
+ gh release create v<版本> --title "v<版本>" --latest --verify-tag \
71
+ --notes-file <双语说明或生成的双语文档>
72
+ ```
73
+
74
+ - `--verify-tag`:标签不存在就拒绝,避免对着错误的提交发版。
75
+ - `--latest`:标记为最新发布。
76
+
77
+ ## 6. 发布后核对(必做)
78
+
79
+ ```bash
80
+ npm view dsh-vibe-math version dist-tags.latest dist.shasum
81
+ npm pack --dry-run # 或 npm pack 后解开,核对清单
82
+ ```
83
+
84
+ 逐项确认:
85
+
86
+ 1. **registry** 上的 `version` 与 `dist-tags.latest` 都是本次版本,`dist.shasum` 与本地 tarball 一致;
87
+ 2. **tarball 内容 vs `package.json#files`**:声明了但缺失的文件数为 **0**;
88
+ 3. 两份发布说明(中/英)**都在 tarball 里**;
89
+ 4. 只应在仓库里存在的守卫/开发文件**不在** tarball 里;
90
+ 5. 全新安装冒烟:在一个空目录里装该 tarball/从 registry 装,确认插件可被宿主加载;
91
+ 6. **npm 传播延迟**:刚发布后 registry 可能短暂读到旧元数据,等一会儿重查,不要据此判定失败。
92
+
93
+ ## 7. 已知陷阱(都真实遇到)
94
+
95
+ - **`gh` 的 JSON 输出没有 `isLatest` 字段**(本机 `gh` 版本):判断"是否为最新发布"要看 **`--latest` 是否被接受**或直接看 Release 页面,别去解析不存在的字段。
96
+ - **`core.autocrlf=true`**:会让某个随包文件在 tarball 里以 **CRLF** 出现(内容等价、字节不同)。若要求 tarball **逐字节可复现**,在下次发布前加 `.gitattributes` 固定行尾(例如 `* text=auto eol=lf` 并对二进制显式 `-text`),并在发布后按第 6 节重新核对 shasum。
97
+ - **发布说明里的历史数字不要改**:冻结的历史发布说明是记录,**不得**为了"看起来一致"去改写(live 文档的计数扫描会**按名豁免**它们)。
98
+ - **别在发布提交里顺手改版本范围**:`engines.dsh` / peer / `screenshots.json` 的变动会改变市场兼容判定,应作为独立、可复核的改动。
99
+
100
+ ## 8. 回滚与补救
101
+
102
+ - 已发布版本**不要**覆盖重发同名版本;发现问题就发**下一个补丁版**,并在发布说明里写清影响与修复。
103
+ - 若标签/Release 打错:删 Release 与标签后重打(`gh release delete` / `git push --delete origin <tag>`),**不要**移动已发布的语义。