EV-21: Solar cuts the car first for the quarter peak #278

Merged
ems-agent merged 5 commits from EV-21 into release/1.0 2026-11-29 03:24:39 +01:00
5 Commits
Author SHA1 Message Date
ems-agentandClaude 1c7761d2c2 EV-21 fix round 3 (re-review, tests only): refused-close retry under a cut under 6 A; R1 standing cut
checks / unit (pull_request) Successful in 46m15s
infra-pin / fresh (pull_request) Successful in 2s
test_ev21_fix2.py: N6/P27 (a) writer-level cuts of 3 A and 0 A, no write after the cut and the charger at 0 A; N6/P27 (b) controller level (close refused at 313, house 18 kW at 315: cut 0 A at once, no retry); R1 standing cut unit row on _car_cut_tick. Red with seq_nopause_retry and r1_nostand. No app/ change.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-29 02:29:25 +01:00
ems-agentandClaude 83e5b9c51f EV-21 fix round 2 (review): a cut during Solar's own phase change ends it; wait cap in watts
checks / unit (pull_request) Successful in 46m35s
infra-pin / fresh (pull_request) Successful in 2s
PM R1: a cut due while Solar's own phase change is under way (seq set or plan.switch) is 0 A at once and ends the change at its 0 A; the 15 s wait cap is held in watts and converted with the phases at the write. test_ev21_fix2.py: T34 (iv) red at 5759e9d, T34 (v) 3->1, N6/P27 refused close red with seq_uncapped, N9 standing cap red with stale_drop. test_ev21_fix1.py: C18 now R1; C16 and Q1 accepted as coded (R5).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-28 18:27:18 +01:00
ems-agentandClaude 5759e9dc9f 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>
2026-11-27 01:33:41 +01:00
ems-agentandClaude 36e9dd765e EV-21: test fixes (T41/T46 on base, test_ev20_writers T46 with the cut first)
checks / unit (pull_request) Successful in 47m29s
infra-pin / fresh (pull_request) Successful in 1s
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-25 17:26:38 +01:00
ems-agentandClaude 7bc8988be0 EV-21: Solar cuts the car first for the quarter peak
infra-pin / fresh (pull_request) Successful in 2s
checks / unit (pull_request) Failing after 1h10m59s
In Solar, when the 15-minute period heads over the aim and the batteries
would have to give more, the car is lowered first: floor((car - excess) /
(230 x phases)) A, 0 under 6 A. At once without real headroom (saturated,
floor-limited, excess beyond what the batteries can add, no battery figure,
cover off, last 120 s), else after at most 15 s. One cut per episode from
its start, deeper only on a growing excess; restart with the start power
under the aim for the start time; none after a 2nd cut in the period.

Grading (formal C2): a Solar car Solar cannot cut is graded, banked and
left in the guard as in Off. A Solar car is never banked. Grey note and Why
"Solar lowered the car for the peak." Manual and Off unchanged.

Tests: test_ev21.py, test_ev21_paths.py, test_ev21_same.py; T49 in
tools/ev20_day.py; T50 in test_ev20_fuzz.py; test_ev20_guard section 8
moved from "as Manual" to "as Off" where Solar cannot cut (T51).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-25 17:01:07 +01:00