fix: step1 空章节过滤 + step3 rule_signature None-safe - Closes #21 #31

Merged
pzhang_zywl merged 1 commits from dev/issue-21-fix-empty-section-coverage into main 2026-06-01 13:19:21 +08:00
Owner

Summary

  • step1 _quick_validate: 添加 _has_section_content() 过滤空内容章节(如仅含"无"字的图片章节),修复覆盖率误报
  • step3 rule_signature: 使用 or {} 防御 trigger=None 导致的 AttributeError

Root Cause

  • 4 个未覆盖章节在 parsed JSON 中仅 1 个字符"无",无图无表——来自 doc_parser 无法解析的图片内容
  • step3 rule_signature 在 _normalize_rule 之前调用,LLM 产出的 trigger: null 会崩溃

Test

  • pytest 全量通过 (79 passed, 13 skipped)
  • step1 _has_section_content 与 QE tests/acceptance 逻辑一致

Closes #21

[da-0601-0914]

## Summary - step1 _quick_validate: 添加 _has_section_content() 过滤空内容章节(如仅含"无"字的图片章节),修复覆盖率误报 - step3 rule_signature: 使用 or {} 防御 trigger=None 导致的 AttributeError ## Root Cause - 4 个未覆盖章节在 parsed JSON 中仅 1 个字符"无",无图无表——来自 doc_parser 无法解析的图片内容 - step3 rule_signature 在 _normalize_rule 之前调用,LLM 产出的 trigger: null 会崩溃 ## Test - [x] pytest 全量通过 (79 passed, 13 skipped) - [x] step1 _has_section_content 与 QE tests/acceptance 逻辑一致 Closes #21 [da-0601-0914]
pzhang_zywl added 1 commit 2026-06-01 13:17:48 +08:00
- step1 _quick_validate 添加 _has_section_content() 过滤空内容章节
  (如仅含"无"字的图片章节),避免误报低覆盖率警告
- step3 rule_signature 使用 `or {}` 防御 trigger=None 场景
  修复 QE 报告的 step3 AttributeError

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
pzhang_zywl merged commit 50eb37094a into main 2026-06-01 13:19:21 +08:00
Sign in to join this conversation.