Model/tests
Khalim Conn-Kowlessar 4daba1f7c5 feat(uow): UnitOfWork port + PostgresUnitOfWork adapter (#1138)
First slice of the per-stage batch-transaction refactor (ADR-0012). A
UnitOfWork is the single transaction a stage runs its batch in: a context
manager exposing the DB repos bound to one session, committing once on
`commit()` and rolling back on exception or exit-without-commit
(all-or-nothing per batch, fail noisily).

- `UnitOfWork` (port): `property` / `epc` / `solar` / `baseline` repos +
  `commit()` / `rollback()`; `__exit__` rolls back uncommitted work.
- `PostgresUnitOfWork(session_factory)`: opens a Session from an injected
  factory (a module-scoped engine + sessionmaker in prod, so the pool is
  reused across warm invocations), binds the Postgres repos to it, closes
  on exit.

Not yet wired into any orchestrator — that lands in the Baseline /
Ingestion refactor slices. 3 tests against ephemeral PG (commit durable
across units; exception rolls back; no-commit persists nothing). pyright
strict clean; AAA.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 09:25:17 +00:00
..
applications feat(ara): AraFirstRunTriggerBody + ara_first_run lambda skeleton (#1130) 2026-05-30 20:38:15 +00:00
domain feat(baseline): BaselineOrchestrator + BaselinePerformance aggregate (#1135) 2026-05-30 21:21:34 +00:00
infrastructure GoogleSolarApi translates BuildingInsightsNotFoundError to sentinel dict 🟩 2026-05-21 16:06:54 +00:00
orchestration feat(first-run): FirstRunPipeline E2E — Ingestion → Baseline → Modelling (#1136) 2026-05-30 22:32:58 +00:00
repositories feat(uow): UnitOfWork port + PostgresUnitOfWork adapter (#1138) 2026-05-31 09:25:17 +00:00
utilities tests framework completed 2026-05-20 14:00:19 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
conftest.py tests framework completed 2026-05-20 14:00:19 +00:00