from typing import Literal

Tier = Literal["auto", "review", "low"]


def classify_tier(
    score: float,
    suggest: float,
    auto_link: float,
    evidence_strength: float,
) -> Tier:
    """
    Classify a suggestion into a tier based on provided thresholds.

    IMPORTANT: Do not hardcode thresholds; only use the passed-in values.
    Rule of thumb:
      - if score >= auto_link and evidence_strength >= 0.6 -> "auto"
      - elif score >= suggest -> "review"
      - else -> "low"
    """
    try:
        s = float(score)
        s_suggest = float(suggest)
        s_auto = float(auto_link)
        strength = float(evidence_strength)
    except Exception:
        # Defensive: if non-numeric inputs, fall back to safest classification
        return "low"

    if s >= s_auto and strength >= 0.6:
        return "auto"
    if s >= s_suggest:
        return "review"
    return "low"
