MAINT-28: hold only where MAINT-24 moved the aim (banked peak above the cap); test_safety119 pins stay
checks / unit (pull_request) Failing after 34m27s
infra-pin / fresh (pull_request) Successful in 2s

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-11-12 23:13:57 +01:00
co-authored by Claude
parent 92f0387415
commit 8640bfcbc1
3 changed files with 14 additions and 6 deletions
+5 -2
View File
@@ -567,11 +567,14 @@ class CycleMixin:
float(self.o.get("peak_cap_w", 3500)),
self.peak_margin_w, _reading)
# MAINT-28: stays paused until the house is clear of the aim.
# N=2 and up; one inverter keeps the old rule (SAFETY-87 pins).
# Only where MAINT-24 moved the aim (a banked peak above the
# cap) and at N=2 and up: elsewhere the old rule, byte for byte
# (SAFETY-87 / SAFETY-119 pins).
house = (None if self.grid is None or self.site_batt_w is None
else float(self.grid) + float(self.site_batt_w))
self._maint_peak_hold = peakguard.shaping_held(
_peak_held and len(self.inverters) > 1,
_peak_held and len(self.inverters) > 1
and maint_aim > self.peak_aim_w(),
self.peak_guard, self.peak_fc,
maint_aim, house)
if self._maint_peak_hold: