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. 设计对齐与文档同步