From dbf8c12881d8766437eb9f41f0ff61cb2b841dd8 Mon Sep 17 00:00:00 2001 From: lhl Date: Wed, 12 Aug 2026 23:32:52 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20Phase5=20spec=20=E8=87=AA=E5=AE=A1?= =?UTF-8?q?=E5=9B=BA=E5=8C=96=E4=B8=A4=E5=A4=84=E6=AD=A7=E4=B9=89=EF=BC=88?= =?UTF-8?q?=E5=BE=AA=E7=8E=AF=E8=80=97=E5=B0=BD=E6=A0=87=E8=AE=B0=20/=20no?= =?UTF-8?q?te=20=E6=B8=B2=E6=9F=93=E9=99=8D=E7=BA=A7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../specs/2026-08-12-phase5-writer-qa-design.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/superpowers/specs/2026-08-12-phase5-writer-qa-design.md b/docs/superpowers/specs/2026-08-12-phase5-writer-qa-design.md index bb2a99e..943dd73 100644 --- a/docs/superpowers/specs/2026-08-12-phase5-writer-qa-design.md +++ b/docs/superpowers/specs/2026-08-12-phase5-writer-qa-design.md @@ -114,7 +114,7 @@ class GenerationContext: - 调用 `DocxInjector(template_path).inject(sections, meta)` - **扩展 T17 DocxInjector**:`Block.kind` 新增 `list`/`note` 支持 - `list`:逐 item 生成 `doc.add_paragraph(item, style="List Bullet"|"List Number")` - - `note`:生成带注释样式段落(如 `doc.add_paragraph(text, style="Intense Quote")` 或普通段落加前缀) + - `note`:生成带「注記」语义的段落——优先使用模板中名为 `Note`/`Intense Quote` 的样式;若模板无对应样式则降级为普通段落并加「※ 」前缀 - 扩展以 TDD 方式验证,不破坏既有 paragraph/heading/table ### 3.6 `services/rag_service.py`(新) @@ -155,10 +155,11 @@ class GenerationContext: | engine.chat_structured 失败(status=failed) | 抛 `WriterGenerationError`,qa_loop 捕获并记为该章生成失败,计入报告 | | source_uri 校验 unresolved | 不阻断生成,记录于 block,QA traceability 维度扣分 | | DocxInjector 残留 `{{...}}` | 抛 `DocxInjectError`,上浮 qa_loop,标记渲染失败 | -| QA 循环达 `max_rounds` 仍 fail | 停循环,报告 `passed=False` + 人工介入提示(OV6 护栏) | +| QA 循环达 `max_rounds` 仍 fail | 停循环,报告 `passed=False` + `needs_human=True` + 轮次数(OV6 护栏) | | fallback 模型不可用 | `resolve_qa_model` 返回 None 时,QA 语义维度退化为中性分并记录告警(不静默回退 primary) | -新增异常:`writer/exceptions.py` → `WriterGenerationError`;`qa/exceptions.py` → `QALoopExhaustedError`(可选,或复用报告标记)。 +新增异常:`writer/exceptions.py` → `WriterGenerationError`。 +QA 循环耗尽**不新增独立异常**,由 `QAReport(passed=False, rounds=max_rounds, needs_human=True)` 标记(与 T15 `QALoopController.is_exhausted()` 一致)。 ## 5. 设计对齐与文档同步