Write report.json to the run directory.
(run_dir: str, report: ExtractionReport)
| 416 | |
| 417 | |
| 418 | def _write_report(run_dir: str, report: ExtractionReport) -> None: |
| 419 | """Write report.json to the run directory.""" |
| 420 | path = os.path.join(run_dir, "report.json") |
| 421 | tmp = path + ".tmp" |
| 422 | with open(tmp, "w") as f: |
| 423 | f.write(report.model_dump_json(indent=2, exclude_none=True)) |
| 424 | f.write("\n") |
| 425 | os.replace(tmp, path) |
| 426 | logger.info("report written to %s", path) |
| 427 | # Clean up standalone batch manifest (now embedded in report). |
| 428 | manifest_path = os.path.join(run_dir, "batch-manifest.json") |
| 429 | if os.path.isfile(manifest_path): |
| 430 | os.remove(manifest_path) |
| 431 | |
| 432 | |
| 433 | # --------------------------------------------------------------------------- |
no outgoing calls