Model/packages/domain
Khalim Conn-Kowlessar 323d3577bd Cohort residual slice 16b: LINE_31 gable_wall fix + 000477 door cleanup
Calculator fix in heat_transmission.py: Detailed §3.10 RR gable_wall
surfaces are routed to `party` at U=0.25 per Table 4, so their area
sits on worksheet line (32) — NOT on (26)-(30). The slice 13 loop
summed every detailed surface (including gable_wall) into
`rr_detailed_area`, overcounting LINE_31 by Σ A_gable and inflating
(36) thermal bridging by `y × A_gable`.

Pinned by a new unit test `test_room_in_roof_detailed_gable_wall_
excluded_from_line_31_external_area` — synthetic dwelling with one
RR detailed surface of each kind asserts LINE_31 matches the
worksheet's (26)-(30) sum, excluding the gable_wall area.

000477 fixture cleanup (cohort consistency per
[[feedback-no-misleading-insulation-type]]):
- door_count 1 → 2. Worksheet line 42 lodges total door area 3.70 m²
  = 2 × _DEFAULT_DOOR_AREA_M2 (1.85). "Doors uninsulated 1" in the
  worksheet is a single entry but the area resolves to 2 physical
  doors (front + back, typical mid-terrace). The slice-14 door_count=1
  closure was a workaround that masked the gable_wall LINE_31 bug —
  now closed properly.
- `insulation_type="mineral_wool"` stripped from the 2 uninsulated
  slope panels. Per the no-misleading-insulation convention,
  uninsulated surfaces (thickness=0) leave `insulation_type` unset.

Impact (e2e):
  000477 SAP integer 65 = PDF (Δ=0 maintained); continuous 64.526
  vs PDF 65.005 = 0.479 (within the existing <=0.5 ceiling, tightens
  in S19). The two corrections (door_count +5.55 W/K, bridging fix
  −2.27 W/K) nearly cancel; the residual ~0.9 W/K LINE_33 undershoot
  is the per-window mixed-U-value lodgement gap (Ticket 3 windows).

Remaining for 000480 closure (separate ticket):
  §3 LINE_33/LINE_37 now match PDF exactly (223.61 / 243.41 vs
  223.62 / 243.42). But SAP=66 vs PDF=61 because downstream
  residuals — lighting kWh +165% (565 vs 213), hot_water kWh +38%
  (3345 vs 2424), main_heating fuel kWh +23% (15472 vs 12580) —
  cascade into a -13% total-fuel-cost gap that the prior gable_wall
  bug was masking. Investigation deferred to a new follow-up.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 21:35:47 +00:00
..
src/domain Cohort residual slice 16b: LINE_31 gable_wall fix + 000477 door cleanup 2026-05-22 21:35:47 +00:00
pyproject.toml slice 13: to_rows(properties) returns pd.DataFrame 2026-05-16 16:43:28 +00:00
README.md added potential file scaffolding: 2026-05-15 10:56:53 +00:00

domna-domain

Shared domain types — Property, Properties, BaselinePerformance, Plan, PlanPhase, Scenario, ScenarioPhase, ScenarioSnapshot, Recommendation, OptimisedPackage, EpcPropertyData, etc.

Boundary: types only. No persistence, no IO, no business logic. Other packages and services depend on domna-domain; this package depends on nothing internal.

Domain definitions live in ../../CONTEXT.md. New types added here must match the glossary terms.

Layout

src/domain/
├── __init__.py
├── property.py             # Property, Properties, PropertyIdentity
├── site_notes.py
├── landlord_overrides.py
├── baseline_performance.py # lodged + effective pair (ADR-0004)
├── plan.py                 # Plan, PlanPhase, OptimisedPackage
├── scenario.py             # Scenario, ScenarioPhase, ScenarioSnapshot (ADR-0005)
├── recommendation.py
├── geospatial.py
├── solar.py
├── anomaly_flags.py
└── ml/
    ├── __init__.py
    ├── transform.py        # EpcMlTransform (versioned per §8.3)
    └── schema.py

When datatypes/epc/domain/ folds in, the EPC schema types move under src/domain/epc/.