From 36ead3ca1db7fabf0f7a20b8439ab5dad241c575 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 1 Jul 2026 13:09:12 +0000 Subject: [PATCH] =?UTF-8?q?Route=20water-heating=20overrides=20through=20t?= =?UTF-8?q?he=20deterministic=20guard=20before=20the=20LLM=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- .../landlord_description_overrides/handler.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/applications/landlord_description_overrides/handler.py b/applications/landlord_description_overrides/handler.py index dd37e461c..bc5fe8ee9 100644 --- a/applications/landlord_description_overrides/handler.py +++ b/applications/landlord_description_overrides/handler.py @@ -22,6 +22,7 @@ from domain.data_transformation.guarded_column_classifier import ( GuardedColumnClassifier, ) from domain.epc.property_overrides.water_heating_type import WaterHeatingType +from domain.epc.property_overrides.water_heating_guard import water_heating_guard from domain.epc.property_overrides.wall_type import WallType from domain.epc.property_overrides.wall_type_construction_dates import ( wall_type_construction_date_prompt_hint, @@ -174,8 +175,16 @@ def _build_columns( "water_heating": lambda src: ClassifiableColumn( name="water_heating", source_column=src, - classifier=ChatGptColumnClassifier( - chat_gpt, WaterHeatingType, WaterHeatingType.UNKNOWN + # A biomass / wood / dual-fuel / biodiesel DHW description has no + # dedicated LLM target and was funnelled into "house coal"; the + # deterministic guard resolves the structured fuels (and the "electric + # immersion assumed" no-system case) and the LLM handles the rest + # (#1376, ADR-0043). + classifier=GuardedColumnClassifier( + guard=water_heating_guard, + fallback=ChatGptColumnClassifier( + chat_gpt, WaterHeatingType, WaterHeatingType.UNKNOWN + ), ), repo=LandlordOverridesRepository[WaterHeatingType]( session, LandlordWaterHeatingOverrideRow