Commit graph

7655 commits

Author SHA1 Message Date
Khalim Conn-Kowlessar
bbfcf1385b Resolve a historic EPC's stable attributes into cohort code spaces 🟩
property_type/built_form reuse the override code mapping; wall material
prefix -> RdSAP wall_construction; E&W age-band strings -> Table S1
letters; main_fuel display text (stripping " (not community)") -> modern
RdSAP-20/21 codes; TFA -> float. Unresolvable -> None (filter inactive).
Roof construction is deferred: its RdSAP code table isn't pinned in-repo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 08:22:31 +00:00
Khalim Conn-Kowlessar
992950bd9f Resolve a historic EPC's stable attributes into cohort code spaces 🟥
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 08:21:41 +00:00
Khalim Conn-Kowlessar
ece4b736d9 A re-lodged UPRN resolves to its latest historic certificate 🟩
Pins behaviour the exact-match slice already carried (max by
lodgement_date; ISO dates sort lexicographically).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 08:18:41 +00:00
Khalim Conn-Kowlessar
f9f80f7184 Resolve a UPRN to its historic EPC record by exact match 🟩
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 08:17:54 +00:00
Khalim Conn-Kowlessar
4bbcdb6a61 Resolve a UPRN to its historic EPC record by exact match 🟥
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 08:17:07 +00:00
Khalim Conn-Kowlessar
2788849e16 ADR-0054 + glossary: expired historic EPC conditions prediction with stable attributes
Settled in a grilling session with Khalim: the pre-2012 backup feeds EPC
Prediction landlord-override-style (stable attrs as relax-ladder filters,
TFA as a ±5% band, exact-UPRN lookup, source="expired"), never trusted as
current state; scoped to the historic source; validated by a pairs harness.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 08:15:43 +00:00
Khalim Conn-Kowlessar
cbffae07b8 Annotate locals assigned from cross-module calls in the historic-EPC stack 🟪
Review ask (dancafc): resolver/repository locals now carry explicit types
(matches: list[ScoredHistoricEpc], records: list[HistoricEpc], df:
pd.DataFrame, ...) so the flow reads without chasing callee signatures.
CLAUDE.md's Type Safety section gains the rule so future sessions enforce it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 14:59:13 +00:00
Khalim Conn-Kowlessar
246834fac0 Map shard rows to HistoricEpc field-by-field so every column is pyright-checked 🟩
The row→domain mapper now names all 93 constructor arguments explicitly
instead of splatting a lowercased dict, takes a plain Mapping (a
DataFrame.to_dict("records") row) instead of a pandas Series, and ignores
columns the domain type doesn't know. A missing/renamed CSV column fails
loudly as a KeyError at the row. Both iterrows() call sites move to
to_dict("records") — pandas-stubs types iterrows' Series unparameterized,
which strict mode rejects. pandas-stubs + boto3-stubs[s3] make the stack
check clean: pyright strict is now 0 errors across the PR's files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 14:58:09 +00:00
Khalim Conn-Kowlessar
55284a1807 A shard with an unexpected extra column still maps to HistoricEpc 🟥
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 14:43:47 +00:00
Khalim Conn-Kowlessar
ab245de68d Merge remote-tracking branch 'origin/main' into feature/historic-epc-repository 2026-07-04 11:19:59 +00:00
KhalimCK
6dfaecc352
Merge pull request #1460 from Hestia-Homes/fix/table-12a-underfloor-rows
Electric underfloor codes resolve their Table 12a Grid 1 rows (ADR-0050 deferred follow-up)
2026-07-03 17:53:59 +01:00
KhalimCK
adcdce4271
Merge pull request #1462 from Hestia-Homes/fix/floor-u-value-gate
Floor insulation gated on the derived floor U-value (ADR-0051 floor arm)
2026-07-03 17:53:34 +01:00
Khalim Conn-Kowlessar
2a0cf05fdd Amend ADR-0051: the floor U-value gate landed; roof stays evidence-gated 🟪
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 16:08:57 +00:00
Khalim Conn-Kowlessar
fb3516ee95 Floor insulation is withheld when it cannot lower the derived floor U 🟩
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 16:06:45 +00:00
Khalim Conn-Kowlessar
128981289a Floor insulation is withheld when it cannot lower the derived floor U 🟥
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 16:05:04 +00:00
Khalim Conn-Kowlessar
6c6be1a432 Electric underfloor codes resolve their SAP 10.2 Table 12a Grid 1 rows 🟩
421 slab -> Other storage heaters (0.00); 422/423 integrated -> 0.20;
424/425 screed/timber -> 0.90/0.50 — per the Grid 1 row labels that name
the codes (PDF p.184). Closes the None all-low-rate fallback that
over-credited 7-hour-metered underfloor dwellings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 16:00:40 +00:00
Khalim Conn-Kowlessar
f604672ae0 Electric underfloor codes resolve their SAP 10.2 Table 12a Grid 1 rows 🟥
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 15:57:37 +00:00
Daniel Roth
c0d36d1e67
Merge pull request #1458 from Hestia-Homes/feature/abri-api-integration
Abri DomnaRelay client — foundation + LogJob vertical (strictly typed)
2026-07-03 16:49:46 +01:00
Jun-te Kim
838668bfdb
Merge pull request #1451 from Hestia-Homes/fix/sap-heating-optional-air-conditioning
Make nested SapHeating.has_fixed_air_conditioning optional across all RdSAP schemas
2026-07-03 16:34:27 +01:00
Jun-te Kim
6172f5d30d
Merge pull request #1452 from Hestia-Homes/fix/roof-construction-another-premises-above
Map API roof_construction code 9 ("another premises above") to None
2026-07-03 16:34:15 +01:00
Daniel Roth
ff868156d1 Abri job logging trigger is named after the DomnaRelay route it fires 🟪
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 15:26:41 +00:00
Daniel Roth
a86607e420 Abri relay exchange reads as serialise, post, parse, then dispatch on the failure document 🟪
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 15:12:44 +00:00
Jun-te Kim
d769f4488a Suppress roof heat loss for API roof_construction codes 7 and 9
RdSAP 10 Specification (10-06-2025) §5.2.5: "If a dwelling or part of a
dwelling has commercial premises above record as another dwelling
above" — so code 9 ("another premises above") must get the same
zero-heat-loss treatment as code 7 ("another dwelling above"), per the
spec's own "there is no heat loss through the roof of a building part
that has the same dwelling above or another dwelling above."

The previous fix mapped both to None, which only avoided the mapper
crash — it didn't achieve zero heat loss. heat_transmission.py's
per-part suppression (part_roof_is_party) only fires when
roof_construction_type CONTAINS the literal string "another dwelling
above"; that string was only ever set on the Elmhurst ingestion path.
The API path mapped 7 (and, until now, 9) to None, so the suppression
never fired for any API-derived cert — has_exposed_roof (the
dwelling_type-label-only fallback) was the sole gate, with no way to
know about a per-part party-ceiling lodgement. Both codes now map to
"(another dwelling above)" so the existing suppression logic fires on
both ingestion paths, matching what
domain/epc/property_overrides/roof_party_ceiling_guard.py already does
independently for the landlord-override pipeline (same spec citation).

Verified against the motivating cert (uprn 10013320122): roof_w_per_k
now correctly computes to 0.0. Full RdSAP-21.0.1 corpus (1000 certs)
re-run: within-0.5 unchanged at 77.8%, MAE improves marginally
(0.6364 vs 0.637 ceiling) — no regression.
2026-07-03 14:44:01 +00:00
Daniel Roth
32b56050b0 Abri relay requests share one envelope, transport and rejection path across request types 🟪
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:37:40 +00:00
Daniel Roth
c23c74be6b Abri log_job treats a logged-job response missing its job number as retriable 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:36:55 +00:00
Daniel Roth
c1c2a1947e Abri log_job treats a logged-job response missing its job number as retriable 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:35:35 +00:00
Daniel Roth
62ad53df5a Abri relay credentials and defaults hydrate from environment configuration 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:34:53 +00:00
Daniel Roth
39055bafed Abri relay credentials and defaults hydrate from environment configuration 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:34:27 +00:00
Daniel Roth
f5fefd4d93 Abri job descriptions identify the visit as a Domna condition survey 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:34:05 +00:00
Daniel Roth
caffa5c4e1 Abri job descriptions identify the visit as a Domna condition survey 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:33:40 +00:00
Daniel Roth
2c660bdb5d Abri unparseable confirmed time fails loudly rather than silently booking all day 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:33:12 +00:00
Daniel Roth
eccc03f9f2 Abri confirmed time at or after midday books the afternoon slot 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:32:49 +00:00
Daniel Roth
cd29cbb0b8 Abri confirmed time before midday books the morning slot 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:32:15 +00:00
Daniel Roth
fcdab30b73 Abri confirmed time before midday books the morning slot 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:31:51 +00:00
Daniel Roth
992ac243ba Abri booking with no confirmed time books an all-day appointment 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:31:33 +00:00
Daniel Roth
da4caea407 Abri booking with no confirmed time books an all-day appointment 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:31:12 +00:00
Daniel Roth
fef69145da Abri log_job treats an unexpectedly shaped relay response as retriable 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:30:29 +00:00
Daniel Roth
a325f65bf0 Abri log_job treats an unexpectedly shaped relay response as retriable 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:30:02 +00:00
Daniel Roth
0df1d866fe Abri log_job treats a malformed relay response as retriable, never as success or rejection 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:29:41 +00:00
Daniel Roth
ff34872c24 Abri log_job treats a malformed relay response as retriable, never as success or rejection 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:29:08 +00:00
Daniel Roth
95bb951b60 Abri log_job raises a retriable transport error when the relay is unreachable 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:28:39 +00:00
Daniel Roth
6b9f5a0140 Abri log_job raises a retriable transport error when the relay is unreachable 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:28:19 +00:00
Daniel Roth
d002a3defc Abri log_job raises a retriable transport error on an HTTP error status 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:27:43 +00:00
Daniel Roth
9fefdf81aa Abri log_job raises a retriable transport error on an HTTP error status 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:27:14 +00:00
Daniel Roth
e0830169ad Abri log_job surfaces an OpenHousing rejection as a typed result with verbatim code and message 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:26:23 +00:00
Daniel Roth
e473ea8a4f Abri log_job surfaces an OpenHousing rejection as a typed result with verbatim code and message 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:25:49 +00:00
Daniel Roth
79ce9dc4b1 Abri log_job sends the spec's recorded LogJob envelope to the relay endpoint 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:24:57 +00:00
Daniel Roth
4803ae40e1 Abri log_job sends the spec's recorded LogJob envelope to the relay endpoint 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:23:42 +00:00
Daniel Roth
dd451a03a8 Abri log_job returns the OpenHousing job number from the relay success response 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:22:56 +00:00
Daniel Roth
b22afcde9f Abri log_job returns the OpenHousing job number from the relay success response 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:22:09 +00:00