fix: 修复 trigger.operator null + 添加覆盖反馈重试 - Closes #22, Closes #21
CI / test (pull_request) Successful in 7s

#22: _normalize_rule 补充 trigger 级别 operator (AND/OR) 默认值
#21: step1 验证失败时自动生成覆盖反馈并重试一轮
#22: step2 过滤空规则片段,避免污染下游

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 20:20:54 +08:00
parent 24dc6ff00c
commit 62266dde4d
3 changed files with 49 additions and 2 deletions
@@ -497,6 +497,13 @@ def main():
print(f"\n[2/3] 逐单元提取 IR 规则...")
fragments = extract_all_rules(semantic_index, doc)
# Filter out fragments with empty rules (LLM extraction failures)
empty_units = [f["unit_id"] for f in fragments
if not f.get("rules") and not f.get("error")]
if empty_units:
print(f" [WARN] {len(empty_units)} 个单元规则为空,已过滤: {empty_units}")
fragments = [f for f in fragments if f.get("rules") or f.get("error")]
# 3. Save
print(f"\n[3/3] 保存 IR 片段...")
config.save_json(fragments, config.IR_FRAGMENTS_JSON)