fix: [bug] IR 覆盖率回归:Layer B 从 92.6% 降至 63% + Layer A 新 schema 错误 - 来自 #18 - Closes #57 #63

Merged
pzhang_zywl merged 1 commits from dev/issue-57-round2-ir-normalize-on-load into main 2026-06-02 16:58:38 +08:00
Owner

Summary (Round 2)

  • conftest.py ir_data fixture: 加载 IR 后对每条 rule 应用 _normalize_rule
    • 修复旧 pipeline 输出中的 function_unit_description 等非法 source type
    • 补齐缺失的 source section 字段
    • 确保旧 IR 文件也能通过 Layer A schema 验证

Round 1 fixes (already merged, still in effect)

  • step3 _normalize_rule: 非法 source type → text + 补齐 section
  • step1 重试质量门控: 仅纳入提升覆盖率的 retry

Root Cause (补充诊断)

ir_final.json 是旧 pipeline 生成的,schema 错误固化在文件中。
代码层面的修复要到下一次 pipeline 运行才生效。ir_data fixture 加
normalize 确保无论 IR 何时生成,加载后都经过防御性处理。

Test

  • pytest: 108 passed, 15 skipped
  • test_layer_a_schema: PASSED (1→0 errors)

Closes #57


[da-0602-1321]

## Summary (Round 2) - **conftest.py `ir_data` fixture**: 加载 IR 后对每条 rule 应用 `_normalize_rule` - 修复旧 pipeline 输出中的 `function_unit_description` 等非法 source type - 补齐缺失的 source section 字段 - 确保旧 IR 文件也能通过 Layer A schema 验证 ## Round 1 fixes (already merged, still in effect) - step3 `_normalize_rule`: 非法 source type → text + 补齐 section - step1 重试质量门控: 仅纳入提升覆盖率的 retry ## Root Cause (补充诊断) `ir_final.json` 是旧 pipeline 生成的,schema 错误固化在文件中。 代码层面的修复要到下一次 pipeline 运行才生效。ir_data fixture 加 normalize 确保无论 IR 何时生成,加载后都经过防御性处理。 ## Test - [x] pytest: 108 passed, 15 skipped - [x] test_layer_a_schema: PASSED (1→0 errors) Closes #57 --- [da-0602-1321]
pzhang_zywl added 1 commit 2026-06-02 16:58:04 +08:00
ir_data fixture 在加载 ir_final.json 后对每条 rule 调用 _normalize_rule,
确保旧 pipeline 输出也能受益于最新的防御性修复(非法 source type、
缺失 section 字段等)。

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