diff --git a/backend/documents_parser/tests/test_pashub_sap_accuracy.py b/backend/documents_parser/tests/test_pashub_sap_accuracy.py index bac2bafd0..25d2d8009 100644 --- a/backend/documents_parser/tests/test_pashub_sap_accuracy.py +++ b/backend/documents_parser/tests/test_pashub_sap_accuracy.py @@ -321,3 +321,26 @@ def test_pashub_sap_accuracy_aggregate(capsys: pytest.CaptureFixture[str]) -> No assert sap_mae <= _MAX_SAP_MAE, ( f"SAP MAE {sap_mae:.3f} exceeded ceiling {_MAX_SAP_MAE}" ) + + +@pytest.mark.skipif(not _FIXTURES, reason="no pashub_accuracy fixtures/manifest") +def test_walsden_pins_to_pashub_resurvey_sap_64() -> None: + """13 Walsden Street (deal 499630239947) has TWO distinct gov-EPC assessments + for the same UPRN: the PAS Hub site-note re-survey we parse (inspected + 26 May 2026, accredited SAP **64**, band D, backed by `rd_sap_site_note` + files) and a SEPARATE later lodged cert (24 Jun 2026, SAP 68, registered, no + site-note). The portfolio-838 baseline latched onto the 24-Jun SAP-68 cert, + but our engine models the survey it was GIVEN and reproduces that survey's own + accredited 64 (~64.19). Confirmed against pashub (Khalim) and corroborated by + the manifest `pre_sap` D64 + hubspot D64; see the 2026-07-15e provenance + investigation in the campaign memory. The manifest is correctly 64, but the + fixture-builder can revert manifest values to a colliding DB row — so this pins + 64 explicitly. Do NOT "correct" this target to 68: that is a different + assessment with no site-note backing, and 13 Walsden is a known + re-survey-diverges outlier, not an engine under-rate.""" + outcome = _evaluate("499630239947") + assert outcome.sap_continuous is not None + assert abs(outcome.sap_continuous - 64) < 0.5, ( + f"13 Walsden SAP {outcome.sap_continuous:.2f} diverged from the PAS Hub " + "re-survey's own accredited 64 (NOT the colliding 24-Jun cert's 68)" + )