diff --git a/applications/landlord_description_overrides/handler.py b/applications/landlord_description_overrides/handler.py index 4020bc512..a43413b4f 100644 --- a/applications/landlord_description_overrides/handler.py +++ b/applications/landlord_description_overrides/handler.py @@ -14,6 +14,12 @@ 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 from domain.epc.property_overrides.roof_type import RoofType +from domain.epc.property_overrides.roof_party_ceiling_guard import ( + roof_party_ceiling_guard, +) +from domain.data_transformation.guarded_column_classifier import ( + GuardedColumnClassifier, +) from domain.epc.property_overrides.water_heating_type import WaterHeatingType from domain.epc.property_overrides.wall_type import WallType from domain.epc.property_overrides.wall_type_construction_dates import ( @@ -115,8 +121,13 @@ def _build_columns( "roof_type": lambda src: ClassifiableColumn( name="roof_type", source_column=src, - classifier=ChatGptColumnClassifier( - chat_gpt, RoofType, RoofType.UNKNOWN + # A party ceiling ("another/same dwelling or premises above") has ~0 + # heat loss and must never be classified as an external roof; the + # deterministic guard resolves those markers and the LLM handles the + # rest (#1376). + classifier=GuardedColumnClassifier( + guard=roof_party_ceiling_guard, + fallback=ChatGptColumnClassifier(chat_gpt, RoofType, RoofType.UNKNOWN), ), repo=LandlordOverridesRepository[RoofType]( session, LandlordRoofTypeOverrideRow