Model/applications
Jun-te Kim efdb8e816c feat(modelling_e2e): condition prediction on the expired Historic EPC (ADR-0054)
ADR-0054 gives a prediction conditioned by an expired Historic EPC the source
"expired", so reporting can tell "no EPC at all" apart from "only an expired
one". It was implemented in IngestionOrchestrator — but the pipeline that
actually runs is modelling_e2e, which predicts through its own _predict_epc and
never adopted it. Result: zero `expired` rows have ever been written, and
`epc_property.source` holds only 'lodged' and 'predicted'.

Two things kept the flavour unreachable here, and both had to go:

  - _predict_epc never looked at the historic backup at all, so no prediction
    was ever conditioned.
  - _flush_writes passed the literal source="predicted", and _PropertyWrite had
    no field to carry a flavour, so one would have been dropped before the write
    even if computed.

_predict_epc now mirrors IngestionOrchestrator._predict: the expired cert's
stable attributes fill the gaps Landlord Overrides left (overrides still win
where both speak) and condition the cohort, and it returns the source alongside
the EPC. _PropertyWrite carries it; _flush_writes persists it. save_batch
already groups deletes by source family, so a mixed predicted/expired batch
clears the shared slot correctly.

Ships dark: the reader is built only when HISTORIC_EPC_S3_ROOT is set, so
without it every prediction stays plain "predicted", exactly as today.
DEFAULT_S3_ROOT names the dev bucket, so defaulting to it would have a prod
lambda silently reading dev data — Terraform sets the var per environment.

Note this also rescues properties that currently fail to model outright: an
expired cert can supply the property_type no override resolved, where today
that raises UnresolvedPropertyTypeError.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 11:15:39 +00:00
..
abri Date an abandonment to the deal's own dates, not now() 🟩 2026-07-08 08:51:39 +00:00
ara_first_run Thread the historic-EPC reader through the first-run composition root 🟩 2026-07-06 08:41:56 +00:00
audit_generator add local handler and orchestrator 2026-06-30 13:58:41 +00:00
bulk_document_download Bulk download: readable email, deal-name folders, visible worker logs 2026-07-08 15:02:38 +00:00
bulk_upload_finaliser property override 2026-06-05 12:18:13 +00:00
landlord_description_overrides Merge pull request #1409 from Hestia-Homes/fix/property-type-leading-token-guard 2026-07-02 10:00:03 +01:00
magic_plan use task_handler rather subtask_handler for magicplan 2026-06-09 12:17:57 +00:00
modelling_e2e feat(modelling_e2e): condition prediction on the expired Historic EPC (ADR-0054) 2026-07-14 11:15:39 +00:00
postcode_splitter updated rdsap option; seperated s3 location in infrastrucutre; added open ai api 2026-05-22 14:00:33 +00:00
sharepoint_renamer delete test data file 2026-07-03 13:38:09 +00:00
__init__.py applications/postcode_splitter: PostcodeSplitterOrchestrator + Lambda entrypoint slice 2026-05-19 17:46:12 +00:00