from pathlib import Path import runpy path=Path(__file__).parent/'write_final_report.py' text=path.read_text(encoding='utf-8') text=text.replace("'test_review_handoff.py', 'test_handoff_safety.py', 'test_handoff_evidence.py',", "'test_review_handoff.py', 'test_handoff_safety.py', 'test_handoff_evidence.py', 'test_queued_handoff_report.py',") text=text.replace("assert all(item['passed'] for item in frontend['results'])", "assert all(item['passed'] for item in frontend['results'])\nassert not frontend['errors']") path.write_text(text,encoding='utf-8') runpy.run_path(str(path),run_name='__main__')