fix(writer): 无锚点子章归并父章生成 + 注入后裸重复子节去重
- template_mapper: 按 design §6.5 仅 Heading level<=1 起章,H2/H3 归入
父章 sub_headings(此前每个 heading 独立成章,无 {{section:id}} 锚点的
6 个子章生成后被静默丢弃)
- models: ChapterSpec.sub_headings 字段;to_vars 暴露 sub_headings 变量
- writer_agent: prompt 新增【小节约束】(有子节时按小节顺序以 level=2
heading 组织,不得遗漏或新增)
- docx_injector: 注入后删除同章内与已生成标题同名且完全无内容的模板裸
H2/H3(保守策略:带内容的模板子节保留)
- 真实试运行验证:7 章 / 无静默丢弃告警 / 14 个 H2 无重复
This commit is contained in:
@@ -15,8 +15,9 @@ def test_run_trial_fake_produces_docx_and_report(tmp_path):
|
||||
"--impact-report", str(report),
|
||||
])
|
||||
|
||||
# 章数:真实概要设计书模板 13 章
|
||||
assert result["chapters"] == 13
|
||||
# 章数:真实概要设计书模板按 §6.5 归并后为 7 个 H1 章
|
||||
#(H2/H3 子节归入父章,不再独立成章被丢弃)
|
||||
assert result["chapters"] == 7
|
||||
# 影响调查 summary 与 MVP 基线一致
|
||||
assert result["summary"] == {
|
||||
"total": 16, "new": 5, "modified": 8, "deleted": 3,
|
||||
|
||||
Reference in New Issue
Block a user