From bb4f8577fe4b2b0b8b3c3f361c021ef8d3ac9fa6 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 26 Jun 2026 16:58:48 +0000 Subject: [PATCH] =?UTF-8?q?test:=20correct=20multi-measure=20plan=20expect?= =?UTF-8?q?ation=20for=20exposed-floor=20fix=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fixture lodges is_exposed_floor=True, which was silently dropped on save->reload before this branch — so the orchestrator (reads the DB) modelled the floor as not-exposed. Now it round-trips, the exposed floor is honoured, and the ASHP-led max-gain fallback on this gas dwelling is bill-neutral (marginally negative) rather than bill-positive: large energy saving, but the gas->electricity fuel switch offsets the GBP saving. Same optimal package, same telescoping; only the bill-savings sign assumption changed. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../test_ara_first_run_pipeline_integration.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/orchestration/test_ara_first_run_pipeline_integration.py b/tests/orchestration/test_ara_first_run_pipeline_integration.py index 5bc08901..bed58c75 100644 --- a/tests/orchestration/test_ara_first_run_pipeline_integration.py +++ b/tests/orchestration/test_ara_first_run_pipeline_integration.py @@ -364,12 +364,18 @@ def test_modelling_optimises_and_persists_a_multi_measure_plan( assert plan.cost_of_works is not None assert plan.cost_of_works > 0.0 # Plan-level energy/bill figures derived from the post-package bill vs the - # baseline bill at the run's Fuel Rates (ADR-0014 amendment). The package - # improves the property, so it consumes less energy and costs less to run. + # baseline bill at the run's Fuel Rates (ADR-0014 amendment). The max-gain + # fallback package is ASHP-led on a *gas* dwelling whose suspended floor is + # correctly modelled as exposed (is_exposed_floor now round-trips through + # persistence — #TBD): it saves a large amount of delivered energy, but the + # gas→electricity fuel switch trades cheap gas kWh for pricier electricity + # kWh, so the *bill* is roughly neutral (marginally negative). The exact + # value is pinned by the telescoping cascade below; here we only assert the + # figure is produced (sign is not load-bearing for a SAP-max fallback). assert plan.post_energy_bill is not None and plan.post_energy_bill > 0.0 assert plan.post_energy_consumption is not None assert plan.post_energy_consumption > 0.0 - assert plan.energy_bill_savings is not None and plan.energy_bill_savings > 0.0 + assert plan.energy_bill_savings is not None assert plan.energy_consumption_savings is not None assert plan.energy_consumption_savings > 0.0