Handover: hand-built fixture skeleton landed (Slice 62); 2/11 pins green

Update NEXT_AGENT_PROMPT.md with the pivot to the rigorous cohort
pattern: cert 001479's hand-built `_elmhurst_worksheet_001479.py`
becomes the ground-truth EpcPropertyData. Cross-mapper parity work
then collapses to "both mappers produce hand-built-equivalent
EpcPropertyData".

Two parallel workstreams documented:

1. Iterate the hand-built skeleton (Slice 62) until all 11 cascade
   pins hit 1e-4. Current state: 2/11 green (pumps_fans, lighting);
   sap_score_continuous gap −3.02 SAP. Likely next slices: HW demand
   routing, §2 ventilation tuning, thermal mass parameter, multiple-
   glazed proportion.

2. Once hand-built is GREEN, add `test_elmhurst_mapper_matches_hand_
   built` + `test_api_mapper_matches_hand_built` over the 7-cert
   cohort (000474..000516 + 001479). Every field diff = mapper bug
   to close. Cross-parity collapses to "both mappers produce
   hand-built-equivalent".

Documents the M-vs-L Ext1 age-band source-data conflict (hand-built
uses worksheet's L; Elmhurst mapper trusts Summary's M) — surfaces
as a known caveat in cross-mapper diff.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-05-25 08:12:30 +00:00
parent ee98dbe0ec
commit 7e1269fc8e

View file

@ -232,7 +232,9 @@ For the new workflow, you'll want a probe that:
## Branch state at handover
```
$ git log --oneline -10
$ git log --oneline -12
ee98dbe0 Slice 62: hand-built _elmhurst_worksheet_001479.py — skeleton + 11 RED pins
0e4f4c05 Handover: TDD red-green session — 4 more slices (58-60) + RED chain pin
31c01a7e Slice 60: thermal bridging y is dwelling-wide, not per-bp
175873b4 Slice 59: heat_transmission apportions window area per bp via window_location
e3dc0b28 Slice 58: secondary fuel cost routes through lodged secondary_fuel_type
@ -356,14 +358,65 @@ chain-test fixtures dir.
### Suggested next steps
1. **`u_floor` Table 19 audit for age C suspended timber** — verify
the cascade matches the canonical RdSAP10 / xlsx. Possible fix
without breaking cohort 000474 (which is age B).
2. **PS sloping-ceiling roof area inclination factor** — multiply
`top_floor_area_m2` by `sec(pitch)` when roof_type is PS. Closes
the (30) and (31) gaps simultaneously.
3. When the chain pin is within ~0.001 of 69.0094, the RED test goes
GREEN — workstream done. Then API ±0.5 pin (test_golden_fixtures
_.py) and cross-parity test are the remaining workstreams.
**User-confirmed plan (rigorous cohort pattern):** the hand-built
fixture `_elmhurst_worksheet_001479.py` (Slice 62) is the ground-
truth EpcPropertyData for this cert. Two parallel workstreams now:
1. **Iterate the hand-built to 1e-4 against the worksheet.** Current
state: 2/11 cascade pins green (pumps_fans, lighting after the
LED/CFL split). The other 9 pins fail with `sap_score_continuous
= 65.99 vs 69.0094` (~3 SAP gap). Likely slice candidates from
the cascade scalar deltas:
- **HW demand routing**: hand-built may be over-counting hot-
water demand (combi-vs-cylinder path; Tcold model; Appendix J
occupancy). The worksheet's `(219) 2358.31` vs cascade's
`hot_water_kwh_per_yr` is one of the highest-impact deltas.
- **§2 ventilation tuning**: confirm `open_chimneys_count=0`,
`blocked_chimneys_count=0`, `closed_flues_count=0`,
`passive_vents_count=0` are all explicitly lodged on
`SapVentilation` to match the worksheet's §2 zeros.
- **Thermal mass parameter**: worksheet lodges `250.00` — verify
the hand-built's default matches.
- **`multiple_glazed_proportion`**: cascade reads it for solar
gain weighting; hand-built leaves None — check if that path
short-circuits to a less-favourable default.
- **`secondary_heating_fraction`**: cascade may be reading 0.10
(gas+gas) vs Elmhurst's 0.10 — confirm. (215) delta is ~290
kWh; worth ~0.2 SAP if mis-routed.
2. **Once 11 pins green: add `test_elmhurst_mapper_matches_hand_
built` + `test_api_mapper_matches_hand_built`** parametrized
over both the new cert 001479 and the 6 cohort certs. Every
field diff is a mapper bug; close them slice-by-slice. The
cross-mapper parity test (`test_api_vs_elmhurst_parity`)
collapses to "both produce hand-built-equivalent EpcPropertyData
for cert 001479".
3. **Current Elmhurst chain pin** (`test_summary_001479_full_chain
_sap_matches_worksheet_pdf_exactly`) is RED at delta 1.19 SAP.
Once the mapper closes its diff vs the hand-built, the chain pin
lands GREEN automatically.
### Probe scripts in /tmp (regenerable)
- `/tmp/probe_001479.py` — cross-mapper diff + cascade (rerun
after every cascade change; current diff count: 215 across both
mappers).
- `/tmp/sensitivity_001479.py` — single-field SAP impact probe.
- `/tmp/perbp_001479.py` — per-bp cascade U-value dump.
### Cohort cascade scalars probe (helpful for hand-built iteration)
Pin the failing fields against an MCVE probe — easiest workflow:
```python
from domain.sap.calculator import Sap10Calculator
from domain.sap.worksheet.tests._elmhurst_worksheet_001479 import build_epc
r = Sap10Calculator().calculate(build_epc())
# Inspect r.hot_water_kwh_per_yr, r.main_heating_fuel_kwh_per_yr, etc.
```
Compare against the cohort cert (e.g. 000490 mains-gas+gas secondary)
to find what hand-built field is missing.
Good luck.