Model/tests/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
..
audit_generator move spreadsheet population logic to domain 2026-06-09 14:43:24 +00:00
magic_plan UploadedFile, FileTypeEnum, FileSourceEnum importable from infrastructure.postgres.uploaded_file_table 🟩 2026-06-09 11:50:51 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
fakes.py Review nitpicks: pids_with_default naming, empty-batch guard, truthful fake 🟪 2026-07-07 16:44:23 +00:00
test_abri_orchestrator_abandon_job.py Date an abandonment to the deal's own dates, not now() 🟩 2026-07-08 08:51:39 +00:00
test_abri_orchestrator_amend_job.py Amending an appointment needs only the deal's changed date and time 🟪 2026-07-07 10:07:23 +00:00
test_abri_orchestrator_log_job.py A changed booking amends the deal's OpenHousing appointment 🟩 2026-07-07 10:01:01 +00:00
test_abri_orchestrator_tenant_data_sync.py A changed booking amends the deal's OpenHousing appointment 🟩 2026-07-07 10:01:01 +00:00
test_ara_first_run_pipeline.py feat(modelling): ModellingOrchestrator persists a Plan end-to-end (#1157) 2026-06-03 12:08:32 +00:00
test_ara_first_run_pipeline_integration.py Fix integration test: LPG solid-brick dwelling now correctly offered HHRSH (#1378) 2026-07-01 11:14:36 +00:00
test_build_canonical_filename.py move tests out of scripts/ 2026-06-15 11:11:08 +00:00
test_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
test_bulk_upload_finaliser_orchestrator.py feat(modelling): mark a Property as run via has_recommendations + updated_at 2026-06-16 23:34:33 +00:00
test_first_run_without_database.py feat(modelling): run_one console entrypoint for DB-less inspection 2026-06-04 08:14:14 +00:00
test_ingestion_orchestrator.py 17.1 and 18 done by claude 2026-06-12 12:52:36 +00:00
test_ingestion_prediction.py An expired historic cert conditions ingestion's prediction and labels it 🟥 2026-07-06 08:34:54 +00:00
test_landlord_description_overrides_orchestrator.py Group landlord property-override enums under domain/epc/property_overrides 🟪 2026-06-19 14:49:58 +00:00
test_modelling_heat_pump_sizing_threading.py The orchestrator threads the dwelling design heat loss into ASHP sizing 🟥 2026-07-03 10:31:57 +00:00
test_modelling_solar_threading.py feat(modelling): gate generation by the considered-measures allowlist 2026-06-16 14:56:09 +00:00
test_postcode_splitter_orchestrator.py updated rdsap option; seperated s3 location in infrastrucutre; added open ai api 2026-05-22 14:00:33 +00:00
test_property_baseline_orchestrator.py ASHP sizing targets the Appendix-N efficiency peak (realistic installed pump) 🟩 2026-07-03 11:02:13 +00:00
test_task_orchestrator.py Test names state the surviving failure-recovery behaviors 🟪 2026-07-07 11:12:12 +00:00