From 3548f1f31ac6ab98c551275c260373eb11f374c8 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 23 Jun 2026 09:48:21 +0000 Subject: [PATCH] =?UTF-8?q?docs(tariff):=20record=20Unknown-meter=20off-pe?= =?UTF-8?q?ak=20as=20a=20verified=20non-fix=20(RdSAP=2010=20=C2=A712=20Rul?= =?UTF-8?q?es,=20table=5F12a)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Khalim's hand-built "simulated case 48" Elmhurst worksheet (main 691 room heaters + Unknown meter + 903 dual electric immersion + cylinder) proves Elmhurst resolves an Unknown meter + Rule-3 room-heater main to 10-Hour Off Peak — Elmhurst SAP 57; ours (STANDARD) 45; routing Unknown+Rule3 to off-peak (10h) gives 55, 7h gives 45 (so Elmhurst uses 10-hour, RdSAP 10 §12 Rule 3, PDF p.62). So the prior "Rule 3 is not off-peak evidence" comment was wrong about Elmhurst's behaviour. But adopting it REGRESSES the lodged-register corpus 72.5%->71.8% / MAE 0.793->0.827: of 11 Unknown+Rule-3 corpus certs only Apartment 241 improves (-5.38->-1.05); the other 10 overshoot +2.7..+9.1 (Flat 2 +9.11). The register's meter_type=3 certs were lodged with STANDARD-tariff costing — the gov-API "Unknown" is lossy and does not mean off-peak. North star is reproducing the lodged register, not Elmhurst's deliberate-Unknown worksheet, so KEEP STANDARD (same "Elmhurst != noisy register" family as roof-windows/shutters). Comment-only; no behaviour change (corpus gauge unchanged 72.5% / 0.793). pyright not installed in this container — strict type gate not run locally. Co-Authored-By: Claude Opus 4.8 (1M context) --- domain/sap10_calculator/tables/table_12a.py | 25 ++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/domain/sap10_calculator/tables/table_12a.py b/domain/sap10_calculator/tables/table_12a.py index ab5394f1..b41819b0 100644 --- a/domain/sap10_calculator/tables/table_12a.py +++ b/domain/sap10_calculator/tables/table_12a.py @@ -342,11 +342,26 @@ def rdsap_tariff_for_cert( # evidence the dwelling is on an off-peak tariff — these charge # overnight at the low rate and cannot run economically on a single # rate, so the tariff is implied. Direct-acting electric / room heaters - # / heat pumps (Rule 3) are NOT off-peak evidence (they run on demand - # and exist on single-rate meters too), so they keep STANDARD here - # rather than being mis-billed 100% at the off-peak low rate. A - # non-electric main also keeps STANDARD (no Rule 4 default — Unknown - # must not force off-peak on a gas dwelling). + # / heat pumps (Rule 3) keep STANDARD here. A non-electric main also + # keeps STANDARD (no Rule 4 default — Unknown must not force off-peak + # on a gas dwelling). + # + # VERIFIED NON-FIX (2026-06-23, "simulated case 48" Elmhurst worksheet): + # Elmhurst DOES resolve an Unknown meter + room-heater main (SAP 691) to + # 10-Hour Off Peak (its Rule 3) — a hand-built case-48 Summary (main 691, + # Unknown meter, 903 dual electric immersion) scores Elmhurst SAP 57; our + # STANDARD gives 45, routing Unknown+Rule3 to off-peak gives 55 (7-hour + # gives 45 — confirms Elmhurst uses 10-hour). So the "Rule 3 is not off- + # peak evidence" intuition is WRONG about Elmhurst's behaviour. BUT + # adopting it REGRESSES the lodged-register corpus (72.5%->71.8%, MAE + # 0.793->0.827): of 11 Unknown+Rule3 corpus certs only ONE improves + # (Apartment 241 -5.38->-1.05); the other 10 overshoot +2.7..+9.1 (Flat 2 + # +9.11). The register's meter_type=3 certs were lodged with STANDARD- + # tariff costing (their low ratings only reconcile at 13.19p flat) — the + # gov-API "Unknown" is lossy and does NOT mean off-peak was used. Since + # our north star is reproducing the lodged register (not Elmhurst's + # deliberate-Unknown worksheet path), KEEP STANDARD. Same "Elmhurst != the + # noisy register" family as roof-windows/shutters. Do NOT re-litigate. if _meter_is_unknown(meter_type): if main_codes & _RULE_1_CPSU_CODES: return Tariff.TEN_HOUR