From 024a01b1286271ee85f012ed69b8b2ea1d8b2ff4 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 7 Jul 2026 22:08:28 +0000 Subject: [PATCH] =?UTF-8?q?The=20Dwelling-Roof=20Cap=20bounds=20Sub-Ladder?= =?UTF-8?q?=20rungs=20too=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pins that the unchanged cap regime (min of 0.7×Google and the ADR-0038 budget) flows into ADR-0058 derivation — no red phase; the tracer implementation passed the already-min'd cap through. Co-Authored-By: Claude Fable 5 --- .../modelling/test_solar_config_selection.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/domain/modelling/test_solar_config_selection.py b/tests/domain/modelling/test_solar_config_selection.py index 01dba8533..eb4f7f757 100644 --- a/tests/domain/modelling/test_solar_config_selection.py +++ b/tests/domain/modelling/test_solar_config_selection.py @@ -373,3 +373,20 @@ def test_roof_capped_below_two_panels_still_yields_no_configs() -> None: # Assert assert configs == () + + +def test_dwelling_roof_cap_bounds_the_sub_ladder_too() -> None: + # ADR-0058 — the cap regime is unchanged: when the Dwelling-Roof Cap + # (ADR-0038) resolves BELOW the 0.7×Google cap, it bounds the Sub-Ladder + # rungs as well — a conflated Google roof can't inflate even a small array. + + # Arrange — max 6 (0.7 cap = 4.2) with Google's ladder starting at 4; + # a ~8.5 m² dwelling roof caps at ≈2.5 panels → only the 2-panel rung. + potential = _potential_with_panel_dims(max_panels=6, panel_counts=(4,)) + + # Act + configs = select_conservative_configs(potential, dwelling_roof_area_m2=8.5) + + # Assert — one rung at 2 panels, pro-rata off the 4-panel rung's 400. + assert [c.panels_count for c in configs] == [2] + assert [c.yearly_energy_dc_kwh for c in configs] == [200.0]