"""The enhanced validator independently recomputes the optimum; check presence here.""" from pathlib import Path for name in ('threshold_report.txt', 'threshold_metrics.json'): assert Path(name).is_file() and Path(name).stat().st_size, f'missing {name}'