Model/repositories
Khalim Conn-Kowlessar c7e2aa3755 feat(modelling): ModellingOrchestrator persists a Plan end-to-end (#1157)
Slice 4b — closes the #1157 tracer. ModellingOrchestrator.run(property_ids,
scenario_ids, portfolio_id) now does real work in one Unit of Work,
committed once (ADR-0011/0012/0016/0017):

  read Property (effective EPC) + Scenario via repos → recommend_cavity_wall
  → select its Option → PackageScorer.score (role-2 package total) +
  marginal_impacts (role-3 attribution) → build Plan/PlanMeasure →
  uow.plan.save → commit.

- AraFirstRunPipeline / ModellingStage thread portfolio_id from the trigger
  body (one source of truth); handler builds the real orchestrator
  (unit_of_work + Sap10Calculator), dropping the Scenario/Materials stubs.
- ScenarioRepository.get_many promoted to @abstractmethod now the bare-stub
  instantiations are gone.
- New ara_first_run-style integration test: a property with an uninsulated
  cavity wall yields a persisted Plan + one cavity_wall_insulation Plan
  Measure (priced from the Product, figures present, linked by plan_id).
  Numeric SAP correctness is pinned separately in test_elmhurst_cascade_pins.
- Existing pipeline integration test updated: seeds scenario 7 and runs the
  real Modelling stage (its already-insulated sample wall yields an empty
  package — no crash).

121 pass across repositories/modelling/orchestration/app; pyright strict clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 12:08:32 +00:00
..
epc perf(repos): bulk get_many / get_for_properties — batch reads, not N round-trips (#1138) 2026-06-01 16:28:48 +00:00
fuel_rates refactor(fuel-rates): name the adapter aggregate-first per house convention 2026-06-02 17:21:27 +00:00
geospatial feat(geospatial): GeospatialRepo — OS Open-UPRN coordinate lookup (#1131) 2026-06-01 16:28:48 +00:00
landlord_overrides move landlord overrides 2026-06-01 15:46:46 +00:00
materials feat(first-run): FirstRunPipeline E2E — Ingestion → Baseline → Modelling (#1136) 2026-06-01 16:28:48 +00:00
plan feat(modelling): plan/recommendation SQLModel mirrors + PlanRepository (#1157) 2026-06-03 11:51:02 +00:00
product feat(modelling): ProductJsonRepository behind the ProductRepository port 2026-06-03 09:49:02 +00:00
property refactor(property): PropertyRow.id non-Optional (PR #1139 review) 2026-06-01 16:28:48 +00:00
property_baseline refactor(property-baseline): rename baseline → property_baseline aggregate (PR #1139 review) 2026-06-01 16:28:48 +00:00
scenario feat(modelling): ModellingOrchestrator persists a Plan end-to-end (#1157) 2026-06-03 12:08:32 +00:00
solar feat(ingestion): relocate EpcClientService to infrastructure + SolarRepo (#1133) 2026-06-01 16:28:48 +00:00
tasks added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
unstandardised_address updated rdsap option; seperated s3 location in infrastrucutre; added open ai api 2026-05-22 14:00:33 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
postgres_unit_of_work.py feat(modelling): expose scenario/product/plan repos on the UnitOfWork (#1157) 2026-06-03 11:53:34 +00:00
unit_of_work.py feat(modelling): expose scenario/product/plan repos on the UnitOfWork (#1157) 2026-06-03 11:53:34 +00:00