"""Classification rules for six-dimension analysis."""

# Question level patterns (L1 lowest → L4 highest)
QUESTION_PATTERNS = {
    "L4_Meta": [
        r"复盘", r"反思", r"框架", r"方法论", r"什么不变", r"如何评价",
        r"设计.*策略", r"我需要设计",
    ],
    "L3_Why": [
        r"为什么", r"为啥", r"原因", r"如果.*会怎", r"假设",
        r"本质", r"底层", r"根本",
    ],
    "L2_What": [
        r"什么是", r"对比", r"比较", r"区别", r"分析", r"评估",
        r"有什么.*建议", r"怎样.*合理", r"该怎么看",
    ],
    "L1_How": [
        r"帮我", r"写一个", r"生成", r"创建", r"修改", r"修复",
        r"怎么.*做", r"如何.*实现", r"运行", r"启动", r"部署",
    ],
}

# Judgment signal patterns
JUDGMENT_SIGNALS = {
    "direction_setting": [
        r"我觉得.*应该", r"我认为", r"我判断", r"不应该",
        r"先不", r"先.*再", r"换个", r"不要",
    ],
    "evaluation": [
        r"哪个.*好", r"比较", r"选择", r"值不值", r"合不合理",
        r"有什么.*建议", r"优缺点",
    ],
    "rejection": [
        r"不对", r"不是这样", r"不用", r"太.*了", r"没必要",
    ],
    "uncertainty_tolerance": [
        r"不确定", r"可能", r"不知道.*但", r"试试看",
    ],
}

# Deep thinking keywords
DEEP_THINKING_KEYWORDS = [
    "复盘", "反思", "为什么失败", "总结经验", "教训",
    "深层", "根源", "底层逻辑",
]

# Narrative / writing keywords
NARRATIVE_KEYWORDS = [
    r"写.*文章", r"公众号", r"blog", r"总结.*写", r"说明文档",
    r"怎么解释", r"写成", r"发布",
]

# Output / hands-on keywords (replaces cognitive_stage=="输出" from original)
OUTPUT_KEYWORDS = [
    r"实现", r"开发", r"部署", r"配置", r"执行", r"创建", r"编写",
    r"implement", r"deploy", r"create", r"build", r"fix",
    r"写一个", r"帮我.*写", r"生成.*代码", r"修改.*文件",
    r"commit", r"push", r"发布", r"修复",
]

# Scoring breakpoints: (input_value, output_score)
# Used for piecewise linear mapping of raw values to 0-100 scores
SCORING_BREAKPOINTS = {
    "questioning": [(0, 0), (0.1, 20), (0.3, 50), (0.5, 75), (0.8, 95), (1.0, 100)],
    "judgment": [(0, 0), (0.1, 15), (0.25, 40), (0.4, 65), (0.6, 85), (1.0, 100)],
    "hands_on": [(0, 0), (0.1, 15), (0.3, 45), (0.5, 70), (0.7, 90), (1.0, 100)],
    "deep_thinking": [(0, 0), (0.05, 15), (0.15, 40), (0.3, 70), (0.5, 90), (1.0, 100)],
    "execution": [(0, 0), (1, 15), (3, 45), (5, 70), (6, 85), (7, 100)],
    "narrative": [(0, 0), (0.05, 15), (0.1, 35), (0.2, 60), (0.35, 85), (1.0, 100)],
}

# Dimension display config
DIMENSIONS = {
    "questioning":   {"name": "提问力", "name_en": "Questioning",    "color": "#E74C3C"},
    "judgment":      {"name": "判断力", "name_en": "Judgment",       "color": "#3498DB"},
    "hands_on":      {"name": "动手力", "name_en": "Hands-on",      "color": "#2ECC71"},
    "deep_thinking": {"name": "深思力", "name_en": "Deep Thinking",  "color": "#9B59B6"},
    "execution":     {"name": "践行力", "name_en": "Execution",      "color": "#F39C12"},
    "narrative":     {"name": "叙事力", "name_en": "Narrative",      "color": "#1ABC9C"},
}
