Model/tests/repositories
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
..
comparable_properties Merge remote-tracking branch 'origin/main' into feature/e2e-runs 2026-06-23 17:07:27 +00:00
epc An expired-source EPC occupies the predicted slot without stranding rows 🟥 2026-07-06 08:28:40 +00:00
fuel_rates Load the off-peak day/night rate from the committed snapshot 🟩 2026-06-24 17:20:19 +00:00
geospatial feat(geospatial): batch coordinates_for_uprns lookup (#1227) 2026-06-15 14:35:32 +00:00
historic_epc Carry the EPC certificate number through address2uprn to property 2026-07-07 13:26:49 +00:00
hubspot_deals The deal row names the job number client_booking_reference, matching HubSpot and the schema 🟪 2026-07-07 12:43:40 +00:00
landlord_overrides Group landlord property-override enums under domain/epc/property_overrides 🟪 2026-06-19 14:49:58 +00:00
magic_plan get_plan_by_uploaded_file_id 🟩 2026-06-08 15:37:52 +00:00
plan A new default plan demotes the prior default across scenarios 🟥 2026-07-07 16:41:48 +00:00
product Hold one DB connection per modelling_e2e invocation 2026-06-24 16:58:21 +00:00
property Resolve a property's display address from its landlord_property_id 🟥 2026-07-08 09:44:36 +00:00
property_baseline Round-trip a null Lodged Performance through persistence 🟩 2026-06-30 22:13:04 +00:00
scenario feat(modelling): drive measure scoping from the Scenario's exclusions 2026-06-16 15:26:25 +00:00
solar perf(modelling_e2e): bulk reads and batch writes to cut RDS load 2026-06-24 18:43:42 +00:00
spatial feat(spatial): per-UPRN cache repo for the OS spatial reference 2026-06-04 17:15:51 +00:00
tasks perf(modelling_e2e): batch SubTask bookkeeping to stop per-property writes 2026-06-24 19:26:42 +00:00
unstandardised_address updated rdsap option; seperated s3 location in infrastrucutre; added open ai api 2026-05-22 14:00:33 +00:00
uploaded_file Bulk download: match uploaded_files via hubspot_deal_id bridge + add worker observability 2026-07-08 13:58:46 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
test_unit_of_work.py Resolve overrides on the unit's own session, not a second connection 2026-06-24 17:01:41 +00:00