Model/tests/domain/epc
Jun-te Kim 88bae2166f Guard property_type to its leading dwelling-type token
The landlord property-type description is a "<dwelling type>: <built form>: <floor>"
split whose leading token IS the dwelling type; the built-form tail is not. The
LLM occasionally over-read the tail and flipped the type — a handful of
"Bungalow: EndTerrace" / "Bungalow: MidTerrace" dwellings were stored as House.

Adds property_type_guard (claims the recognised leading token: House / Bungalow /
Flat / Maisonette / Park home; defers unrecognised phrasings to the LLM) and wires
property_type through a GuardedColumnClassifier, so the built-form tail can never
flip the type and the live path is deterministic.

Applied the scoped backfill to portfolio 796 (Hyde): 3 rows corrected from House
back to Bungalow. No enum migration needed — the targets are original members.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 17:24:37 +00:00
..
__init__.py Map landlord-override property type and built form to gov EPC codes 🟩 2026-06-16 15:07:09 +00:00
test_attribute_overlay.py move overlas to its own thing 2026-06-18 10:04:14 +00:00
test_construction_age_band_overlay.py Group landlord property-override enums under domain/epc/property_overrides 🟪 2026-06-19 14:49:58 +00:00
test_glazing_mix_guard.py Leave a uniform or unparseable glazing description to the LLM classifier 🟩 2026-07-01 11:05:10 +00:00
test_glazing_overlay.py Resolve a MIXED glazing override to no overlay, keeping the cert per-window glazing 🟩 2026-07-01 11:06:50 +00:00
test_main_fuel_overlay.py Rename SapEnergySource.mains_gas to gas_connection_available 🟩 2026-07-01 10:59:21 +00:00
test_main_heating_guard.py Deterministically guard the high-heat-retention storage description 🟥 2026-07-01 14:30:13 +00:00
test_main_heating_system_overlay.py Drag HHRSH's intrinsic control, electricity fuel and off-peak meter 🟥 2026-07-01 14:27:59 +00:00
test_override_code_mapping.py Group landlord property-override enums under domain/epc/property_overrides 🟪 2026-06-19 14:49:58 +00:00
test_property_type_guard.py Guard property_type to its leading dwelling-type token 2026-07-01 17:24:37 +00:00
test_roof_party_ceiling_guard.py Leave a genuine (non-party-ceiling) roof description to the LLM classifier 🟩 2026-07-01 09:38:03 +00:00
test_roof_type_overlay.py Add flat-roof insulation-thickness taxonomy members lock-step with the overlay 🟩 2026-07-01 10:16:35 +00:00
test_wall_type_overlay.py Stop a System-built landlord override being mis-read as a basement 🟥 2026-06-29 19:30:25 +00:00
test_water_heating_guard.py Deterministically guard structured biomass and immersion water-heating descriptions 🟥 2026-07-01 13:05:47 +00:00
test_water_heating_overlay.py Resolve biomass, dual-fuel and biodiesel water-heating overrides off house coal 🟥 2026-07-01 13:02:38 +00:00