Model/tests
Jun-te Kim f5fbeb8e7e Fix HHRSH storage heaters priced at peak rate (engine 48 vs Elmhurst 71)
The high-heat-retention storage-heater (HHRSH) recommendation was computed
as LOWERING SAP and wrongly rejected by the Optimiser, leaving electric-
room-heater flats/maisonettes stuck at band E with no sensible plan.

Root cause: `_HHR_STORAGE_OVERLAY` sets `sap_main_heating_code=409` (HHR
storage) + `meter_type="Dual"` but left `main_heating_category` at the
pre-existing value (10 = electric room heaters). The SAP 10.2 Table 12a
space-heating high-rate-fraction resolver classifies by category, so it
misread the off-peak storage heating as direct-acting electric (1.00
high-rate) and priced 100% at the 7-hour peak rate (15.29p) instead of the
storage off-peak split (0.00, ~5.5p).

Verified against accredited Elmhurst RdSAP-10 on UPRN 100020942571
(8 Booth Close, SE28 8BW): engine HHRSH SAP 48 (peak-priced, cost £1087)
vs Elmhurst 71 (cost ~£611); with the fix the engine gives 73 / £576.

Two-part fix (defence in depth, so no future overlay/mapper can
reintroduce it):
- `_HHR_STORAGE_OVERLAY` now sets `main_heating_category=7`, keeping the
  overlaid EPC internally consistent.
- `_table_12a_system_for_main` now classifies electric storage heaters by
  their Table 4a SAP code (401-409) as well as `category==7`, checked
  before the room-heater branch, so a specific storage code is
  authoritative over a stale/inconsistent category.

Tests: new regression `test_storage_heater_classified_by_sap_code_over_stale_category`;
updated the HHRSH overlay pin. Full accuracy corpus still passes (no regressions).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 11:24:03 +00:00
..
applications fix broken unit tests 2026-06-29 15:40:22 +00:00
datatypes Normalize RdSAP insulated_door_u_value on the 20.0.0 + 21.0.0 paths 2026-07-01 14:48:25 +00:00
domain Fix HHRSH storage heaters priced at peak rate (engine 48 vs Elmhurst 71) 2026-07-02 11:24:03 +00:00
e2e Prove prediction resolves landlord overrides to a real cohort match end-to-end 🟩 2026-06-16 15:20:49 +00:00
fixtures/epc_prediction feat(epc-prediction): geo-proximity weighting, per-component (#1227) 2026-06-15 14:58:42 +00:00
harness Re-pin golden cert 0036 to expect the zoned tune-up its PCDB boiler now fires (#1399) 2026-07-01 22:56:12 +00:00
infrastructure test(accuracy): ratchet after HP water-heating 100% floor 🟪 2026-06-29 15:40:53 +00: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 Fix integration test: LPG solid-brick dwelling now correctly offered HHRSH (#1378) 2026-07-01 11:14:36 +00:00
repositories Merge pull request #1373 from Hestia-Homes/fix/1361-class-b-predicted-null-lodged 2026-07-01 08:35:58 +01:00
scripts Reclassify electric-underfloor overrides via the generalized main-heating reclassify 🟩 2026-07-01 16:51:22 +00:00
utilities task_handler passes orchestrator and task_id to wrapped function when flag is true 🟥 2026-06-24 10:47:05 +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