Commit graph

7467 commits

Author SHA1 Message Date
Jun-te Kim
06a2c413f5 test(accuracy): ratchet 75.5% -> 77.0% via secondary-fuel collision fix on cost path
The gov-API `secondary_fuel_type` enums 5 (anthracite) / 9 (dual fuel) /
33 (coal) collide in VALUE with same-valued RdSAP-10 Table-32 codes for
OTHER fuels (5=bulk LPG, 9=LPG SC11F, 33=elec 10h-low). The main-fuel
boundary and the CO2/display `_secondary_fuel_cost_gbp_per_kwh` already
canonicalise these via `canonical_fuel_code`, but the SAP-DRIVING
`_fuel_cost` cascade had a SEPARATE inline secondary rate that passed the
raw enum straight to the price lookup — so the two paths diverged and the
cost path silently mis-priced.

Anthracite (enum 5) was billed at the bulk-LPG code-5 rate 12.19 p/kWh
instead of 3.64 — a 3x over-cost on the secondary that under-rated every
solid-fuel-secondary dwelling. Worst: corpus cert 100050355518 (semi,
2 extensions, anthracite room-heater secondary) lodged 36 / engine 20.8
-> 35.5. Its CO2/PE already matched lodged (the demand cascade was right)
— a pure cost-side gap, which is what localised it.

Fix: canonicalise `secondary_fuel` before the Table-32 lookup in
`_fuel_cost`, mirroring the main-fuel boundary. 55 corpus certs carry a
colliding secondary.

Gauge: within-0.5 75.5% -> 77.0%, SAP MAE 0.708 -> 0.668 (floors
ratcheted). The prior enum-9 test only guarded the display helper; new
test_fuel_cost_secondary_colliding_fuel_priced_at_canonical_rate pins the
_fuel_cost cost path directly. RealCertExpectation pinned for
100050355518 (36 = lodged).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 19:43:31 +00:00
Jun-te Kim
a11b10f427 docs(skill): bank corpus-1000 findings (cost triangulation, software divergences, assumed-roof rule)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 19:12:48 +00:00
Jun-te Kim
c380377948 test(accuracy): ratchet 74.2% -> 75.5% via 'insulated (assumed)' roof Table-18 fix
RdSAP 10 §5.11.4: a pitched roof lodging thickness "NI" with description
"...insulated (assumed)" was billed at the §5.11.4 observed-retrofit
50 mm row (U 0.68) while the SAME description lodged with "ND" fell
through to the Table 18 age-band default (0.40 for bands A-G). The
ND-vs-NI sentinel is lodging-software noise; "(assumed)" means the
insulation PRESENCE is an age-band assumption, not an observed
retrofit, so Table 18's "thickness cannot be determined" clause
governs both forms. The bare "insulated" description (observed
retrofit, no qualifier) keeps the 50 mm row.

Evidence: the 27-cert loc4+NI corpus cohort was systematically
under-rated (~-1 SAP; zero positive movers among "(assumed)" certs),
vs the 102-cert loc4+ND cohort already on Table 18 at ~0 bias.

Gauge: within-0.5 74.2% -> 75.5%, SAP MAE 0.721 -> 0.708, CO2 MAE
0.09 -> 0.074, PE MAE 3.5 -> 3.2 (floors ratcheted). Unit-pinned in
test_rdsap_uvalues (assumed -> Table 18; bare-insulated -> 0.68
regression guard); integration pin in test_heat_transmission updated;
RealCertExpectation pinned for 10094975827 (66 = lodged, was -1.87).

Ledger: C002 103001004 deferred pending Elmhurst arbitration
(single-immersion off-peak pricing + declared cylinder loss vs
Table-2); C006 quadruplet marked ⚠ (LIG-21.0 software honours lodged
0 extract fans literally vs the Elmhurst-validated 0=unknown->default
convention, worksheet case 46).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 19:06:26 +00:00
Jun-te Kim
b9f1f428b9 test(accuracy): corpus-1000 campaign ledger + C001 4510053280 pinned 75 (lodged-software PSR gap)
Setup for the RdSAP-21.0.1 corpus gauge campaign (74.2% within-0.5,
SAP MAE 0.721 at HEAD, 1000/1000 computed):

- scripts/corpus_1000/build_worklist.py — runs all 1000 corpus certs
  through the gauge's own path (from_api_response -> Sap10Calculator),
  ranks |engine - lodged| descending, clusters by dwelling signature,
  and (re)writes scripts/corpus_1000/worklist.md preserving per-cert
  statuses and notes. 258 certs outside 0.5 in 249 clusters.

- C001 (worst cert, Δ +23.9): uprn 4510053280, ground-floor flat 47 m²
  on ASHP PCDB 100053 (Mitsubishi Ecodan 5 kW, PSR table 0.2-2.0).
  Dwelling PSR 2.031 -> SAP 10.2 N2 footnotes 44/45 heat-pump extension
  (reciprocal interpolation toward 100% at 2x largest PSR) = 305%
  space efficiency, which accredited Elmhurst also applies (golden
  case 56, record 100061). The LODGED software instead treated the
  out-of-range record as invalid and billed 100% direct electric +
  standard schedule (reproduces lodged CO2 to 1%). Lodged-software
  methodology gap, worklist ⚠, engine untouched; observed engine 75
  pinned in test_real_cert_sap_accuracy.

Gauge floors unchanged (no engine change).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 18:28:20 +00:00
Daniel Roth
fad2264def
Merge pull request #1437 from Hestia-Homes/feature/abri-api-integration
Abri API: hubspot deal differ for AmendJob
2026-07-02 18:01:51 +01:00
Jun-te Kim
99ab1ca88f
Merge pull request #1436 from Hestia-Homes/fix/cylinder-uninsulated-storage-loss
Uninsulated / unknown-insulation cylinders no longer drop the SAP storage loss
2026-07-02 17:55:02 +01:00
Jun-te Kim
cde8a5d6ca
Merge pull request #1433 from Hestia-Homes/fix/audit-cylinder-storage-loss-check
Audit check: lodged cylinder with unresolvable insulation drops storage loss
2026-07-02 17:54:49 +01:00
Daniel Roth
60146f0c30 Abri survey amendment trigger defers first-time survey dates to the creation trigger 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:52:49 +00:00
Daniel Roth
1529544c19 Abri survey amendment trigger defers first-time survey dates to the creation trigger 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:52:26 +00:00
Daniel Roth
597cd1c83f Abri survey amendment trigger fires when the confirmed survey time changes on an Abri condition deal 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:52:00 +00:00
Daniel Roth
8c5d1a27ff Abri survey amendment trigger fires when the confirmed survey time changes on an Abri condition deal 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:50:53 +00:00
Daniel Roth
bf344e1b58 Abri survey amendment trigger stays quiet when the survey date and time are unchanged 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:49:19 +00:00
Daniel Roth
fce9d30589 Abri survey amendment trigger stays quiet when the survey date and time are unchanged 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:48:53 +00:00
Daniel Roth
7bfd26476e Abri survey amendment trigger ignores deals that are not Abri condition deals 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:48:26 +00:00
Daniel Roth
16b25c4b54 Abri survey amendment trigger ignores deals that are not Abri condition deals 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:47:51 +00:00
Daniel Roth
dbbb12fa54 Abri survey amendment trigger fires when the confirmed survey date changes on an Abri condition deal 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:47:29 +00:00
Daniel Roth
1c75b44630 Abri survey amendment trigger fires when the confirmed survey date changes on an Abri condition deal 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:47:07 +00:00
Daniel Roth
5df78cf9ba Merge branch 'main' into feature/abri-api-integration 2026-07-02 16:41:46 +00:00
Daniel Roth
ffb0f8cc66
Merge pull request #1434 from Hestia-Homes/feature/abri-api-integration
Abri API: hubspot deal differ for CreateJob
2026-07-02 17:41:18 +01:00
Daniel Roth
fdeb15501f Abri survey creation trigger falls back to project code only when no project is associated 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:29:11 +00:00
Daniel Roth
911e77d7cf Abri survey creation trigger falls back to project code only when no project is associated 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:28:13 +00:00
Daniel Roth
cf5a272d7e Abri survey creation trigger recognises deals by their associated Abri project id 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:27:29 +00:00
Daniel Roth
cc682e3e74 Abri survey creation trigger recognises deals by their associated Abri project id 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:27:05 +00:00
Jun-te Kim
ecefd439fd Cylinder with unknown insulation defaults per RdSAP Table 29 age band 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:11:10 +00:00
Jun-te Kim
6accf365d7 Cylinder with unknown insulation defaults per RdSAP Table 29 age band 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:09:46 +00:00
Jun-te Kim
233f085fb3 Elmhurst 'No Insulation' cylinder (0 mm lodged) takes the uninsulated storage loss 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:08:46 +00:00
Jun-te Kim
4cf3db388f Elmhurst 'No Insulation' cylinder (0 mm lodged) takes the uninsulated storage loss 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:07:20 +00:00
Jun-te Kim
e813cc0ef2 Uninsulated cylinder (type 0) takes the SAP Table 2 jacket t=0 storage loss 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:06:33 +00:00
Jun-te Kim
db488de43d Uninsulated cylinder (type 0) takes the SAP Table 2 jacket t=0 storage loss 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:04:16 +00:00
Daniel Roth
592173e1e5 Abri Condition project gate is a reusable helper for future Abri triggers 🟪
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:03:34 +00:00
Daniel Roth
7aabfdfa5b Abri survey creation trigger ignores syncs with no parseable confirmed_survey_date 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:02:36 +00:00
Daniel Roth
c059771af5 Abri survey creation trigger ignores syncs with no parseable confirmed_survey_date 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:02:08 +00:00
Daniel Roth
fb2b7e164c Abri survey creation trigger matches the Abri Condition project code case-insensitively 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:01:43 +00:00
Daniel Roth
5b9038ab61 Abri survey creation trigger matches the Abri Condition project code case-insensitively 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:01:25 +00:00
Daniel Roth
bd0c45aa57 Abri Condition project code lives in a reusable class constant 🟪
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:00:09 +00:00
Daniel Roth
97bf001fbf Abri survey creation trigger ignores deals outside the Abri Condition project 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:59:38 +00:00
Daniel Roth
882eb1eff9 Abri survey creation trigger ignores deals outside the Abri Condition project 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:59:05 +00:00
Daniel Roth
fc2ba88759 Abri survey creation trigger ignores deals that already have a confirmed_survey_date 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:58:41 +00:00
Daniel Roth
697df8ade3 Abri survey creation trigger ignores deals that already have a confirmed_survey_date 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:58:09 +00:00
Daniel Roth
51ac5e2f5e Abri survey creation trigger fires when confirmed_survey_date is first set on an Abri Condition deal 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:57:26 +00:00
Jun-te Kim
26bcb3e9a6 Pass new cylinder fields through _make_audit test helper
PropertyAudit gained three required cylinder fields; the pre-existing
divergence/goal-shortfall tests construct it via _make_audit, which
wasn't updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:57:04 +00:00
Daniel Roth
bd3c45d81c Abri survey creation trigger fires when confirmed_survey_date is first set on an Abri Condition deal 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:56:49 +00:00
Jun-te Kim
318a859e88 Audit check: lodged cylinder with unresolvable insulation drops storage loss
Portfolio 814 / scenario 1271 audit (2026-07-03): all 26 properties lodging
has_hot_water_cylinder with insulation type 0 (none) or NULL over-rate their
effective baseline by up to +18 SAP (avg +12.7) because
_cylinder_storage_loss_override returns None for any insulation label it
can't resolve and the worksheet keeps the zero-storage-loss combi default.
Same-lodged neighbours split by 19 effective points (WD5 0DP pids
742215/742216, both lodged 54, effective 50 vs 69) and the inflated members
distorted neighbour-divergence cohort medians (E17 6EB pid 742355 Δ+18).

New HIGH check cylinder-storage-loss-dropped fires on the deterministic
input pattern (cylinder present, insulation type ∉ {factory, loose jacket}
or thickness missing) — 28/338 on the motivating portfolio (the 26 above
plus 2 same-pattern rows with no lodged score). The calculator fix
(uninsulated Table 2 loss, or RdSAP Table 29 age-band default) is separate
follow-up work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:27:15 +00:00
Jun-te Kim
cf50c53cad
Merge pull request #1431 from Hestia-Homes/fix/refetch-solar-reuse-stored
Fix refetch_solar=False dropping solar from re-modelled plans (reuse stored Solar instead)
2026-07-02 15:27:44 +01:00
Jun-te Kim
100949073f refetch_solar=False models with stored Solar insights and never calls Google 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 14:21:46 +00:00
Jun-te Kim
c1a558d2b5 refetch_solar=False models with stored Solar insights and never calls Google 🟥
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 14:19:31 +00:00
Jun-te Kim
e08048244a
Merge pull request #1429 from Hestia-Homes/fix/property-overlay-storage-category
Set electric-storage category (7) on storage property overlays
2026-07-02 12:51:58 +01:00
Jun-te Kim
12e8e52eaa
Merge pull request #1428 from Hestia-Homes/test/booth-close-sap-accuracy-corpus
Add UPRN 100020942571 (8 Booth Close) to the SAP accuracy corpus
2026-07-02 12:51:38 +01:00
Jun-te Kim
4ca3491eb2
Merge pull request #1426 from Hestia-Homes/fix/hhrsh-storage-offpeak-pricing
Fix HHRSH storage heaters priced at peak rate (engine 48 vs accredited Elmhurst 71)
2026-07-02 12:50:32 +01:00
KhalimCK
61321d0d47
Merge pull request #1422 from Hestia-Homes/fix/roof-vaulted-nd-sentinel-eligibility
Roof eligibility resolves sentinel thickness by age band (vaulted joins sloping)
2026-07-02 12:45:51 +01:00