Deterministically guard the electric-underfloor descriptions 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-01 16:48:45 +00:00
parent 6dcb8aee21
commit 9d106d9d6d

View file

@ -20,6 +20,10 @@ def main_heating_guard(description: str) -> Optional[MainHeatingSystemType]:
solid-fuel room heaters (open fire 631 / + back boiler 632 / closed + boiler
634) and electric ``"NA"``-type boilers (SAP 191). "NA" is the boiler-type
value meaning "not a gas combi/regular/CPSU", i.e. an electric boiler.
- **Electric underfloor** (ADR-0046): dumped into Direct-acting (191) / old
storage (401) for want of the dedicated SAP underfloor codes in concrete
slab (421, off-peak), integrated storage+direct-acting (422), in screed (424,
meter deferred to the cert).
Returns ``None`` for descriptions the LLM already classifies correctly (genuine
gas boilers, other storage subtypes, a plain closed room heater) and for varied
@ -30,6 +34,14 @@ def main_heating_guard(description: str) -> Optional[MainHeatingSystemType]:
text = description.lower()
if "high heat retention" in text:
return MainHeatingSystemType.ELECTRIC_STORAGE_HIGH_HEAT_RETENTION
if "underfloor" in text:
if "concrete slab" in text:
return MainHeatingSystemType.ELECTRIC_UNDERFLOOR_SLAB_OFF_PEAK
if "integrated" in text:
return MainHeatingSystemType.ELECTRIC_UNDERFLOOR_INTEGRATED
if "screed" in text:
return MainHeatingSystemType.ELECTRIC_UNDERFLOOR_SCREED
return None
if "rated na" in text:
return MainHeatingSystemType.ELECTRIC_BOILER
if "open fire" in text and "back boiler" in text: