Model/packages
Khalim Conn-Kowlessar 4d9586bd56 Slice 79: cohort 000487 RIR reorder + alt-wall code 8 → 5
Closes 22 of the remaining 23 mapper-vs-hand-built load-bearing
divergences on cohort cert 000487. All 11 `_FIXTURE_PINS["000487"]`
SapResult pins remain GREEN at 1e-4 against worksheet `SAP value
61.6431` (cascade-equivalent — see per-change rationale).

(1) RIR `detailed_surfaces` reorder to match the mapper's per-row
Summary §3.10 extraction order:

  was: [gable_wall, gable_wall_external(u=0.86), flat_ceiling,
        stud_wall(100mm/min.wool), slope(0mm)]
  now: [flat_ceiling, stud_wall, slope, gable_wall,
        gable_wall_external(u=0.86)]

The cascade reads these surfaces as a set (sums U × area per kind),
so list order is cascade-inert. Confirmed: all 11 cohort 000487
cascade pins GREEN post-reorder. Per-surface insulation_thickness_mm
and u_value are unchanged from the prior encoding (matches mapper).

(2) Alt-wall `_WC_TIMBER_FRAME` constant: **8 → 5**.

The prior `_WC_TIMBER_FRAME = 8` was a mislabel — SAP10 code 8 is
"Park home" per `_ELMHURST_WALL_CODE_TO_SAP10`. The mapper extracts
"TI Timber Frame" → SAP10 code **5** (Timber frame). Both codes
happen to cascade to U=1.9 at age band B (different default paths),
so the prior encoding produced the right cascade output despite the
wrong semantic; switching to 5 mirrors the cert truth and the mapper.

Dropped the alt-wall's `wall_insulation_thickness='150'` workaround
and `u_value=1.90` explicit pin — the cascade for `wall_construction
=5` at age B resolves to U=1.9 from the age-band default; mapper
passes None for both fields and the cascade computes them.

Remaining diff: 1 (`sap_windows: LEN 5 vs 2`) — Slice 80.

Pyright net-zero on the touched fixture.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 18:04:32 +00:00
..
domain Slice 79: cohort 000487 RIR reorder + alt-wall code 8 → 5 2026-05-25 18:04:32 +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/.