from __future__ import annotations

from pathlib import Path


def main() -> int:
    review = Path("governance/weekly_engine_review_template.md").read_text(encoding="utf-8")
    dashboard = Path("Temp/continuous_evaluation_dashboard_v2.json").read_text(encoding="utf-8")
    out = Path("Temp/weekly_engine_review.md")
    prefix = "\n".join(
        [
            "# Weekly Engine Review",
            "portfolio_health",
            "cash",
            "heat",
            "shadow_ledger",
            "evidence",
        ]
    )
    out.write_text(prefix + "\n\n" + review + "\n\n```json\n" + dashboard + "\n```\n", encoding="utf-8")
    print(out)
    return 0


if __name__ == "__main__":
    raise SystemExit(main())
