dsh-vibe-math 2.7.0 → 2.7.2

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 (55) hide show
  1. package/README.en.md +681 -685
  2. package/README.md +9 -13
  3. package/cordis.patch.yml +12 -6
  4. package/docs/AUDIT-CHECKLIST.md +518 -518
  5. package/docs/COMPAT-AUDIT-ROUND3.md +154 -154
  6. package/docs/final-paper.md +172 -172
  7. package/docs/formal-verification.md +588 -588
  8. package/docs/math-computation.md +187 -121
  9. package/docs/release-notes/README.en.md +48 -0
  10. package/docs/release-notes/README.md +47 -0
  11. package/docs/release-notes/RELEASE-NOTES-2.7.1.en.md +86 -0
  12. package/docs/release-notes/RELEASE-NOTES-2.7.1.md +86 -0
  13. package/docs/release-notes/RELEASE-NOTES-2.7.2.en.md +72 -0
  14. package/docs/release-notes/RELEASE-NOTES-2.7.2.md +72 -0
  15. package/docs/release-notes/TEMPLATE.md +120 -0
  16. package/docs/test-timing.md +154 -154
  17. package/package.json +208 -201
  18. package/prompt-corpus-persona/persona-corpus.json +8 -8
  19. package/prompt-corpus-persona/persona-corpus.md +24 -12
  20. package/prompt-corpus-v2/formal-verify-v2.json +176 -98
  21. package/prompt-corpus-v2/formal-verify-v2.md +1161 -96
  22. package/prompt-corpus-v3/formal-verify-v3.json +201 -63
  23. package/prompt-corpus-v3/formal-verify-v3.md +1401 -57
  24. package/prompt-corpus-v4/formal-verify-v4.json +10 -10
  25. package/prompt-corpus-v4/formal-verify-v4.md +40 -20
  26. package/prompt-corpus-v5/prompt-corpus-v5.json +81 -81
  27. package/prompt-corpus-v5/prompt-corpus-v5.md +199 -128
  28. package/tests/audit-math-computation-contract.mjs +56 -1
  29. package/tests/audit-math-computation-parity.mjs +30 -1
  30. package/tests/audit-math-computation-sensitivity.mjs +2 -2
  31. package/tests/audit-v5-sensitivity.mjs +3 -1
  32. package/tests/e2e-v5-round2.test.mjs +116 -0
  33. package/tests/formal-verify-v2.test.mjs +108 -2
  34. package/tests/formal-verify-v3.test.mjs +117 -2
  35. package/tests/formal-verify-v4.test.mjs +87 -0
  36. package/tests/helpers/math-computation-fake-seam.mjs +30 -2
  37. package/tests/math-computation-shared.test.mjs +430 -3
  38. package/vibe-math-v2/agent.cordis.yml +4 -2
  39. package/vibe-math-v2/math-computation.js +509 -55
  40. package/vibe-math-v2/math-engines.js +47 -6
  41. package/vibe-math-v2/vibe-math-v2.js +92 -12
  42. package/vibe-math-v3/agent.cordis.yml +4 -2
  43. package/vibe-math-v3/math-computation.js +509 -55
  44. package/vibe-math-v3/math-engines.js +47 -6
  45. package/vibe-math-v3/vibe-math-v3.js +77 -14
  46. package/vibe-math-v4/agent.cordis.yml +8 -4
  47. package/vibe-math-v4/math-computation.js +509 -55
  48. package/vibe-math-v4/math-engines.js +47 -6
  49. package/vibe-math-v4/vibe-math-v4.js +70 -15
  50. package/vibe-math-v5/agent.cordis.yml +8 -4
  51. package/vibe-math-v5/math-computation.js +509 -55
  52. package/vibe-math-v5/math-engines.js +47 -6
  53. package/vibe-math-v5/vibe-math-v5.js +152 -31
  54. package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +1660 -1655
  55. package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +693 -693
@@ -0,0 +1,86 @@
1
+ # dsh-vibe-math 2.7.1 — 发布说明(中文)
2
+
3
+ > 上一版:2.7.0。本版是**补丁版**,两批改动一起发。**第一批(诚实性与安装口径)**:替代方案若改变精确性或结论强度必须声明;python 安装按**检测到的环境**分派 conda/mamba/uv/pip;R/Octave/Julia 的系统级作用域拒绝给出**每引擎理由**;**版本求解交给包管理器**,本工具只查存在。**第二批(首次真机端到端跑出来的七个缺陷)**:`probe` 回显请求的引擎、引擎发现新增 **DSH 自带运行时**、`cli` 逃生口的包预检改用它自己那个解释器、`mode:'code'` **真的把脚本传进去**(调用方 argv 自带程序槽时以调用方为准)、版本报真值、探针 argv 不含 shell 元字符、探测不再依赖项目目录已存在。既有参数默认值、数据格式与目录结构**未变**,DSH 支撑窗口不变,无需迁移。
4
+
5
+ ---
6
+
7
+ ## 概览
8
+
9
+ - **替代必须声明**:新规则行(中/英)说明"替代方案改变精确性/结论强度时必须写明",进入四套预设的**两个 persona 文本块**、规则段与工具描述;缺引擎/缺包时明确给**替代方案或安装计划**,安装一律 `plan → planToken → confirm`。
10
+ - **python 包管理器分派**:`conda` / `mamba`(`-y -c conda-forge`)/ `uv`(`uv pip …`)/ **pip 回退**(`-m pip install --user`);按解释器**自身环境**检测,不猜;歧义时回退 pip 并在计划/消息/审计里标明**假设**。
11
+ - **系统级作用域有理由**:`system` 仍返回 `MATH_REFUSED` + `next.reason:'system-scope-unsupported'`,但消息现在说明**每个引擎为什么**(R→`R_LIBS_USER`、Octave→`share/packages`、Julia→`JULIA_DEPOT_PATH`,conda/mamba/uv 各自理由)。
12
+ - **版本约束口径**:接受 `名称` / `名称[extras]` / `名称<op>版本`;其余写法显式拒绝(新 reason `unsupported-version-syntax`)。**版本求解是包管理器的事**,本工具只按 base name 查存在、把规格原样透传。
13
+ - 随功能修掉一个真机缺陷:安装路径此前按**引擎名**解析解释器(`python`)而不是候选顺序(`python3`→`python`→`py`),会让 conda 检测在真机上失效。
14
+
15
+ ## 变更
16
+
17
+ ### 1. 替代方案的诚实性
18
+
19
+ - **规则**:当替代方案改变了**精确性或结论强度**时——精确符号解 → 数值近似、闭式解 → 采样/求积、改了精度/容差/假设、换了算法类——结论里**必须写明**,不得读起来像得到了原本(精确/所要求的)结果;拿不到精确结果就直说。
20
+ - **落点**(中/英各一条常量):`MATH_SUBSTITUTION_RULE_LINE` / `MATH_SUBSTITUTION_RULE_LINE_EN`,已并入 `MATH_RULE_LINES`/`_EN`(因此 `mathAvailabilityLine()` 自动携带),工具描述也加了同义句;**四套预设的两个 persona 文本块都逐字追加**(追加,不替换既有规则行)。
21
+ - **缺引擎/缺包**:仍然只报告,并明确给**用户自装指引**或**代理代装计划**;**安装一律先出计划、再由 `planToken` 确认**(token 绑定计划内容,内容变了即失效),默认 user 作用域,`system` 每次显式且不被记住。
22
+
23
+ ### 2. Python 包管理器分派
24
+
25
+ `python` 的安装计划按**解释器自身环境**选择管理器,而不是固定 pip:
26
+
27
+ | 检测到的环境 | 计划里的命令 | 依据 |
28
+ |---|---|---|
29
+ | 解释器路径含 conda 标记(`/envs/`、`/conda`、`/miniconda*`、`/anaconda*`、`/mambaforge`、`/miniforge`)且 `conda` 可解析 | `conda install -y -c conda-forge <pkg>`(卸载 `conda remove -y <pkg>`) | 路径标记 + 可解析确认 |
30
+ | 同上但只有 `mamba` | `mamba install -y -c conda-forge <pkg>`(卸载 `mamba remove -y <pkg>`) | 同上 |
31
+ | `uv` 与解释器**同目录**(uv 管理的 venv) | `uv pip install <pkg>`(卸载 `uv pip uninstall <pkg>`) | 同目录才算 |
32
+ | 其它 | `python -m pip install --user <pkg>`(卸载 `python -m pip uninstall -y <pkg>`) | **文档化回退**,计划标 `managerAssumed` |
33
+
34
+ - **检测,不猜**:计划、返回消息与审计 JSON 都带 `manager` / `managerAssumed` / `managerWhy`;歧义时回退 pip 并明说"计划假设用 pip"。
35
+ - **install 与 uninstall 成对**:卸载命令来自同一个被选中的管理器(审计里带卸载模板;仍**没有**通用自动回滚)。
36
+ - **顺手修掉的真实缺陷**:安装路径此前用**引擎名**(`python`)解析解释器,而不是描述符的**候选顺序**(`python3`→`python`→`py`)——真机上 conda 的 `python3` 才是那个解释器,所以分派会看不到环境标记。现在与运行路径一致,按候选依次解析。
37
+
38
+ ### 3. 每引擎系统级作用域策略
39
+
40
+ - R / Octave / Julia **只做用户级**,`scope:'system'` 返回 `MATH_REFUSED` + `next.reason:'system-scope-unsupported'`,消息里给出**该引擎的理由**:
41
+ - **R**:用户库是 `R_LIBS_USER`;系统级要写发行版包目录(需 root 或发行版包管理器)。
42
+ - **Octave**:`pkg install` 装进用户包目录;系统级要写 Octave 的 `share/packages`(需 root)。
43
+ - **Julia**:`Pkg.add` 装进当前活动环境 / 用户 depot(`JULIA_DEPOT_PATH`);"系统级"不是 Julia 的概念。
44
+ - **conda / mamba / uv** 同样没有系统模板,各自带理由;**python 走 pip 时仍保留真实的系统模板**(不带 `--user`),由每次调用显式确认。
45
+
46
+ ### 4. 版本约束口径
47
+
48
+ - **接受的写法**:`名称`、`名称[extras]`、`名称<op>版本`,其中 `<op>` ∈ `==` `>=` `<=` `~=` `!=` `>` `<` `=`(pip 风格的 `numpy==1.2`、conda 风格的 `numpy=1.2`)。
49
+ - **拒绝的写法**:空格、`;`、`|`、`&`、`$`、反引号、`@`、括号等 shell 危险或管理器不认识的语法 ⇒ `MATH_INVALID_ARGUMENT` + `next.reason:'unsupported-version-syntax'`(**不会**把可疑字符串丢给 shell)。
50
+ - **分工**:**版本求解交给包管理器**——本工具只按 **base name** 探测与报缺,安装计划把规格**原样透传**,并在计划里带 `versionPolicy` 说明这一点。
51
+ - **词汇表**:`unsupported-version-syntax` 是新增的机读 reason;词汇表现共 **13 reason / 7 `next.kind` / 11 失败码**,在 `tool-schema.json#refusalVocabulary`、`docs/math-computation.md` §3 与 parity 守卫之间保持**集合相等**(守卫还要求每个 `reason:` 取值都是字符串字面量)。
52
+
53
+ ### 5. 真机缺陷修复(一条根因、三个症状)
54
+
55
+ 1. **`op:'probe'` 忽略请求的引擎**:响应里 `engine` 是 `null`(或"第一个允许的引擎"),失败路径总是指责 `params.mathEngines[0]`(python),于是 `probe{engine:'r'}` 回显 python 并让用户去装 python。现在解析并报告**请求的**引擎(名字/路径/版本);被请求且解析成功的引擎(包括 `cli`)也算可用,请求的引擎缺失时错误与指引都指向它。
56
+ 2. **引擎发现漏掉 DSH 自带的运行时**:PATH 仍然优先;都没有时,若宿主声明了可选字段 `runtimeRoots` + `listDirAbs`,最后扫描 `<root>/dsh-runtimes/*/dependencies/<engine>/`——**树名通配**(从不写死 `dsh-primary-runtime`),且只接受描述符自己的候选名。找到的引擎会报**真实版本**,并且**不再给安装指引**(对已装的引擎给 winget 提示正是误导的来源)。
57
+ 3. **`cli` 包预检忽略 `cli.command`**:通用 `cli` 描述符没有包探测,于是所有包看起来都缺、逃生口把自己堵死。现在按解析出的命令的**族**(`python*`/`Rscript`/`octave`/`julia`)用**那个解释器**探测;族不可识别时**跳过**预检并给出明确警告,而不是误报"缺包"。
58
+ 4. **`mode:'code'` 从不传脚本**:`cli` 只拿到命令,于是 python 掉进 REPL(`exit=0`、stdout 空——读起来像成功)。现在 `mode:'code'`/`'file'` 会把归档脚本路径追加到 argv;**若调用方 argv 自带程序槽(`-c`/`-m`/`-e`/`--eval`/`--command`)则以调用方为准、不追加**(否则脚本会被当成多余参数)。回执记录 `cli.scriptAppended`,跳过时记录 `cli.scriptSkipped` 及原因。
59
+ 5. **`engine.version` 是 `"unknown"`**:`cli` 现在用族描述符的**真实版本探测**取版本(族不可识别时仍是 `"unknown"`)。
60
+ 6. **探针 argv 含 shell 元字符**:真实宿主对含 `|`(以及 `%`)的 argv 会返回**空 spawn**。所有探针代码改为不含元字符(每包一行 `名称 ok|missing`),解析器同时接受旧的 `名称:状态` 与新形态;python 仍是**每包一个 argv 项**。
61
+ 7. **根因:探测的 cwd 在全新工作区不存在**。版本探测、包预检与许可探测用 `projectRoot()` 作 cwd,而全新会话里该目录还不存在,宿主对这种 spawn 返回 `spawned:true, exit:null`(**重试无用**:同 cwd 同结果)。这一条同时造成了"找到了却不可用"、误报"缺包"与 `version:"unknown"`。现在探测走**一定存在**的 cwd(`probeCwd`:可选宿主字段 → OS 临时目录 → 项目根);真正的 `run` 仍用项目根——它本来就会先写回执,写盘会创建目录树。
62
+
63
+ ### 6. 新增两条永久守卫
64
+
65
+ - **§20 响应必须可 JSON 序列化**:诊断对象曾出现自引用的 `retryDiag`,导致 `JSON.stringify(response)` 抛 `Converting circular structure to JSON`,调用方**看不到任何结果**。现在诊断经 `jsonSafeDiag` 投影成纯字段,共享套件断言 **13 种响应**(`probe`/`run`/`receipt`/`install`,成功与失败,含重试后失败的 `retryDiag` 场景)都能序列化。
66
+ - **§21 fresh-root 仿真**:假 seam 模拟宿主("cwd 不存在 ⇒ `exit:null`",且 `writeText` 标记目录已创建),断言全新根上 `probe` 仍 `ok:true` 且版本是真值、没有任何探测报 `exit:null`、包预检照常运行。
67
+
68
+ ### 7. 审查与验证
69
+
70
+ - **同一套纪律**:共享模块四份**字节一致**(`install-copies --check` ⇒ `COPIES OK`);`math-computation-shared` **278/0**、四套预设 **114/116/153/117**、`audit-math-computation-contract` **155/0**、`audit-math-computation-parity` **92/0**、`audit-math-computation-sensitivity` **22 探针 / 0 problems**、变异证明 **16 proved / 0 problems**(每一个都把**具名**断言打红);门禁 `TOTAL 65 PASS 65 FAIL 0`(**44 套件 + 21 探针**)。
71
+ - **真机证据(全新空工作区、第一个工具调用)**:`probe{engine:'python'}` ⇒ `ok:true`、版本 `3.12.14`、路径 `…/dsh-runtimes/dsh-primary-runtime/dependencies/python/python.exe`、无 `exit:null`;用 `cli` + 自带解释器 `run` 且 `packages:['numpy']` ⇒ `exit:0`、`stdout:"1.643935 -2.0"`(k=1..1000 的 Σ1/k² 与 det([[1,2],[3,4]]))、`packages.found.numpy:"present"`、`warnings:[]`、回执 6 个文件。
72
+ - **仍然成立的诚实边界**:引擎执行现在**已通过 `cli` 逃生口在 DSH 自带运行时上真机验证**(这是本项目唯一被证明的真实引擎路径——内置引擎仍只通过假 subprocess seam 覆盖);`session/follow` 的 token 级增量、多客户端与回合中 `cancel` **仍未验证**;宿主 `subprocess.spawn` **没有 policy 槽**,插件不能强制禁网/限权(需宿主 sandbox);Maple/MATLAB/Wolfram 的模板标 `VERIFY` 并提供 `mathEngineOverride`;**SageMath 属 P2**;两个对照实验只是 **run-book**,本说明**不含编造数字**。
73
+
74
+ ## 兼容性
75
+
76
+ - 既有参数默认值、数据格式与目录结构**未变**;新增的只是规则文本、安装计划的分派逻辑与一个机读 reason,**无需迁移**。
77
+ - **行为变化仅限安装计划**:没有 conda/uv 标记的机器仍走 pip(与上一版一致);**conda/mamba/uv 环境现在会得到该管理器的命令**(这正是本版目的),卸载命令同样来自该管理器。
78
+ - `system` 作用域的返回码与 `next.reason` **未变**(只是消息更有信息量);python+pip 的系统模板仍在。
79
+
80
+ ## 升级
81
+
82
+ - 直接升级即可,无需迁移。
83
+ - 若希望安装计划**总是用 pip**:在非 conda/uv 的解释器上运行(或指向系统 python);本工具不会"猜"管理器,只在解释器自身环境给出标记时才分派。
84
+ - **七个真机缺陷全部修复**(都来自首次真机端到端,且都在同一份字节上关闭):`probe` 对任何请求引擎都回显 `python`;DSH 自带运行时发现不到;`cli` 包预检忽略 `cli.command`;`mode:'code'` 从不传脚本;`engine.version` 是 `"unknown"`;探针 argv 含 `|`/`%`(真实宿主会以空 spawn 回应);探测用的 cwd 在**全新工作区还不存在**——**这一条是"找到了却不可用"和"误报缺包"的共同根因**。
85
+ - **新增两条永久守卫**:§20 **13 种响应必须可 JSON 序列化**的横切不变量;§21 **fresh-root 仿真**(cwd 不存在时宿主返回 `exit:null`)。
86
+
@@ -0,0 +1,72 @@
1
+ # dsh-vibe-math 2.7.2 — Release Notes (English)
2
+
3
+ > Previous release: 2.7.1. This is a **PATCH release that contains fixes and additive response fields only** — no existing behaviour contract changes. It completes **engine discovery, evidence and diagnostics** on real hosts: an engine that is installed but not on `PATH` is now found, install guidance never hands over a command that cannot run, and failure evidence (timeout, missing packages, unenforced constraints) is neither absent nor silent. The archive identity and the participant-set semantics are directly checkable. Parameter defaults, data formats and the directory layout are **unchanged**, the DSH support window is unchanged, and **no migration is needed**.
4
+
5
+ ## Overview
6
+
7
+ - **More reliable discovery on real hosts**: discovery now runs PATH → runtimes shipped by the host → **the known per-OS install locations**, so an engine installed in its default directory but never added to `PATH` (R, for example) is found.
8
+ - **No more unrunnable install commands**: `MATH_ENGINE_NOT_FOUND` only offers an executable command when that package manager really exists on this machine; otherwise it gives the suggested command, the official location and the reason.
9
+ - **`probe` no longer reports only the good news**: besides the engines that resolved, it names the **configured but not found** engines and why.
10
+ - **Complete failure evidence**: `MATH_TIMEOUT` carries the same fields as `MATH_NONZERO_EXIT`, and a timeout's partial output is available in **both the response and the receipt**.
11
+ - **The constraint policy is stated**: version constraints are **checked for existence only and never enforced**, and the constraints that were not checked are listed instead of being dropped silently.
12
+ - **Checkable archive identity**: the run response carries the archive id and attempt, and the "edit an archived script, then re-run" semantics are explained by an explicit field and warning.
13
+ - **One participant set per verify/meeting (v4/v5)**: the roster is snapshotted with a version, every view reads the same snapshot, and the version increments when the set really changes so a stale set is detectable.
14
+ - **More specific diagnostics**: member-level failures return a code, the current state and a next step instead of a bare "no such resident".
15
+
16
+ ## Added
17
+
18
+ - The `math_computation` `run` response now carries **`runId`** and **`attempt`** (previously the archive id existed only inside the receipt, so a caller could not verify "same archive").
19
+ - The `probe` response now carries **`configured`** (every engine enabled in the configuration) and **`absent[]`**, where each missing engine states **`why`** (`not-found-on-this-machine` or `needs-a-caller-supplied-command`).
20
+ - Constraint policy fields: both a successful response and a "missing packages" failure carry **`versionPolicy`** and **`constraintsNotEnforced`** (the constraints that were **not** checked, or an empty array).
21
+ - `MATH_TIMEOUT` responses carry **`stdout`**/**`stderr`** (capped); the receipt JSON carries **`partialStdout`**/**`partialStderr`**.
22
+ - `MATH_ENGINE_NOT_FOUND`'s `next` carries **`suggestedCommand`**, **`packageManager`**, **`packageManagerAvailable`** and **`note`** (plus `vendorUrl` where the engine has one).
23
+ - The `run` response carries **`fileIsArchivedScript`**, and emits an **`ARCHIVED_SCRIPT_RERUN`** warning when `mode:'file'` targets an archived script.
24
+ - v4: `status()` carries **`rosterVersion`** and **`frozenParticipants`**; the `consensus` / `meeting` / `verify` views carry their own `rosterVersion`.
25
+ - v4: the `paper` view carries **`dirProjected`** / **`dirSource`** / **`readSideEffect`**, saying whether the path is a projection or real state.
26
+ - v2/v3: decision and sub-agent interrupt diagnostics carry **`code`** and **`next`** (for example `VIBE_MATH_DECISION_NOT_FOUND`, with the current queue state); v4 member-level calls carry **`V4_NO_SUCH_RESIDENT`** with the current roster and a next step.
27
+
28
+ ## Changed
29
+
30
+ - **Discovery order**: PATH → runtimes shipped by the host → the known per-OS install locations (Windows `%ProgramFiles%`, `%ProgramFiles(x86)%`, `%LOCALAPPDATA%\Programs`; the macOS framework path; Linux `/usr/lib/R`, `/opt/R`, and similar). **Existence is always proven by listing a directory**, never assumed.
31
+ - **Install guidance**: `next.command` is an executable command only when the corresponding package manager resolves on this machine; otherwise it is empty and a `note` plus the official location is given. Installation is still plan → `planToken` confirmation → execution, with user scope by default.
32
+ - **The archive key**: `mode:'file'` is keyed by the **source path** and `mode:'code'`/`'expr'` by the script content. Editing the **same source file** and re-running therefore lands on the **same archive** (`attempt ≥ 2`, `scriptChanged:true`, `previousReceipt` pointing at the previous attempt, and the earlier attempt is never overwritten). Pointing at a **different path** (a copy of the archived script, say) writes a **new archive**, where `attempt:1`, `scriptChanged:false` and `previousReceipt:null` are **expected**. The archive id contains no random value.
33
+ - **v4 roster freeze and prune**: a verify/meeting freezes its participant set and records `rosterVersion`; **removing a member also prunes it from the frozen set** (otherwise in-flight votes could never close), **new members do not join a frozen set**, and `rosterVersion` increments whenever the set really changes. With no verify/meeting in progress, `status().frozenParticipants` is an explicit `null`.
34
+ - **v2/v3 single-source vote counting**: the per-round counts come from one function (`voteCount`, reading the **expectation recorded when the verify task was created** plus the round), so the four readers (enough votes, all reported, consensus, final verdict) no longer derive them separately — raising or lowering the verifier count can no longer make the views disagree. **Deliberately unchanged**: the `MIN_REVIEWERS` floor and the "everyone agrees" predicate. That combination — not a simplified predicate over the current round alone — is what decides when a verification may conclude; collapsing the two would let a single reviewer's verdict be accepted too early.
35
+ - **Documentation** now states the verification boundary, the known differences and the new response fields, including the engine versions verified on real hosts and the confirmed edge codes.
36
+
37
+ ## Fixed
38
+
39
+ - **Installed but invisible engines**: scanning only the host process's PATH reported an engine installed in its default directory (measured: R 4.6.1) as missing; it is now discovered from the known install locations and version-probed like any other candidate.
40
+ - **Unrunnable install commands**: the tool used to suggest a package manager that does not exist on the machine (for example `winget`); it now only offers the command when the manager resolves, and otherwise gives the official location plus an explanation.
41
+ - **Incomplete timeout evidence**: `MATH_TIMEOUT` previously lacked `exit` and `stderr`, and its partial output existed only in the on-disk `stdout.txt`; the response and the receipt now both carry the capped partial output, aligned with `MATH_NONZERO_EXIT`.
42
+ - **`probe` listing only what worked**: the availability line could show a few engines without explaining the rest of the configuration; it now names the **configured but not found** engines and why.
43
+ - **Version constraints silently ignored**: the response now states that constraints are existence-only and lists every constraint it did **not** check.
44
+ - **Confusing "edit an archived script, then re-run"**: an explicit field and warning now distinguish "targeting a copy of an archive ⇒ a new archive with no history" from "targeting the original source ⇒ the same archive with a new attempt", and state that an old receipt is not evidence for edited code.
45
+ - **A misleading `paper` field in v4**: with no paper state the field is a **projected path**; it is now flagged via `dirProjected`/`dirSource` and declares that reading `status` has no filesystem side effect.
46
+ - **Path basis in member-visible material**: all four presets now state that member file tools resolve against the **session cwd**, that the listed relative paths need the **absolute project-root prefix**, and that computation artifacts should be opened via the absolute `receipt.scriptAbs` or by joining `receipt.cwd` with `receipt.scriptPath`.
47
+ - **Member-level calls answering only "not found"**: v4 now returns an error code, the current roster and a next step; v2/v3 decision and interrupt diagnostics likewise return `code` and `next`.
48
+
49
+ ## Compatibility & Migration
50
+
51
+ - **Breaking changes: none.** Parameter defaults, data formats and the directory layout of all four presets are unchanged.
52
+ - **Additive only**: every field added in this release is additional; please ignore unknown fields rather than failing on them.
53
+ - **Migration: none needed.**
54
+ - The DSH support window is the same as 2.7.1 (see `engines.dsh` in `package.json`).
55
+
56
+ ## Known Limitations
57
+
58
+ - **Octave / Julia are not shipped** and were not installed on the verification machine; their templates and install plans are statically validated but have not been executed on a real host.
59
+ - **Commercial engine templates (MATLAB / Maple / Wolfram)** still need confirmation on a licensed machine and remain marked `VERIFY` by default.
60
+ - **Version constraints are existence-only**: version solving still belongs to the package manager; this tool does not parse constraints.
61
+ - **The plugin cannot enforce network or write restrictions**: the subprocess channel has no policy slot; that requires a host-side sandbox.
62
+ - **Release notes before 2.7.0 are Chinese-only** (see the English history index in `README.en.md`).
63
+
64
+ ## Verification
65
+
66
+ - `node tests/run-tests.mjs` — all green (65 items: 44 suites + 21 sensitivity probes).
67
+ - Three math-contract guards: `tests/audit-math-computation-parity.mjs`, `-contract.mjs`, `-sensitivity.mjs`.
68
+ - Real-host verification (python 3.12.10 and R 4.6.1): both engines produce the same numbers for the same computation; the native path and the `cli` escape hatch agree numerically and share the same `scriptHash`; timeout → `MATH_TIMEOUT`, syntax error → `MATH_NONZERO_EXIT` (with stderr and a receipt), missing package → `MATH_MISSING_PACKAGES` (no receipt directory written), an engine warning → a normal exit with stderr preserved.
69
+
70
+ ## Dependencies
71
+
72
+ - **No new runtime dependencies**; the DSH support window is unchanged.
@@ -0,0 +1,72 @@
1
+ # dsh-vibe-math 2.7.2 — 发布说明
2
+
3
+ > 上一版本:2.7.1。本版是**补丁版:只包含修复与附加(新增)响应字段**,不改变任何既有行为契约——把真实引擎环境下的**发现、证据与诊断**补齐:装了但不在 PATH 的引擎能被发现、安装建议不再给出本机跑不了的命令、失败证据(超时/缺包/未校验约束)不再缺失或静默、归档身份与名册口径可直接核对。四套预设的**参数默认值、数据格式与目录结构未变**,DSH 支撑窗口不变,**无需迁移**。
4
+
5
+ ## 概述
6
+
7
+ - **真实引擎发现更可靠**:引擎发现顺序为 PATH → 宿主自带运行时 → **各操作系统的已知安装目录**,因此在默认目录安装、但没有加进 PATH 的引擎(例如 R)也能被发现。
8
+ - **不再给出跑不了的安装命令**:`MATH_ENGINE_NOT_FOUND` 只在本机的包管理器**确实存在**时才给出可执行命令,否则给出建议命令与官方地址,并说明原因。
9
+ - **`probe` 不再"报喜不报忧"**:除了可用引擎,还会列出**已配置但本机未发现**的引擎及原因。
10
+ - **失败证据完整**:`MATH_TIMEOUT` 与 `MATH_NONZERO_EXIT` 携带同样的证据字段,超时的部分输出在**响应与回执**里都能拿到。
11
+ - **约束口径明说**:版本约束**只按存在性检查、从不校验**,未校验的约束会被逐条列出,不再静默忽略。
12
+ - **归档身份可核对**:运行响应直接给出归档 id 与 attempt;"编辑归档脚本后重跑"的语义有显式字段与警告解释。
13
+ - **名册口径统一(v4/v5)**:一次验证/会议冻结一份名册快照并记录版本号,所有视图读同一份数据;成员变化时版本号递增,读到的集合是否过期一目了然。
14
+ - **诊断更具体**:成员级调用失败时给出错误码、当前状态与下一步建议(而不是一句"不存在")。
15
+
16
+ ## 新增
17
+
18
+ - `math_computation` 的 `run` 响应新增 **`runId`** 与 **`attempt`**(此前归档 id 只存在于回执里,调用方无法直接核对"是不是同一个归档")。
19
+ - `probe` 响应新增 **`configured`**(配置启用的引擎全集)与 **`absent[]`**:每个未发现的引擎带 **`why`**(`not-found-on-this-machine` 或 `needs-a-caller-supplied-command`)。
20
+ - 新增约束口径字段:成功响应与"缺包"失败都带 **`versionPolicy`** 与 **`constraintsNotEnforced`**(本次**未校验**的约束逐条列出;没有约束时为空数组)。
21
+ - `MATH_TIMEOUT` 响应新增 **`stdout`**/**`stderr`**(按上限截断);回执 JSON 新增 **`partialStdout`**/**`partialStderr`**。
22
+ - `MATH_ENGINE_NOT_FOUND` 的 `next` 新增 **`suggestedCommand`**、**`packageManager`**、**`packageManagerAvailable`**、**`note`**(`vendorUrl` 视引擎而定)。
23
+ - `run` 响应新增 **`fileIsArchivedScript`**,并在 `mode:'file'` 指向归档脚本时给出 **`ARCHIVED_SCRIPT_RERUN`** 警告。
24
+ - v4:`status()` 新增 **`rosterVersion`** 与 **`frozenParticipants`**;`consensus` / `meeting` / `verify` 视图带各自的 `rosterVersion`。
25
+ - v4:`paper` 视图新增 **`dirProjected`** / **`dirSource`** / **`readSideEffect`**,明确该路径是投影还是真实状态。
26
+ - v2/v3:决策与子代理中断诊断新增 **`code`** 与 **`next`**(例如 `VIBE_MATH_DECISION_NOT_FOUND`,并说明队列现状);v4 的成员级调用新增 **`V4_NO_SUCH_RESIDENT`**(带当前编制与下一步建议)。
27
+
28
+ ## 变更
29
+
30
+ - **引擎发现顺序**:PATH → 宿主自带运行时 → 已知的每操作系统安装目录(Windows 的 `%ProgramFiles%` / `%ProgramFiles(x86)%` / `%LOCALAPPDATA%\Programs`,macOS 的 framework 路径,Linux 的 `/usr/lib/R`、`/opt/R` 等)。**存在性一律靠列目录证明**,从不假设路径存在。
31
+ - **安装建议**:只有在本机能解析出对应包管理器时,`next.command` 才是可执行命令;否则为空,并给出 `note` 与官方地址。安装流程仍是"计划 → `planToken` 确认 → 执行",作用域默认用户级。
32
+ - **归档 id 的键**:`mode:'file'` 以**源路径**为键,`mode:'code'`/`'expr'` 以脚本内容为键。因此编辑**同一个源文件**再跑会落到**同一个归档**(`attempt ≥ 2`、`scriptChanged:true`、`previousReceipt` 指向上一次,且旧 attempt 绝不被覆盖);而指向**另一个路径**(例如上一份归档的副本)会写入**新归档**,此时 `attempt:1`、`scriptChanged:false`、`previousReceipt:null` 都是**预期**。归档 id 不含随机数。
33
+ - **v4 名册冻结与修剪**:验证/会议开始时冻结参与集合并记录 `rosterVersion`;**移除成员会同时从冻结集合中剔除**(否则在飞投票永远凑不齐),**新增成员不进入已冻结集合**,集合真正变化时 `rosterVersion` 递增。没有进行中的验证/会议时,`status().frozenParticipants` 为显式 `null`。
34
+ - **v2/v3 票数与法定人数单一来源**:每轮票数只由一个函数(`voteCount`,读**验证任务创建时**记录的期望人数快照 + 轮次)给出,"是否够票、是否都报、共识、最终判定"四个读取点不再各自重算,因此调高/调低验证人数不会让各视图分叉。**刻意保持不变**:`MIN_REVIEWERS` 下限与"全体一致"判据——正是这两条(而不是把判据简化成只看本轮)决定了什么时候能收束;把它们一起"简化"掉会让单审阅者的结论被过早采纳。
35
+ - **文档口径更新**:计算工具的验证边界、已知差异与响应字段都写进了随包文档(含真机验证过的引擎版本与边界码)。
36
+
37
+ ## 修复
38
+
39
+ - **装了却"看不见"的引擎**:只扫描宿主进程 PATH 时,安装在默认目录但未加入 PATH 的引擎(实测:R 4.6.1)会被报成缺失;现在能从已知安装目录发现,并且版本探测与其他候选一致。
40
+ - **跑不了的安装命令**:此前会给出本机并不存在的包管理器命令(例如 `winget`);现在只在管理器确实存在时给出命令,否则给出官方地址与说明。
41
+ - **超时证据不完整**:`MATH_TIMEOUT` 之前缺少 `exit` 与 `stderr`,部分输出只存在于磁盘上的 `stdout.txt`;现在响应与回执都带截断后的部分输出,字段与 `MATH_NONZERO_EXIT` 对齐。
42
+ - **`probe` 只报可用项**:可用性一行此前可能只列出少数引擎而不解释其余配置项;现在点名"已配置但本机未发现"的引擎与原因。
43
+ - **版本约束被静默忽略**:现在明确说明"只按 base name 检查是否存在",并把本次未校验的约束逐条列出。
44
+ - **归档脚本"编辑后重跑"易被误读**:新增显式字段与警告说明"指向归档副本 ⇒ 新归档、无历史"与"指向原源文件 ⇒ 同一归档 + 新的 attempt",并明确旧回执不能作为修改后代码的证据。
45
+ - **v4 `paper` 字段可能被误读**:没有论文状态时该字段是**投影路径**;现在标注 `dirProjected`/`dirSource` 并声明读 `status` 无文件系统副作用。
46
+ - **成员可见材料的路径口径**:四个预设的成员材料补齐说明——文件工具按**会话 cwd** 解析路径,列出的相对路径需拼**项目根的绝对前缀**;计算产物请用回执的绝对字段 `receipt.scriptAbs`,或把 `receipt.cwd` 与 `receipt.scriptPath` 拼起来。
47
+ - **成员级调用只回一句"不存在"**:v4 现在返回错误码、当前编制与下一步建议;v2/v3 的决策与中断诊断同样给出 `code` 与 `next`。
48
+
49
+ ## 兼容性与迁移
50
+
51
+ - **破坏性变更:无。** 四套预设的参数默认值、数据格式、目录结构均未改变。
52
+ - **纯新增**:本版新增的响应字段都是**附加**的;遇到不认识的字段请忽略,不要据此报错。
53
+ - **迁移:无需迁移。**
54
+ - DSH 支撑窗口与 2.7.1 相同(见 `package.json` 的 `engines.dsh`)。
55
+
56
+ ## 已知限制
57
+
58
+ - **Octave / Julia 未随包提供**,在本次的验证机器上也未安装;相关模板与安装计划是静态校验过的,未经真机执行。
59
+ - **商业引擎(MATLAB / Maple / Wolfram)模板**仍需在持证机器上确认,默认标记为 `VERIFY`。
60
+ - **版本约束只按存在性检查**:具体版本求解仍由包管理器负责,本工具不解析约束。
61
+ - **插件无法强制禁网或限制写权限**:`subprocess` 通道没有策略槽位,需要宿主侧沙箱。
62
+ - **2.7.0 之前的发布说明仅提供中文**(英文历史索引见 `README.en.md`)。
63
+
64
+ ## 验证方式
65
+
66
+ - `node tests/run-tests.mjs` —— 全部通过(65 项:44 个套件 + 21 个灵敏度探针)。
67
+ - 三个数学契约守卫:`tests/audit-math-computation-parity.mjs`、`-contract.mjs`、`-sensitivity.mjs`。
68
+ - 真机验证(python 3.12.10 与 R 4.6.1):同一算式两边给出相同数值;原生路径与 `cli` 逃生口数字一致且 `scriptHash` 相同;超时 → `MATH_TIMEOUT`,语法错误 → `MATH_NONZERO_EXIT`(带 stderr 与回执),缺包 → `MATH_MISSING_PACKAGES`(不写回执目录),引擎警告 → 正常退出并保留 stderr。
69
+
70
+ ## 依赖
71
+
72
+ - **无新增运行时依赖**;DSH 支撑窗口不变。
@@ -0,0 +1,120 @@
1
+ # Release-notes template / 发布说明模板
2
+
3
+ This file defines the **single template** every `RELEASE-NOTES-<version>.md` (Chinese) and
4
+ `RELEASE-NOTES-<version>.en.md` (English) must follow. 本文件定义所有发布说明必须遵循的**唯一模板**。
5
+
6
+ - **File naming / 文件命名**:`RELEASE-NOTES-<version>.md`(中文)与 `RELEASE-NOTES-<version>.en.md`(English)。
7
+ Both files are required for every new release and both must be listed in `package.json#files`
8
+ (`tests/audit-market-metadata.test.mjs` enforces exactly that). 每个新版本**必须同时**有两份文件,且都列入
9
+ `package.json#files`(守卫 `tests/audit-market-metadata.test.mjs` 会检查)。
10
+ - **Heading order / 标题顺序**:the two languages use the **same order and the same section set**.
11
+ 中英两份必须**顺序一致、章节一致**(见下)。
12
+ - **Audience / 读者**:someone reading a changelog. 面向读变更日志的用户。
13
+ **Never** write internal project vocabulary (audit rounds, task/agent names, session IDs, "we found during
14
+ our testing") — state what changed for the user and how it is verified. 不得出现内部工作词汇(审计轮次、
15
+ 任务/成员名、会话编号、"我们在测试中发现"之类),只写对用户的变化与验证方式。
16
+
17
+ ## Required sections (in this order) / 必需章节(按此顺序)
18
+
19
+ | # | 中文标题 | English heading | Content / 内容要求 |
20
+ |---|---|---|---|
21
+ | 1 | `# dsh-vibe-math <version> — 发布说明` | `# dsh-vibe-math <version> — Release Notes` | Title with the exact version. 标题带准确版本号。 |
22
+ | 2 | `> 上一版本:<prev>。…` | `> Previous release: <prev>. …` | One paragraph: **what kind of release this is** (patch/minor), the headline changes, and an explicit compatibility sentence (defaults/formats/directory layout unchanged? migration needed?). 一段话:版本类型、要点、以及明确的兼容性结论(默认值/数据格式/目录结构是否变化、是否需要迁移)。 |
23
+ | 3 | `## 概述` | `## Overview` | 3–8 bullets, user-visible outcomes only; each bullet = one change. 3–8 条要点,只写用户可见的结果,一条一个变化。 |
24
+ | 4 | `## 新增` | `## Added` | New capabilities/fields/parameters. State the **exact** field or parameter names in backticks. 新能力/字段/参数,字段名一律用反引号写准确。 |
25
+ | 5 | `## 变更` | `## Changed` | Behaviour or wording changes (including documentation that now states something new). 行为或文案变化(含文档口径变化)。 |
26
+ | 6 | `## 修复` | `## Fixed` | Each fix: the user-visible symptom → the corrected behaviour. Include how it was reproduced/verified. 每条:用户可见症状 → 修正后的行为,并说明如何复现/验证。 |
27
+ | 7 | `## 兼容性与迁移` | `## Compatibility & Migration` | Explicit: breaking changes (usually "无 / None"), additive-only additions, migration steps, DSH support window. 明确列出破坏性变更(通常"无")、纯新增项、迁移步骤、DSH 支撑窗口。 |
28
+ | 8 | `## 已知限制` | `## Known Limitations` | Honest limits, including "unverified" and "not shipped". 如实写限制,包括"未验证"和"未随包提供"。 |
29
+ | 9 | `## 验证方式` | `## Verification` | The commands a reader can run (`node tests/run-tests.mjs …`) and what was verified on real engines, with versions. 读者可自行运行的命令,以及真机验证过的内容与版本号。 |
30
+ | 10 | `## 依赖` | `## Dependencies` | New/changed runtime dependencies (usually "无新增" / "None added") and the host (DSH) requirement. 新增/变化的运行时依赖(通常"无新增")与宿主(DSH)要求。 |
31
+
32
+ Sections with nothing to report keep their heading and say `无。` / `None.` — never delete a section, so
33
+ readers can rely on the structure. 无内容的章节**保留标题**并写"无。",不要删除章节,保证结构稳定。
34
+
35
+ ## Skeleton / 骨架
36
+
37
+ Chinese (`RELEASE-NOTES-<version>.md`):
38
+
39
+ ```markdown
40
+ # dsh-vibe-math <version> — 发布说明
41
+
42
+ > 上一版本:<prev>。本版是**补丁版 / 功能版**,<一句话要点>。四套预设的参数默认值、数据格式与目录结构**未变**,DSH 支撑窗口不变,**无需迁移**。
43
+
44
+ ## 概述
45
+ - …
46
+
47
+ ## 新增
48
+ - …
49
+
50
+ ## 变更
51
+ - …
52
+
53
+ ## 修复
54
+ - …
55
+
56
+ ## 兼容性与迁移
57
+ - 破坏性变更:无。
58
+ - 纯新增:…
59
+ - 迁移:无需迁移。
60
+
61
+ ## 已知限制
62
+ - …
63
+
64
+ ## 验证方式
65
+ - `node tests/run-tests.mjs` —— 全部通过(<N> 项)。
66
+ - …
67
+
68
+ ## 依赖
69
+ - 无新增运行时依赖;DSH 支撑窗口不变。
70
+ ```
71
+
72
+ English (`RELEASE-NOTES-<version>.en.md`):
73
+
74
+ ```markdown
75
+ # dsh-vibe-math <version> — Release Notes
76
+
77
+ > Previous release: <prev>. This is a **PATCH / FEATURE** release that <one-line headline>. Parameter defaults, data formats and the directory layout are **unchanged**, the DSH support window is unchanged, and **no migration is needed**.
78
+
79
+ ## Overview
80
+ - …
81
+
82
+ ## Added
83
+ - …
84
+
85
+ ## Changed
86
+ - …
87
+
88
+ ## Fixed
89
+ - …
90
+
91
+ ## Compatibility & Migration
92
+ - Breaking changes: none.
93
+ - Additive only: …
94
+ - Migration: none needed.
95
+
96
+ ## Known Limitations
97
+ - …
98
+
99
+ ## Verification
100
+ - `node tests/run-tests.mjs` — all green (<N> items).
101
+ - …
102
+
103
+ ## Dependencies
104
+ - No new runtime dependencies; the DSH support window is unchanged.
105
+ ```
106
+
107
+ ## Rules / 写作规则
108
+
109
+ 1. **Verify every claim against the code or docs before writing it.** If a behaviour is not in the shipped
110
+ bytes, it does not go in the notes. 每条声称在写之前都要对照代码/文档核实;没进包的行为不写。
111
+ 2. **Patch vs minor must be stated and justified** in the summary line; the version number itself is chosen
112
+ by the maintainer. 概述里写明是补丁版还是功能版并给出理由;版本号由维护者决定。
113
+ 3. **Name the exact API surface** (`field`, `next.reason`, parameter names) so users can grep for it.
114
+ 接口一律写准确名字,便于用户检索。
115
+ 4. **Do not machine-translate** the two versions: both are written by hand and kept structurally identical.
116
+ 两份都必须手写并保持结构一致,不用机翻。
117
+ 5. **English index**: every release also updates `README.en.md` (see below) so English readers can navigate
118
+ a history whose earlier entries are Chinese-only. 每个版本同时更新 `README.en.md`(英文历史索引)。
119
+ 6. **Historical files are frozen**: older notes are not reformatted retroactively; the template applies from
120
+ the next release onward. 历史文件不改写;模板自下一版本起生效。