From 598aac155603df4fe51089b4b6e5082f0a1b3eda Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 1 Jul 2026 14:32:14 +0000 Subject: [PATCH] =?UTF-8?q?Route=20main-heating=20overrides=20through=20th?= =?UTF-8?q?e=20HHRSH=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 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/applications/landlord_description_overrides/handler.py b/applications/landlord_description_overrides/handler.py index dd37e461c..f33dd3705 100644 --- a/applications/landlord_description_overrides/handler.py +++ b/applications/landlord_description_overrides/handler.py @@ -13,6 +13,7 @@ from domain.epc.property_overrides.glazing_type import GlazingType from domain.epc.property_overrides.glazing_mix_guard import glazing_mix_guard from domain.epc.property_overrides.main_fuel_type import MainFuelType from domain.epc.property_overrides.main_heating_system_type import MainHeatingSystemType +from domain.epc.property_overrides.main_heating_guard import main_heating_guard from domain.epc.property_overrides.property_type import PropertyType from domain.epc.property_overrides.roof_type import RoofType from domain.epc.property_overrides.roof_party_ceiling_guard import ( @@ -184,8 +185,15 @@ def _build_columns( "main_heating_system": lambda src: ClassifiableColumn( name="main_heating_system", source_column=src, - classifier=ChatGptColumnClassifier( - chat_gpt, MainHeatingSystemType, MainHeatingSystemType.UNKNOWN + # High heat retention storage heaters have no LLM target distinct from + # old storage, so they were funnelled into "Electric storage heaters, + # old" (401); the deterministic guard resolves HHRSH to its own + # archetype (SAP 409) and the LLM handles the rest (#1376, ADR-0044). + classifier=GuardedColumnClassifier( + guard=main_heating_guard, + fallback=ChatGptColumnClassifier( + chat_gpt, MainHeatingSystemType, MainHeatingSystemType.UNKNOWN + ), ), repo=LandlordOverridesRepository[MainHeatingSystemType]( session, LandlordMainHeatingSystemOverrideRow