From 1500725d1d5c60ffbb74de2d25d96aa66bcdebc8 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 1 Jul 2026 11:07:45 +0000 Subject: [PATCH] =?UTF-8?q?Guard=20the=20glazing=20classifier=20so=20an=20?= =?UTF-8?q?aggregate=20mix=20keeps=20the=20cert=20per-window=20glazing=20?= =?UTF-8?q?=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires GuardedColumnClassifier(glazing_mix_guard, ) into the glazing column so a structured percentage mix deterministically resolves to MIXED (no overlay), while uniform and varied phrasings fall through to the LLM (#1376, ADR-0042). 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 a43413b4f..dd37e461c 100644 --- a/applications/landlord_description_overrides/handler.py +++ b/applications/landlord_description_overrides/handler.py @@ -10,6 +10,7 @@ from applications.landlord_description_overrides.landlord_description_overrides_ from domain.epc.property_overrides.built_form_type import BuiltFormType from domain.epc.property_overrides.construction_age_band import ConstructionAgeBand 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.property_type import PropertyType @@ -146,8 +147,15 @@ def _build_columns( "glazing": lambda src: ClassifiableColumn( name="glazing", source_column=src, - classifier=ChatGptColumnClassifier( - chat_gpt, GlazingType, GlazingType.UNKNOWN + # An aggregate glazing mix ("40% double, 60% single") can't be applied + # per-window, so the deterministic guard resolves the structured split + # to MIXED (no overlay → keep the cert's per-window glazing) and the LLM + # handles uniform / varied phrasings (#1376, ADR-0042). + classifier=GuardedColumnClassifier( + guard=glazing_mix_guard, + fallback=ChatGptColumnClassifier( + chat_gpt, GlazingType, GlazingType.UNKNOWN + ), ), repo=LandlordOverridesRepository[GlazingType]( session, LandlordGlazingOverrideRow