From 53ba1f16943ff419e3f61d9effb0c4366528a818 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 15 Jul 2026 10:57:16 +0000 Subject: [PATCH] =?UTF-8?q?Re-baseline=20the=20pashub=20MAE=20ceiling=20to?= =?UTF-8?q?=201.415=20for=20the=20water-only=20DHW=20fix=20=F0=9F=9F=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Second sanctioned exception to "ratchets never loosen" — needs @KhalimCK's call, since the prior note expected to re-tighten here. Exactly one cohort property is WHC 950 (16 Bingley Close, +5.946 -> +6.818 = the whole +0.0043); within-0.5 unchanged at 23.9%. Its pre_sap is verified correct but its ~+6 residual is a known extraction bug, and this hybrid gauge cannot adjudicate a calculator fix (#1592 Problem 2). The gov-API corpus, which gauges the calculator alone, improves. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../tests/test_pashub_sap_accuracy.py | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/backend/documents_parser/tests/test_pashub_sap_accuracy.py b/backend/documents_parser/tests/test_pashub_sap_accuracy.py index f1b8037ce..b178461f4 100644 --- a/backend/documents_parser/tests/test_pashub_sap_accuracy.py +++ b/backend/documents_parser/tests/test_pashub_sap_accuracy.py @@ -142,7 +142,36 @@ _MIN_WITHIN_HALF: float = 0.23 # RdSAP corpus). 16 Bingley Close reverts +3.2 -> +4.3, so observed MAE 1.405 -> # 1.4103; re-tighten when the water-only branch is fixed correctly under #1592 # (the cylinder-insulation MAPPER fix is retained, so the revert is partial). -_MAX_SAP_MAE: float = 1.411 +# DELIBERATELY LOOSENED 1.411 -> 1.415 by the #1592 sub-task B water-only DHW +# fix — the SECOND sanctioned exception to "ratchets never loosen", and the +# note above expected to RE-TIGHTEN here, so this needs @KhalimCK's explicit +# call before merge. +# +# The fix is spec-verified against the SAP 10.2 PDF (not ticket prose): §4.3 +# p.24 "The efficiency for water heating is incorporated in the price of heat +# from a heat network in Table 12"; C4 p.53 scopes the plant efficiency to +# "the calculation of CO2 emissions and Primary Energy"; C6 p.54 + worksheet +# (310) = (64) × (305a) × (306) carry no efficiency term. The dwelling-side +# `plant_eff / DLF` divisor was applying it a SECOND time. +# +# Exactly ONE cohort property is WHC 950 — 507644414148 (16 Bingley Close), +# +5.946 -> +6.818 = 0.872/205 = +0.0043 MAE, the whole movement. within-0.5 +# UNCHANGED at 23.9% (49/205); mean signed +1.050 -> +1.054. Observed 1.41458. +# +# Why this is not a regression signal: Bingley's `pre_sap` E52 is Khalim- +# verified correct (2026-07-14), but its ~+6 residual is a KNOWN extraction bug +# still being hunted (see HANDOVER_PASHUB_EXTRACTOR_ACCURACY.md: "community- +# heating residual — ... community standing charge/tariff detail, or DLF +# 'Unknown' distribution type"). This hybrid gauge conflates that extraction +# error with the SAP-10.2-vs-lodged-2012-RdSAP engine offset, so per #1592 +# Problem 2 it CANNOT adjudicate a calculator fix — the same reasoning the +# orientation exception above rests on. The gov-API RdSAP corpus, which gauges +# the calculator alone, IMPROVES on this change (within-0.5 78.7% -> 78.8%, +# MAE 0.6273 -> 0.6272; exactly 3 certs move, all WHC 950). +# +# Re-tighten under #1592 sub-task C, once an accredited Elmhurst 10.2 worksheet +# pins WHC-950 — Bingley is the natural capture candidate. +_MAX_SAP_MAE: float = 1.415 _KNOWN_GAP_REASON = ( "pashub `from_site_notes` mapper does not int-code a main-heating "