Model/harness
Daniel Roth f7328f54c5 Fetch a property's lodged EPC by UPRN, not property_id
An epc_property row can carry a null property_id (FE/historic ingestion
persists EPC rows never linked to a property row), so a property_id-keyed
read silently misses them. UPRN is the durable key both the property row
and the epc_property row share. Repoint the lodged reads (get_for_property
+ get_for_properties) onto UPRN; the predicted reads stay on property_id
because a predicted EPC deep-copies a neighbour's UPRN, so its UPRN column
is never the property's own.

UPRN is not unique on epc_property, so the read tie-break is now load-
bearing (it was dormant under property_id, where the write path guarantees
one lodged row per property): the most recently ingested (highest-id) row
wins. Write path stays keyed on (property_id, source).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 10:35:51 +00:00
..
__init__.py feat(modelling): sense-check table for a Plan in the DB-less harness 2026-06-04 08:06:53 +00:00
cohort.py feat(modelling): turnkey offline cohort script (tables + CSV) 2026-06-04 09:30:53 +00:00
console.py Fetch a property's lodged EPC by UPRN, not property_id 2026-07-14 10:35:51 +00:00
epc_bulk.py feat(modelling): sample a year from the EPC bulk export, offline-ready 2026-06-04 12:20:57 +00:00
epc_prediction_corpus.py Expired-pairs integration gate: frozen single-file corpus + ratcheting floors 🟩 2026-07-06 13:05:18 +00:00
plan_table.py feat(modelling): wire Valuation Uplift onto the Plan 2026-06-04 08:59:04 +00:00
report.py Guard build_property_report against None from unmapped-schema certs 2026-07-10 11:34:12 +00:00
sample_catalogue.json feat(modelling): cost data for secondary-heating-removal (ADR-0028) 2026-06-11 13:51:16 +00:00