Model/scripts/lisasrequest
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
..
compare_to_ara.py Resolve a landlord mains-gas override to the primary fuel code 🟩 2026-06-19 12:15:54 +00:00
durkan_805_schema_check.py Resolve a landlord mains-gas override to the primary fuel code 🟩 2026-06-19 12:15:54 +00:00
fill_domna_address.py Resolve a landlord mains-gas override to the primary fuel code 🟩 2026-06-19 12:15:54 +00:00
finalise_to_property_table.py Resolve a landlord mains-gas override to the primary fuel code 🟩 2026-06-19 12:15:54 +00:00
reclassify_property_type.py Guard property_type to its leading dwelling-type token 2026-07-01 17:24:37 +00:00
resolve_uprns_for_finaliser.py Resolve a landlord mains-gas override to the primary fuel code 🟩 2026-06-19 12:15:54 +00:00
review_flags.py Resolve a landlord mains-gas override to the primary fuel code 🟩 2026-06-19 12:15:54 +00:00