EV-21 fix round 1 (formal round 4): C14 cut due while batteries charge; C15 grace once per value
checks / unit (pull_request) Successful in 46m9s
infra-pin / fresh (pull_request) Successful in 1s

C14 (PM Q2): slowing a battery charge counts as the batteries taking more, so the cut is due whatever the batteries do; their charge counts only as headroom for the 15 s wait. C15 (PM Q1): sent_at is renewed only for a new value, so a retry of a refused cut gets no new 2 s grace. test_ev21_fix1.py: both red on 36e9dd7; C16, C18 and Q1's other writer pinned as the code has them. Test shapes: slow batteries and refusals start after Solar's own start, which C14 would otherwise cut on its start blip; T38 cover off from 300 s; T46 bounds the excess; T39 counts writes after the cut.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ems-agent
2026-11-27 01:33:41 +01:00
co-authored by Claude
parent 36e9dd765e
commit 5759e9dc9f
9 changed files with 250 additions and 36 deletions
+9 -1
View File
@@ -162,10 +162,18 @@ def house_trace(t):
return 600.0 + (k * 7919 % 900)
def cover_off(p, c):
c.o["ev_batt_cover"] = False
for cover in (True, False):
# Cover off from 300 s, once Solar's own start is past: with it off from
# the start, PM Q2 / formal C14 with OQ3 cut Solar's own start blip at
# once (dev report, Findings). On c79eb37 both hours hash the same.
r = drive(house_trace, lambda t: house_trace(t) + 7000.0, dur=3600,
first="car", phases=3, socs={"a": 60.0, "b": 60.0},
opts={"ev_phases": "3", "ev_batt_cover": cover})
opts={"ev_phases": "3"},
events={} if cover else {300: cover_off})
caps = [x["t"] for x in r["rec"].rows if x["cap"] is not None]
check(f"T38 [cover {'on' if cover else 'off'}]: no cut in an hour with no "
f"excess ({caps[:2]})", not caps)