From 573588d4e790aadc273a6005db408eab814ae51c Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 3 Jul 2026 11:37:57 +0000 Subject: [PATCH] =?UTF-8?q?Underfloor=20overrides=20no=20longer=20log=20an?= =?UTF-8?q?=20incomplete=20companion=20set=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression guard: category 8 + control 2701 keep the ADR-0048 coherence invariant satisfied for SAP codes 421/422/424. Co-Authored-By: Claude Opus 4.8 --- .../epc/test_main_heating_system_overlay.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/domain/epc/test_main_heating_system_overlay.py b/tests/domain/epc/test_main_heating_system_overlay.py index 3ae8b07b7..5c1b680d2 100644 --- a/tests/domain/epc/test_main_heating_system_overlay.py +++ b/tests/domain/epc/test_main_heating_system_overlay.py @@ -285,6 +285,28 @@ def test_electric_underfloor_drags_the_conservative_group_7_control( assert simulation.heating.main_heating_control == 2701 +@pytest.mark.parametrize( + "main_heating_value", + [ + "Electric underfloor, in concrete slab (off-peak)", + "Electric underfloor, integrated storage and direct-acting", + "Electric underfloor, in screed above insulation", + ], +) +def test_complete_underfloor_overlay_does_not_log_a_companion_gap( + main_heating_value: str, caplog: pytest.LogCaptureFixture +) -> None: + # Electric underfloor now resolves a full companion set (category 8 + + # control 2701, ADR-0050), so the overlay must NOT log an + # incomplete-companion gap — guarding that the set stays complete. + # Act + with caplog.at_level(logging.ERROR): + main_heating_overlay_for(main_heating_value, 0) + + # Assert + assert "incomplete companion set" not in caplog.text + + def test_screed_underfloor_defers_the_meter_to_the_cert() -> None: # "In screed above insulation (standard or off peak)" is tariff-ambiguous (81% # of the corpus lodge off-peak), so the archetype cannot know the meter — it