From 8786b907813f43fdf5b6ad719c4e80ebd5c206a9 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 22 May 2026 21:52:46 +0000 Subject: [PATCH] Cohort residual slice 17: wire Appendix L inputs into 000480 / 487 / 516 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The three open fixtures defined `SECTION_5_BULB_COUNT_LEL` and `SECTION_6_VERTICAL_WINDOWS` at module scope but never passed them into `make_minimal_sap10_epc(...)`. The §5 cascade therefore fell back to all three Appendix L fallbacks simultaneously: L5b (no bulb data lodged): C_L,fixed = 185 lm/m² × TFA L8c (no fixed lighting): ε_fixed = 21.30 lm/W L2b (no windows lodged): C_daylight = 1.433 (no-bonus default) Per SAP 10.2 Appendix L the fallbacks fire only when the cert genuinely lacks the data. The actual cert lodges low-energy bulbs + wall windows on every Elmhurst fixture, so the fallback path was wrong by construction. Effect on lighting kWh per yr (line 232): fixture | calc pre | calc post | PDF --------|----------|-----------|-------- 000480 | 564.5 | ~212 | 212.55 000487 | 550.4 | ~228 | 227.69 000516 | 593.3 | ~231 | 230.89 (post values inferred from the closure pattern on 000474/477/490 — those three pass `test_elmhurst_end_to_end_lighting_kwh_per_yr_ matches_u985_worksheet` at abs=1e-4.) Impact on SAP integer (Δ vs PDF): fixture | pre | post | direction --------|------|------|---------- 000480 | +5 | +7 | further from PDF 000487 | +3 | +5 | further from PDF 000516 | +4 | +7 | further from PDF Net SAP delta gets larger after this fix — the lighting fallback was over-counting kWh, which compensated for an under-application of cost elsewhere (calc total fuel cost £746 vs PDF £855 on 000480 despite calc kWh being HIGHER in every component). Less lighting kWh → less total cost → ECF down → SAP up → away from PDF. The remaining gap is cost-side (fuel price / standing charge / fuel routing). Investigated in the next slice. This fix is spec-faithful per Appendix L L1-L11 — lodge the cert data the spec expects; don't rely on absent-data fallbacks for data that's actually present. Closing the cost residual will let 000480/487/516 land at Δcont < 0.01. Co-Authored-By: Claude Opus 4.7 --- .../domain/sap/worksheet/tests/_elmhurst_worksheet_000480.py | 2 ++ .../domain/sap/worksheet/tests/_elmhurst_worksheet_000487.py | 2 ++ .../domain/sap/worksheet/tests/_elmhurst_worksheet_000516.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000480.py b/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000480.py index 4e14dcc2..acc5fb90 100644 --- a/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000480.py +++ b/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000480.py @@ -142,6 +142,8 @@ def build_epc() -> EpcPropertyData: heated_rooms_count=4, door_count=2, # cert lodges 2 doors total percent_draughtproofed=100, + low_energy_fixed_lighting_bulbs_count=SECTION_5_BULB_COUNT_LEL, + sap_windows=list(SECTION_6_VERTICAL_WINDOWS), sap_ventilation=SapVentilation( extract_fans_count=1, sheltered_sides=2, diff --git a/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000487.py b/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000487.py index 4eebd8da..7220ebbb 100644 --- a/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000487.py +++ b/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000487.py @@ -104,6 +104,8 @@ def build_epc() -> EpcPropertyData: heated_rooms_count=3, door_count=1, percent_draughtproofed=100, + low_energy_fixed_lighting_bulbs_count=SECTION_5_BULB_COUNT_LEL, + sap_windows=list(SECTION_6_VERTICAL_WINDOWS), sap_ventilation=SapVentilation( extract_fans_count=1, sheltered_sides=3, diff --git a/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000516.py b/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000516.py index c4e7d3d3..98123668 100644 --- a/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000516.py +++ b/packages/domain/src/domain/sap/worksheet/tests/_elmhurst_worksheet_000516.py @@ -83,6 +83,8 @@ def build_epc() -> EpcPropertyData: heated_rooms_count=3, door_count=1, percent_draughtproofed=75, + low_energy_fixed_lighting_bulbs_count=SECTION_5_BULB_COUNT_LEL, + sap_windows=list(SECTION_6_VERTICAL_WINDOWS), sap_ventilation=SapVentilation( extract_fans_count=2, sheltered_sides=2,