dsh-molbio-tools 0.28.0 → 0.28.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.
- package/CHANGELOG.md +98 -0
- package/README.md +8 -6
- package/batch.mjs +53 -21
- package/benchmark/README.md +6 -0
- package/benchmark/harness.mjs +11 -3
- package/benchmark/profile.mjs +2 -2
- package/benchmark/run.mjs +3 -1
- package/benchmark/sequences.mjs +16 -0
- package/benchmark/tasks/01-core.json +1 -1
- package/benchmark/tasks/02-primers.json +1 -5
- package/benchmark/tasks/04-cloning.json +2 -2
- package/benchmark/tasks/09-formats.json +1 -1
- package/benchmark/tasks/10-v28.json +1 -1
- package/benchmark/verifications.mjs +3 -9
- package/build/check.mjs +463 -0
- package/build/client-bundle.mjs +1 -1
- package/build/panel-core.mjs +15 -3
- package/build/release-notes.mjs +82 -52
- package/build/release-preflight.mjs +1 -1
- package/docs/audit-2026-12.md +314 -0
- package/docs/change-process.md +305 -0
- package/docs/history.md +2 -0
- package/docs/maintainer.md +7 -2
- package/docs/roadmap.md +1 -1
- package/docs/rules.md +36 -6
- package/docs/store-evidence.md +17 -7
- package/docs/workflow.md +17 -5
- package/genbank.mjs +65 -14
- package/host.mjs +1 -1
- package/index.mjs +239 -140
- package/lib/client.js +89 -17
- package/package.json +11 -7
- package/pcr.mjs +29 -7
- package/phylo.mjs +0 -6
- package/seqio.mjs +5 -0
- package/taqman.mjs +4 -0
- package/test/client.mjs +6 -0
- package/test/contract.mjs +1 -1
- package/test/prompt.mjs +149 -0
- package/test/release.mjs +15 -8
- package/test/smoke.mjs +129 -4
- package/view.mjs +13 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,104 @@
|
|
|
10
10
|
改为按**包名**引用后模块缓存问题随之消失——没有拷贝,也就没有需要保持同步的版本目录。
|
|
11
11
|
下文历史条目里出现的 `vN` 目录保持原样,作为当时的记录。
|
|
12
12
|
|
|
13
|
+
## [0.28.2] — 2026-12-04(审计修复 + 参数校验收紧 + 发布流程门禁)
|
|
14
|
+
|
|
15
|
+
**工具数 72 不变,benchmark 73 题不变;面板包 0.1.17 → 0.1.18**(浏览器半包含同一批修复,
|
|
16
|
+
两个 npm 条目在同一个 tag 下发布)。这一版来自一次全面审计:修掉 10 类会给出错误结果或崩溃的缺陷,
|
|
17
|
+
把"拼错参数照常成功"从结构上根除,并给仓库装上了提交前门禁。
|
|
18
|
+
|
|
19
|
+
### 修复
|
|
20
|
+
|
|
21
|
+
- `molbio_parse_genbank`:折行的 `join()` location 不再被截断,超大 `join()` 不再 `RangeError`。
|
|
22
|
+
- `molbio_batch_analyze`:1 Mb 基因组的 ORF 汇总不再崩溃;glob 匹配改为线性,异常 `*` 模式不再挂起。
|
|
23
|
+
- `molbio_pcr_simulate`:环状模板不再重复报同一位点/同一条带;全长产物序列不再被截断;候选过多时明确标记 `truncated`。
|
|
24
|
+
- `molbio_fasta_fastq`:FASTA 中 `;` 开头的注释行不再被拼进序列,长度与 GC% 不再错。
|
|
25
|
+
- `molbio_design_taqman`:不再推荐含 `N` 的探针(此类探针无法订购)。
|
|
26
|
+
- 参数校验:未声明的参数直接报错并列出合法参数名;数值 enum 与嵌套对象同样校验。
|
|
27
|
+
- 安全:自动打开图片只接受 `.svg`/HTML 白名单扩展名;论文链接只放行 `http(s)://`。
|
|
28
|
+
- 网络与服务不可用不再报成参数错误,模型不会为此反复改参数重试。
|
|
29
|
+
- `attach_image` 只给开关、没给路径时返回 `image_note`;`molbio_signal_peptide` 的失败原因出现在文本里。
|
|
30
|
+
|
|
31
|
+
### 内部(不计入 GitHub Release 说明)
|
|
32
|
+
|
|
33
|
+
- 新增 `docs/audit-2026-12.md`(审计记录)与 `docs/change-process.md`(变更 SOP)。
|
|
34
|
+
- 新增 `build/check.mjs` 预检门禁:文档计数、benchmark 任务名、构建产物、版本/CHANGELOG、
|
|
35
|
+
Release 正文格式、git 隐形改动、DSH 基线;并入 `npm test` 与 CI。
|
|
36
|
+
- 真实模型 benchmark 明确为**按需**(仅新增/优化工具时),常规门禁只跑零成本的 `bench:offline`。
|
|
37
|
+
- GitHub Release 正文改为只取 `### 新增工具` / `### 修复` 的顶层条目,不再附安装说明与链接。
|
|
38
|
+
- 文档计数(64→72、65→73)、版本号、兼容性声明与 `.gitignore` 全部对齐;审计基线 DSH 0.2.3-alpha.2。
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## [0.28.1] — 2026-12-01(提示面受测化 + 文件输入收敛 + 判分口径修正)
|
|
43
|
+
|
|
44
|
+
**工具数 72 不变,benchmark 73 题不变。** 这一版全部是 0.28.0 之后的提示词与工具接口修复:`prompt` 面
|
|
45
|
+
第一次成为受测产物,四个工具补齐了文件输入/输出边界,三处 benchmark 判分口径被修正。没有新增工具,
|
|
46
|
+
`engines`、preset 行清单与面板包均未改。
|
|
47
|
+
|
|
48
|
+
### 修复
|
|
49
|
+
|
|
50
|
+
- `molbio_parse_genbank` 支持 `path` 文件输入,不再要求把序列重打一遍。
|
|
51
|
+
- `molbio_align` 支持 `path1`/`path2`,并识别 FASTA / GenBank / SnapGene。
|
|
52
|
+
- `molbio_editing_outcome` 的 `paths` 支持多记录 FASTA。
|
|
53
|
+
- `molbio_pcr_simulate` 对 5' 克隆尾给出明确诊断,不再报假的 `no product`。
|
|
54
|
+
- `molbio_verify_sanger` 对长 trace 与局部比对窗给出 PARTIAL 与改用建议。
|
|
55
|
+
- `molbio_enzyme_lookup` 新增 `only_cutting`;`molbio_restriction_sites` 的 `common` 默认只列真正切开的酶。
|
|
56
|
+
- `molbio_conservation` 的超长错误信息指向 `molbio_align`。
|
|
57
|
+
- `molbio_clone_primers` 明确反向引物结合段的订购方向。
|
|
58
|
+
- 提示段重写并纳入测试:预算、行宽、无版本标记、覆盖与去重五条不变量。
|
|
59
|
+
|
|
60
|
+
### 1. 提示面(prompt)受测化
|
|
61
|
+
|
|
62
|
+
- **`PROMPT_SECTION` 重写**:按问题路由(72 个工具全覆盖)+ 8 条硬规则 + 5 条约定;删掉 `(v19)`/`(v28)`
|
|
63
|
+
之类版本标记与重复段落;11,185 → 5,813 字符(预算 6,000),最长行 1,408 → 364 字符。
|
|
64
|
+
- **新增 `test/prompt.mjs`**:段落预算 / 单行宽度 / 无版本标记 / 工具覆盖(双向)/ 与工具描述 ≥60 字符
|
|
65
|
+
逐字去重,五个不变量 + 五个突变实验(规则 9:守卫必须被证明会失败),已并入 `npm test`。
|
|
66
|
+
- **描述去重与行为指引**:跨描述 ≥70 字符逐字重合 11 对 → 0 对;同时补进"一次调用拿全"、"报数而不只是
|
|
67
|
+
报路径"、"不要用 translate/脚本复核工具已算过的结果"等指引。
|
|
68
|
+
|
|
69
|
+
### 2. 工具接口修复(来自 4 轮全量 benchmark 的逐题会话复盘)
|
|
70
|
+
|
|
71
|
+
- **`molbio_parse_genbank` 新增 `path`**:此前只收内联文本,逼模型读文件再重打,实测产生 3163 bp 的转录错误
|
|
72
|
+
并丢失 `complement()`;现在与 `molbio_parse_snapgene` 一样直接吃文件。
|
|
73
|
+
- **`molbio_align` 新增 `path1`/`path2`**,并识别 FASTA / GenBank(`LOCUS`)/ SnapGene `.dna`:两条长序列的
|
|
74
|
+
一致性比对从「extract_region ×4 + pwsh 比字符串」收敛为一次调用。
|
|
75
|
+
- **`molbio_editing_outcome` 的 `paths` 支持多记录 FASTA**:此前会把整份 `reads.fa` 当成单条 trace 拒绝
|
|
76
|
+
(`a trace is a single read`)。
|
|
77
|
+
- **`molbio_pcr_simulate`** 对 5' 克隆尾给出明确诊断(整条引物匹配、尾不退火),描述同步;克隆引物设计后
|
|
78
|
+
的"验证"不再显示成假的 `no product`。
|
|
79
|
+
- **`molbio_verify_sanger`**:trace 长于参考直接拒绝;比对窗小于参考全长时输出 **PARTIAL** 说明;等长时
|
|
80
|
+
提示改用 `molbio_align`(此前 1221/3162 bp 的局部窗口会报 `verdict: match`)。
|
|
81
|
+
- **`molbio_conservation`** 超 3000 bp 的错误信息指向 `molbio_align`。
|
|
82
|
+
- **`molbio_enzyme_lookup` 新增 `only_cutting`**。
|
|
83
|
+
- **`molbio_restriction_sites`**:`enzymes: ["common"]` 默认只列真正切开的酶(`only_cutting: false` 可看全表),
|
|
84
|
+
103 个酶的刷屏消失;`test/smoke.mjs` 的契约断言同步覆盖两种模式。
|
|
85
|
+
- **`molbio_clone_primers`** 渲染明确反向引物的"3' 结合段以订购方向给出",避免把模板互补序列当引物。
|
|
86
|
+
|
|
87
|
+
### 3. benchmark 与判分口径
|
|
88
|
+
|
|
89
|
+
- **`editing-outcome` 改用 `reads.fa` fixture**:高重复的 96-mer 不再内联在指令里(序列上移到
|
|
90
|
+
`benchmark/sequences.mjs` 单一来源),从结构上消除转录误差。
|
|
91
|
+
- **`taqman-assay` 不再钉死 #1 探针**:该探针只有 +0.44 °C 余量,与题面"probe 至少高出几度"自相矛盾;
|
|
92
|
+
模型改推一个真正达标的 assay 是正确行为。
|
|
93
|
+
- **`methylation-block` / `fastq-trim`** 的判分正则接受等价表述(`usable`、表格形式的 "Reads 4 → 3")。
|
|
94
|
+
- **`benchmark/profile.mjs` 修复**:`yaml.dump`/`schema` 未定义导致 profile 生成直接崩溃;`loaderYaml` 现在
|
|
95
|
+
同时提供 `dump`(js-yaml + Include 的 `entryListSchema`,能往返 `!!js`)。
|
|
96
|
+
|
|
97
|
+
### 4. 实测(单模型单日,样本不是保证)
|
|
98
|
+
|
|
99
|
+
- 全量 73 题:**工具调用 257 → 217(重复调用 67 → 35)**,12.50M → 11.66M token;
|
|
100
|
+
`genbank-parse` 14 次/93.9s → **3 次/14.4s**,`clone-primers` 6 → 3 次,`intron-qpcr` 71 → 19s,
|
|
101
|
+
`multiplex-panel` 23 → 6 次,`codon-optimize` 16 → 4 次,`editing-outcome` 83 → 34s。
|
|
102
|
+
- 保留一处真实模型失败:`restraint-simple-math`(10 µL × 50 mM / 500 µL 被模型算成 0.5 mM,正确是 1 mM)——
|
|
103
|
+
这是模型口算错误,不用提示词修饰。
|
|
104
|
+
|
|
105
|
+
### 5. 文档
|
|
106
|
+
|
|
107
|
+
- `docs/rules.md` 新增规则 10:提示面(段落 + 工具描述)是受测产物,有预算、覆盖与去重三条不变量。
|
|
108
|
+
- 根包 `0.28.0 → 0.28.1`;面板包保持 `0.1.17`。
|
|
109
|
+
|
|
110
|
+
---
|
|
13
111
|
## [0.28.0] — 2026-11-26(蛋白注释 + 格式互操作 + 测序判读:survey #13/#14/#21/#10/#27/#31)
|
|
14
112
|
|
|
15
113
|
**工具数 65 → 72,benchmark 66 → 73 题(72/72 覆盖)。** 这一版把三条候选线一次做完:蛋白注释、
|
package/README.md
CHANGED
|
@@ -751,20 +751,22 @@ agent 的 shell 子进程继承**,内联参数会出现在对话记录与工
|
|
|
751
751
|
**发布(CD)**:CI 是 `.github/workflows/test.yml`(push / PR 跑全套,双平台),CD 是
|
|
752
752
|
`.github/workflows/release.yml`——**推一个 `v*` tag 就会**在被打 tag 的提交上重跑全套、过
|
|
753
753
|
`build/release-preflight.mjs` 的发布前置检查,然后用 npm 的 **Trusted Publishing(OIDC)**
|
|
754
|
-
把两个 npm 条目分开发布(仓库里没有任何长期 token
|
|
754
|
+
把两个 npm 条目分开发布(仓库里没有任何长期 token),最后用该版本段落里的
|
|
755
|
+
`### 新增工具` / `### 修复` 生成 GitHub Release 正文(只含新增工具与修复,不含内部改动)。
|
|
755
756
|
两个包的**首次发布必须由人手动做一次**(可信发布要求包已存在于 npm),步骤见
|
|
756
757
|
[docs/workflow.md](docs/workflow.md) 第 4 节。
|
|
757
758
|
|
|
758
759
|
想评估"模型到底会不会用这些工具",看 **[benchmark/README.md](benchmark/README.md)**:
|
|
759
760
|
`npm run bench:offline` 零成本校验期望值(在 `npm test` 里),`npm run bench` 用真实模型
|
|
760
761
|
跑 **core 档 14 题**,`npm run bench:full` 跑**全部 73 题(覆盖 72/72 个工具)**。
|
|
762
|
+
真实模型评测**按需**:只在新工具或优化/改动已有工具时跑,平时与 CI 都不跑。
|
|
761
763
|
|
|
762
764
|
> **改动与 benchmark 的关系(硬规则)**:新增或改动任何工具行为,**必须**新增/更新对应的
|
|
763
|
-
> benchmark
|
|
764
|
-
> `node benchmark/run.mjs --model --changed
|
|
765
|
-
>
|
|
766
|
-
>
|
|
767
|
-
>
|
|
765
|
+
> benchmark 任务并按需跑一次真实模型评测;没有改动就不必动。需要跑时用
|
|
766
|
+
> `node benchmark/run.mjs --model --changed`——它从你的改动反推出该跑哪几题
|
|
767
|
+
> (先加 `--list` 可零成本看判断结果;`lib.mjs` 这类共享库会自动放大到全量)。
|
|
768
|
+
> 常规门禁只跑两道零成本检查:`test/benchmark-coverage.mjs` 拦住"新工具没有任务"
|
|
769
|
+
> (断言 72/72 覆盖),`bench --offline` 拦住"期望值过期"。完整对照表见
|
|
768
770
|
> [docs/workflow.md](docs/workflow.md) 第 2 节。
|
|
769
771
|
|
|
770
772
|
> **benchmark 已经查出的一个真实缺陷**:`molbio_design_primers` 返回的引物对把
|
package/batch.mjs
CHANGED
|
@@ -23,7 +23,6 @@ export const BATCH_LIMITS = {
|
|
|
23
23
|
maxFiles: 500,
|
|
24
24
|
maxFileBytes: 50 * 1024 * 1024,
|
|
25
25
|
maxTotalBytes: 500 * 1024 * 1024,
|
|
26
|
-
maxOrfBases: 2_000_000,
|
|
27
26
|
maxEnzymes: 20,
|
|
28
27
|
};
|
|
29
28
|
|
|
@@ -43,17 +42,46 @@ export function detectBatchFormat(path, text) {
|
|
|
43
42
|
return 'text';
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Match one basename against a simple glob (`*` = any run, `?` = one character,
|
|
47
|
+
* ASCII case-insensitive).
|
|
48
|
+
*
|
|
49
|
+
* Deliberately NOT a RegExp. Translating `*` to `.*` makes a caller-supplied
|
|
50
|
+
* pattern such as `*a*a*a*a*a*a*a*b` backtrack exponentially (measured: ~1.4 s
|
|
51
|
+
* on a 28-character name, and every extra `*` multiplies it), so a pattern the
|
|
52
|
+
* model can mistype could stall the tool. This matcher is a two-pointer scan
|
|
53
|
+
* with ONE backtrack point: O(pattern × name), never exponential.
|
|
54
|
+
*/
|
|
55
|
+
export function globMatches(pattern, name) {
|
|
56
|
+
const glob = String(pattern);
|
|
57
|
+
const text = String(name);
|
|
58
|
+
let globIndex = 0;
|
|
59
|
+
let textIndex = 0;
|
|
60
|
+
let star = -1;
|
|
61
|
+
let resume = 0;
|
|
62
|
+
while (textIndex < text.length) {
|
|
63
|
+
const globChar = glob[globIndex];
|
|
64
|
+
if (globIndex < glob.length && (globChar === '?' || globChar.toLowerCase() === text[textIndex].toLowerCase())) {
|
|
65
|
+
globIndex += 1;
|
|
66
|
+
textIndex += 1;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (globIndex < glob.length && globChar === '*') {
|
|
70
|
+
star = globIndex;
|
|
71
|
+
resume = textIndex;
|
|
72
|
+
globIndex += 1;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (star !== -1) {
|
|
76
|
+
resume += 1;
|
|
77
|
+
textIndex = resume;
|
|
78
|
+
globIndex = star + 1;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
while (globIndex < glob.length && glob[globIndex] === '*') globIndex += 1;
|
|
84
|
+
return globIndex === glob.length;
|
|
57
85
|
}
|
|
58
86
|
|
|
59
87
|
/** Parse one sequence file into its name/topology/sequence/features. */
|
|
@@ -142,16 +170,20 @@ export function analyzeSequenceFile(input) {
|
|
|
142
170
|
}
|
|
143
171
|
const orfMinAa = input.orfMinAa ?? 0;
|
|
144
172
|
if (orfMinAa > 0) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
173
|
+
// No size guard here: `normalizeSequence` already rejects anything above
|
|
174
|
+
// 1 Mb, so the previous 2 Mb threshold could never fire — a dead limit that
|
|
175
|
+
// read like protection. The reduction is a loop, not `Math.max(...orfs)`:
|
|
176
|
+
// a 1 Mb genome with min length 1 aa yields ~166k ORFs, and spreading that
|
|
177
|
+
// into an argument list throws RangeError, which the tool turned into an
|
|
178
|
+
// "error" row for a perfectly valid file.
|
|
179
|
+
const { orfs } = translateFrames(sequence, 'all', input.codonTable ?? 'standard', orfMinAa);
|
|
180
|
+
row.orf_count = orfs.length;
|
|
181
|
+
let longestOrfAa = 0;
|
|
182
|
+
for (const orf of orfs) {
|
|
183
|
+
if (orf.length_aa > longestOrfAa) longestOrfAa = orf.length_aa;
|
|
154
184
|
}
|
|
185
|
+
row.longest_orf_aa = longestOrfAa;
|
|
186
|
+
row.orf_skipped = false;
|
|
155
187
|
}
|
|
156
188
|
if (format === 'fasta' || format === 'fastq') {
|
|
157
189
|
const stats = entryStats(parsed.fastaEntries ?? parsed.fastqEntries ?? [], format === 'fastq');
|
package/benchmark/README.md
CHANGED
|
@@ -48,6 +48,12 @@ It needs no model, takes a few hundred milliseconds, and is part of `npm test`.
|
|
|
48
48
|
`--model` spawns `dsh --profile molbio-bench` once per task and grades the event
|
|
49
49
|
stream. It costs tokens, so it is opt-in.
|
|
50
50
|
|
|
51
|
+
**When it runs:** only when a tool is added, or an existing tool is optimised or
|
|
52
|
+
changed in a way that can alter what a task observes. It never runs in `npm test`
|
|
53
|
+
and never in CI — those keep `--offline` and the frozen-response replay. `--changed`
|
|
54
|
+
(or `--list --changed` first, which is free) is how you scope it to the tools a
|
|
55
|
+
diff actually touches.
|
|
56
|
+
|
|
51
57
|
**`--model` refuses to run while `--offline` fails.** A stale expected value
|
|
52
58
|
would otherwise be reported as a model failure — the most misleading outcome a
|
|
53
59
|
benchmark can produce.
|
package/benchmark/harness.mjs
CHANGED
|
@@ -124,13 +124,21 @@ export async function importPackage(name, harnessRoot) {
|
|
|
124
124
|
*/
|
|
125
125
|
export async function loaderYaml(harnessRoot) {
|
|
126
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
127
|
const { entryListSchema } = include;
|
|
131
128
|
const yaml = (await importPackage('js-yaml', harnessRoot)).default;
|
|
129
|
+
// The dialect is js-yaml's JSON schema plus one tag: `!!js <expr>`, which
|
|
130
|
+
// round-trips as `{ __jsExpr }`. Reading without the tag turns an expression
|
|
131
|
+
// into a plain string; writing without it cannot put the tag back — and the
|
|
132
|
+
// profile patch carries `disabled: !!js ...` rows, so BOTH halves are needed.
|
|
133
|
+
const dump = entryListSchema === undefined
|
|
134
|
+
? () => { throw new Error('benchmark: this harness exposes no entryListSchema to serialize a profile patch with'); }
|
|
135
|
+
: (document) => yaml.dump(document, { schema: entryListSchema, noRefs: true, lineWidth: -1 });
|
|
136
|
+
if (typeof include.parseEntryYaml === 'function') {
|
|
137
|
+
return { parse: include.parseEntryYaml, dump, describe: 'yaml@2 (Include.parseEntryYaml)' };
|
|
138
|
+
}
|
|
132
139
|
return {
|
|
133
140
|
parse: (text) => yaml.load(text, { schema: entryListSchema }),
|
|
141
|
+
dump,
|
|
134
142
|
describe: 'js-yaml (Include.entryListSchema)',
|
|
135
143
|
};
|
|
136
144
|
}
|
package/benchmark/profile.mjs
CHANGED
|
@@ -166,7 +166,7 @@ function molbioRow(rows) {
|
|
|
166
166
|
* @returns {Promise<string>} the YAML text.
|
|
167
167
|
*/
|
|
168
168
|
export async function renderProfilePatch(options) {
|
|
169
|
-
const { parse } = await loaderYaml(options.harnessRoot);
|
|
169
|
+
const { parse, dump } = await loaderYaml(options.harnessRoot);
|
|
170
170
|
const document = await parse(await readFile(options.presetPath, 'utf8'));
|
|
171
171
|
const rows = presetPlugins(document);
|
|
172
172
|
if (rows.length === 0) {
|
|
@@ -189,7 +189,7 @@ export async function renderProfilePatch(options) {
|
|
|
189
189
|
'# tool execution and file mutation every task here requires.',
|
|
190
190
|
'',
|
|
191
191
|
].join('\n');
|
|
192
|
-
return `${header}${
|
|
192
|
+
return `${header}${dump(profilePatch(kept))}`;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
/** The profile directory for a harness home. */
|
package/benchmark/run.mjs
CHANGED
|
@@ -32,7 +32,7 @@ import { PROFILE_NAME } from './profile.mjs';
|
|
|
32
32
|
import { changedFiles, resolveChanged } from './changed.mjs';
|
|
33
33
|
import { foldEvents, loadTasks, renderInstruction, scoreSuiteOffline, scoreTrace, tasksForTier } from './score.mjs';
|
|
34
34
|
import { makeWorkspace } from './tools.mjs';
|
|
35
|
-
import { FIXTURES } from './sequences.mjs';
|
|
35
|
+
import { FIXTURES, v28EditReadsFasta } from './sequences.mjs';
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* The workspace files a task's tools read but no `fixtures` entry declares.
|
|
@@ -52,6 +52,8 @@ const FILE_FIXTURES = {
|
|
|
52
52
|
'chart-volcano': { 'de.csv': FIXTURES.DE_CSV },
|
|
53
53
|
'chart-heatmap': { 'expression.tsv': FIXTURES.HEATMAP_TSV },
|
|
54
54
|
'fastq-trim': { 'reads.fq': FIXTURES.TRIM_FASTQ_TEXT },
|
|
55
|
+
// Long, repeat-rich reads: inline them and the model retypes them (and drops a base).
|
|
56
|
+
'editing-outcome': { 'reads.fa': v28EditReadsFasta() },
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
/** Where reports land. Gitignored: a report is a measurement, not a source. */
|
package/benchmark/sequences.mjs
CHANGED
|
@@ -28,6 +28,22 @@ import { FIXTURES, reverseComplementOf } from './fixtures.mjs';
|
|
|
28
28
|
|
|
29
29
|
export { FIXTURES, reverseComplementOf };
|
|
30
30
|
|
|
31
|
+
/** The 96 bp reference of the v28 editing-outcome task. */
|
|
32
|
+
export const V28_EDIT_REF = 'ATG' + 'GCT'.repeat(30) + 'TAA';
|
|
33
|
+
|
|
34
|
+
/** Its four reads, derived from the reference so the ground truth cannot drift. */
|
|
35
|
+
export const V28_EDIT_READS = [
|
|
36
|
+
{ name: 'wt1', sequence: V28_EDIT_REF },
|
|
37
|
+
{ name: 'wt2', sequence: V28_EDIT_REF },
|
|
38
|
+
{ name: 'del', sequence: V28_EDIT_REF.slice(0, 3) + V28_EDIT_REF.slice(6) },
|
|
39
|
+
{ name: 'sub', sequence: V28_EDIT_REF.slice(0, 3) + 'A' + V28_EDIT_REF.slice(4) },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
/** The same reads as the FASTA file the task's workspace carries. */
|
|
43
|
+
export function v28EditReadsFasta() {
|
|
44
|
+
return V28_EDIT_READS.map((read) => `>${read.name}\n${read.sequence}`).join('\n') + '\n';
|
|
45
|
+
}
|
|
46
|
+
|
|
31
47
|
/** Deterministic pseudo-random DNA (the generator `test/smoke.mjs` uses). */
|
|
32
48
|
export function makeTemplate(n, seed = 42) {
|
|
33
49
|
let s = seed;
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"where": "answer",
|
|
76
|
-
"pattern": "not .{0,
|
|
76
|
+
"pattern": "not .{0,45}(sensitive|affected|blocked|impaired)|unaffected|tolerat|does not (block|inhibit)|cuts? (fine|normally)|no (dam|methylation) (effect|impact)|not (dam|dam-)|usable",
|
|
77
77
|
"note": "the verdict on BamHI. Widened on purpose: the point is that the model reports BamHI as NOT methylation-blocked, however it phrases it. Before 0.16.0 the tool said the opposite and a model that cross-checked the supplier was penalised for being right; now the tool and the supplier agree, so the model's verdict is assertable."
|
|
78
78
|
}
|
|
79
79
|
]
|
|
@@ -66,11 +66,7 @@
|
|
|
66
66
|
"pattern": "[0-9]+ TaqMan assay candidate\\(s\\), best first",
|
|
67
67
|
"note": "the tool returned assay candidates. The count is NOT pinned: it depends on the Tm-margin and amplicon windows the model chooses, and every one of those choices is a legitimate reading of the request."
|
|
68
68
|
},
|
|
69
|
-
|
|
70
|
-
"where": "tool",
|
|
71
|
-
"pattern": "AGTTGAATGGGTAAGCCGGCA",
|
|
72
|
-
"note": "the probe the tool places in the top-ranked amplicon. The amplicon is not pinned either: a model that reads 'a few degrees above the primers' as a hard filter will reject #1 (its probe is BELOW the primers) and choose a later, genuinely qualifying assay — which is a better answer than the one this task first encoded."
|
|
73
|
-
},
|
|
69
|
+
|
|
74
70
|
{
|
|
75
71
|
"where": "tool",
|
|
76
72
|
"pattern": "vs the hotter primer",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"assertions": [
|
|
25
25
|
{
|
|
26
26
|
"where": "tool",
|
|
27
|
-
"pattern": "extracted
|
|
28
|
-
"note": "the tool ran with the sequence it was given. Measured behaviour worth
|
|
27
|
+
"pattern": "extracted sequence 101-200 \\(100 bp\\)",
|
|
28
|
+
"note": "the tool ran with the sequence it was given. Measured behaviour worth recording: in the original full-tier run the model called `molbio_extract_region` THREE times, every call failed on the argument name, and it rebuilt the region by hand (correctly). Root cause was upstream of the model: `resolveVector` read only `args.vector` while the schema advertises `sequence`/`source_path`. Undeclared keys are now REJECTED with the valid names in the message, and this verification calls the declared `sequence`, so the invocation measures the tool rather than a silent no-op."
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"where": "tool",
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
"covers": [
|
|
259
259
|
"molbio_editing_outcome"
|
|
260
260
|
],
|
|
261
|
-
"instruction": "These four Sanger reads come from editing a 96 bp reference (ATG + 30×GCT + TAA). Cluster them into alleles, and give each frequency and protein effect inside the CDS 1-96. Treat the reference as linear
|
|
261
|
+
"instruction": "These four Sanger reads come from editing a 96 bp reference (ATG + 30×GCT + TAA). They are in the file `reads.fa` (FASTA) in your working directory — pass that file to the tool instead of retyping the sequences. Cluster them into alleles, and give each frequency and protein effect inside the CDS 1-96. Treat the reference as linear.\\n\\n\\n\\nThe reference is ATG + 30×GCT + TAA (96 bp).",
|
|
262
262
|
"timeout_ms": 300000,
|
|
263
263
|
"expect_tools": [
|
|
264
264
|
"molbio_editing_outcome"
|
|
@@ -24,7 +24,7 @@ import { join } from 'node:path';
|
|
|
24
24
|
import { readFileSync } from 'node:fs';
|
|
25
25
|
import { fileURLToPath } from 'node:url';
|
|
26
26
|
|
|
27
|
-
import { FIXTURES, NAMED_SEQUENCES, QPCR_TEMPLATE, makeTemplate, reverseComplementOf } from './sequences.mjs';
|
|
27
|
+
import { FIXTURES, V28_EDIT_READS, V28_EDIT_REF, NAMED_SEQUENCES, QPCR_TEMPLATE, makeTemplate, reverseComplementOf } from './sequences.mjs';
|
|
28
28
|
|
|
29
29
|
/** The committed GenBank fixture's text, read once at module scope. */
|
|
30
30
|
const GENBANK_TEXT = readFileSync(
|
|
@@ -43,13 +43,7 @@ const V28_ASSEMBLY_READS = [
|
|
|
43
43
|
{ name: 'r2', sequence: V28_ASSEMBLY_REF.slice(150, 370) },
|
|
44
44
|
{ name: 'r3', sequence: 'TCCATGTTCGGTATAAACATTGCTGGTCCCTACGTTATCATCAGCTCAAAGTCACCACCCAACTACGCTTTAAGGTAATGTCGCCTTGACAATTCAGTTCCAAACCACGGTTGTCCTCCA' },
|
|
45
45
|
];
|
|
46
|
-
|
|
47
|
-
const V28_EDIT_READS = [
|
|
48
|
-
{ name: 'wt1', sequence: V28_EDIT_REF },
|
|
49
|
-
{ name: 'wt2', sequence: V28_EDIT_REF },
|
|
50
|
-
{ name: 'del', sequence: V28_EDIT_REF.slice(0, 3) + V28_EDIT_REF.slice(6) },
|
|
51
|
-
{ name: 'sub', sequence: V28_EDIT_REF.slice(0, 3) + 'A' + V28_EDIT_REF.slice(4) },
|
|
52
|
-
];
|
|
46
|
+
|
|
53
47
|
/** The plasmid sequence, loaded once per offline run. */
|
|
54
48
|
let puc118;
|
|
55
49
|
|
|
@@ -238,7 +232,7 @@ export function invocationsFor(task) {
|
|
|
238
232
|
|
|
239
233
|
// cloning
|
|
240
234
|
'region-extract': () => [
|
|
241
|
-
{ tool: 'molbio_extract_region', args: {
|
|
235
|
+
{ tool: 'molbio_extract_region', args: { sequence: FIXTURES.CONSTRUCT, start: 101, end: 200 } },
|
|
242
236
|
],
|
|
243
237
|
mutagenesis: () => [
|
|
244
238
|
{ tool: 'molbio_mutagenesis_primers', args: { template: FIXTURES.MUTAGENESIS_TEMPLATE, mutations: [FIXTURES.MUTAGENESIS_MUTATION], tm_min: 60, tm_max: 90, max_results: 1 } },
|