"""Evaluation, scoring, and quality assessment constants."""
from wisent.core.constant_definitions.for_experiments.by_domain.analysis import *  # noqa: F401,F403

# --- Evaluator thresholds ---
NLI_MARGIN = 0.12
NLI_ENT_MIN = 0.40
EMB_DELTA_MIN = 0.04
EMB_MATCH_MIN = 0.35
TRUTHFUL_MIN_SIMILARITY = 0.3
TRUTHFUL_MIN_MARGIN = 0.05
VIDEO_TEMPORAL_DECAY = 0.9

# --- Evaluator scoring ---
EVAL_WEIGHT_EMBEDDING = 0.4
EVAL_WEIGHT_NLI = 0.6
EVAL_MIN_MARGIN = 0.05
EVAL_CONFIDENCE_CEILING = 0.95
EVAL_CONFIDENCE_BASELINE = 0.6
EVAL_NLI_THRESHOLD = 0.5
EVAL_NLI_CONF_CEILING = 0.85
EVAL_NLI_CONF_BASE = 0.6
EVAL_NLI_CONF_SCALE = 0.3
EVAL_EMB_THRESHOLD = 0.6
EVAL_EMB_CONF_CEILING = 0.8
EVAL_EMB_CONF_BASE = 0.5
EVAL_EMB_CONF_SCALE = 0.3
EVAL_F1_MATCH_THRESHOLD = 0.8
EVAL_F1_PARTIAL_THRESHOLD = 0.5
EVAL_DEFAULT_DIFFERENCE_SCORE = 50.0
EVAL_DIFFERENCE_CUTOFF = 70
EVAL_W_DIFFERENCE = 0.2
EVAL_W_QUALITY = 0.3
EVAL_W_ALIGNMENT = 0.5
EVAL_CONFIDENCE_BASE = 0.5
EVAL_PAIR_LIMIT = 1500

# --- NLI evaluator ---
NLI_ENTAILMENT_THRESHOLD = 0.45
NLI_REVERSE_ENTAILMENT_THRESHOLD = 0.50
NLI_CONFIDENCE_BASE_WEIGHT = 0.7
NLI_CONFIDENCE_SCALE_WEIGHT = 0.3
NLP_EVAL_CONFIDENCE_BASE = 0.75
NLP_EMB_CONFIDENCE_CAP = 0.8
NLP_EMB_CONFIDENCE_BASE = 0.5

# --- Coherence detection ---
COHERENCE_FUNCTION_WORD_THRESHOLD = 0.15
COHERENCE_SPACE_RATIO_MIN = 0.08
COHERENCE_LONG_TOKEN_LEN = 25
COHERENCE_LONG_TOKEN_RATIO = 0.1
COHERENCE_VALIDITY_RATIO_MIN = 0.3
COHERENCE_UNIQUE_TOKEN_RATIO_MIN = 0.4
COHERENCE_REPETITION_RATIO_MAX = 0.3
COHERENCE_SPECIAL_CHAR_RATIO_MAX = 0.2
COHERENCE_SPECIAL_CHAR_PENALTY = 0.7
COHERENCE_SHORT_RESPONSE_PENALTY = 0.1
COHERENCE_NONSENSE_WORD_RATIO_MAX = 0.15
COHERENCE_TRIGRAM_REPEAT_THRESHOLD = 3
COHERENCE_CONTENT_WORD_REPEAT_THRESHOLD = 3
COHERENCE_RATIO_THRESHOLD = 0.5
COHERENCE_QUALITY_MIN_TOKENS = 4
COHERENCE_DEGENERATION_PENALTY = 0.5

# --- Coherence/text quality thresholds ---
MIN_RESPONSE_TOKENS = 4
MIN_TOKENS_TRIGRAM = 6
MIN_CONTENT_WORD_LENGTH = 4
MIN_TOKEN_LENGTH_NONSENSE = 4

# --- Refusal detection ---
REFUSAL_WEIGHT_CANNOT_ACTION = 1.0
REFUSAL_WEIGHT_PREFER_RATHER = 0.6
REFUSAL_WEIGHT_DECLINE_REFUSE = 0.9
REFUSAL_WEIGHT_NO_SUPPORT = 0.8
REFUSAL_WEIGHT_NO_ABILITY = 0.8
REFUSAL_WEIGHT_REFUSAL_WORD = 0.6
REFUSAL_DETECTION_THRESHOLD = 0.9
REFUSAL_APOLOGY_BONUS = 0.1
REFUSAL_FAMILY_DEFAULT_WEIGHT = 0.5

# --- Quality thresholds ---
QUALITY_THRESHOLD = 50.0
QUALITY_SCORE_SPARSE = 0.1
QUALITY_SCORE_CONCENTRATED = 0.3
QUALITY_SCORE_GOOD = 0.8
QUALITY_SPARSITY_THRESHOLD = 0.99
QUALITY_THRESHOLD_CLAMP_MIN = 0.1
QUALITY_THRESHOLD_CLAMP_MAX = 0.9
MIN_QUALITY_SCORE_OUTPUT = 50.0
MIN_QUALITY_SCORE_DEFAULT = 2
MIN_SNR_EARLY_REJECT = 5.0
MIN_CV_SCORE_EARLY_REJECT = 0.1

# --- Perplexity evaluator ---
EVAL_PERPLEXITY_DIFF_THRESHOLD = 1.0
PERPLEXITY_WIKITEXT_THRESHOLD = 100

# --- Behavioral validation ---
BEHAVIORAL_CONF_IMPROPERLY = 0.5
BEHAVIORAL_CONF_UNEXPECTED = 0.3
BEHAVIORAL_CONF_INEFFECTIVE = 0.1

# --- Preflight compatibility ---
PREFLIGHT_COMPAT_DEFAULT = 0.5
PREFLIGHT_COMPAT_EXCELLENT = 1.0
PREFLIGHT_COMPAT_GOOD = 0.7
PREFLIGHT_COMPAT_ADAPTIVE = 0.9
PREFLIGHT_COMPAT_POOR = 0.3
PREFLIGHT_COMPAT_NEUTRAL = 0.5
PREFLIGHT_COMPAT_THRESHOLD = 0.5
PREFLIGHT_LINEAR_HIGH = 0.8
PREFLIGHT_LINEAR_VERY_HIGH = 0.9
PREFLIGHT_LINEAR_MODERATE = 0.5
PREFLIGHT_CONE_HIGH = 0.7
PREFLIGHT_MANIFOLD_HIGH = 0.8
PREFLIGHT_BIMODAL_MODERATE = 0.6

# --- Code evaluation ---
CODE_CORRECTNESS_THRESHOLD = 0.5
DEFAULT_CODE_EVAL_LIMIT = 20

# --- GPTZero detector ---
GPTZERO_MIN_TEXT_LENGTH = 50
GPTZERO_DEFAULT_NEUTRAL_SCORE = 0.5
GPTZERO_AI_PROB_WEIGHT = 0.7
GPTZERO_AVG_PROB_WEIGHT = 0.3

# --- Generation evaluator ---
GEN_EVAL_HIGH_CONFIDENCE = 0.9

# --- Humanization evaluator ---
HUMANIZATION_COHERENCE_THRESHOLD = 0.3

# --- Optimization evaluator ---
OPTIMIZE_ACCURACY_THRESHOLD_MULT = 0.95

# --- BLEU threshold ---
BLEU_THRESHOLD = 0.5

# --- Diagnostics / quality ---
DIAG_MIN_DIVERGENCE = 0.3
DIAG_MAX_LOW_DIV_FRACTION = 0.1
DIAG_NEAR_DUPLICATE_THRESHOLD = 0.9
DIAG_NUM_COMPONENTS = 5
DIAG_OPTIMIZATION_STEPS = 50
DIAG_MAX_PAIR_COMBINATIONS = 50

# --- Scoring weights ---
BENCHMARK_WEIGHT = 0.7
PROBE_WEIGHT = 0.3
SCORE_WEIGHT_DEFAULT = 0.0

# --- Samples / splits ---
SAMPLES_PER_BENCHMARK = 10
DEFAULT_NUM_SAMPLES = 5
DEFAULT_SPLIT_RATIO = 0.8

# --- Benchmark test limits ---
BENCHMARK_TEST_DATA_LIMIT = 300
BENCHMARK_SPLIT_LIMIT = 15

# --- Null distribution ---
NULL_DISTRIBUTION_SAMPLES = 100
NULL_DISTRIBUTION_SAMPLES_PER_CLASS = 50
MAX_PAIRS_FOR_NULL_TEST = 1000
MAX_PAIRS_FOR_METRICS = 1000
NULL_TEST_Z_SCORE_NORMALIZER = 0.1

# --- Confidence vote thresholds ---
CONFIDENCE_HIGH_VOTES = 4
CONFIDENCE_MEDIUM_VOTES = 3

# --- Confidence bounds ---
CONFIDENCE_UPPER_BOUND = 0.95
CONFIDENCE_LOWER_BOUND = 0.1

# --- Condition number ---
CONDITION_NUMBER_HIGH = 1000

# --- Robustness thresholds ---
ROBUSTNESS_THRESHOLD_STRICT = 0.1
ROBUSTNESS_THRESHOLD_MODERATE = 0.2
ROBUSTNESS_THRESHOLD_LOOSE = 0.3

# --- Eval harness ---
EVAL_HARNESS_NUM_SAMPLES = 100
EVAL_HARNESS_NUM_SAMPLES_SMALL = 5

# --- Relevance semantic scoring ---
RELEVANCE_CONTENT_MATCH_SCORE = 3
RELEVANCE_TAG_MATCH_SCORE = 2
RELEVANCE_POPULAR_BENCHMARK_BONUS = 0.5
RELEVANCE_FAST_HIGH_SCORING_BONUS = 1.0
RELEVANCE_HIGH_SCORING_BONUS = 0.3
RELEVANCE_MEDIUM_SCORING_BONUS = 0.1
RELEVANCE_PRIORITY_BONUS_FAST_HIGH = 0.15
RELEVANCE_PRIORITY_BONUS_HIGH = 0.05
RELEVANCE_PRIORITY_BONUS_MEDIUM = 0.02

# --- Basic metrics ---
PERCENTILE_P10 = 10
PERCENTILE_P25 = 25
PERCENTILE_P75 = 75
PERCENTILE_P90 = 90
PERCENTILE_HIGH = 95
PERCENTILE_CRITICAL = 99
ALIGNMENT_HIGH_THRESHOLD = 0.5
METRICS_TOP_INDICES_LIMIT = 20
METRICS_THRESHOLD_FRACTION_DEFAULT = 0.01
CUMSUM_THRESHOLD_50 = 0.5
CUMSUM_THRESHOLD_90 = 0.9
CUMSUM_THRESHOLD_99 = 0.99

# --- Verify steering analysis thresholds ---
VERIFY_ALIGNMENT_THRESHOLD = 0.3
VERIFY_GATE_ACTIVE_THRESHOLD = 0.7
VERIFY_GATE_PARTIAL_THRESHOLD = 0.3
VERIFY_GATE_VARIANCE_THRESHOLD = 0.1
VERIFY_GOOD_LAYER_THRESHOLD = 0.5

# --- Steering evaluator ---
STEERING_EVAL_NUM_PROMPTS = 30

# --- Task selector quality ---
PARSER_DEFAULT_MIN_QUALITY = 2

# --- Test/inspection defaults ---
NUM_EXAMPLES_DEFAULT = 5
MAX_DOCS_INSPECT = 100

# --- Scoring adjustments ---
STEERING_ICD_WEIGHT = 2.0
STRENGTH_ACCURACY_WEIGHT = 0.5
STEERING_EFFECT_CAP = 100.0
BINARY_CLASSIFICATION_THRESHOLD = 0.5
CONTRASTIVE_SCORE_OFFSET = 2
CONTRASTIVE_SCORE_RANGE = 4
