dsh-molbio-tools 0.27.0 → 0.28.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/CHANGELOG.md CHANGED
@@ -10,6 +10,218 @@
10
10
  改为按**包名**引用后模块缓存问题随之消失——没有拷贝,也就没有需要保持同步的版本目录。
11
11
  下文历史条目里出现的 `vN` 目录保持原样,作为当时的记录。
12
12
 
13
+ ## [0.28.0] — 2026-11-26(蛋白注释 + 格式互操作 + 测序判读:survey #13/#14/#21/#10/#27/#31)
14
+
15
+ **工具数 65 → 72,benchmark 66 → 73 题(72/72 覆盖)。** 这一版把三条候选线一次做完:蛋白注释、
16
+ 注释格式与序列编辑、Sanger 读段判读。上游没有可跟的版本(`0.2.3-alpha.2` 仍是 npm `alpha` 的最新,
17
+ `latest`/`next` 仍是 `0.2.2-rc.5`),所以这一版全部是工具行为,`dshReleases` / `engines` / preset 行清单
18
+ 都没有改。
19
+
20
+ ### 1. 蛋白注释(#13 / #21 / #14)
21
+
22
+ - **`molbio_protein_features`**(#13):PTM 基序扫描(N-糖基化 N-{P}-[S/T]、C-甘露糖基化 W-x-x-W、
23
+ N-端肉豆蔻酰化、SUMO 化 ψKxE、PKA R-R-x-[S/T]、CK2 [S/T]-x-x-[D/E]、脯氨酸导向 [S/T]-P)、
24
+ SEG 风格的熵窗口低复杂度区、芳香性与 Guruprasad 不稳定指数(>40 报 `unstable`)。
25
+ - **`molbio_signal_peptide`**(#21):von Heijne 1986 的 −13..+2 位置权重(真核 / 革兰阴性两套,
26
+ 与 EMBOSS sigcleave 的 `log(count/expected)` 构造一致),给出最佳切割位点、信号肽、候选切割位点,
27
+ 以及**与 `molbio_hydropathy_plot` 同一窗口/阈值**的候选跨膜段;附一张分数曲线 SVG。
28
+ 只扫描 N 端前 50 个残基(`max_cleavage` 可调),避免把中段偶然高分读成信号肽。
29
+ - **`molbio_antigenicity`**(#14):Kolaskar–Tongaonkar 1990 的 7-mer A(p) 倾向,按“全蛋白均值 / 1.0”
30
+ 选位点、连续 ≥6 个残基成区;同时报 Parker 亲水性、Emini 可及性与 Vihinen 柔性的**区间均值**,
31
+ 不合成单一分数。
32
+ - **表格来源与验证**:DIWV(20×20)、Parker/Emini/Vihinen(各 20)转录自 Biopython 1.88
33
+ `ProtParamData.py`(BSD-3,Guruprasad 1990 的参考实现);A(p) 与两套信号肽计数转录自
34
+ EMBOSS 6.6.0 的 `data/Eantigenic.dat`、`data/Esig.euk`、`data/Esig.pro`。所有值都在源码注释里
35
+ 注明出处,测试用可手算的已知值钉住(`AAAA` 的不稳定指数 7.5、20×A 的 A(p) 区间 4-17、
36
+ 胰岛素原信号肽切割位点 24、绿色荧光蛋白片段不报信号肽)。
37
+
38
+ ### 2. 注释格式与序列编辑(#10)
39
+
40
+ - **`molbio_feature_export`**:把 `.dna`/`.gb` 或内联序列 + features 导出为 **GFF3(1-based inclusive)**、
41
+ **BED(0-based half-open)**或 CSV,并在输出里写明用的是哪套坐标;`location` 原样保留,
42
+ 多段特征按外边界导出并给出提示。**CDS phase 不计算**(没有建模转录本阅读框),列写 `.`,
43
+ 而不是猜一个看起来合理的数。写文件仍走 `ctx.fs` + `sandboxPolicy`。
44
+ - **`molbio_sequence_edit`**:rotate / insert / delete / replace / split / join(可带精确 overlap 校验)。
45
+ 坐标统一 1-based inclusive;`insert.position` / `split.position` 是“保留在前面的碱基数”。
46
+ **不重映射特征坐标**,输出里明确提示:编辑移动了注释就要重新导出。
47
+
48
+ ### 3. Sanger 读段判读(#27 / #31)
49
+
50
+ - **`molbio_sanger_assemble`**(#27):1–24 条 `.ab1`/`.seq`/`.fasta` 或内联 reads 的贪心 overlap-layout
51
+ 组装;每条读两种朝向都试,按“overlap − 2×mismatch”选最优;Phred 末端修剪;每次放置后用
52
+ **质量加权共识**重建 contig;报每条读的位置/朝向/overlap、覆盖度、冲突与未放置读;
53
+ 可选精确 end-overlap 环化。文本写明它不是基因组组装器,也不合并 paired-end。
54
+ - **`molbio_editing_outcome`**(#31):每条读两向比对参考(环状参考按加倍处理),按**精确变异签名**
55
+ 聚类成等位基因,报频率与 CDS 内的蛋白效应(wild_type / silent / missense / nonsense / frameshift /
56
+ in_frame_indel / outside_cds)。频率是**已比对 reads 的比例**,不是 TIDE 的峰分解。
57
+ **两条边界**:identity 之外还要求至少比对到读长的一半(最少 20 bp),否则一段偶然的短局部匹配
58
+ 会被误收成等位基因;indel 的移码判定用**净长度变化**,所以被比对拆成两段的 3 bp 缺失仍判 in-frame。
59
+
60
+ ### 4. 测试、benchmark 与守卫
61
+
62
+ - `test/smoke.mjs`:新增 7 个工具的已知值/边界/错误路径断言(基序正负例、低复杂度、截断、
63
+ 信号肽阳性/阴性、跨膜段、A(p) 手算值、GFF3/BED/CSV 三套坐标、旋转/插入/删除/替换/拆分/合并、
64
+ 三读组装与未放置读、四读等位基因聚类与 A2T/in-frame 判定);工具数断言 65 → 72。
65
+ - 图片工具 17 → 18(`molbio_signal_peptide`);`test/contract.mjs` 同步;`test/svgpng.mjs` 的
66
+ 样本集加入信号肽曲线,仍然证明 `unsupported` / `missing_glyphs` 为空。
67
+ - benchmark:新增 `protein-features`、`signal-peptide`、`antigenicity`、`feature-export`、
68
+ `sequence-edit`、`sanger-assemble`、`editing-outcome` 七条 full 档任务(`tasks/10-v28.json`),
69
+ 并加到 `benchmark/verifications.mjs`;`bench --offline` 73 题全绿,`benchmark-coverage` 72/72。
70
+ 可复现的输入记录在 `benchmark/_probe-v28.mjs`。
71
+ - **首次真实模型跑后的可用性修正(editing-outcome)**:第一跑用了 10 次工具调用 / 107 s——模型把 96 bp
72
+ 参考抄成了 93 bp 的 read,随后逐条重试、用 shell 核对长度、再用 `translate` 复核。据此把工具描述
73
+ 改成“一次调用传全部 reads、`reference` 是完整分子而不是 CDS 或 read、不要在 shell/translate 里重算”,
74
+ 并在结果里增加“没有任何 read 与参考完全一致”的诊断(全编辑样本也会触发,所以是提示而非报错)。
75
+ 同题重跑:**27 s / 4 次调用 / 180,845 tokens,仍 PASS**。
76
+ - `test/benchmark-profile.mjs` 的 headless profile 现为 14 行 / 72 工具。
77
+
78
+ ### 5. 文档与版本
79
+
80
+ - README 的工具表/计数、`preset.yml` 描述、`agent.cordis.yml` 注释、`cordis.patch.yml`(重新生成)、
81
+ `docs/maintainer.md`、`docs/roadmap.md`、`docs/capability-gap-survey.md` 同步到 72 工具 / 73 题。
82
+ - 根包 `0.27.1 → 0.28.0`;面板包保持 `0.1.17`:三个新模块只在宿主半,
83
+ `lib/client.js` 字节未变(与 0.27.0 因 `lib.mjs` 进浏览器半而 bump 的情形不同)。
84
+
85
+ ### 6. 验收(本机 0.2.3-alpha.2 桌面版 `app.asar`)
86
+
87
+ - `smoke`(72 工具)、`svgpng`(23)、`svgio`、`charts`、`structure`、`client`、`panel-render`、
88
+ `map-card`、`client-mount`、`contract`(17)、`drift-probe`(17 个突变)、`preset-health`(31 行)、
89
+ `benchmark-profile`(72 工具)、`benchmark-score`、`benchmark-coverage`(72/72、73 题)、
90
+ `bench --offline`(73 题)全部通过。
91
+ - `test/release.mjs` **13 项全绿**(npm 11.20.0,满足可信发布下限 11.5.1);
92
+ `build/release-preflight.mjs --tag v0.28.0` 通过(根包 0.28.0 待发布,面板 0.1.17 已发布且字节一致)。
93
+ 注意:npm 版本探测在 DSH 沙箱内会因管道捕获子进程而返回 `EPERM`,发布守卫应在沙箱外跑;
94
+ 本版验收时已在沙箱外实跑。
95
+ ## [0.27.1] — 2026-11-24(DSH 0.2.3-alpha.2 适配:面板改读 workingDirectory projection 并修正 workspaceFiles 首参、守卫换用 Include 解析器、preset 跟上游两行)
96
+
97
+ **工具数不变(65),benchmark 不变(66 题)。** 0.25.3 的验收基线是 **0.2.2-rc.5**;这一版把基线推到
98
+ **0.2.3-alpha.2**,并在本机桌面版 `app.asar` 上重跑了整套守卫。上游在 rc.5 之后改了三处本包依赖的东西。
99
+
100
+ ### 1. 上游变化(0.2.3-alpha.2)
101
+
102
+ - 桌面端 `@deepseek-ai/dsh-desktop-runtime` 为 0.2.3-alpha.2(Electron 44.11.5 / Node 24.22.3;Node
103
+ 下限随 0.2.3-alpha.1 提到 24.22.3,本机恰好等于该值)。
104
+ - `standard.patch.yml` 变为 7363 B、sha256 `57c14c30…`,与本包基线相比只有两处:新增 `tool-cordis`
105
+ 行,`tool-plugin-manager` 改为 `disabled: !!js "!ctx.get('profileContext')"`(profile 里实际启用)。
106
+ - `@deepseek-ai/cordis-plugin-include` 改用 `yaml` 包并导出 `parseEntryYaml`/`stringifyEntryYaml`;
107
+ `js-yaml` 与 `entryListSchema` 不再随宿主提供。
108
+ - 会话目录移入 Session projection:官方 `ui-sidebar-files` / `ui-workspace` 统一用
109
+ `selectSessionDirectory()`,读 `projectionsBySession…workingDirectory` →
110
+ `byId…projectionValues.workingDirectory` → `byId…cwd`。
111
+
112
+ ### 2. 面板:工作区根目录按官方顺序读取
113
+
114
+ - `build/panel-core.mjs` 新增 `selectSessionDirectory(state, sessionId)`,Molbio 与 Papers 两个正文都改用它。
115
+ 旧版 DSH 上没有 projection 时仍回退到 `cwd`,因此 `engines` 覆盖的旧版本不受影响;空字符串按“无根目录”处理,
116
+ 与面板的 `cwd === undefined` 加载态一致。
117
+ - `test/client.mjs` 增加四条优先级/回退断言;`test/contract.mjs` 的官方先例断言改为检查
118
+ `selectSessionDirectory` + `projectionsBySession` + `projectionValues`(旧的 `byId…cwd` 断言已删除)。
119
+
120
+ ### 3. 面板:workspaceFiles 首参 + 命名空间注入修正(.fasta/.pdb/.cif 一个都列不出来的根因)
121
+
122
+ - 宿主的 `workspaceFiles.list/read/readBytes` 首个参数是 **SessionId `lookup`**
123
+ (`workspaceFileScopeId`,strict `{type:'string'}` codec),由网关在服务端解析成会话的 workspace
124
+ scope;官方 `ui-sidebar-files` / `ui-sidebar-documentpreview` 都直接传 `sessionId` 字符串。
125
+ - 面板此前传的是 `{ sessionId }` 对象(自首个客户端提交 a478dbf 起),网关在参数解码阶段就拒绝,
126
+ 于是**目录列举与文件读取全部失败**:列表只剩 “No .dna / .gb / … files”,与文件扩展名无关
127
+ (`.fasta`→alignment、`.pdb/.cif`→structure 的映射本身是对的)。
128
+ - `build/client-entry.mjs`(`listDirectory`、`readBytes`)与 `build/panel-core.mjs`
129
+ (`readWorkspaceText`)改为传裸 `sessionId`;同时删掉早已不可达的 `readAll` 兼容分支
130
+ (0.1.7-alpha.1 起宿主只提供 `readBytes`)。
131
+ - 守卫:`test/panel-render.mjs` 的 Remote 桩现在**断言首参是字符串**(传对象即抛);
132
+ `test/contract.mjs` 按 `list(sessionId, path, signal)` 等实参形态断言,并新增
133
+ “任何 workspaceFiles 调用都不得传 `{ sessionId }`”的反向断言。
134
+ - 同一处的第二个问题:`remote.workspaceFiles` 是**命名空间子服务**,官方每个消费者都在 `inject` 里
135
+ 显式声明它(`ui-sidebar-files` / `ui-sidebar-documentpreview` / `ui-reference` / `ui-open-in-app`,
136
+ rc.3 起即如此),本包此前只声明了 `remote`。客户端的 `inject` 现为
137
+ `['slots','sidebarRightTabs','remote','remote.workspaceFiles']`。
138
+ - 列表不再阻塞在 store 的 `cwd` 上:取不到 `cwd` 时用工作区相对路径 `'.'`(宿主按会话 workspace root
139
+ 解析),读取用同一前缀的相对路径;列表头显示实际目录与可打开文件数。这样“等待工作区”与“没有文件”
140
+ 不再长得一样,也修掉了快照晚到/缺 `cwd` 时空列表的问题。`test/panel-render.mjs` 新增
141
+ “无 cwd 仍列出根目录”用例。
142
+
143
+ ### 4. preset:跟上游两行
144
+
145
+ - 补 `tool-cordis`(`@deepseek-ai/dsh-tool-cordis`,位于 `tool-web` 与 `present` 之间)。
146
+ - `tool-plugin-manager` 由硬 `disabled: true` 改为上游同款条件禁用。
147
+ - 生成物 `cordis.patch.yml` 由 `build/preset-patch.mjs` 重新生成;`preset-health` 的漂移输出回到零。
148
+
149
+ ### 5. 守卫:按宿主自己的方言解析补丁
150
+
151
+ - `benchmark/harness.mjs` 的 `loaderYaml()` 现在优先用宿主 Include 的 `parseEntryYaml`,仅在旧宿主上
152
+ 回退到 `js-yaml` + `entryListSchema`;`readComposition()` 与 `benchmark/profile.mjs` 的两处调用点随之改。
153
+ `test/client-mount.mjs` 里重复的那份旧读取器也删掉,改为调用 `readComposition()`。
154
+ - 在此之前,`preset-health` 与 `client-mount` 在 0.2.3-alpha.2 上会直接抛
155
+ `YAMLException: unknown tag !!js`——不是组合有问题,而是读取器还停在旧引擎上。
156
+ - `benchmark/profile.mjs` 的 `resolveDisabled()` 认识 `!ctx.get('profileContext')`(benchmark 生成的是真 profile,
157
+ 按启用处理),并把 `tool-plugin-manager` 加进 `SKIPPED_ROWS`(管理型工具,一次性任务用不到)。
158
+
159
+ ### 6. 声明与版本
160
+
161
+ - 两个包的 `dsh.compatibility.dshReleases` 增加 `"0.2.3-alpha.2": "compatible"`;`engines.dsh` 不变
162
+ (`>=0.2.1-rc.2 <0.3.0-0`,宿主按 `includePrerelease` 匹配,实测两份清单均被接受)。
163
+ - 根包 `0.27.0 → 0.27.1`;面板包 `0.1.16 → 0.1.17`——`lib/client.js` 的字节变了,发布守卫要求面板
164
+ 独立 bump。两份 `lib/client.js` 已重建(499.8 KB)。
165
+
166
+ ### 7. 验收(本机 0.2.3-alpha.2 桌面版 `app.asar`)
167
+
168
+ - `contract` 17/17、`preset-health`(31 行展开)、`drift-probe`(17 个突变全抓到)、`client-mount`
169
+ (214 行、83 个 client 行)、`smoke`(65 工具)、`client`、`panel-render`、`map-card`、`benchmark-profile`、
170
+ `benchmark-score`、`benchmark-coverage`(65/65)、`bench:offline`(66 题)全部通过。
171
+ 面板 Remote 桩的字符串断言与 contract 的实参断言覆盖了两个方向:传错类型即失败。
172
+ - 额外静态核对:宿主 `evaluatePluginCompatibility()` 对两份清单都返回接受;65 个工具的
173
+ parameters / output schema 全部通过 `dsh-tools` 的 `assertObjectJsonSchema` /
174
+ `assertSupportedJsonSchema`。
175
+
176
+ ### 8. 面板:单序列 FASTA 直接显示 + 比对结果可缩放
177
+
178
+ - **单条序列不比对**:`parseAlignmentFile()` 过去对任何 FASTA 都跑 `progressiveAlign`,且不足 2 条直接抛错。
179
+ 现在 1 条时返回 `{ rows, single: true }`(不再比对),面板用 `sequenceText()` 按 60 字符换行、
180
+ 保留 `>id` 头,以等宽文本显示;空文件仍明确报错。
181
+ - **比对按自然宽度绘制并可缩放**:logo SVG 不再被 `max-width:100%` 压进面板,而是放进可横向滚动的
182
+ 容器、以渲染器自己的像素宽度显示;新增 − / + / 100% 三个控件(10%–800%,每步 ×1.25),缩放只改
183
+ 已追加 SVG 的 `width`/`height`,不重新计算比对。换文件时缩放复位。
184
+ - 测试:`test/client.mjs` 覆盖单序列记录、`sequenceText()` 换行与空文件报错;`test/panel-render.mjs`
185
+ 覆盖“单序列打印为文本、无缩放控件”与“点 + 后 SVG 宽度变大、显示 125%”,DOM 桩会记录
186
+ `setAttribute`,不再吞掉缩放。
187
+
188
+ ### 9. 面板:非核苷酸 FASTA 不再被当成 DNA 比对
189
+
190
+ - **根因**:`parseAlignmentFile()` 把 FASTA 行直接交给 DNA 比对器,绕过了 `normalizeMsaSequence()` 的字母校验。
191
+ 蛋白序列里不在 IUPAC 表中的字母(E/F/I/L/P/Q…)在比对器的符号表里没有下标、却在 `residues` 里被计数;
192
+ logo 再把它们当“未知字符”跳过并计成 gap —— 于是一张大部分列空白、少量列报 2 bits 的“怪图”就出来了。
193
+ - 现在先判定字母表:任一行出现非 IUPAC 核苷酸字母即按**蛋白/非核苷酸**处理,返回 `protein: true`;
194
+ 面板显示 `not nucleotide` + 说明 + 换行后的原始序列文本,**不比对、不画 logo、不给缩放控件**。
195
+ - 顺带修掉两个会改变结果的相关缺陷:
196
+ - **小写 FASTA** 先 `normalizeMsaSequence()` 再比对(旧路径把 `acgt` 当未知字母,比出一个任意结果);
197
+ - **预比对 FASTA**(行内含 `-`/`.`)用 `normalizeAlignedRow()` 按原样接受、要求等长,不再二次比对。
198
+ - `columnComposition()` 的**全 gap 列**改为 `information = 0`(模块文档一直这么承诺;旧代码返回 2 bits 却不画字母)。
199
+ 正常的 DNA 多序列比对输出不受影响。
200
+ - 测试:`test/client.mjs` 覆盖蛋白、小写、预比对、全 gap 列;`test/panel-render.mjs` 覆盖蛋白文件显示文本与
201
+ “NOT aligned”提示、无缩放控件。
202
+
203
+ ### 10. Papers 面板:`range` 参数与库路径修正
204
+
205
+ - **range 参数**:`readWorkspaceText()` 原先把 `workspaceFiles.read(sessionId, path, undefined, signal)` 的第三个参数传成
206
+ `undefined`,而宿主的 `read()` 直接解构 `range.offset` —— 这一调用必然抛
207
+ “Cannot read properties of undefined (reading 'offset')”,Papers tab 从来读不到库。现在传 `{}`(宿主取默认页),
208
+ 并在响应的 `eof === false` 时明确报“超过一页”,不再把截断的 JSON 报成“不是合法 JSON”。
209
+ - **库路径**:工具写库用 `papers.mjs` 的 `workspaceFilePath()`,基准是 **workspace root**(沙箱根);面板却拼
210
+ `cwd/papers.json`。在 worktree/附加工作区这类 `cwd ≠ workspaceRoot` 的会话里,两者指向不同文件。现在面板直接用
211
+ 工作区相对路径 `papers.json`,与工具同源;`useSessions` 仍留在正文签名里(slot 契约会检查)。
212
+ - **其余参数审计**:`credentials.describe([ref])` 与宿主 descriptor 的 `refs: string[]` 一致;`remote.$on` 是客户端
213
+ Remote 的正式事件 API(多个官方包在用);`remote.workspaceFiles` 子服务注入已在第 3 节补上。Papers 不列目录,
214
+ 所以没有 Molbio 那种“列目录首参”问题。
215
+ - 测试:`test/client.mjs` 断言 `read` 的 range 是对象、截断页报错;`test/panel-render.mjs` 的 Remote 桩对 range 做
216
+ 断言,Papers 用例改用工作区相对库路径。
217
+
218
+ ### 11. CI 与发布
219
+
220
+ - `.github/workflows/test.yml` 与 `release.yml` 的 harness pin 由 `0.2.2-rc.5` 提到 **`0.2.3-alpha.2`**
221
+ (已确认该版本在 npm 上存在;Node 注释同步为桌面版内嵌的 24.22.3)。不换 pin 的话,CI 会拿 rc.5 的
222
+ `standard` 与新版 preset 对比,把 `tool-cordis` 判成多出来的行。
223
+ - 发布前本地已跑:`test/release.mjs`(13 项)、`release-preflight.mjs --tag v0.27.1`、以及针对
224
+ 0.2.3-alpha.2 桌面版 `app.asar` 的全部守卫;两份 `lib/client.js` 与 `cordis.patch.yml` 均通过 `--check`。
13
225
  ## [0.27.0] — 2026-11-22(molbio_duplex_thermo:双链热力学,survey #9)
14
226
 
15
227
  **工具数 64 → 65,benchmark 65 → 66 题(65/65 覆盖)。** 候选池里排序第 9 的"双链热力学扩展":
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-molbio-tools
2
2
 
3
- **给 AI 助手装上分子生物学的"手"**:一个零依赖的 DeepSeek Harness 插件包,为它提供 **65 个
3
+ **给 AI 助手装上分子生物学的"手"**:一个零依赖的 DeepSeek Harness 插件包,为它提供 **72 个
4
4
  `molbio_*` 工具**——序列分析、引物/探针自动设计、克隆模拟、质粒图谱、测序验证、蛋白与 CRISPR
5
5
  分析、qPCR 统计、文献与实验记录。装上之后,你可以直接用自然语言让助手完成这些计算,并把结果
6
6
  画成图。
@@ -31,7 +31,7 @@
31
31
  ## 目录
32
32
 
33
33
  - [安装](#安装)(3 步)
34
- - [它会做什么](#它会做什么)(按任务分组的 65 个工具)
34
+ - [它会做什么](#它会做什么)(按任务分组的 72 个工具)
35
35
  - [典型用法示例](#典型用法示例)
36
36
  - [输出文件、自动打开与浏览器面板](#输出文件自动打开与浏览器面板)
37
37
  - [方法学与使用须知](#方法学与使用须知)(各工具的模型、估算范围与边界)
@@ -46,7 +46,7 @@
46
46
 
47
47
  ### 推荐:在 DSH 插件页安装(3 步)
48
48
 
49
- 装完后,预设选择器里会出现 **Molecular Biology Lab** 模式;**65 个工具只在这个模式里出现**,
49
+ 装完后,预设选择器里会出现 **Molecular Biology Lab** 模式;**72 个工具只在这个模式里出现**,
50
50
  不会污染你其它会话(这点很重要:工具多了会占提示预算)。**右栏的 Molbio / Papers 两个面板也随这个包
51
51
  一起装好**,不需要再装 `dsh-molbio-panel`。
52
52
 
@@ -106,9 +106,9 @@ dsh plugin --profile web update dsh-molbio-tools
106
106
  | 层(同一个 `cordis.patch.yml` 里的两段) | 作用 |
107
107
  | --- | --- |
108
108
  | `molbio-client` → `./host.mjs` | 只插一行**惰性宿主锚点**,不注册任何工具 |
109
- | `preset-molbio-lab` → `@deepseek-ai/dsh-agent-preset` | 声明 **Molecular Biology Lab** 模式,65 个工具在这一层里 |
109
+ | `preset-molbio-lab` → `@deepseek-ai/dsh-agent-preset` | 声明 **Molecular Biology Lab** 模式,72 个工具在这一层里 |
110
110
 
111
- 所以 65 个工具**只在选中该模式的会话里加载**,其它模式(standard / ptc / minimal / cordis)
111
+ 所以 72 个工具**只在选中该模式的会话里加载**,其它模式(standard / ptc / minimal / cordis)
112
112
  不带它们,不占提示预算。bundle 安装 ≠ 工具全局可见:bundle 只是把"模式"和"面板"一起装进来。
113
113
 
114
114
  > **那一行锚点不是多余的。** DSH 的客户端模块扫描只走**宿主 Loader 树**(官方原话:
@@ -124,7 +124,7 @@ dsh plugin --profile web update dsh-molbio-tools
124
124
 
125
125
  ### 只要浏览器面板
126
126
 
127
- 如果只想要图形面板、不想让该 profile 装 65 个工具(连模式都不装),装面板专用包即可
127
+ 如果只想要图形面板、不想让该 profile 装 72 个工具(连模式都不装),装面板专用包即可
128
128
  (见[浏览器面板](#浏览器面板可选))。**它和 `dsh-molbio-tools` 二选一**:两者注册同一组右栏 tab
129
129
  (`dsh-molbio-tools` / `dsh-molbio-tools/papers`),同时装会重复注册并报
130
130
  `tab type id ... is already registered`。同样在 **插件 → 添加插件** 里输入 `dsh-molbio-panel`,
@@ -140,10 +140,10 @@ dsh plugin --profile <profile> add dsh-molbio-panel
140
140
 
141
141
  ## 它会做什么
142
142
 
143
- 65 个工具按任务分为十组。下表是"你想做什么 → 用哪个工具"的索引,参数细节模型会在调用时自己
143
+ 72 个工具按任务分为十组。下表是"你想做什么 → 用哪个工具"的索引,参数细节模型会在调用时自己
144
144
  填;你只需要把意图说清楚。
145
145
 
146
- ### 1. 序列分析与酶切(9)
146
+ ### 1. 序列分析与酶切(11)
147
147
 
148
148
  | 工具 | 用途 |
149
149
  | --- | --- |
@@ -156,8 +156,10 @@ dsh plugin --profile <profile> add dsh-molbio-panel
156
156
  | `molbio_double_digest` | **双酶切规划**:两个酶各自的切点/片段、合并切点与片段,以及两者**是否共用 buffer**(无共用则提示顺序酶切或换用厂商双酶切 buffer) |
157
157
  | `molbio_dotplot` | **序列自身 dotplot**:按 k-mer 精确匹配画直接重复(黑)与反向重复(红),网格分箱以限制文件大小,并报告匹配数与任何扫描/绘图截断;是精确 k-mer 视图,不是滑窗同一性打分图 |
158
158
  | `molbio_contamination_screen` | **载体/接头污染筛查**:用内置的短签名表(pUC/pBR322、pUC19 lacZ/M13、pET T7、pcDNA CMV/BGH、Gateway attB1/attB2、Illumina/Nextera 接头)扫描序列或 FASTA/FASTQ;双链、默认精确、可选 0–2 错配,报告每个签名命中的 reads 数、示例位置/链/错配。**短签名筛查,不是 BLAST/全库比对;未命中不等于干净** |
159
+ | `molbio_feature_export` | **注释导出**:特征 → GFF3(1-based 闭区间)/ BED(0-based 半开)/ CSV,输出里写明用哪套坐标;多段特征按外边界导出并保留原 `location`;CDS phase 不建模,写 `.` |
160
+ | `molbio_sequence_edit` | **序列编辑**:rotate / insert / delete / replace / split / join(join 可校验精确 overlap);坐标 1-based 闭区间;**不重映射特征** |
159
161
 
160
- ### 2. 引物设计(6)
162
+ ### 2. 引物设计(7)
161
163
 
162
164
  | 工具 | 用途 |
163
165
  | --- | --- |
@@ -190,7 +192,7 @@ dsh plugin --profile <profile> add dsh-molbio-panel
190
192
  | `molbio_silent_site_mutagenesis` | **静默酶切位点突变**:在同义密码子范围内添加/移除限制性位点,保持蛋白序列不变;输出逐碱基变化、可直接喂给 `molbio_mutagenesis_primers` 的 mutation texts、突变后序列;只支持识别序列无简并碱基的酶 |
191
193
  | `molbio_extract_region` | 从质粒文件按特征名(如 "AmpR"、"MCS")或坐标提取子序列,可选反向互补与存 FASTA |
192
194
 
193
- ### 5. 测序与实验数据(6)
195
+ ### 5. 测序与实验数据(8)
194
196
 
195
197
  | 工具 | 用途 |
196
198
  | --- | --- |
@@ -200,8 +202,10 @@ dsh plugin --profile <profile> add dsh-molbio-panel
200
202
  | `molbio_lab_math` | 稀释计算、摩尔浓度、DNA 拷贝数 |
201
203
  | `molbio_plot` | **实验数据图表(8 种)**:柱状图(均值±SD 误差棒)、散点图(可选拟合线)、折线图(按分组列拆多条序列)、直方图(分箱默认 Freedman-Diaconis)、箱型图(Q1–Q3 箱 + 中位线 + 1.5×IQR 须 + 离群点)、**小提琴图**(高斯核密度轮廓 + 内部箱;看分布形状时用它)、**火山图**(log2FC × 显著性,带虚线阈值;**只画不检验**,p 值必须由表提供)、**热力图**(行×列矩阵,一格一色 + 色标;支持宽表与长表两种版式,`scale: row_zscore\|log2` 是**显式申报的展示变换**)。表类图表直接读工作区 **CSV/TSV**(`data_path` + `columns` 指名列),也可用 `data` 内联表格文本;结果里带回算好的统计量,**报数请引用它而不是照图估读** |
202
204
  | `molbio_virtual_gel` | **虚拟琼脂糖凝胶**:给出预期片段大小 → SVG 凝胶图 + 分子量 ladder,和真胶对照 |
205
+ | `molbio_sanger_assemble` | **Sanger 读段组装**:1–24 条 `.ab1`/`.seq`/`.fasta` 的贪心 overlap-layout,双朝向、Phred 末端修剪、质量加权共识、覆盖度/冲突/未放置读,可选精确 end-overlap 环化 |
206
+ | `molbio_editing_outcome` | **编辑结果归类**:读段两向比对参考 → 按精确变异签名聚类 → 频率与 CDS 蛋白效应(silent/missense/nonsense/frameshift/in_frame_indel);频率是**已比对 reads** 的比例,不是 TIDE |
203
207
 
204
- ### 6. 蛋白质(6)
208
+ ### 6. 蛋白质(9)
205
209
 
206
210
  | 工具 | 用途 |
207
211
  | --- | --- |
@@ -211,6 +215,9 @@ dsh plugin --profile <profile> add dsh-molbio-panel
211
215
  | `molbio_codon_optimize` | E. coli/酵母/人密码子优化,可顺便避开指定酶切位点 |
212
216
  | `molbio_helical_wheel` | **螺旋轮投影**:残基按 3.6 残基/圈落在圆周上、按性质着色,给出疏水矩 μH(判断是否两亲性),出 SVG |
213
217
  | `molbio_hydropathy_plot` | **Kyte-Doolittle 疏水性图**:滑动窗口曲线 + GRAVY + 达到跨膜阈值的峰,出 SVG |
218
+ | `molbio_protein_features` | **蛋白注释**:PTM 基序(N-糖基化/甘露糖基化/肉豆蔻酰化/SUMO/PKA/CK2/脯氨酸导向)、SEG 风格低复杂度区、芳香性、Guruprasad 不稳定指数(>40 = unstable) |
219
+ | `molbio_signal_peptide` | **信号肽与跨膜段**:von Heijne 1986 −13..+2 权重(真核/革兰阴性),报切割位点/信号肽/候选位点;跨膜段与 `molbio_hydropathy_plot` 同窗口同阈值;出分数曲线 SVG |
220
+ | `molbio_antigenicity` | **抗原性**:Kolaskar–Tongaonkar 1990 的 7-mer A(p) 倾向 + Parker/Emini/Vihinen 区间均值;启发式排序,不是表位预测 |
214
221
 
215
222
  ### 7. 比对与保守性(7)
216
223
 
@@ -645,6 +652,24 @@ mutations remain deferred")。所以插件无法在工作区里合法地落一
645
652
  *指示*,不是判定**,且只对闭合复制子有意义——序列太短时工具**不给**这个提示并说明原因。
646
653
  简并碱基被排除在 skew/CpG/词频统计之外并计入 `n_percent`。
647
654
 
655
+ ### 蛋白注释与测序判读(0.28.0)
656
+
657
+ - **三个蛋白工具都是发表表格的转录 + 滑窗,不是训练权重模型。** PTM 是线性共识基序(命中不等于
658
+ 真的被修饰);低复杂度是 SEG 风格的熵窗口近似,不是 SEG 本身;不稳定指数用 Guruprasad 1990 的
659
+ DIWV 表(>40 按惯例读作 unstable)。不要把它们说成 SignalP/TMHMM/NetNGlyc/BepiPred 的预测。
660
+ - **信号肽**用 von Heijne 1986 的 −13..+2 位置权重(EMBOSS `sigcleave` 的两套表),分数是
661
+ `log(count/expected)` 求和;只扫描 N 端前 50 个残基(`max_cleavage` 可调),因为信号肽在 N 端,
662
+ 全序列扫描会把中段偶然高分也报出来。**跨膜段**直接复用 `molbio_hydropathy_plot` 的窗口/阈值,
663
+ 所以两个工具不会给出两套数;拓扑朝向**不预测**。
664
+ - **抗原性**是 Kolaskar–Tongaonkar 1990 的 7-mer A(p) 倾向:按“全蛋白均值 / 1.0”选位点,连续
665
+ ≥6 个残基成区;Parker/Emini/Vihinen 只作为区间均值并列展示,**不合成单一分数**。
666
+ - **GFF3 与 BED 的坐标体系不同**:GFF3/CSV 是 1-based 闭区间,BED 是 0-based 半开(start−1 .. end)。
667
+ 工具逐格式转换并在输出里写明;多段特征按**外边界**导出、原 `location` 保留;CDS phase 不建模,
668
+ 列写 `.`——不猜一个看起来合理的数。**序列编辑不重映射特征**,编辑移动了注释就要重新导出。
669
+ - **Sanger 组装**是贪心 overlap-layout(读段双朝向、质量加权共识),不是基因组组装器;长于
670
+ `min_overlap` 的重复可能塌缩。**编辑结果归类**按精确变异签名聚类,频率是已比对 reads 的比例,
671
+ 不做 TIDE 的混合峰分解;一条读还必须至少比对到自身一半长度(最少 20 bp),否则一段偶然的短
672
+ 局部匹配会被误收成一个等位基因。
648
673
  ### 明确不做的事(以及为什么)
649
674
 
650
675
  这些是这个工具集的**边界**,写在这里是为了不再重复勘察:**BAM/CRAM**(二进制格式)、
@@ -732,13 +757,13 @@ agent 的 shell 子进程继承**,内联参数会出现在对话记录与工
732
757
 
733
758
  想评估"模型到底会不会用这些工具",看 **[benchmark/README.md](benchmark/README.md)**:
734
759
  `npm run bench:offline` 零成本校验期望值(在 `npm test` 里),`npm run bench` 用真实模型
735
- 跑 **core 档 14 题**,`npm run bench:full` 跑**全部 66 题(覆盖 65/65 个工具)**。
760
+ 跑 **core 档 14 题**,`npm run bench:full` 跑**全部 73 题(覆盖 72/72 个工具)**。
736
761
 
737
762
  > **改动与 benchmark 的关系(硬规则)**:新增或改动任何工具行为,**必须**新增/更新对应的
738
763
  > benchmark 任务并重跑;没有改动就不必重跑。日常只需要一条命令——
739
764
  > `node benchmark/run.mjs --model --changed`——它会从你的改动反推出该跑哪几题
740
765
  > (`lib.mjs` 这类共享库会自动放大到全量),改动只在文档/测试时则直接回答"无事可跑"。
741
- > `test/benchmark-coverage.mjs` 会拦住"新工具没有任务"(断言 65/65 覆盖),
766
+ > `test/benchmark-coverage.mjs` 会拦住"新工具没有任务"(断言 72/72 覆盖),
742
767
  > `bench --offline` 会拦住"期望值过期"。完整对照表见
743
768
  > [docs/workflow.md](docs/workflow.md) 第 2 节。
744
769
 
@@ -765,7 +790,7 @@ agent 的 shell 子进程继承**,内联参数会出现在对话记录与工
765
790
 
766
791
  ```
767
792
  dsh-molbio-tools/
768
- ├── index.mjs # 插件入口:export { name, inject, apply },注册 65 个工具
793
+ ├── index.mjs # 插件入口:export { name, inject, apply },注册 72 个工具
769
794
  ├── lib.mjs # 基础库:IUPAC、翻译、酶表、NN 热力学、qPCR、lab math、甲基化/buffer 参考表
770
795
  ├── design.mjs # 引物自动设计(含跨内含子 qPCR)
771
796
  ├── taqman.mjs # TaqMan 水解探针设计(复用 design.mjs 的引物引擎)
@@ -76,11 +76,11 @@ Measured, and printed so the answer can be audited:
76
76
 
77
77
  ```
78
78
  $ touch crispr.mjs && node benchmark/run.mjs --list --changed
79
- 1 of 66 task(s) selected — --tools molbio_grna_design --changed
79
+ 1 of 73 task(s) selected — --tools molbio_grna_design --changed
80
80
  (from --changed; 2 module(s) affected: crispr.mjs, index.mjs)
81
81
 
82
82
  $ touch lib.mjs && node benchmark/run.mjs --list --changed
83
- 56 of 66 task(s) selected — --changed (27 module(s) affected: align.mjs, cloning.mjs, …)
83
+ 62 of 73 task(s) selected — --changed (27 module(s) affected: align.mjs, cloning.mjs, …)
84
84
  ```
85
85
 
86
86
  `lib.mjs` selecting nearly everything is the **correct** answer, not a failure to
@@ -102,7 +102,7 @@ you changed, so its task runs even if it is full-only.
102
102
  | `--tools a,b,c` / `primer_*` | the union | you changed a few |
103
103
  | `--changed --tools X` | the INTERSECTION | "of what I changed, test X" |
104
104
  | (default) | **core** — 14 tasks | a broad smoke of the catalog |
105
- | `--tier full` | all 66, 65/65 tools | before a release |
105
+ | `--tier full` | all 73, 72/72 tools | before a release |
106
106
 
107
107
  The two `--tools` operators are stated because confusing them is the difference
108
108
  between testing what you changed and testing **less** than that: alone it unions,
@@ -134,7 +134,7 @@ and `test/benchmark-changed.mjs` asserts both directions.
134
134
  ### The part that still runs in full, on purpose
135
135
 
136
136
  A model run with `--changed` or `--tools` first executes the **whole** offline
137
- gate: all 66 tasks' `where: "tool"` expectations are recomputed against the shipped
137
+ gate: all 73 tasks' `where: "tool"` expectations are recomputed against the shipped
138
138
  tools (no model, a few hundred milliseconds). That is what makes partial runs safe
139
139
  — the expected values are re-proven for the tasks you skipped, so "skipped because
140
140
  unchanged" is a checked claim, not a remembered one.
@@ -169,7 +169,7 @@ asserting whatever the tool happened to emit.
169
169
 
170
170
  Two guards make "someone forgot" fail loudly instead of quietly:
171
171
 
172
- - `test/benchmark-coverage.mjs` asserts **65/65 registered tools are covered by
172
+ - `test/benchmark-coverage.mjs` asserts **72/72 registered tools are covered by
173
173
  at least one task**. Adding a tool without a task is a red build. It also
174
174
  asserts the fixtures' premises (the Golden Gate backbone is BsaI-free, the
175
175
  mutagenesis template still admits a primer pair), that a `covers` entry names a
@@ -210,7 +210,7 @@ recorded tool text, and it says so instead of silently scoring empty text).
210
210
 
211
211
  ## The headless profile (`benchmark/profile.mjs`)
212
212
 
213
- The model-facing way to get the 65 tools is the **Molecular Biology Lab** agent
213
+ The model-facing way to get the 72 tools is the **Molecular Biology Lab** agent
214
214
  preset. The benchmark cannot use it, and the reason is structural rather than
215
215
  configurational — `dsh-headless/lib/index.js` refuses an adoption whose session
216
216
  records a preset:
@@ -568,7 +568,7 @@ implementation happens to return for one set of arguments.**
568
568
  and `args_ok` both true is a *reporting* finding, not a tool bug.
569
569
  - **Multimodal hand-off.** `attach_image` is exercised as an argument at most; no
570
570
  assertion inspects a decoded PNG (that is `svgpng.mjs` and `contract.mjs`).
571
- - **Most of the toolset is now covered, but shallowly.** 66 tasks touch all 65
571
+ - **Most of the toolset is now covered, but shallowly.** 73 tasks touch all 72
572
572
  tools; most tools appear in exactly one task, and several appearances are a
573
573
  single argument check rather than a full workflow. Breadth is asserted by
574
574
  `test/benchmark-coverage.mjs`; depth is not, and cannot be.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * dsh-molbio-tools/benchmark/_probe-v28.mjs
3
+ *
4
+ * Reproducible record of the INPUTS behind the v0.28.0 benchmark tasks, and of
5
+ * what the shipped tools render for them. `tasks/*.json` carries the expected
6
+ * text; this file carries the invocation that must still produce it, so a tool
7
+ * change shows up as a failing task rather than as a silently rewritten
8
+ * expectation.
9
+ *
10
+ * Run: node benchmark/_probe-v28.mjs
11
+ */
12
+
13
+ import { join, resolve } from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+
16
+ import { loadTools } from './tools.mjs';
17
+
18
+ process.env.MOLBIO_AUTO_VIEW = '0';
19
+
20
+ const here = resolve(fileURLToPath(import.meta.url), '..');
21
+ const workspaceRoot = resolve(here, '_probe-v28-workspace');
22
+ const harness = loadTools({ workspaceRoot });
23
+
24
+ const ASSEMBLY_REF = 'GCGTGGTTATAATACAAGTTGAGCATATAAGGTTTGACAGCCTCTGACGCCTGCGGCGAAGGCCCATAATGGTACCGGAAGACTTCCGCCTCGATGCATCACTCACATCGGTGTCACCTGTTGTCGTCCGTTAACAAGTAGCAGGTTAGATCCGATCCGCGTCTAGGAGTGATCCTTATCAAATTGACTCAAAGGCGATATACAGCGAAAACATCAACCGTGGACTTCAGGAACACGGTGTGAGGGTTGGTCTCTTTTGAGAGATATTACAGACACTTTCTGGAGGACAACCGTGGTTTGGAACTGAATTGTCAAGGCGACATTACCTTAAAGCGTAGTTGGGTGGTGACTTTGAGCTGATGATAACGTAGGGACCAGCAATGTTTATACCGAACATGGA';
25
+ const ASSEMBLY_READS = [
26
+ { name: 'r1', sequence: ASSEMBLY_REF.slice(0, 220) },
27
+ { name: 'r2', sequence: ASSEMBLY_REF.slice(150, 370) },
28
+ { name: 'r3', sequence: 'TCCATGTTCGGTATAAACATTGCTGGTCCCTACGTTATCATCAGCTCAAAGTCACCACCCAACTACGCTTTAAGGTAATGTCGCCTTGACAATTCAGTTCCAAACCACGGTTGTCCTCCA' },
29
+ ];
30
+ const EDIT_REF = 'ATG' + 'GCT'.repeat(30) + 'TAA';
31
+ const EDIT_READS = [
32
+ { name: 'wt1', sequence: EDIT_REF },
33
+ { name: 'wt2', sequence: EDIT_REF },
34
+ { name: 'del', sequence: EDIT_REF.slice(0, 3) + EDIT_REF.slice(6) },
35
+ { name: 'sub', sequence: EDIT_REF.slice(0, 3) + 'A' + EDIT_REF.slice(4) },
36
+ ];
37
+ const INSULIN = 'MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN';
38
+
39
+ const probes = [
40
+ ['protein-features', 'molbio_protein_features', { sequence: 'AANASWAAWGEASTALKAERRASAAE' + 'A'.repeat(16) }],
41
+ ['signal-peptide', 'molbio_signal_peptide', { sequence: INSULIN.slice(0, 40) }],
42
+ ['antigenicity', 'molbio_antigenicity', { sequence: INSULIN }],
43
+ ['feature-export', 'molbio_feature_export', { sequence: 'ACGTACGTAC', features: [{ type: 'CDS', start: 2, end: 6, strand: 1, label: 'gene1' }], format: 'gff3' }],
44
+ ['sequence-edit', 'molbio_sequence_edit', { sequence: 'AACCGGTT', operation: 'rotate', position: 3 }],
45
+ ['sanger-assemble', 'molbio_sanger_assemble', { reads: ASSEMBLY_READS, min_overlap: 40, trim_quality: 0 }],
46
+ ['editing-outcome', 'molbio_editing_outcome', { reads: EDIT_READS, reference: EDIT_REF, circular: false, cds_start: 1, cds_end: EDIT_REF.length }],
47
+ ];
48
+
49
+ for (const [name, tool, args] of probes) {
50
+ try {
51
+ const value = await harness.run(tool, args);
52
+ const text = harness.render(tool, args, value);
53
+ console.log(`===== ${name} [${tool}]`);
54
+ console.log(text);
55
+ } catch (error) {
56
+ console.log(`===== ${name} ERROR ${String(error)}`);
57
+ }
58
+ }
59
+
60
+ void join;
@@ -107,13 +107,32 @@ export async function importPackage(name, harnessRoot) {
107
107
  /**
108
108
  * The Loader's YAML dialect, loaded once per process.
109
109
  *
110
+ * DSH 0.2.3-alpha.1 moved Include from `js-yaml` + an exported
111
+ * `entryListSchema` to the `yaml` package + `parseEntryYaml` (YAML 1.2 core
112
+ * schema plus the `!!js` tag). The exported parser is the only correct entry
113
+ * point: `js-yaml` is no longer installed beside the harness, and a stock
114
+ * `yaml.load` rejects the bundle patches with
115
+ * `unknown tag !<tag:yaml.org,2002:js>`.
116
+ *
117
+ * Both shapes are supported so this suite can still validate an OLDER installed
118
+ * harness — the same reason the composition reader stays harness-driven instead
119
+ * of hard-coding one parser version. `parse` is synchronous in both branches.
120
+ *
110
121
  * @param {string} harnessRoot the installed harness.
111
- * @returns {Promise<{yaml: object, schema: object}>} the `js-yaml` module and `entryListSchema`.
122
+ * @returns {Promise<{parse: (text: string) => unknown, describe: string}>} the
123
+ * dialect's parser, plus a label for report headers.
112
124
  */
113
125
  export async function loaderYaml(harnessRoot) {
114
- const { entryListSchema } = await importPackage('@deepseek-ai/cordis-plugin-include', harnessRoot);
126
+ const include = await importPackage('@deepseek-ai/cordis-plugin-include', harnessRoot);
127
+ if (typeof include.parseEntryYaml === 'function') {
128
+ return { parse: include.parseEntryYaml, describe: 'yaml@2 (Include.parseEntryYaml)' };
129
+ }
130
+ const { entryListSchema } = include;
115
131
  const yaml = (await importPackage('js-yaml', harnessRoot)).default;
116
- return { yaml, schema: entryListSchema };
132
+ return {
133
+ parse: (text) => yaml.load(text, { schema: entryListSchema }),
134
+ describe: 'js-yaml (Include.entryListSchema)',
135
+ };
117
136
  }
118
137
 
119
138
  /**
@@ -124,8 +143,8 @@ export async function loaderYaml(harnessRoot) {
124
143
  * @returns {Promise<unknown>} the parsed document.
125
144
  */
126
145
  export async function readComposition(path, harnessRoot) {
127
- const { yaml, schema } = await loaderYaml(harnessRoot);
128
- return yaml.load(await readFile(path, 'utf8'), { schema });
146
+ const { parse } = await loaderYaml(harnessRoot);
147
+ return parse(await readFile(path, 'utf8'));
129
148
  }
130
149
 
131
150
  /** The harness version, for report headers. */
@@ -52,6 +52,10 @@ export const SKIPPED_ROWS = new Map([
52
52
  ['skill-filesystem', 'not needed: these tasks are computation, and the row would scan the workspace for skills'],
53
53
  ['command-goal', 'a human slash command; no human is at the keyboard in a one-shot run'],
54
54
  ['tool-goal', 'a long-horizon goal loop; every task here is one turn'],
55
+ // 0.2.3 enables this row inside a profile (`disabled: !!js "!ctx.get('profileContext')"`).
56
+ // Its model tools manage the profile's plugins — an operator action no benchmark
57
+ // task performs, and a service the headless run does not need.
58
+ ['tool-plugin-manager', 'admin-only: plugin management is an operator action, not a task step'],
55
59
  ]);
56
60
 
57
61
  /**
@@ -76,6 +80,12 @@ export function resolveDisabled(value) {
76
80
  const expression = value.__jsExpr.trim();
77
81
  if (expression === "process.platform === 'win32'") return process.platform === 'win32';
78
82
  if (expression === "process.platform !== 'win32'") return process.platform !== 'win32';
83
+ // 0.2.3's standard preset guards `tool-plugin-manager` with the profile
84
+ // context. The benchmark generates a real profile under
85
+ // `$DSH_HOME/profiles/molbio-bench`, so the service exists and the row is
86
+ // ENABLED there; `benchmarkProfileRows` then drops it through SKIPPED_ROWS,
87
+ // where the omission is named and guarded against getting stale.
88
+ if (expression === "!ctx.get('profileContext')") return false;
79
89
  throw new Error(
80
90
  `benchmark: unrecognised \`!!js\` expression in \`disabled\`: ${JSON.stringify(expression)} — ` +
81
91
  'add it to resolveDisabled rather than guessing',
@@ -156,8 +166,8 @@ function molbioRow(rows) {
156
166
  * @returns {Promise<string>} the YAML text.
157
167
  */
158
168
  export async function renderProfilePatch(options) {
159
- const { yaml, schema } = await loaderYaml(options.harnessRoot);
160
- const document = await yaml.load(await readFile(options.presetPath, 'utf8'), { schema });
169
+ const { parse } = await loaderYaml(options.harnessRoot);
170
+ const document = await parse(await readFile(options.presetPath, 'utf8'));
161
171
  const rows = presetPlugins(document);
162
172
  if (rows.length === 0) {
163
173
  throw new Error(`benchmark: ${options.presetPath} declares no preset rows — refusing to generate an empty profile`);
@@ -237,10 +247,9 @@ export async function writeProfile(options) {
237
247
  });
238
248
  await writeFile(patchPath, patch, 'utf8');
239
249
 
240
- const { yaml, schema } = await loaderYaml(options.harnessRoot);
241
- const document = yaml.load(
250
+ const { parse } = await loaderYaml(options.harnessRoot);
251
+ const document = await parse(
242
252
  await readFile(join(options.repoRoot, 'preset', 'molbio-lab', 'agent.cordis.yml'), 'utf8'),
243
- { schema },
244
253
  );
245
254
  const { kept, skipped } = benchmarkProfileRows(presetPlugins(document));
246
255
  return { dir, patchPath, rows: kept.length, skipped };