Commit graph

7110 commits

Author SHA1 Message Date
Jun-te Kim
015ea0a293
Merge pull request #1338 from Hestia-Homes/fix/solar-pv-dwelling-roof-cap
fix(modelling): bound Solar PV array to the dwelling's own roof (ADR-0038)
2026-06-26 13:32:55 +01:00
Jun-te Kim
6cbfa5c0ad
Merge pull request #1335 from Hestia-Homes/feature/e2e-modelling-trigger-optional-refetch
Configure whether lodged EPCs are re-fetched and predicted EPCs are re-predicted during e2e modelling
2026-06-26 13:29:55 +01:00
Khalim Conn-Kowlessar
0a2ed67e94 Harden Dwelling-Roof Cap on real data: positional segments, ground-floor basis 🟩
Three corrections found by re-running property 742003 end-to-end:
- roofSegmentStats are POSITIONAL — real responses omit the segmentIndex field
  the fixture happened to carry; key the centre/area lookup by array position.
- Base the cap on ground_floor_area (the footprint the roof covers), not the
  greatest per-storey area; roof_area is the fallback.
- Clamp the basis by total_floor_area: predicted EPCs borrow the structural
  template's geometry (742003: a 118.62 m² MAIN ground floor) decoupled from
  the predicted 55 m² (ADR-0029), so without the clamp the cap reads the
  template's larger footprint.

Result: 742003 plan A/92.4 (16 kWp) -> C/74.4 (6.4 kWp). 29 solar tests +
orchestration threading + products green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 12:24:52 +00:00
Khalim Conn-Kowlessar
edce0f46af Dwelling-Roof Cap bounds the PV array to the dwelling's own roof 🟩
select_conservative_configs now also caps panels by the dwelling's own usable
roof — min(0.70 × maxArrayPanelsCount, roof_area/cos(pitch) × 0.5 / panel_area)
— threaded from recommend_solar via roof_area(epc, MAIN) (ADR-0038). No-op on
correctly-matched homes; falls back to the Google cap when the EPC has no MAIN
part. Defeats Google footprint conflation (semi-detached/terraced).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 12:17:07 +00:00
Khalim Conn-Kowlessar
904c205e3a Dwelling-Roof Cap bounds the PV array to the dwelling's own roof 🟥
select_conservative_configs must accept the dwelling's roof area and cap panels
to its usable roof (ADR-0038) — bounding a 55m² dwelling to ~16 panels under
Google footprint conflation, while staying a no-op on correctly-matched homes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 12:15:28 +00:00
Khalim Conn-Kowlessar
d6a59be950 SolarPotential carries panel dims + per-segment centre/area 🟩
Enrich each SolarRoofSegment from roofSegmentStats (centre + areaMeters2, keyed
by segmentIndex) and read panelHeightMeters/panelWidthMeters onto SolarPotential
— the geometry the Dwelling-Roof Cap (ADR-0038) needs. All Optional; existing
projection + config-selection tests stay green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 12:14:00 +00:00
Khalim Conn-Kowlessar
cf2780ed77 SolarPotential carries panel dims + per-segment centre/area 🟥
The Dwelling-Roof Cap (ADR-0038) sizes by usable roof area and ranks segments
by distance from the dwelling, so the projection must carry each panel's
footprint and each segment's centre + area (from roofSegmentStats).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 12:12:12 +00:00
Khalim Conn-Kowlessar
58f6b868a7 docs: ADR-0038 + glossary — bound Solar PV array to the dwelling's own roof
ADR-0026 sized PV at 0.70 x Google maxArrayPanelsCount, assuming Google's roof
is the dwelling's. Medium-imagery footprint conflation (semi-detached/terraced)
returns the whole building's roof -> oversized arrays (property 742003: 55m2
bungalow -> ~16 kWp -> effective E/49.7 -> A/92.4 on solar alone). ADR-0038
bounds the array to the dwelling's own usable roof (roof_area-based budget,
proximity segment selection anchored on the dwelling), subsuming the legacy
GoogleSolarApi guards the rewrite dropped. CONTEXT: add Footprint Conflation +
Dwelling-Roof Cap, extend Solar Potential (per-segment centre + area).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 12:08:11 +00:00
Daniel Roth
7f552edc0d pass scenario id to already processed check 2026-06-26 11:32:17 +00:00
Daniel Roth
f811b39fa1 correct previous comits 2026-06-26 11:26:28 +00:00
Daniel Roth
632465f03f allow for multiple scenarios for 1 portfolio without ignoring all properties in second scenario 2026-06-26 11:24:26 +00:00
Daniel Roth
17a9f0aafc refetch_epc=False skips API entirely; EPC-less properties go straight to prediction path
When refetch_epc=False and no stored lodged EPC exists, the handler no longer
falls back to a live EPC API call — it treats the property as EPC-less and
hands it to the prediction path. This keeps REFETCH_EPC (lodged path) and
REPREDICT_EPC (prediction path) cleanly independent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 10:24:27 +00:00
Daniel Roth
b1fd9d9368 Clarify REFETCH_EPC/REPREDICT_EPC comments — both flags skip-if-stored, not never-fetch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 10:20:29 +00:00
Daniel Roth
5c3bde0cf5 Update trigger script and local invoker to use refetch_solar, refetch_epc, repredict_epc 🟩
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 10:17:20 +00:00
Daniel Roth
100a580119 Add tests for repredict_epc flag routing via stored predicted EPC 🟩
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 10:15:40 +00:00
Daniel Roth
a940c94b33 Handler pre-fetches stored EPCs and routes per-property via refetch_epc flag 🟩
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 10:13:51 +00:00
Daniel Roth
c51ca47467 Rename no_solar → refetch_solar and add refetch_epc, repredict_epc flags to TriggerBody 🟩
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 10:12:21 +00:00
KhalimCK
56b365f488
Merge pull request #1334 from Hestia-Homes/feat/rdsap-19-21-ventilation
fix(epc-mapper): construct sap_ventilation in RdSAP 19.0 / 21.0.0 mappers
2026-06-26 11:11:44 +01:00
Khalim Conn-Kowlessar
cc1c763946 docs: mark 19.0/21.0.0 ventilation fixed (feat/rdsap-19-21-ventilation) 🟪
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:00:48 +00:00
Khalim Conn-Kowlessar
a63276387e Construct sap_ventilation in from_rdsap_schema_19_0 / 21_0_0 🟩
Both passed no sap_ventilation= → EpcPropertyData default None, dropping the
whole §2 block so MEV/MVHR certs scored as natural. Mirror 21.0.1's block for
the only fields each schema lodges: mechanical_ventilation_kind (§2 MV-kind
dispatch) + sheltered_sides (§S5, from built_form). Neither schema lodges the
fan/flue/vent counts (RdSAP Table-5 age defaults), so those stay unset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 09:55:08 +00:00
Khalim Conn-Kowlessar
34d97a75f4 Construct sap_ventilation in from_rdsap_schema_19_0 / 21_0_0 🟥
19.0 + 21.0.0 pass no sap_ventilation= at all → EpcPropertyData default None,
dropping the entire §2 block (sheltered_sides + mechanical_ventilation_kind).
Extend the MVHR mapper test to both and add a sheltered_sides regression,
mirroring 21.0.1 (remaining ADR-0037 ventilation follow-up).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 09:53:19 +00:00
Daniel Roth
04b3cb240a
Merge pull request #1333 from Hestia-Homes/fix/baseline-downgrades
fix(epc-mapper): complete full-SAP 17.1 mapper so pre-SAP10 certs rebaseline (no more impossible downgrade)
2026-06-26 10:44:52 +01:00
Daniel Roth
d77232c333
Merge pull request #1332 from Hestia-Homes/fix/solar-429-concurrency
fix(solar): throttle per-container Solar calls to hold the fleet under 600 QPM
2026-06-26 10:44:47 +01:00
Khalim Conn-Kowlessar
e405928516 Re-baseline prediction component-accuracy gate for full-SAP donors (ADR-0037)
Full-SAP certs mapped property_type=None, so the hard cohort filter silently
excluded them as comparables. Correctly typing them admits real lodged EPCs as
donors — a ground-truth-method change (cf #1245). Net over the n=36 fixture: 16
components better, 4 worse, 6 unchanged; gains concentrated in the physical
characteristics full-SAP certs measure (window_count 3.83->1.69, building_parts,
total_window_area, floor_construction, construction_age_band, glazing, walls).
The 4 that fell are new-build-vs-old-stock service mismatch on 1-2 targets each
(heating/water fuel, cylinder insulation) + floor_area. Tighten 16, loosen 4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 09:34:27 +00:00
Khalim Conn-Kowlessar
b2c74dbf5b docs: ventilation mapping inconsistency — 17.1/18.0/20.0.0 fixed, 19.0/21.0.0 open
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 08:46:01 +00:00
Khalim Conn-Kowlessar
e770c876ea Map mechanical_ventilation_kind in the 3 bare-SapVentilation RdSAP mappers 🟩
17.1/18.0/20.0.0 built SapVentilation(sheltered_sides=…) and dropped the cert's
mechanical_ventilation, mis-scoring MEV/MVHR dwellings as natural. Mirror 21.0.1's
_api_mechanical_ventilation_kind. Natural certs (code 0/5 → None) unchanged
(corpus 73.3%/0.774, mapper corpus green, 726605 SAP 68.058 unchanged).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 08:44:37 +00:00
Khalim Conn-Kowlessar
debbbb84f2 Map mechanical_ventilation_kind in the 3 bare-SapVentilation RdSAP mappers 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 08:38:13 +00:00
Khalim Conn-Kowlessar
3f69c4be02 docs: full-SAP baseline-downgrade follow-ups + Case A population sweep tool
Captures the calc-facing ventilation-type gap (older RdSAP mappers drop
mechanical_ventilation_kind), the FE-side Main Fuel display, the sweep survivor
clusters, and the predicted-property display path — all separate from ADR-0037.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 21:45:44 +00:00
Khalim Conn-Kowlessar
590a456065 Map main_heating_controls in the older RdSAP mappers for the FE panel 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 21:43:17 +00:00
Khalim Conn-Kowlessar
a975d870c9 Map main_heating_controls in the older RdSAP mappers for the FE panel 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 21:41:41 +00:00
Khalim Conn-Kowlessar
5deea0a27c Map main_heating_controls on full-SAP certs for the FE panel 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 21:38:50 +00:00
Khalim Conn-Kowlessar
0440de4965 Map main_heating_controls on full-SAP certs for the FE panel 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 21:38:06 +00:00
Khalim Conn-Kowlessar
95701d03e4 Map display EnergyElements on full-SAP certs for the FE panel 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:55:51 +00:00
Khalim Conn-Kowlessar
4c65640e4e Map display EnergyElements on full-SAP certs for the FE panel 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:54:46 +00:00
Khalim Conn-Kowlessar
304e8afb00 Map assessment_type on full-SAP certs 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:53:22 +00:00
Khalim Conn-Kowlessar
33f9988ac5 Map assessment_type on full-SAP certs 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:52:07 +00:00
Khalim Conn-Kowlessar
f568ec00fc Full-SAP certs rebaseline off the lodged SAP-2012 value (downgrade fix) 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:43:31 +00:00
Khalim Conn-Kowlessar
5149400f96 Map secondary_heating on full-SAP certs for the calculator 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:40:59 +00:00
Khalim Conn-Kowlessar
7b06d9dbab Map secondary_heating on full-SAP certs for the calculator 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:40:30 +00:00
Khalim Conn-Kowlessar
bc394ce5f5 Map built_form on full-SAP certs 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:38:50 +00:00
Khalim Conn-Kowlessar
d2ede36b41 Map built_form on full-SAP certs 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:38:16 +00:00
Khalim Conn-Kowlessar
5c0460cee2 Map property_type on full-SAP certs for correct heat-transmission 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:37:34 +00:00
Khalim Conn-Kowlessar
951bee3115 Map property_type on full-SAP certs for correct heat-transmission 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:36:38 +00:00
Khalim Conn-Kowlessar
cff5b061a4 Map sap_version on full-SAP certs so pre-SAP10 rebaseline fires 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:36:04 +00:00
Khalim Conn-Kowlessar
14c777f37b Map sap_version on full-SAP certs so pre-SAP10 rebaseline fires 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:34:35 +00:00
Khalim Conn-Kowlessar
2d18e9a3b0 docs: ADR-0037 + Full-SAP Assessment term for the baseline-downgrade family
Captures the grill-with-docs decisions for the full-SAP-17.1 mapper completion:
rebaseline-to-10.2 (restores Rebaselining trigger (a)), calc-affecting fields
coupled with the sap_version flip, and growing Elmhurst-anchored validation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:24:34 +00:00
Daniel Roth
8322c197aa
Merge pull request #1331 from Hestia-Homes/feature/handle-main_heating_category-11
Fix UnmappedSapCode for main_heating_category 11 (electric ceiling heating)
2026-06-25 17:14:55 +01:00
Khalim Conn-Kowlessar
ecb31bf114 Inject Solar throttle gap derived from queue maximum_concurrency
Terraform computes SOLAR_MIN_REQUEST_INTERVAL_SECONDS = N / (0.8 * 600 / 60)
from var.maximum_concurrency (=4.0s at N=32) so the fleet width has one source
of truth and the per-container Solar pacing tracks it automatically.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 16:05:57 +00:00
Khalim Conn-Kowlessar
1e3c401b38 Resolve the Solar throttle gap from env with a 32-wide fallback 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 16:04:39 +00:00
Khalim Conn-Kowlessar
85e203f366 Resolve the Solar throttle gap from env with a 32-wide fallback 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 16:03:42 +00:00