Deterministically guard the high-heat-retention storage description 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-01 14:30:40 +00:00
parent 9711b2e5f5
commit b7848848a5

View file

@ -8,4 +8,17 @@ from domain.epc.property_overrides.main_heating_system_type import (
def main_heating_guard(description: str) -> Optional[MainHeatingSystemType]:
raise NotImplementedError
"""Deterministically resolve a High Heat Retention Storage Heater (HHRSH)
description, which the LLM funnelled into ``"Electric storage heaters, old"``
(SAP 401) for want of an HHRSH archetype (#1376 / ADR-0044).
HHRSH is a distinct RdSAP system (SAP Table 4a 409) with its own intrinsic
charge control (2404) the *best* modern storage, not the *worst* old large-
volume type. This guard claims only the structured HHRSH phrasing and returns
``None`` for every other description (the remaining storage subtypes the LLM
already classifies correctly, and varied phrasings), so they still reach the
LLM classifier via ``GuardedColumnClassifier``.
"""
if "high heat retention" in description.lower():
return MainHeatingSystemType.ELECTRIC_STORAGE_HIGH_HEAT_RETENTION
return None