Rank costed works on an already-compliant dwelling HIGH 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-21 10:12:58 +00:00
parent 0df40278e5
commit 68ffb0c47c

View file

@ -163,10 +163,22 @@ def _plan_score_below_baseline(a: PropertyAudit) -> Optional[str]:
return f"post SAP {a.post_sap:.1f} below effective baseline {a.effective_sap:.1f}{a.post_sap - a.effective_sap:.1f})"
@check("already-meets-goal-with-works", Severity.MEDIUM)
@check("already-meets-goal-with-works", Severity.HIGH)
def _already_meets_goal_with_works(a: PropertyAudit) -> Optional[str]:
"""The property already meets/exceeds the scenario's goal band, yet the plan
spends money on measures nothing should be recommended."""
spends money on measures nothing should be recommended.
Provenance: #1652 / #1654. Ranked HIGH because it bills real money and is the
signature of the Optimiser judging the goal against something other than the
published band. It ran at MEDIUM and was waved through as stale-plan noise
while 630 homes in portfolio 796 published at band C were each sold ~1 SAP
point of works toward a band they had already reached (£282k), and 172 more
in 824. The cause there was a continuous baseline compared against the
*integer* band floor, so a dwelling publishing at the floor read as a
fraction short; the goal is now judged on the continuous floor
(`Epc.sap_lower_bound_continuous`). Any fresh firing means a baseline the
Optimiser used has diverged from the published one again re-debug it,
do not re-bucket it."""
goal, base = _band_rank(a.scenario_goal_band), _band_rank(a.effective_band)
if goal is None or base is None or base > goal:
return None