Model/backend/documents_parser/tests
Khalim Conn-Kowlessar 2605a7bf6e Slice 102f-prep.10: Alt-wall opening allocation per window_wall_type
RdSAP §1.4.2: window openings deduct from the gross of the wall they
pierce. The cert schema lodges `window_wall_type` on each SapWindow:
code 1 = main wall, codes 2/3 = alternative walls 1/2. Cohort
ground-truth: cert 2636 BP0 lodges one window (1.14 × 1.04 ≈ 1.19 m²)
with `window_wall_type=2` → it pierces alt.1 (12.76 m² cavity
unfilled at age D → U=0.70).

Pre-fix the cascade subtracted ALL openings from the BP's (main+alt)
gross then routed each alt at its FULL gross — over-counting alt's
contribution by 1.19 × U_alt and under-counting main by 1.19 × U_main.
For cert 2636: 1.19 × (0.70 − 0.25) = +0.535 W/K cascade walls excess,
matching the observed cascade walls 20.56 vs worksheet 20.024.

`_window_on_alt_wall` translates the per-window `window_wall_type`
code; the per-BP loop aggregates alt-wall windows into
`alt_window_area_by_bp`, passes that opening area through to
`_alt_wall_w_per_k` (alt.1 only — no cohort cert exercises alt.2
windows), and adds the deducted area back to the main wall's net
area so the conservation invariant holds.

Cohort impact: cert 2636 cascade walls closes from 20.5595 → 20.0240
(spec-exact to 1e-3). Cascade (37) closes from 114.7067 → 114.1846
(Δ +0.0134 from a small thermal-bridging area rounding diff). Cert
2636 SAP shifts from -0.0055 → +0.0323 — joining the cohort cluster
(all 7 ASHP certs now within +0.030 to +0.059 SAP).

The current near-zero cancellation state for cert 2636 was hiding
two opposite cascade errors (over-count walls + under-count η_space).
This slice closes walls correctly; the remaining +0.03 SAP cluster
across all 7 certs is the systematic PSR-denominator HLC×ΔT drift
documented in the handover (not max_output, which BRE confirmed
is 4.39 kW exactly).

Zero regressions on Elmhurst hand-built fixtures, closed-cert Layer
4 1e-4 chain gates, or golden cert residual pins.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 16:28:46 +00:00
..
fixtures chore: stage cert 9501 fixtures (second boiler validation cert) 2026-06-01 16:28:45 +00:00
__init__.py Map to RdSapSiteNotes from site notes JSON 🟥 2026-04-16 13:54:03 +00:00
test_elmhurst_end_to_end.py fix: address 22 project-wide test failures from previous sweep 2026-05-26 13:34:51 +00:00
test_elmhurst_extractor.py extract window frame details from elmhurst site notes 🟥 2026-04-27 15:50:25 +00:00
test_end_to_end.py P6.1 follow-on: unbox BuildingPartIdentifier at backend boundaries 2026-05-20 09:58:23 +00:00
test_extractor.py Handle wall thickness "Unmeasurable" 🟩 2026-04-30 16:41:16 +00:00
test_pdf.py rename example site notes to PasHub_ and add Elmhurst example 2026-04-24 13:01:51 +00:00
test_summary_pdf_mapper_chain.py Slice 102f-prep.10: Alt-wall opening allocation per window_wall_type 2026-06-01 16:28:46 +00:00