""" Quality check layer for translations. Tracks: A1 — L0 backend (pure Python, no API calls). Always available. A2 — L0 frontend JavaScript mirror. Browser/Node compatible. A3 — L1 LLM judge (API-based, opt-in). Cheap model, sampled. Designed to be ADDITIVE: existing translation flow is untouched. Public API: L0: QualityCheckResult — per-chunk result dataclass DocumentQualityResult — aggregated result dataclass evaluate_chunk(...) — score a single (source, translation) pair evaluate_document(...) — score a list of pairs and aggregate run_l0_check(...) — defensive wrapper used by the route extract_sample(...) — extract text from a finished file L1: L1Result — verdict dataclass LLMJudge — judge client run_l1_check(...) — async wrapper used by the route sample_chunks_for_l1(...) — pick representative chunks Helpers: get_script, isArabicScriptLang """ from .script_detector import ( QualityCheckResult, DocumentQualityResult, evaluate_chunk, evaluate_document, detect_arabic_variant, ) from .pipeline import run_l0_check, run_l1_check from .file_extractor import extract_sample from .sampler import sample_chunks_for_l1 from .llm_judge import L1Result, L1ChunkVerdict, LLMJudge __all__ = [ # L0 "QualityCheckResult", "DocumentQualityResult", "evaluate_chunk", "evaluate_document", "detect_arabic_variant", "run_l0_check", "extract_sample", # L1 "L1Result", "L1ChunkVerdict", "LLMJudge", "run_l1_check", "sample_chunks_for_l1", ]