Model/backend/documents_parser
Khalim Conn-Kowlessar dca2ff0918 Slice S0380.1: RED — pin cert 0380 Summary cascade against worksheet 88.5104
Adds `test_summary_0380_full_chain_sap_matches_worksheet_pdf_exactly`
plus the `_SUMMARY_000899_PDF` fixture constant. The test pins the
Summary → ElmhurstSiteNotesExtractor → EpcPropertyDataMapper →
cert_to_inputs → calculator chain for cert 0380-2471-3250-2596-8761
(Mitsubishi PUZ-WM50VHA ASHP, PCDB index 104568, semi-detached
bungalow age D, TFA 60.43 m²) against the unrounded SAP lodged on
the `dr87-0001-000899.pdf` worksheet "SAP value" line: **88.5104**.

Opens the Summary-path workstream for the 7-cert ASHP cohort. API
path is already at the spec-precision floor (Δ +0.0594, pinned by
slice 102f). The Summary path becomes the canonical reference once
it closes to 1e-4 — the boiler precedents (cert 001479 worksheet
69.0094, cert 0330 worksheet 61.5993) followed the same Summary-
first ordering.

Diagnostic baseline (printed by the probe in the handover):

  Summary mapper main_heating_category:     None    (expected: 4 / HP)
  Summary mapper main_heating_index_number: 104568  (expected: 104568)
  Summary path SAP: 33.7920  Δ vs 88.5104: -54.7184

Failure mode is exactly what the handover predicts: the Elmhurst
extractor surfaces the PCDB index correctly but leaves
`main_heating_category=None`, so `cert_to_inputs` misroutes off the
Appendix N3.6/N3.7 heat-pump path and lands on a default boiler-ish
cascade. First slice to fix in slice 2: surface
`main_heating_category=4` from the Elmhurst Summary heating block
when the PCDB index resolves to a HP record.

Pyright: 0 errors on the test file. Convention: 1e-4 tolerance per
`feedback_zero_error_strict` and the closed-boiler precedent (no
widening until cascade matches at 1e-3 and the residual is documented).
AAA literal headers per `feedback_aaa_test_convention`. `abs(diff)`
not `pytest.approx` per `feedback_abs_diff_over_pytest_approx`.

Baseline shifts from "669 pass + 10 pre-existing fail" to "669 pass +
11 fail" — the new fail is the forcing function for the workstream.

Refs:
- backend/documents_parser/tests/test_summary_pdf_mapper_chain.py:494
- domain/sap10_calculator/docs/HANDOVER_CERT_0380_SUMMARY_PATH.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 17:31:59 +00:00
..
handler address JTK review comments 2026-04-20 15:11:17 +00:00
tests Slice S0380.1: RED — pin cert 0380 Summary cascade against worksheet 88.5104 2026-05-27 17:31:59 +00:00
__init__.py Map to RdSapSiteNotes from site notes JSON 🟥 2026-04-16 13:54:03 +00:00
db_writer.py include updating epc_property_data to pashub to ara workflow 2026-04-29 09:55:14 +00:00
elmhurst_extractor.py Slice 99d: surface PV array from Elmhurst Summary §19.0 2026-05-26 21:38:14 +00:00
extractor.py Handle wall thickness "Unmeasurable" 🟩 2026-04-30 16:41:16 +00:00
local_runner.py update local runner to work for elmhurst 2026-04-24 14:01:36 +00:00
parser.py load ecmk site notes to db 2026-04-29 11:20:47 +00:00
pdf.py update local runner to work for elmhurst 2026-04-24 14:01:36 +00:00