mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
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> |
||
|---|---|---|
| .. | ||
| applications | ||
| datatypes | ||
| domain | ||
| e2e | ||
| fixtures/epc_prediction | ||
| harness | ||
| infrastructure | ||
| lambdas | ||
| magic_plan | ||
| orchestration | ||
| repositories | ||
| scripts | ||
| utilities | ||
| __init__.py | ||
| conftest.py | ||
| test_lambda_packaging.py | ||