diff --git a/docs/sap-spec/NEXT_AGENT_PROMPT.md b/docs/sap-spec/NEXT_AGENT_PROMPT.md index 7edcace0..01a7a33b 100644 --- a/docs/sap-spec/NEXT_AGENT_PROMPT.md +++ b/docs/sap-spec/NEXT_AGENT_PROMPT.md @@ -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.