"""
Arbitrary constants. Migrated from _constants_part5.py.
"""
from wisent.core.grp_05.sub_constants.arbitrary.sub_arb._arb_06 import *  # noqa: F401,F403

# --- Tokenization limits ---
MAX_TOKENIZATION_LENGTH = 2048
TOKENIZER_MAX_LENGTH_GEOMETRY = 512
TOKENIZER_MAX_LENGTH_CLUSTER = 1024
TOKENIZER_MAX_LENGTH_NONSENSE = 256
TOKENIZER_MAX_LENGTH_DETECTOR = 768

# --- Extraction strategy ---
EXTRACTION_WEIGHTED_DECAY = 0.5

# --- Statistical significance ---
SIGNIFICANCE_MARGIN = 0.1

# --- Signal detection ---
SIGNAL_STRENGTH_THRESHOLD = 0.6
SIGNAL_PROBE_ACCURACY_THRESHOLD = 0.6

# --- NURT architecture ---
NURT_MAX_CONCEPT_DIM = 10
NURT_FLOW_HIDDEN_MIN = 32
NURT_FLOW_HIDDEN_MAX = 128
NURT_FLOW_HIDDEN_MULTIPLIER = 4

# --- GROM architecture divisors ---
# GROM_GATE_DIM_DIVISOR and GROM_INTENSITY_DIM_DIVISOR defined in _arb_03
GROM_ROUTING_DIM_DIVISOR = 32

# --- GROM create-steering defaults ---
GROM_CREATE_NOISE_SCALE = 0.3
GROM_CREATE_GATE_THRESHOLD = 0.5
GROM_CREATE_LOG_INTERVAL = 50

# --- GROM loss weights ---
# GROM_LOSS_CONCENTRATION_WEIGHT defined in _arb_03 (=0.3)
GROM_LOSS_CAA_TARGET = 1.0

# --- Training logging ---
TRAINING_LOG_INTERVAL = 20

# --- Nonsense baseline generation ---
NONSENSE_MIN_TOKENS = 5
NONSENSE_TOKEN_OFFSET = 100
NONSENSE_Z_SIGNIFICANCE = 2.0

# --- Dimensionality diagnostics ---
SHRINKAGE_INTENSITY_THRESHOLD = 0.3
STATISTICAL_POWER_THRESHOLD = 0.5
PCA_MAX_COMPONENTS_NULL = 50

# --- Sample adequacy ratios (n/d) ---
SAMPLE_RATIO_ADEQUATE = 20
SAMPLE_RATIO_GOOD = 10
SAMPLE_RATIO_ACCEPTABLE = 5

# --- Steering autotuner ---
AUTOTUNER_STRENGTHS = (0.5, 1.0, 1.5, 2.0, 3.0, 5.0)
AUTOTUNER_PROGRESS_INTERVAL = 10

# --- Contrastive pairs diagnostics thresholds ---
PAIRS_MAX_DUPLICATE_FRACTION = 0.05
PAIRS_MIN_UNIQUE_PROMPT_RATIO = 0.75
PAIRS_MIN_AVERAGE_LENGTH = 15

# --- Clustering ---
CLUSTERING_DEFAULT_CONFIDENCE = 0.5
CLUSTERING_MAX_CLUSTERS_DIVISOR = 5

# --- Direction visualization thresholds ---
DIRECTION_ORTHOGONAL_THRESHOLD = 0.1
DIRECTION_ALIGNED_THRESHOLD = 0.9
DIRECTION_HIGH_SIMILARITY = 0.8
DIRECTION_MODERATE_SIMILARITY = 0.5
DIRECTION_LOW_SIMILARITY = 0.1

# --- Verification 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

# --- Agent budget ---
BUDGET_EMA_ALPHA = 0.3
BUDGET_DEFAULT_QUANTITY = 100
BUDGET_RECENCY_WINDOW_DAYS = 90

# --- Classifier marketplace scoring ---
MARKETPLACE_F1_WEIGHT = 0.5
MARKETPLACE_ACCURACY_WEIGHT = 0.2
MARKETPLACE_DATA_QUALITY_WEIGHT = 0.2
MARKETPLACE_RECENCY_WEIGHT = 0.1
MARKETPLACE_DATA_QUALITY_DENOM = 1000

# --- Select classifiers scoring ---
SELECT_F1_WEIGHT = 0.6
SELECT_ACCURACY_WEIGHT = 0.4

# --- Agent improvement detection ---
AGENT_IMPROVEMENT_THRESHOLD = 0.05
AGENT_PENALTY_MULTIPLIER = 0.7

# --- Data generation bounds ---
GENERATE_PAIRS_MIN_TOKENS = 2048
GENERATE_OVERSAMPLING_FACTOR = 1.5

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

# --- Coherence evaluator ---
COHERENCE_QUALITY_MIN_TOKENS = 4

# --- Humanization evaluator ---
HUMANIZATION_COHERENCE_THRESHOLD = 0.3
HUMANIZATION_MAX_LENGTH = 512

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

# --- Pairs similarity/dedup ---
PAIRS_SIMILARITY_THRESHOLD = 0.8

# --- Autotune validation ---
AUTOTUNE_VAL_SPLIT = 0.5

# --- Check-linearity CLI defaults ---
CHECK_LINEARITY_LINEAR_THRESHOLD = 0.7
CHECK_LINEARITY_WEAK_THRESHOLD = 0.5
CHECK_LINEARITY_MIN_COHENS_D = 1.0
CHECK_LINEARITY_DEFAULT_MAX_PAIRS = 50

# --- Concept analysis ---
CONCEPT_K_MAX = 10
CONCEPT_PCA_COMPONENTS = 20
CONCEPT_TOP_SINGULAR_VALUES = 10
ICD_SINGLE_CONCEPT_THRESHOLD = 20
ICD_MODERATE_THRESHOLD = 100
SILHOUETTE_MULTI_CONCEPT_THRESHOLD = 0.3
SILHOUETTE_WEAK_MULTI_THRESHOLD = 0.2

# --- Vector quality scores ---
QUALITY_SCORE_SPARSE = 0.1
QUALITY_SCORE_CONCENTRATED = 0.3
QUALITY_SCORE_GOOD = 0.8
QUALITY_SPARSITY_THRESHOLD = 0.99

# --- Temporal ramp boundaries ---
TEMPORAL_RAMP_MIN = 0.1
TEMPORAL_RAMP_MAX = 1.0

# --- Agent decision defaults ---
AGENT_DECISION_QUALITY_THRESHOLD = 0.3
AGENT_DECISION_TIME_BUDGET = 10.0
AGENT_RESOURCE_BUDGET_MINUTES = 5.0
AGENT_QUALITY_HIGH_THRESHOLD = 0.7
AGENT_CONFIDENCE_HIGH_THRESHOLD = 0.8
AGENT_MAX_RESPONSE_ATTEMPTS = 3
QUALITY_CONTROL_MAX_ATTEMPTS = 5

# --- Classifier creation defaults ---
# CLASSIFIER_TRAINING_SAMPLES defined in _arb_02 (=25)

# --- Database loading limits ---
DATABASE_PAIR_LOADING_LIMIT = 1000
DATABASE_ACTIVATION_LOADING_LIMIT = 500
BENCHMARK_PAIR_LOADING_LIMIT = 60

# --- Sample adequacy marginal ---
SAMPLE_RATIO_MARGINAL = 2

# --- Variance explained threshold (90th percentile) ---
VARIANCE_EXPLAINED_90PCT = 0.9

# --- Confidence bounds (intervention selection) ---
CONFIDENCE_UPPER_BOUND = 0.95
CONFIDENCE_LOWER_BOUND = 0.1

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

# --- GROM initialization (skip PCA component too similar to CAA) ---
GROM_CAA_SIMILARITY_SKIP = 0.9
