Slice S0380.36: tighten _ASHP_COHORT_CHAIN_TOLERANCE 0.04 -> 1e-4 after S0380.31 closes cohort

Cohort-1 ASHP cohort residuals at HEAD d61a27e0 (post S0380.31..S0380.35):
  cert 0330: Summary -1.1e-5  (API -1.1e-5 via cert 0380 fixture)
  cert 0350: Summary +2.2e-5  (API +2.2e-5)
  cert 0380: Summary +1.0e-6  (API +1.0e-6)
  cert 2225: Summary -4.8e-5  (API -4.8e-5) [worst]
  cert 2636: Summary -2.4e-6  (API -2.4e-6)  closed by S0380.31
  cert 3800: Summary -2.0e-5  (API -2.0e-5)
  cert 9285: Summary -3.4e-5  (API -3.4e-5)
  cert 9418: Summary -3.6e-7  (API -3.6e-7)

All 7 certs sit at < 5e-5 on BOTH paths. The 0.04 tolerance set in
S0380.29 was sized to the API-path +0.03..+0.06 cluster that S0380.30
(glazing codes) and S0380.31 (alt-wall openings in (31)) subsequently
closed.

1e-4 matches the user's "1e-4 across the board" target with ~2x
headroom over cert 2225's worst residual. Any future regression beyond
~5e-5 fires the tolerance loudly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-05-28 16:10:50 +00:00 committed by Jun-te Kim
parent 4b22f56d45
commit 8b445e28fa

View file

@ -1782,16 +1782,21 @@ _API_9285_JSON = (
/ "9285-3062-0205-7766-7200.json"
)
_ASHP_COHORT_CHAIN_TOLERANCE: float = 0.04
"""ASHP-cohort chain-test tolerance after S0380.28 (reciprocal-linear
PSR interpolation per SAP 10.2 Appendix N footnote 43). Pre-slice the
cohort sat at +0.03..+0.06 SAP and this constant was 0.07. Post-slice:
Summary path: 6 of 7 certs hit < 1e-4; cert 2636 -0.015 (cantilever)
API path: all 6 certs hit +0.014..+0.031 (cohort-residual cluster
open thread; Summary EPC API EPC for a load-bearing
field see [[project-api-to-sap-residual-test]])
0.04 gives ~30% headroom over the API path's worst residual (cert 0350
+0.031) and fires loudly on regression beyond the documented residuals."""
_ASHP_COHORT_CHAIN_TOLERANCE: float = 1e-4
"""ASHP-cohort chain-test tolerance.
The cohort closed cumulatively across S0380.26..S0380.35: §3.2 curtain
+ reciprocal-η interpolation (SAP 10.2 fn 43), glazing-code Table 6b
extension to RdSAP21 codes 8-15, (31) NET area for alt-wall openings
(SAP 10.2 K2), and the RdSAP10 §15 Decimal-rounding cluster on living
area / gross wall / kWp. At HEAD all 7 ASHP cohort certs sit at < 5e-5
SAP on BOTH paths (worst residual: cert 2225 4.8e-5):
Summary path: 7/7 < 1e-4 (cert 2636 -2e-6 after S0380.31)
API path: 7/7 < 1e-4 (parity with Summary at cascade output level)
1e-4 matches the user's [[feedback-one-e-minus-4-across-the-board]]
target with ~2x headroom over the worst residual. Any future cohort
regression beyond ~5e-5 fires this tolerance loudly."""
def test_api_0380_full_chain_sap_within_spec_floor_of_worksheet() -> None: