fix: step1 空章节过滤 + step3 rule_signature None-safe - Closes #21
CI / test (pull_request) Successful in 9s

- 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>
This commit is contained in:
2026-06-01 13:15:19 +08:00
parent d1e36b20ee
commit ebda8e37d1
2 changed files with 21 additions and 3 deletions
@@ -111,8 +111,8 @@ def load_path_enumeration() -> dict:
def rule_signature(rule: dict) -> str:
"""Generate a dedup signature from path + trigger + actions."""
path = rule.get("path", [])
trigger = rule.get("trigger", {})
actions = rule.get("actions", [])
trigger = rule.get("trigger") or {}
actions = rule.get("actions") or []
conditions = sorted(
trigger.get("conditions", []), key=lambda c: c.get("signal", "")