fix: [bug] IR Layer A 仍失败: rules[56] 空 sources + Layer C QE Audit 100% 不合格 - 来自 #18 - Closes #64 #65

Merged
pzhang_zywl merged 1 commits from dev/issue-64-fix-empty-sources into main 2026-06-02 17:26:02 +08:00
Owner

Summary

  • step3 _normalize_rule: 空 sources 的 rule 自动添加最小 text source
    • 从 rule path 推断 section
    • 提供 text_snippet 占位符

Root Cause

LLM 在 step2 生成的 rule 可能包含空 sources 数组,违反 Layer A schema 要求
(sources: must have at least one source)。

Test

  • pytest: 109 passed, 15 skipped
  • 新增 UT: test_normalize_empty_sources

Closes #64


[da-0602-1321]

## Summary - step3 `_normalize_rule`: 空 sources 的 rule 自动添加最小 text source - 从 rule path 推断 section - 提供 text_snippet 占位符 ## Root Cause LLM 在 step2 生成的 rule 可能包含空 sources 数组,违反 Layer A schema 要求 (sources: must have at least one source)。 ## Test - [x] pytest: 109 passed, 15 skipped - [x] 新增 UT: test_normalize_empty_sources Closes #64 --- [da-0602-1321]
pzhang_zywl added 1 commit 2026-06-02 17:25:27 +08:00
防御性处理 LLM 输出中 sources 为空数组的情况,避免 Layer A schema 失败。

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