Revert "MAINT-28: during a real peak the maintenance charge stays paused (#247)"
checks / unit (pull_request) Successful in 27m32s
infra-pin / fresh (pull_request) Successful in 2s

Takes PR #247 (f3f9483) out of release/1.0 so the 19 Nov release ships
MAINT-24 + MAINT-25 without MAINT-28. The rig failed f3f9483
(reports/MAINT-28-test-report.md) and the fix-forward PR #248 review found
a High regression (reports/MAINT-28-fix-review-report.md). MAINT-28
continues on PR #248 after the release.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-11-14 01:33:24 +01:00
co-authored by Claude
parent f3f9483d9c
commit 7bc8ad264b
6 changed files with 3 additions and 363 deletions
+2 -15
View File
@@ -537,10 +537,6 @@ class CycleMixin:
# maintenance ⚠️ ONE PASS PER PACK, AND `arbitrate()` IS WHY THE LIST
# STAYS SHORT. (DECISIONS/MAIN-orchestration-archive.md)
# MAINT-28: the hold lives only while the charge-only branch is taken;
# kept through the two short holds above on purpose
# (DECISIONS/MAINT-28-hold-the-pause-in-a-peak.md).
_peak_held, self._maint_peak_hold = self._maint_peak_hold, False
for inv, result in zip(self.inverters, maint_results):
if result.owns_setpoint:
# PER-INVERTER: §12's recalibration is a PACK procedure, filed
@@ -568,17 +564,8 @@ class CycleMixin:
maint_aim = peakguard.quarter_target_w(
float(self.o.get("peak_cap_w", 3500)),
self.peak_margin_w, _reading)
# MAINT-28: hold the pause in a real peak.
# DECISIONS/MAINT-28-hold-the-pause-in-a-peak.md
house = (None if self.grid is None or self.site_batt_w is None
else float(self.grid) + float(self.site_batt_w))
_susp = peakguard.shaping_suspended(
self.peak_guard, self.peak_fc, maint_aim)
self._maint_peak_hold = peakguard.shaping_held(
_susp, _peak_held and len(self.inverters) > 1
and maint_aim > self.peak_aim_w(),
self.peak_fc, maint_aim, house)
if self._maint_peak_hold:
if peakguard.shaping_suspended(
self.peak_guard, self.peak_fc, maint_aim):
# Edge-logged: level-logging here would write one line per
# cycle for as long as the event lasts and flush the 40-line
# action log of the very context that explains it.
-1
View File
@@ -505,7 +505,6 @@ class Controller(InputsMixin, WritesMixin, TradeMixin, CycleMixin, AlarmsMixin,
self._land_batt_prev = None
self._peak_needed = False
self._maint_shape_suspended = False
self._maint_peak_hold = False # MAINT-28
# OPT-11: battery modes, off by default (SAFETY-10 section 1). Each
# battery's mode and on/off switch live in the store, not in options,
# so a change applies at once (`pack_use`, `pack_mode`).
-18
View File
@@ -28,10 +28,6 @@ FLOOR_AT_SOC_FLOOR = "the battery level is at or below the peak reserve"
SOURCE = "peak"
# MAINT-28. Watts the house must sit under the aim before a paused maintenance
# charge resumes. DECISIONS/MAINT-28-hold-the-pause-in-a-peak.md.
MAINT_RESUME_UNDER_W = 300.0
# Mirror of config.yaml's peak options, pinned to the file by
# test_peakguard.py. Not a read: `decide()` takes them as arguments.
PEAK_OPTION_DEFAULTS = {
@@ -450,20 +446,6 @@ def shaping_suspended(decision, peak_forecast_w, cap_w) -> bool:
return decision is not None and decision.engaged
def shaping_held(suspended, held, peak_forecast_w, aim_w, house_w) -> bool:
"""MAINT-28. `suspended` (`shaping_suspended()`'s answer), kept on while
`held` until the house is `MAINT_RESUME_UNDER_W` under `aim_w`
(`peak_forecast_w` stands in for an unread house; neither read: not held,
as SAFETY-63). Only ever pauses the maintenance charge, never a cut-back.
DECISIONS/MAINT-28-hold-the-pause-in-a-peak.md."""
if suspended:
return True
if not held:
return False
level = house_w if house_w is not None else peak_forecast_w
return level is not None and level > float(aim_w) - MAINT_RESUME_UNDER_W
def cap_floor(decision, cap_w):
"""SAFETY-128: the floor no higher than `cap_w` (the command standing while
the readings have not answered it), or `decision` unchanged when None.