Route water-heating overrides through the deterministic guard before the LLM 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-01 13:09:12 +00:00
parent d0aa596ae7
commit 36ead3ca1d

View file

@ -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