mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
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> |
||
|---|---|---|
| .. | ||
| handler | ||
| tests | ||
| __init__.py | ||
| db_writer.py | ||
| elmhurst_extractor.py | ||
| extractor.py | ||
| local_runner.py | ||
| parser.py | ||
| pdf.py | ||