#!/usr/bin/env python3 """Static safety gate for the final merged-model vision evaluation.""" from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def main() -> None: launcher = (ROOT / "scripts" / "phase6_run_final_vision_eval.sh").read_text() for invariant in ( "verify_hf_device_map.py", "bind_vision_eval_run.py", "--no_remove_unused_columns", "--require-complete", "compare_vision_evals.py", "DSV4VL_FINAL_VISION_SEMANTIC_SMOKE=PASS", "DSV4VL_FINAL_VISION_EVAL_AND_IMPROVEMENT=PASS", "DSV4VL_VISION_EVAL_COST_APPROVED", "DSV4VL_VISION_EVAL_AUTO_COST_LIMIT", "calculate_vision_eval_cost.py", "quantization_config", "num_nextn_predict_layers", ): assert invariant in launcher assert "--per-suite 16" in launcher assert "--write_batch_size \"$write_batch\"" in launcher assert "cmp -s \"$MODEL/modeling_dsv4_vl.py\"" in launcher assert launcher.index("DSV4VL_FINAL_VISION_SEMANTIC_SMOKE=PASS") < launcher.index( "DSV4VL_VISION_EVAL_COST_APPROVED" ) assert launcher.index("DSV4VL_VISION_EVAL_COST_APPROVED") < launcher.index( 'run_pending "$FULL_RESULT"' ) print("DSV4VL_FINAL_VISION_EVAL_SCRIPT=PASS") if __name__ == "__main__": main()