Model/orchestration
Khalim Conn-Kowlessar 26857f8df7 Bulk download: match uploaded_files via hubspot_deal_id bridge + add worker observability
A live test returned 'no documents could be packaged' for 91 correctly-resolved
properties. Root cause: no upload source populates uploaded_files.landlord_property_id
(pashub/magic-plan/audit set hubspot_deal_id; ECMK sets hubspot_listing_id), so
matching on landlord_property_id found zero rows.

Match fix: the worker now joins uploaded_files -> hubspot_deal_data (on deal_id) ->
landlord_property_id, taking the property identity from the bridge. The repository
returns a small PropertyDocument read-model instead of the infra ORM row, so the
orchestrator no longer names infrastructure.postgres.* (resolves the leak dancafc
flagged) and the s3_upload_timestamp cast is gone. Coverage is limited to
deal-id-linked sources; listing_id/uprn-only files are a noted follow-up.

Observability: the empty-selection failure now carries stage counts
(selected/matched/planned/skipped) in both the message (-> the worker WARNING log)
and details (-> sub_task.outputs), and the run logs those counts. The next failure
says 'matched 0 documents' instead of failing opaquely.

ADR-0060 + CONTEXT.md updated (matching decision + considered options).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 13:58:46 +00:00
..
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
abri_orchestrator.py Date an abandonment to the deal's own dates, not now() 🟩 2026-07-08 08:51:39 +00:00
ara_first_run_pipeline.py feat(modelling): ModellingOrchestrator persists a Plan end-to-end (#1157) 2026-06-03 12:08:32 +00:00
audit_generator_orchestrator.py populate_sheet writes to new Sero template column layout 🟩 2026-06-10 13:21:50 +00:00
audit_generator_unit_of_work.py Audit generator populates XLSX, uploads to S3, and records UploadedFile row 🟥 2026-06-09 11:59:09 +00:00
bulk_document_download_orchestrator.py Bulk download: match uploaded_files via hubspot_deal_id bridge + add worker observability 2026-07-08 13:58:46 +00:00
bulk_upload_finaliser_orchestrator.py Group landlord property-override enums under domain/epc/property_overrides 🟪 2026-06-19 14:49:58 +00:00
classifiable_column.py moved classifier data transformation to an easy one 2026-06-01 14:53:34 +00:00
ingestion_orchestrator.py An expired historic cert conditions ingestion's prediction and labels it 🟩 2026-07-06 08:38:07 +00:00
landlord_description_overrides_orchestrator.py tests wrong environemnt 2026-05-29 16:17:06 +00:00
magic_plan_orchestrator.py UploadedFile, FileTypeEnum, FileSourceEnum importable from infrastructure.postgres.uploaded_file_table 🟩 2026-06-09 11:50:51 +00:00
modelling_orchestrator.py ASHP sizing targets the Appendix-N efficiency peak (realistic installed pump) 🟩 2026-07-03 11:02:13 +00:00
postcode_splitter_orchestrator.py standardist Address 2026-05-22 10:13:32 +00:00
property_baseline_orchestrator.py Persist no Lodged Performance for a predicted Property 🟩 2026-06-30 22:10:57 +00:00
sharepoint_renamer_orchestrator.py UPRN-prefixed property folders rename to a single-UPRN filename 🟩 2026-07-03 12:09:32 +00:00
task_orchestrator.py Completing a re-run failed batch un-fails the task 🟩 2026-07-07 11:11:52 +00:00