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 "