kai
c444007f04
v0.8: Serper 集成 + H1 章节标题双行居中 + 反方证据观点化 + 术语核查命令
...
新增:Google 系检索(SerpAPI → Serper.dev)
- scripts/lib/serper_client.py:封装 serper.dev 的 Google Search / Scholar / News / Patents
- 专利检索用 site:patents.google.com 技巧,serper.dev 没专用 endpoint 但效果很好
- Scholar 带引用数、年份、期刊信息,便于权威信源识别
- News 支持 time_range(d/w/m/y)时效性过滤
- scripts/lib/search_client.py 扩展为多路由门面:
- search() 通用:Exa → Tavily
- patents() 专利:Serper(Google Patents)→ 通用搜索 + site: 兜底
- scholar() 论文:Serper Scholar → 通用搜索兜底
- news() 新闻:Serper News → 通用搜索兜底
- 所有 httpx 客户端 trust_env=False,绕过系统 socks5 代理(v0.6 修过的 TLS EOF)
- .opencode/skills/search-strategy/SKILL.md §三重写:按查询类型路由,明确何时用哪个 API
H1 章节标题:两行居中 + 装饰横线
- 新增 ParagraphStyle: h1-chapter-num / h1-chapter-title
- 新增 parse_chapter_title() 支持中文/阿拉伯/混合空格章号:
"第一章" / "第 9 章" / "第6章" / "Chapter 1" 全覆盖
- 分隔符支持: em dash — / en dash – / - / : / :
- 新增 build_chapter_header():章号小字居中 + 章名大字深蓝居中 + HRFlowable 3cm 装饰线
- 只对正文章节(_title_kind == "chapter")启用;前置件(免责声明/执行摘要/术语表/目录)
仍用单行 h1 样式
反方证据段规范化(用户反馈 v0.7 问题 #5)
- skill:evidence-table 新增 §"正文中反方证据段落的写作规范":
- 禁止机械标题"反驳证据" / "Counter-Evidence" / "反方观点"
- 必须观点化,包含具体判断(如"另一种声音:管线虚胖还是真实进展?")
- 用 H2 或 H3,禁止加粗段冒充标题
- 给出段落结构模板(1-2 句过渡 → 列表型反方论点 → 整合判断)
- dr-analyst.md Hard Rules #3 改为引用该规范
术语表事实核查前置(新 command /dr-glossary)
- 新增 .opencode/commands/dr-glossary.md,支持 --from phase1|phase2|phase4 三个时机
- Phase 1 末 / Phase 2 初:从 framework.md 抽取专有名词种子表,在 dr-analyst 起草前
预先核查公司名/产品名/技术名拼写,避免编造错误(Mabwell → Maywavee 这类)
- Phase 4:维持当前用法,对 glossary.json 全量核查
实测:dual-target-rnai-pipeline-2026 重生 PDF 55 页,所有 10 章标题双行居中正确渲染
(第一章/第二章/... 第十章 / 第 6 章 / 第 9 章 多种形式都识别)。
2026-04-22 17:04:05 +08:00
kai
09f681beb5
v0.7.2: 前置件排版重构 + emoji 禁令 + 引文核查
...
用户反馈 7 个 bug 修复:
1. 禁止 LLM 使用 emoji(全链路)
- scripts/prompts/translate_system.txt 增加规则 12
- scripts/prompts/polish_system.txt 增加规则 7
- .opencode/agents/dr-analyst.md Hard Rules 增加第 10 条(同时把 prompt 自身的 ✅ ❌ 改为 MUST / MUST NOT)
- .opencode/agents/dr-editor-in-chief.md 禁止事项加入 emoji 条款
- .opencode/skills/output-hygiene/SKILL.md 新增 §J emoji 强制禁用
2. 术语表位置错误(应在目录之后)
重构 build_body 为两阶段:
(a) 扫描所有前置件(第一个正文 H1 前的所有 H1/H2),按 title_kind 分组收集
(b) 按固定顺序渲染:免责声明 → 执行摘要 → 目录 → 术语表 → 正文 → 参考文献
无论 Markdown 原文顺序如何,排版都一致。
3. 执行摘要/术语表提升为一级标题 + 分页空页 bug
统一所有独立章节(disclaimer/executive_summary/toc/glossary/references)用 h1 样式,
章节前 PageBreak;但第一个独立章节不 PageBreak(封面后已换页,避免空白)。
去掉 build_toc 内部末尾 PageBreak(原双 PageBreak 夹出空白页)。
4. 参考文献分页
已作为独立章节自动分页。
5. 附录章节自动删除
_title_kind 识别 "appendix" / "version_history" / "abstract" 全部跳过。
正文中若写了这些章节,模板直接丢弃。
6. 信源完整性核查
新增 scripts/check_citations.py:
- 孤立引用(正文有 sources 无)检测
- 孤岛信源(sources 有正文无)检测
- emoji 扫描
- 实测发现项目中 61 条孤立引用(dr-analyst 编造的占位符)+ 5 条孤岛信源
7. git commit message 中文转义 bug
之前 commit 用 shell 双引号 + 反斜杠导致 \uXXXX 字面保留。
本 commit 用 heredoc 保证中文以 UTF-8 直接写入。
已 push 的历史不改,之后都用本 commit 的写法。
PDF 验证结果:55 页,0 空白页。
章节起始页:封面(1) - 免责声明(2) - 执行摘要(3) - 目录(5) - 术语表(7) -
第一章(12) - 第十章(48) - 参考文献(52)。
2026-04-22 16:31:01 +08:00
kai
333b7bb8d5
v0.5.1: disable apply_patch in agents prone to append-mode failures
...
Root cause: apply_patch finds anchor lines in read-cached file state,
but file may have been modified between read and patch, causing stalls.
Changes:
- dr-verifier: disable apply_patch AND edit; force read-then-write protocol for evidence file appends
- dr-analyst: document write-preferred protocol for sources.jsonl appends
- dr-polisher: disable apply_patch; keep edit for small string replacements
- dr-editor-in-chief / dr-translator: disable apply_patch
Recovery procedure documented in dr-verifier for write failures.
2026-04-21 14:44:03 +08:00
kai
a092af4398
v0.5: deep quality refactor (P0+P1+P2)
...
- Split dr-chief-editor (Phase 3 read-only) vs new dr-editor-in-chief (Opus, Phase 4 lead)
- New dr-translator (en->zh) and new humanizer-cn / output-hygiene / en-zh-translation skills
- Switch to English working language (Phase 2-3), final Chinese translation (Phase 4)
- /dr-init: add report title proposals + word budget mode
- /dr-frame: bilingual framework
- /dr-finalize: new chain editor->translator->polisher->reporter
- report-template.py: widows/orphans/keepWithNext, 3-color hierarchy, confidentiality banner
- dr-reporter: mandatory citations backfill + output hygiene check
- dr-pm: batch-level context compression via manifest.batches_summary
- mckinsey-method: SCQA only for Executive Summary + chapter intros (no explicit labels)
- length-budget: 4 word-budget modes + en/zh 1:1.4 ratio
2026-04-21 13:02:54 +08:00
kai
4a38f6bed1
snapshot before v0.5 refactor
2026-04-21 12:31:58 +08:00