mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
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> |
||
|---|---|---|
| .. | ||
| adr | ||
| migrations | ||