Model/backend/documents_parser
Khalim Conn-Kowlessar 24a7351fed 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-05-27 16:54:07 +00:00
..
handler address JTK review comments 2026-04-20 15:11:17 +00:00
tests Slice 102f-prep.10: Alt-wall opening allocation per window_wall_type 2026-05-27 16:54:07 +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