Model/orchestration
Jun-te Kim b1ff711260 perf(modelling_e2e): batch SubTask bookkeeping to stop per-property writes
Even after batching the data writes, the handler still wrote to the DB per
property through the orchestrator's SubTask bookkeeping: create + start +
complete each self-committed, and _cascade re-listed every sibling and re-saved
the parent on every transition — ~5 writes per property plus an O(N^2) cascade.

- TaskOrchestrator.run_subtasks: create all children in one INSERT, run each
  (failures isolated per child), then persist all terminal states in one bulk
  save and cascade the parent once. Children go WAITING -> terminal; the
  transient IN_PROGRESS row is never written.
- SubTaskRepository.create_many / save_many (bulk INSERT / bulk fetch + update).
- _cascade short-circuits when the Task is already FAILED (terminal) — skips the
  sibling roll-up entirely.
- modelling_e2e handler fans out via run_subtasks instead of per-property
  create_child_subtask + run_subtask.

Per N-property batch the SubTask bookkeeping drops from ~5N writes + an O(N^2)
cascade to ~2 writes + 1 cascade.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 19:26:42 +00:00
..
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +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_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 refactor(epc-prediction): PR review — rename ComparableProperty, relocate PredictionTarget 2026-06-16 13:34:44 +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 measured excluded plus get geospatial nearby stuff working 2026-06-22 16:12:16 +00:00
postcode_splitter_orchestrator.py standardist Address 2026-05-22 10:13:32 +00:00
property_baseline_orchestrator.py Fall back to computed kWh for predicted-EPC baselines (no lodged RHI) 2026-06-24 08:58:24 +00:00
sharepoint_renamer_orchestrator.py ignore jpg and heic files. resolve filepath relatively 2026-06-16 10:06:39 +00:00
task_orchestrator.py perf(modelling_e2e): batch SubTask bookkeeping to stop per-property writes 2026-06-24 19:26:42 +00:00