mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Slice S0380.10: pin certs 3800 + 9285 Summary chain tests — first-try closure
Adds two Layer-4 chain tests for the ASHP cohort, both pinning at the
±0.07 spec-floor tolerance with **zero new mapper slices required**.
The structural debt paid down in S0380.2..S0380.9 (HP routing,
cylinder block, composite walls, multi-array PV, multi-bp extension
wall_insulation_thickness inheritance) was already sufficient for
these two certs — they close first-try.
First-attempt probe results across the 5 remaining ASHP cohort certs:
cert Worksheet Summary-cascade Δ in floor?
2225 88.7921 88.4842 -0.3079 no
2636 86.2641 86.7514 +0.4873 no
3800 86.1458 86.1900 +0.0442 **YES** ← this slice
9285 84.1369 84.1871 +0.0502 **YES** ← this slice
9418 84.6305 87.2278 +2.5973 no (Daikin)
This is the strongest evidence yet that the Summary mapper has
amortized its variant-debt for standard single-bp / single-array
Mitsubishi-cohort ASHPs. Per the [[project-summary-path-cohort-
closure]] memory: 0380 needed 6 slices; 0350 needed 2; 3800 and 9285
need ZERO; 2225 / 2636 / 9418 each need ≤2-3 small slices to close.
Also adds the 5 remaining ASHP cohort Summary PDFs as fixtures
(Summary_000898, 000900, 000901, 000902, 000904) — copied from
`sap worksheets/Additional data with api/<cert>/`. The 3 not-yet-
closed certs (2225, 2636, 9418) will pick up chain tests in
subsequent slices once their per-cert gaps are paid down.
Pyright: 0 errors on the test file (no other code touched).
Regression suite: 679 pass + 10 fail (= handover baseline 669 + 10
+ 10 new GREEN tests across Slices S0380.2..S0380.10). Of the 10
new tests, 7 are unit-level mapper-boundary pins and 4 are chain
tests at ±0.07 (certs 0380, 0350, 3800, 9285).
Spec / precedent refs:
- Slice 102f (commit c0086660) — same disposition on the API path
for the same 7 ASHP cohort certs.
- SAP 10.2 Appendix N3.6 — PSR-interpolation precision floor
(calculator-side limit, not mapper).
- Project memory `project-summary-path-cohort-closure` tracks the
closure status table for all 7 cohort certs.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
43a86d66c2
commit
f546bd5ddc
6 changed files with 49 additions and 0 deletions
BIN
backend/documents_parser/tests/fixtures/Summary_000898.pdf
vendored
Normal file
BIN
backend/documents_parser/tests/fixtures/Summary_000898.pdf
vendored
Normal file
Binary file not shown.
BIN
backend/documents_parser/tests/fixtures/Summary_000900.pdf
vendored
Normal file
BIN
backend/documents_parser/tests/fixtures/Summary_000900.pdf
vendored
Normal file
Binary file not shown.
BIN
backend/documents_parser/tests/fixtures/Summary_000901.pdf
vendored
Normal file
BIN
backend/documents_parser/tests/fixtures/Summary_000901.pdf
vendored
Normal file
Binary file not shown.
BIN
backend/documents_parser/tests/fixtures/Summary_000902.pdf
vendored
Normal file
BIN
backend/documents_parser/tests/fixtures/Summary_000902.pdf
vendored
Normal file
Binary file not shown.
BIN
backend/documents_parser/tests/fixtures/Summary_000904.pdf
vendored
Normal file
BIN
backend/documents_parser/tests/fixtures/Summary_000904.pdf
vendored
Normal file
Binary file not shown.
|
|
@ -60,6 +60,8 @@ _SUMMARY_000897_PDF = _FIXTURES / "Summary_000897.pdf"
|
|||
_SUMMARY_000784_PDF = _FIXTURES / "Summary_000784.pdf"
|
||||
_SUMMARY_000899_PDF = _FIXTURES / "Summary_000899.pdf"
|
||||
_SUMMARY_000903_PDF = _FIXTURES / "Summary_000903.pdf"
|
||||
_SUMMARY_000901_PDF = _FIXTURES / "Summary_000901.pdf" # cert 3800
|
||||
_SUMMARY_000904_PDF = _FIXTURES / "Summary_000904.pdf" # cert 9285
|
||||
|
||||
# GOV.UK EPB API JSON for cert 001479 — the API-path counterpart of the
|
||||
# Summary_001479.pdf fixture. Together they drive the API ≡ Summary
|
||||
|
|
@ -711,6 +713,53 @@ def test_summary_0350_full_chain_sap_within_spec_floor_of_worksheet() -> None:
|
|||
assert abs(result.sap_score_continuous - worksheet_unrounded_sap) < _ASHP_COHORT_CHAIN_TOLERANCE
|
||||
|
||||
|
||||
def test_summary_3800_full_chain_sap_within_spec_floor_of_worksheet() -> None:
|
||||
# Arrange — cert 3800-8515-0922-3398-3563 (Summary_000901.pdf /
|
||||
# dr87-0001-000901.pdf) is the third ASHP cohort cert to close on
|
||||
# the Summary path: Mitsubishi PUZ-WM50VHA ASHP (PCDB 104568).
|
||||
# Worksheet "SAP value" lodges 86.1458.
|
||||
#
|
||||
# **First-try closure — zero new mapper slices required**. The
|
||||
# structural work shipped in slices S0380.2..S0380.9 (HP routing,
|
||||
# cylinder block, composite walls, multi-array PV, extension
|
||||
# inheritance) was already sufficient for cert 3800's variant set.
|
||||
# Strong evidence that the Summary mapper has reached completeness
|
||||
# for the standard single-bp / single-array ASHP shape.
|
||||
pages = _summary_pdf_to_textract_style_pages(_SUMMARY_000901_PDF)
|
||||
site_notes = ElmhurstSiteNotesExtractor(pages).extract()
|
||||
epc = EpcPropertyDataMapper.from_elmhurst_site_notes(site_notes)
|
||||
|
||||
# Act
|
||||
result = calculate_sap_from_inputs(
|
||||
cert_to_inputs(epc, prices=SAP_10_2_SPEC_PRICES)
|
||||
)
|
||||
|
||||
# Assert — ±0.07 ASHP-cohort spec-floor tolerance.
|
||||
worksheet_unrounded_sap = 86.1458
|
||||
assert abs(result.sap_score_continuous - worksheet_unrounded_sap) < _ASHP_COHORT_CHAIN_TOLERANCE
|
||||
|
||||
|
||||
def test_summary_9285_full_chain_sap_within_spec_floor_of_worksheet() -> None:
|
||||
# Arrange — cert 9285-3062-0205-7766-7200 (Summary_000904.pdf /
|
||||
# dr87-0001-000904.pdf) is the fourth ASHP cohort cert to close on
|
||||
# the Summary path: Mitsubishi PUZ-WM50VHA ASHP (PCDB 104568).
|
||||
# Worksheet "SAP value" lodges 84.1369. Same "first-try closure,
|
||||
# zero new slices" disposition as cert 3800 — the cohort's
|
||||
# structural mapper completeness is the load-bearing claim.
|
||||
pages = _summary_pdf_to_textract_style_pages(_SUMMARY_000904_PDF)
|
||||
site_notes = ElmhurstSiteNotesExtractor(pages).extract()
|
||||
epc = EpcPropertyDataMapper.from_elmhurst_site_notes(site_notes)
|
||||
|
||||
# Act
|
||||
result = calculate_sap_from_inputs(
|
||||
cert_to_inputs(epc, prices=SAP_10_2_SPEC_PRICES)
|
||||
)
|
||||
|
||||
# Assert — ±0.07 ASHP-cohort spec-floor tolerance.
|
||||
worksheet_unrounded_sap = 84.1369
|
||||
assert abs(result.sap_score_continuous - worksheet_unrounded_sap) < _ASHP_COHORT_CHAIN_TOLERANCE
|
||||
|
||||
|
||||
def test_summary_0380_full_chain_sap_within_spec_floor_of_worksheet() -> None:
|
||||
# Arrange — cert 0380-2471-3250-2596-8761 (Summary_000899.pdf /
|
||||
# dr87-0001-000899.pdf) is the first heat-pump cert under per-cert
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue