MAINT-28 fix-forward round 4: the paused pack's cap is its own part of the guard's floor, the largest of the period, per unit
Owner 2026-11-13 ("ok max", relayed by the manager): while the pause holds,
the pack in maintenance CHARGE gives at most the largest floor the guard
claimed in the quarter. The cap is now that pack's own part of the floor
(the floor less what the other units are placed at, split without the cap),
the largest in the 15-minute period, kept per unit (`_m28_hi`). 0 W while
the guard holds it at its reserve. test_maint28b: SoC check stated against
the owner-accepted give (0.70 point, measured 0.64); both-packs-able tests
(B on Cheap hours, B on Solar first); per-unit state and the one-slot
arbitrate. test_maint28 unchanged (5925 W). Pins: test_safety84
n2_charge_banked, test_packshare's one-resolve AST pin (a second call with
the same weights).
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
fb4a449591
commit
07d23d2eed
@@ -29,7 +29,7 @@ from . import shadow
|
||||
from .price import Uncertainty
|
||||
from .tariff import next_quarter
|
||||
from .watchdog import loop_is_following
|
||||
from .ctl_trade import pack_energy_of
|
||||
from .ctl_trade import M28_REASON, pack_energy_of
|
||||
from .rows import why_key, why_raised
|
||||
|
||||
_LOG = logging.getLogger("goodwe")
|
||||
@@ -589,25 +589,20 @@ class CycleMixin:
|
||||
"suspended so the peak claim is not "
|
||||
"contradicted",
|
||||
hint=messages.hint("maint_paused"))
|
||||
# MAINT-28: while held this pack gives at most the most the
|
||||
# guard claimed this period (0 W under its reserve: the
|
||||
# guard places its claim on the other packs).
|
||||
# MAINT-28: while held this pack gives at most the most of
|
||||
# the guard's floor placed on it this period
|
||||
# (`_m28_share()`).
|
||||
# DECISIONS/MAINT-28-hold-the-pause-in-a-peak.md
|
||||
_q = int(now.timestamp() // 900)
|
||||
if self._m28_q != _q:
|
||||
self._m28_q, self._m28_hi = _q, 0.0
|
||||
if self.peak_guard is None or \
|
||||
inv.name not in self.peak_guard.held:
|
||||
self._m28_hi = max(self._m28_hi, max(
|
||||
(c.lo for c in claims
|
||||
if c.source == peakguard.SOURCE), default=0.0))
|
||||
shape = ((0.0 if self.peak_guard is not None
|
||||
and inv.name in self.peak_guard.held
|
||||
else self._m28_hi, "peak hold")
|
||||
else max([c.lo for c in claims
|
||||
if c.source == peakguard.SOURCE]
|
||||
+ [self._m28_was(self.actuator_of(
|
||||
"maintenance", inv), now)],
|
||||
default=0.0), M28_REASON)
|
||||
if _m28 else None)
|
||||
else:
|
||||
self._maint_shape_suspended = False
|
||||
self._m28_hi = 0.0
|
||||
hi = 0.0
|
||||
reason = "charge-only"
|
||||
if self.cheap:
|
||||
@@ -875,6 +870,9 @@ class CycleMixin:
|
||||
self.loop_clamp_facts = ()
|
||||
self._loop_decision = None
|
||||
|
||||
# MAINT-28: a paused pack gives at most its largest part of the floor
|
||||
# in this period.
|
||||
self._m28_share(claims, now)
|
||||
# SAFETY-28. A new resolution is a new tick, and the previous record is
|
||||
# stale from this line onwards. Incremented BEFORE resolve() so that the
|
||||
# record resolve() builds is stamped with the tick it is for.
|
||||
|
||||
Reference in New Issue
Block a user