Model/tests
Khalim Conn-Kowlessar de08d93369 Refresh a stale stored gov cert on a refetch when its content differs
refetch_epc=True fetched a fresh cert but the recency tie-break (strict >)
dropped it whenever the stored row shared the cert's inspection date — so a
row written before a schema field/table existed (e.g. room-in-roof geometry)
could never be healed by re-fetching. The dwelling was modelled on stale
fabric indefinitely.

Reconcile instead of just comparing dates: on an equal inspection date,
refresh a public gov cert (uploaded_file_id NULL) when the fetched cert
differs from the stored one, so a plain re-fetch re-ingests it. One of our
own surveys (PasHub / ECMK / Elmhurst — uploaded_file_id set) is preserved on
the tie, keeping the survey-wins rule (ADR-0001 / #1589); an unchanged public
cert is still not re-persisted.

`_reconcile_lodged` layers the content refresh over `_newer_lodged` (recency
untouched). New `EpcRepository.survey_lodged_uprns` surfaces the row-level
uploaded_file_id provenance the hydrated EpcPropertyData drops. Together with
the property_id-anchored persist, a refetch_epc=True re-run now heals both a
missing epc_property row and a stale one.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-27 14:34:26 +00:00
..
abri Surface both canceljob failure shapes as verbatim rejections 🟥 2026-07-07 15:33:16 +00:00
applications Refresh a stale stored gov cert on a refetch when its content differs 2026-07-27 14:34:26 +00:00
backend Resolve export property ids with explicit ids overriding filters 🟥 2026-07-14 09:32:14 +00:00
condition Run a Calico load end to end and return its reconciliation 🟥 2026-07-13 15:13:06 +00:00
datatypes Convert external-measurement dimensions to internal per RdSAP Table 2 🟩 2026-07-22 13:17:55 +00:00
domain Merge pull request #1685 from Hestia-Homes/feat/1639-pashub-lrha-wave3-residual 2026-07-27 14:01:29 +01:00
e2e Prove prediction resolves landlord overrides to a real cohort match end-to-end 🟩 2026-06-16 15:20:49 +00:00
fixtures Expired-pairs integration gate: frozen single-file corpus + ratcheting floors 🟩 2026-07-06 13:05:18 +00:00
harness Re-pin the trigger-attributes fixture to one that still buys lighting 🟪 2026-07-21 16:57:22 +00:00
infrastructure Merge pull request #1672 from Hestia-Homes/fix/sap10-accuracy-calc-batch 2026-07-23 10:04:16 +01:00
lambdas new application to trigger e2e for a single property and scenario 2026-06-22 12:54:53 +00:00
magic_plan Mapper reads new 'Total Trickle Vent Effective Area' label 🟥 2026-06-30 12:56:54 +00:00
orchestration Refresh a stale stored gov cert on a refetch when its content differs 2026-07-27 14:34:26 +00:00
repositories Refresh a stale stored gov cert on a refetch when its content differs 2026-07-27 14:34:26 +00:00
scripts Move the PasHub fetcher into the DDD layer structure 🟪 2026-07-22 13:35:54 +00:00
utilities abri_api not abri 2026-07-07 14:40:33 +00:00
utils SharePoint 404s raise ResourceNotFoundError without error-level logging 🟩 2026-07-03 12:26:33 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
conftest.py Audit generator populates XLSX, uploads to S3, and records UploadedFile row 🟪 2026-06-09 12:05:55 +00:00
test_lambda_packaging.py better smoke tests to check what is failign 2026-06-17 11:53:33 +00:00