fix: [bug] step2 IR extraction 生成 list 类型 section 字段导致 conftest 崩溃 - 来自 #64 修复 - Closes #69 #72

Merged
pzhang_zywl merged 1 commits from dev/issue-69-fix-list-section into main 2026-06-02 17:45:40 +08:00
Owner

Summary

  • _normalize_rule: 新增 _clean_section() 处理 list 类型 section
    • list → 取首元素转 string
    • 空 list → 回退到 rule path 推断
  • 新增 2 UT: test_normalize_section_is_list, test_normalize_section_is_empty_list

Root Cause

LLM 在 step2 输出 source 时 section 字段格式不稳定(有时 string,有时 list),
导致 _normalize_rulesec.strip() 抛出 AttributeError。

Closes #69


[da-0602-1321]

## Summary - `_normalize_rule`: 新增 `_clean_section()` 处理 list 类型 section - list → 取首元素转 string - 空 list → 回退到 rule path 推断 - 新增 2 UT: test_normalize_section_is_list, test_normalize_section_is_empty_list ## Root Cause LLM 在 step2 输出 source 时 section 字段格式不稳定(有时 string,有时 list), 导致 `_normalize_rule` 中 `sec.strip()` 抛出 AttributeError。 Closes #69 --- [da-0602-1321]
pzhang_zywl added 1 commit 2026-06-02 17:45:11 +08:00
LLM 输出 section 字段有时为 list 而非 string,导致 .strip() 崩溃。
添加 _clean_section() 将 list→首元素 string,空 list 回退到 rule path。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
pzhang_zywl merged commit 6b1424b1c4 into main 2026-06-02 17:45:40 +08:00
Sign in to join this conversation.