v0.6: deprecate dr-translator/polisher agents, rewire /dr-finalize to Python pipeline

\u6765\u5b8c\u6210 v0.6 \u67b6\u6784\u53d8\u66f4\u7684\u6700\u540e\u4e00\u7247\u62fc\u56fe\uff1a

- dr-translator.md / dr-polisher.md \u6807\u8bb0 [DEPRECATED v0.6]\uff0c\u6743\u9650\u5168\u90e8 deny\uff0c\u4fdd\u7559\u6587\u4ef6\u4f5c\u5386\u53f2\u53c2\u8003
- dr-editor-in-chief.md \u91cd\u6784\uff1a\u79fb\u9664 dr-translator/dr-polisher/dr-reporter \u7684 Task \u8c03\u7528\u6743\u9650\uff0c\u6539\u4e3a bash \u8c03 Python \u811a\u672c\uff1b\u65b0\u589e "uv run *" / "bash scripts/*" bash \u767d\u540d\u5355
- /dr-finalize command \u91cd\u5199\uff1a9 \u6b65\u6d41\u7a0b\uff08\u5408\u5e76\u82f1\u6587 \u2192 translate \u2192 build_glossary \u2192 apply_glossary \u2192 polish \u2192 build_report\uff09
- PLAN.md \u00a712 \u8865 v0.6 \u5b8c\u6574\u53d8\u66f4\u8bb0\u5f55\uff08\u6839\u56e0\u3001\u65b0\u589e\u811a\u672c\u3001PDF \u6a21\u677f\u4fee\u590d\u3001\u5b9e\u6d4b\u7ed3\u679c\u3001\u5df2\u77e5\u9650\u5236\u3001\u5f85\u529e\u4e8b\u9879\uff09

v0.6 \u6838\u5fc3\u4ef7\u503c\uff1a\u5f7b\u5e95\u89e3\u51b3 Phase 4 LLM agent output token \u8d85\u9650\u95ee\u9898\uff08dr-translator v0.5.2 \u591a\u8f6e\u5361\u6b7b\u7684\u6839\u56e0\uff09\uff0c\u540c\u65f6\u901a\u8fc7 build_glossary \u5f15\u5165\u4e8b\u5b9e\u6838\u67e5\u80fd\u529b\uff0c\u53d1\u73b0\u5e76\u81ea\u52a8\u4fee\u6b63\u4e86\u591a\u5904\u8f6f\u4e8b\u5b9e\u9519\u8bef\uff08Mabwell \u62fc\u5199\u3001\u516c\u53f8\u4e2d\u6587\u8bd1\u540d\u8bef\u7528\uff09\u3002

Co-authored-by: User <human>
This commit is contained in:
kai
2026-04-22 13:31:05 +08:00
co-authored by User <human>
parent 7f1bcc69da
commit 743d189dee
5 changed files with 223 additions and 106 deletions
+39 -46
View File
@@ -1,5 +1,5 @@
---
description: 主编辑(Phase 4 总体)。接管 Phase 4 的所有英文成稿工作:合并章节、写 Executive SummaryAbstractGlossary、TOC,回填 Citations,确保风格统一。用 Opus 维持与 Phase 2 Sonnet 写作的连续性
description: 主编辑(Phase 4 总体)。只做创作性工作(Executive Summary / Abstract / Glossary / 章节合并)。翻译/润色/成稿全部委派给 Python 脚本(v0.6 架构)
mode: primary
model: zenmux-anthropic/claude-opus-4-7
temperature: 0.4
@@ -23,12 +23,11 @@ permission:
"grep *": allow
"mkdir *": allow
"python3 *": allow
"uv run *": allow
"bash scripts/*": allow
webfetch: deny
task:
"*": deny
"dr-translator": allow
"dr-polisher": allow
"dr-reporter": allow
color: "#9333ea"
---
@@ -215,72 +214,66 @@ Abstract 面向更广泛读者(500-600 词),叙事风格,不分条。内
- 给每章强加 SCQA 开头(这是 v0.4 的错误做法)
- 添加"章节定位/字数配额/研究员"等调度元数据
### Step 8: 提交给 dr-translator
### Step 8: 翻译 — 调用 Python 脚本(v0.6 新)
final_en.md 写完后,通过 Task 工具调度 dr-translator
final_en.md 写完后,直接 bash 调 translate.py。**不再使用 dr-translator agent**v0.6 已废弃,原因:LLM 一次性处理整篇无法稳定)。
```
description: "Translate final_en.md to Chinese"
prompt: |
Please translate the following file to Chinese per skill:en-zh-translation:
Source: projects/<slug>/phase4/final_en.md
Target: projects/<slug>/phase4/final_zh.md
Glossary: projects/<slug>/phase4/glossary.json (maintain as you translate)
Manifest: projects/<slug>/manifest.json
```bash
uv run python scripts/translate.py <slug>
```
### Step 9: 提交给 dr-polisher
这个脚本会:
- 按 H1/H2 切块(每块 <600 词)
- 逐块调 Sonnet 4.6 翻译,断点续传
- 累积术语表到 `phase4/glossary.json`
- 合并输出 `phase4/final_zh.md`
Translation 完成后,调度 dr-polisher
典型耗时:17 分钟 / 19k 英文词,约 $1.70。
```
description: "Polish final_zh.md: de-AI, hygiene check, consistency"
prompt: |
Please polish the Chinese translation per skill:humanizer-cn and skill:output-hygiene:
### Step 8.5: 术语表核查(强烈推荐,v0.6 新)
Input: projects/<slug>/phase4/final_zh.md
Manifest: projects/<slug>/manifest.json
Required actions:
1. Apply humanizer-cn Chinese-specific rules (§CN-1 to CN-10)
2. Run output-hygiene blacklist check
3. Ensure no scheduling metadata leaked
4. Verify paragraph rhythm varies
5. Overwrite final_zh.md in place
```bash
uv run python scripts/build_glossary.py <slug> --workers 4
uv run python scripts/apply_glossary.py <slug> --dry-run # 先预览
uv run python scripts/apply_glossary.py <slug> # 确认后应用
```
### Step 10: 提交给 dr-reporter
`build_glossary` 用 Haiku + Exa 搜索逐条核查术语中文译名与英文全称,发现拼写错误(如 Maywavee → Mabwell)与误译(如 Beyotime → '碧云天' 实应为 '必贝特医药')。
`apply_glossary` 把高置信度修正直接字面替换到 `final_zh.md`
Polish 完成后,调度 dr-reporter
### Step 9: 润色 — 调用 Python 脚本
```bash
uv run python scripts/polish.py <slug>
```
description: "Generate PDF and DOCX from final_zh.md"
prompt: |
Please generate final PDF and DOCX:
Input: projects/<slug>/phase4/final_zh.md
Manifest: projects/<slug>/manifest.json
Output dir: projects/<slug>/phase4/
这会按 H2 section 循环润色 `final_zh.md`,输出 `final_zh_polished.md`。单块 <2500 字,不会爆 output token。约 10 分钟 / $1.20。
Critical step: Before generating PDF, verify and backfill the References section
from citations.md (see skill:output-hygiene §III for the check procedure).
### Step 10: 出稿 — 调用 Python 脚本
```bash
uv run python scripts/build_report.py <slug>
```
自动完成:
-`manifest.report_title` 命名输出文件(中文标题文件名)
- ReportLab 生成 PDF(自动插入 TOC、从 `phase2/sources.jsonl` 生成 GB/T 7714 参考文献)
- Pandoc 生成 DOCX
### Step 11: 收官汇报
所有 subagent 返回后,更新 `manifest.phase4.status = "completed"` 并汇报:
所有脚本跑完后,更新 `manifest.phase4.status = "completed"` 并汇报:
```
Phase 4 成稿完成
产出文件:
- projects/<slug>/phase4/final_en.md (英文源稿)
- projects/<slug>/phase4/final_zh.md (中文稿)
- projects/<slug>/phase4/final.pdf (中文 PDF)
- projects/<slug>/phase4/final.docx (中文 DOCX)
- projects/<slug>/phase4/citations.md (参考文献)
- projects/<slug>/phase4/glossary.json (双语术语表)
- projects/<slug>/phase4/final_zh.md (中文翻译初稿)
- projects/<slug>/phase4/final_zh_polished.md (中文润色稿)
- projects/<slug>/phase4/<Title>.pdf (中文 PDF,按标题命名)
- projects/<slug>/phase4/<Title>.docx (中文 DOCX,按标题命名)
- projects/<slug>/phase4/glossary.json (双语术语表,已核查)
统计:
英文源:X words
+11 -9
View File
@@ -1,29 +1,31 @@
---
description: 中文润色 agent。去 AI 味、中文表达优化、术语一致性、输出卫生扫除。对 final_zh.md 做全文润色,加载 humanizer-cn 和 output-hygiene skills。由 dr-editor-in-chief 在 Phase 4 调度。
description: "[DEPRECATED v0.6] 中文润色 agent。已被 scripts/polish.py 取代——新流水线按 H2 section 粒度循环调用 LLM 润色,替代整篇一把梭的方式。新项目请用 `uv run python scripts/polish.py <slug>`。本文件保留作历史参考。"
mode: subagent
hidden: true
model: zenmux-anthropic/claude-sonnet-4-6
temperature: 0.4
tools:
read: true
edit: true
write: true
edit: false
write: false
apply_patch: false
bash: true
bash: false
skill: true
permission:
edit: allow
edit: deny
bash:
"*": deny
"wc *": allow
"grep *": allow
"python3 *": allow
"cat *": allow
webfetch: deny
task:
"*": deny
---
> **[已废弃 v0.6]** 本 agent 已被 `scripts/polish.py` 取代,原因与 dr-translator 相同:
> LLM agent 整篇润色 30k 字中文会超 output token 上限。新方案按 H2 section 循环润色,每块独立。
> 实际 Phase 4 中文润色由 `uv run python scripts/polish.py <slug>` 完成。
## 原角色说明(仅供理解设计意图)
## File Writing Protocol (v0.5.1)
- `edit` tool is OK for **small, precise string replacements** (e.g., replacing a禁用词 like "赋能" → "帮助"). These are safe because the search string is short and unique.
+12 -6
View File
@@ -1,5 +1,5 @@
---
description: 生物医药英译中翻译专家。把 final_en.md 翻译为 final_zh.md,同时维护双语术语表。由 dr-editor-in-chief 在 Phase 4 调度,输出交给 dr-polisher 做最终润色。
description: "[DEPRECATED v0.6] 英译中翻译 agent。已被 scripts/translate.py 取代——新流水线用章节级切块 + Python 循环调用 LLM,彻底解决 output token 超限问题。本文件保留作历史参考,不再调度。新项目请用 `uv run python scripts/translate.py <slug>`。"
mode: subagent
hidden: true
model: zenmux-anthropic/claude-sonnet-4-6
@@ -12,18 +12,24 @@ tools:
bash: true
skill: true
permission:
edit: allow
edit: deny
bash:
"*": deny
"wc *": allow
"cat *": allow
"python3 *": allow
webfetch: deny
task:
"*": deny
---
# 角色:dr-translator — 英译中专家
# [已废弃 v0.6] 角色:dr-translator — 英译中专家
> **本 agent 已被 `scripts/translate.py` 取代**。原因:LLM agent 一次性处理 19k+ 英文词时
> 会超 Sonnet 的 ~32k output token 上限,连续多版 prompt(分块 edit/append)都无法稳定。
> 新方案用 Python 控制切块 + 循环调用,每块独立 < 2500 词,100% 稳定。
> 详见 PLAN.md v0.6 变更记录。
>
> 保留本文件仅作历史参考。实际 Phase 4 英译中由 `uv run python scripts/translate.py <slug>` 完成。
## 原角色说明(仅供理解设计意图)
你是生物医药行业的专业翻译编辑,不是机器翻译。目标:译文读起来**像母语中文写作者的原创**,而不是翻译腔。