"""AR 6 个 SubPattern 的 distractor_rules 含单维反事实约束关键词。"""

from app.question_gen.strategy_action_recognition import AR_SUB_PATTERNS


def test_all_sub_patterns_enforce_single_dimension_counterfactual():
    for sp in AR_SUB_PATTERNS:
        rules = sp.distractor_rules
        assert "真实" in rules, sp.name  # 干扰项须真实发生
        assert ("单一维度" in rules or "只在" in rules or "仅在" in rules), sp.name
        assert ("缺席" in rules or "未出现" in rules or "凭空" in rules), sp.name


def test_sub_pattern_count_unchanged():
    assert len(AR_SUB_PATTERNS) == 6
