Model/docs/adr
Khalim Conn-Kowlessar 76717dfc3a feat(baseline): BaselineOrchestrator + BaselinePerformance aggregate (#1135)
Stage 2 of First Run. Establishes each Property's Baseline Performance
from persisted source data and writes it back — reads only from repos,
never a Fetcher or HTTP (ADR-0003), so it is byte-identical whether
Ingestion ran milliseconds ago or last week.

Domain (`domain/baseline/`):
- `Performance` VO — the four rated quantities: SAP / EPC Band / CO2 /
  Primary Energy Intensity. `lodged_performance(epc)` reads them off the
  EPC's recorded fields (PEUI = `energy_consumption_current`).
- `BaselinePerformance` (ADR-0004) — the paired `lodged` + `effective`
  Performance + `rebaseline_reason`, plus the no-derivation part of the
  energy block (`space_heating_kwh` / `water_heating_kwh`, off the RHI,
  deterministic per ADR-0006). Both halves always populated.
- `Rebaseliner` port + `StubRebaseliner`: the re-score-on-override seam
  (ADR-0011). SAP10 certs pass through (effective == lodged, reason
  "none"); a pre-SAP10 cert raises `RebaselineNotImplemented` rather
  than fabricating a plausible-but-wrong "none" — ML rebaselining is not
  wired yet. Mirrors the repo's strict-raise culture.

Persistence: new `BaselineRepository` port + `BaselinePostgresRepository`
+ flat-column `baseline_performance` SQLModel (one row per Property). Per
ADR-0004's amendment this is a standalone table, NOT columns on the
retiring `property_details_epc`. Production migration is FE-owned
(Drizzle) — docs/migrations/baseline-performance-table.md.

Docs (grill-with-docs): corrected CONTEXT.md Lodged/Effective Performance
to Primary Energy Intensity (the term collided with its own _Avoid_ entry
under "heat demand") + fixed stale RHI field names; amended ADR-0004
Consequences for the standalone-table decision.

Fuel split + bills (rest of EPC Energy Derivation) deferred to a
follow-up — they need a Fuel Rates source (Ofgem-cap ETL) that does not
exist yet.

TDD, one test -> one impl: 7 tests (lodged read, rebaseliner pass-through
+ raise, orchestrator establish-and-persist + pre-SAP10 raise, Postgres
round-trip + absent). pyright strict clean; AAA layout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 21:21:34 +00:00
..
0001-two-source-paths.md added architechtural decisions, added to prd 2026-05-13 21:26:18 +00:00
0002-property-aggregate-root.md added architechtural decisions, added to prd 2026-05-13 21:26:18 +00:00
0003-strict-ingestion-modelling-separation.md docs(ara): composable stage-orchestrator design (ADR-0011 + ADR-0003 amend + CONTEXT) 2026-05-30 19:26:17 +00:00
0004-baseline-performance-lodged-effective-pair.md feat(baseline): BaselineOrchestrator + BaselinePerformance aggregate (#1135) 2026-05-30 21:21:34 +00:00
0005-multi-phase-scenarios-per-phase-recompute.md scaffolding for ml pipeline 2026-05-16 14:15:56 +00:00
0006-deterministic-kwh-no-baseline-ml.md scaffolding for ml pipeline 2026-05-16 14:15:56 +00:00
0007-kwh-as-ml-target.md scaffolding for ml pipeline 2026-05-16 14:15:56 +00:00
0008-physics-as-feature.md docs: ADR-0008 physics-as-feature + v16.0.0 schema bump 2026-05-17 11:20:40 +00:00
0009-deterministic-sap-calculator.md refactor: move docs/sap-spec/ contents into domain/sap10_calculator/ 2026-05-26 13:17:18 +00:00
0010-sap10-calculator-spec-target-and-validation.md refactor: move docs/sap-spec/ contents into domain/sap10_calculator/ 2026-05-26 13:17:18 +00:00
0011-composable-stage-orchestrators.md docs(ara): composable stage-orchestrator design (ADR-0011 + ADR-0003 amend + CONTEXT) 2026-05-30 19:26:17 +00:00