fix: [product] _normalize_rule 增加 screen_type 默认值防御 + step2 test 降级 warn - Closes #86 #87

Merged
pzhang_zywl merged 1 commits from dev/issue-86-screen-type-defense into main 2026-06-03 14:44:50 +08:00
Owner

Summary

  • _normalize_rule 新增 precondition 防御层:screen_type 缺失→"any",geo 缺失→"global",precondition=None→{}
  • test_step2_precondition_fields 降级为 warn(取决于 LLM 输出质量,step3 兜底)
  • 新增 4 个 normalize UT:missing screen_type / missing geo / None precondition / missing precondition

修复类型

  • 代码级修复(UT 可验证)

Test

  • pytest 全量通过 (115 passed, 16 skipped)
  • 新增 4 个 normalize UT

Closes #86


[da-0603-1426]

## Summary - `_normalize_rule` 新增 precondition 防御层:screen_type 缺失→"any",geo 缺失→"global",precondition=None→{} - `test_step2_precondition_fields` 降级为 warn(取决于 LLM 输出质量,step3 兜底) - 新增 4 个 normalize UT:missing screen_type / missing geo / None precondition / missing precondition ## 修复类型 - [x] 代码级修复(UT 可验证) ## Test - [x] pytest 全量通过 (115 passed, 16 skipped) - [x] 新增 4 个 normalize UT Closes #86 --- [da-0603-1426]
pzhang_zywl added 1 commit 2026-06-03 14:44:33 +08:00
pzhang_zywl merged commit bdef679c2b into main 2026-06-03 14:44:50 +08:00
Sign in to join this conversation.