diff --git a/scripts/run_modelling_e2e.py b/scripts/run_modelling_e2e.py index 80a53db6..e38fdb63 100644 --- a/scripts/run_modelling_e2e.py +++ b/scripts/run_modelling_e2e.py @@ -20,7 +20,8 @@ band); without it the run synthesises an Increasing-EPC-to-``--goal`` Scenario. (mirroring the legacy `inclusions`) — e.g. only HHRSH + Solar PV. Config: loads `backend/.env` for the DB creds (`DB_*`), the EPC API token -(`EPC_AUTH_TOKEN`), the Google Solar key (`GOOGLE_SOLAR_API_KEY`) and the S3 +(`OPEN_EPC_API_TOKEN` — the Bearer token for the new gov API), the Google Solar +key (`GOOGLE_SOLAR_API_KEY`) and the S3 reference bucket (`DATA_BUCKET`) — the agent never sees the secrets. AWS creds come from the ambient `~/.aws` profile. Run from the worktree root: @@ -280,7 +281,10 @@ def main() -> None: parser.error("--persist requires --scenario-id and --portfolio-id") _load_env(_ENV_PATH) - epc_client = EpcClientService(os.environ["EPC_AUTH_TOKEN"]) + # The new gov EPC API (Bearer) authenticates with OPEN_EPC_API_TOKEN — the + # name is misleading; EPC_AUTH_TOKEN is dead (403). Verified against the + # /api/domestic/search endpoint. + epc_client = EpcClientService(os.environ["OPEN_EPC_API_TOKEN"]) geospatial = GeospatialS3Repository(_s3_parquet_reader(os.environ["DATA_BUCKET"])) solar_client = GoogleSolarApiClient(os.environ["GOOGLE_SOLAR_API_KEY"]) engine = _engine()