Model/packages
Khalim Conn-Kowlessar ee98dbe0ec Slice 62: hand-built _elmhurst_worksheet_001479.py — skeleton + 11 RED pins
User-driven pivot from cascade chain-pin chase to the rigorous cohort
pattern: a hand-built EpcPropertyData that cascades to the worksheet
at 1e-4 is the ground truth for cross-mapper parity testing. Both the
Elmhurst mapper and the API mapper should ultimately produce a hand-
built-equivalent EpcPropertyData for cert 001479; every divergence
from the hand-built is a mapper bug.

This skeleton encodes the cert 001479 worksheet inputs:
- 3 building parts (Main C, Ext1 L, Ext2 C) with per-bp wall U
- Main party wall CU (cavity unfilled, U=0.50, lodged via WC_CAVITY=4)
- Cantilevered upper-storey Ext2 with `is_exposed_floor=True` (U=1.20)
- Ext2 PS sloping-ceiling roof at `roof_insulation_thickness=0`
  (Slice 57 PS+pre-1950 path → Table 16 row 0 U=2.30)
- Main 300 mm joist roof insulation → U=0.14
- 8 Main windows (U=2.8, g=0.76) + 1 Ext1 window (U=1.4, g=0.72)
- Worcester Greenstar 30i (PCDF 17507) main + SAP 605 gas fire secondary
  (Slice 58 mains-gas secondary fuel cost routing)
- Sheltered sides 1, 2 intermittent fans, 90% draught-proof, 23 LEDs

Adds an `001479` entry to `_FIXTURE_PINS` + `_FIXTURE_MODULES` in
`test_e2e_elmhurst_sap_score.py` with the worksheet PDF's 11
cascade-output line refs:

  sap_score                          69          (258)
  sap_score_continuous               69.0094     "SAP value"
  ecf                                2.2215      (257)
  total_fuel_cost_gbp                600.4001    (255)
  co2_kg_per_yr                      2687.3610   (272)
  space_heating_kwh_per_yr           8103.7054   Σ (98c)
  main_heating_fuel_kwh_per_yr       8194.7583   (211)
  secondary_heating_fuel_kwh_per_yr  2025.9264   (215)
  hot_water_kwh_per_yr               2358.3123   (219)
  pumps_fans_kwh_per_yr              160.0000    (231)
  lighting_kwh_per_yr                163.3584    (232)

Current state of the hand-built cascade vs worksheet:
  Pin                                  Cascade    Expected   PASS?
  sap_score_continuous                 65.99      69.01      no, -3.02
  total_fuel_cost_gbp                  658.92     600.40     no, +58.52
  main_heating_fuel_kwh_per_yr         9359.6     8194.8     no
  pumps_fans_kwh_per_yr                160.0      160.0      PASS
  lighting_kwh_per_yr                  163.4      163.4      PASS (after
                                                              LED/CFL split)
  (... 9 others all failing by various deltas)

2/11 pins green. The remaining ~3 SAP gap means the hand-built has
input gaps that produce more loss/cost than Elmhurst's calc. Likely
suspects (slice candidates):
- HW demand: cascade likely over-counts (combi vs cylinder routing,
  Tcold model)
- Internal gains: appliance + cooking energy share
- §2 ventilation tuning (chimney/flue counts, suspended-floor flag)
- Thermal mass parameter (250 default — confirm worksheet matches)
- Multiple-glazed proportion (cascade reads None → may default
  unfavourably for solar gains)

Documents source-data caveat in the fixture docstring: Summary §3
says Ext1 age "M 2023 onwards"; worksheet header says "Ext1: L".
Hand-built uses 'L' to mirror the worksheet (which is the calc's
input source of truth); Elmhurst mapper produces 'M' from the
Summary — cross-mapper diff will flag this as a known caveat.

All 6 cohort cascade pins remain green at 1e-4 (66/66 fixture pins).
Pyright net-zero on the new fixture file.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 08:11:03 +00:00
..
domain Slice 62: hand-built _elmhurst_worksheet_001479.py — skeleton + 11 RED pins 2026-05-25 08:11:03 +00:00
fetchers added potential file scaffolding: 2026-05-15 10:56:53 +00:00
repos added potential file scaffolding: 2026-05-15 10:56:53 +00:00
utils added potential file scaffolding: 2026-05-15 10:56:53 +00:00
README.md added potential file scaffolding: 2026-05-15 10:56:53 +00:00

Shared packages

Workspace packages consumed by services/*. Each package is its own Python distribution with its own pyproject.toml; services import via the workspace dependency mechanism ({ workspace = true }).

Package Purpose
domain/ Shared domain types — Property, BaselinePerformance, Plan, Scenario, EpcPropertyData, etc. No persistence, no IO, no business logic.
repos/ Persistence layer — one repo per aggregate. Owns the SQL. Depends on domain.
fetchers/ External API clients (gov EPC, Ofgem, Google Solar, etc.). Depend on domain for response shapes.
utils/ Cross-cutting infra — logging, S3, CloudWatch URL builders, SQS task helpers.

Adding a new shared package

Only when a real second consumer materialises. Don't pre-shatter (repos-epc, repos-property, ...) — split when a deployment needs to drop a dep, not before.

See ../ara_backend_design.md §11 for the broader monorepo layout and ../CONTEXT.md for the domain glossary that names the types living in domain/.