Model/backend/epc_api/json_samples/real_life_examples
Jun-te Kim 06a2c413f5 test(accuracy): ratchet 75.5% -> 77.0% via secondary-fuel collision fix on cost path
The gov-API `secondary_fuel_type` enums 5 (anthracite) / 9 (dual fuel) /
33 (coal) collide in VALUE with same-valued RdSAP-10 Table-32 codes for
OTHER fuels (5=bulk LPG, 9=LPG SC11F, 33=elec 10h-low). The main-fuel
boundary and the CO2/display `_secondary_fuel_cost_gbp_per_kwh` already
canonicalise these via `canonical_fuel_code`, but the SAP-DRIVING
`_fuel_cost` cascade had a SEPARATE inline secondary rate that passed the
raw enum straight to the price lookup — so the two paths diverged and the
cost path silently mis-priced.

Anthracite (enum 5) was billed at the bulk-LPG code-5 rate 12.19 p/kWh
instead of 3.64 — a 3x over-cost on the secondary that under-rated every
solid-fuel-secondary dwelling. Worst: corpus cert 100050355518 (semi,
2 extensions, anthracite room-heater secondary) lodged 36 / engine 20.8
-> 35.5. Its CO2/PE already matched lodged (the demand cascade was right)
— a pure cost-side gap, which is what localised it.

Fix: canonicalise `secondary_fuel` before the Table-32 lookup in
`_fuel_cost`, mirroring the main-fuel boundary. 55 corpus certs carry a
colliding secondary.

Gauge: within-0.5 75.5% -> 77.0%, SAP MAE 0.708 -> 0.668 (floors
ratcheted). The prior enum-9 test only guarded the display helper; new
test_fuel_cost_secondary_colliding_fuel_priced_at_canonical_rate pins the
_fuel_cost cost path directly. RealCertExpectation pinned for
100050355518 (36 = lodged).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 19:43:31 +00:00
..
RdSAP-Schema-17.0 sap score and elmhirst mapper optimsaiation 2026-06-20 07:25:42 +00:00
RdSAP-Schema-17.1 updated sap scaema to take in inputs 2026-06-23 10:22:40 +00:00
RdSAP-Schema-18.0 Add UPRN 100020942571 (8 Booth Close) to the SAP accuracy corpus 2026-07-02 11:31:28 +00:00
RdSAP-Schema-19.0 Add SAP-18.0.0 + SAP-16.0 schema coverage; autonomous-run triage findings 2026-06-16 20:04:43 +00:00
RdSAP-Schema-20.0.0 test(accuracy): pin RdSAP-20.0.0 PV semi uprn_22086693 (PV-list fix corpus) 2026-06-23 16:13:34 +00:00
RdSAP-Schema-21.0.1 test(accuracy): ratchet 75.5% -> 77.0% via secondary-fuel collision fix on cost path 2026-07-02 19:43:31 +00:00
SAP-Schema-16.0 test(accuracy): pin SAP-16.0 storage-flat uprn_10070004512 (built_form fix corpus) 2026-06-23 15:35:06 +00:00
SAP-Schema-16.1/uprn_100021943298 more examples 2026-06-19 09:51:49 +00:00
SAP-Schema-16.2 sap score and elmhirst mapper optimsaiation 2026-06-20 07:25:42 +00:00
SAP-Schema-16.3 data types 2026-06-23 12:42:53 +00:00
SAP-Schema-17.0 neighbouring properties added 2026-06-22 14:38:00 +00:00
SAP-Schema-17.1 sap score and elmhirst mapper optimsaiation 2026-06-20 07:25:42 +00:00
SAP-Schema-18.0.0 Add SAP-18.0.0 + SAP-16.0 schema coverage; autonomous-run triage findings 2026-06-16 20:04:43 +00:00
SAP-Schema-19.1.0/uprn_10096028301 more examples 2026-06-19 09:51:49 +00:00