""" Email the latest LGR landscape report (Word doc attached) to named recipients with a short covering note. Internal only. Usage: python scripts/send_lgr_report.py "Jordan:jordanhart@curiumsolutions.com" "Stu:stuartbailey@curiumsolutions.com" python scripts/send_lgr_report.py --dry-run "Jordan:..." "Stu:..." Each recipient arg is "Name:email". Attaches the most recent intel_assets/lgr_landscape_*.docx. """ from __future__ import annotations import sys from pathlib import Path REPO_ROOT = Path(__file__).resolve().parent.parent sys.path.insert(0, str(REPO_ROOT)) try: from dotenv import load_dotenv load_dotenv(REPO_ROOT / ".env", override=False) except ImportError: pass import mailer import weekly_digest INTEL_DIR = REPO_ROOT / "intel_assets" DRY_RUN = "--dry-run" in sys.argv def _latest_docx() -> Path | None: docs = sorted(INTEL_DIR.glob("lgr_landscape_*.docx")) # Skip Word lock files docs = [d for d in docs if not d.name.startswith("~$")] return docs[-1] if docs else None def _covering_html(name: str, report_date: str) -> str: try: fb = weekly_digest._feedback_prompt_html(recipient_name=name) except Exception: fb = "" return f"""
Hi {name},
Apologies first. The LGR report I sent earlier today contained factual errors — most importantly it claimed Oxfordshire and several other counties had ministerial decisions in March 2026. They had not. That was a fabrication by the report generator, and I should have caught it before sending. Please bin the earlier version.
What went wrong, and what's fixed: the tool was letting the AI assert confident specifics that weren't backed by a source. I've rebuilt the generator so every factual claim must now trace to a cited source, decision status can't be overstated, and anything not found in sources is left as "unknown" rather than invented. This attached version was produced under those rules and I've independently verified the key facts against gov.uk before sending.
The corrected position on decisions:
Every claim in the attached report carries an inline [n] citation to the References section. The report opens with a caveat line reminding you to verify dates, names and notice numbers against the cited source before acting — please do, especially on anything you'd put in front of a client.
Thanks for the catch, and sorry again for the earlier version.
Best,
Curium Lead Intelligence