EV-19: no floor alarm when the batteries first reach the reserve early in a Manual car session #265

Merged
admin merged 3 commits from EV-19 into release/1.0 2026-11-20 23:42:31 +01:00
Collaborator

EV-19: no floor alarm when the batteries first reach the peak reserve early in a Manual car session (EV-15 rig F-B).

Cause (reproduced on 43b0db7, T1 grid): at the reserve inverter-b goes on following the house, so its output rises in that cycle. The battery reading shows the rise one cycle before the P1 sample does. EV-18's house figure (held - car + now - min(now, prev)) counted the new battery power as house load, so _car_need_house latched for the quarter. Result: one PEAK_GUARD_FLOOR_LIMITED ERROR and one goodwe_peak_soc_floor at R+1, then red until the guard stopped wanting power (about 100 s at x1, 10 cycles at x10). 17 of 168 grid cells reproduce it (b at 0, 400 or 800 W before R at x1, every plug-in time; b at 1 200 W at x10 and mono x1); the T3 sweep shows it for b at 0-1 600 W.

Fix (app/ctl_car.py, _car_explains_alarm): for the house latch only, a reading above both earlier readings counts as house only up to the higher of them, until a second reading confirms it. The credit stays the lower of the last two readings. No change to the guard's claim, floor, setpoints or charger writes. _car_over_now, the EV-10 latches and SAFETY-126 are unchanged.

Tests: test_ev19.py (new) with the harness tools/ev19_reserve.py (new). It covers T1-T17, T20 and N1-N6 of reports/EV-19-test-plan.md. Red on 43b0db7: 49 checks. Green on the fix: 124 of 124. Command digests identical head vs base in all 342 runs. test_ev18, test_ev10, test_ev10b, test_ev15, test_ev04, test_safety81/87/126/126b, test_named_absence and test_bytecode are unchanged and green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w

EV-19: no floor alarm when the batteries first reach the peak reserve early in a Manual car session (EV-15 rig F-B). **Cause (reproduced on 43b0db7, T1 grid):** at the reserve inverter-b goes on following the house, so its output rises in that cycle. The battery reading shows the rise one cycle before the P1 sample does. EV-18's house figure (`held - car + now - min(now, prev)`) counted the new battery power as house load, so `_car_need_house` latched for the quarter. Result: one PEAK_GUARD_FLOOR_LIMITED ERROR and one `goodwe_peak_soc_floor` at R+1, then red until the guard stopped wanting power (about 100 s at x1, 10 cycles at x10). 17 of 168 grid cells reproduce it (b at 0, 400 or 800 W before R at x1, every plug-in time; b at 1 200 W at x10 and mono x1); the T3 sweep shows it for b at 0-1 600 W. **Fix** (`app/ctl_car.py`, `_car_explains_alarm`): for the house latch only, a reading above both earlier readings counts as house only up to the higher of them, until a second reading confirms it. The credit stays the lower of the last two readings. No change to the guard's claim, floor, setpoints or charger writes. `_car_over_now`, the EV-10 latches and SAFETY-126 are unchanged. **Tests:** `test_ev19.py` (new) with the harness `tools/ev19_reserve.py` (new). It covers T1-T17, T20 and N1-N6 of reports/EV-19-test-plan.md. Red on 43b0db7: 49 checks. Green on the fix: 124 of 124. Command digests identical head vs base in all 342 runs. test_ev18, test_ev10, test_ev10b, test_ev15, test_ev04, test_safety81/87/126/126b, test_named_absence and test_bytecode are unchanged and green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
ems-agent added 1 commit 2026-11-20 20:16:52 +01:00
EV-19: no floor alarm when the batteries first reach the reserve early in a Manual car session
checks / unit (pull_request) Successful in 25m47s
infra-pin / fresh (pull_request) Failing after 2s
4950a2374f
EV-15 rig F-B, reproduced on 43b0db7 (tools/ev19_reserve.py, T1 grid). At
the reserve inverter-b goes on following the house, so its output rises
in that cycle. The battery reading shows the rise one cycle before the P1
sample does, and EV-18's house figure (held - car + now - min(now, prev))
counted the new battery power as house load. `_car_need_house` latched:
one PEAK_GUARD_FLOOR_LIMITED ERROR and goodwe_peak_soc_floor at R+1, red
until the guard stopped wanting power.

ctl_car._car_explains_alarm: for the house latch only, a reading above
both earlier readings counts as house only up to the higher of them. The
credit stays the lower of the last two readings. The claim, floor,
setpoints and charger writes are unchanged (342 runs, same digests).

test_ev19.py: T1-T17, T20, N1-N6 of reports/EV-19-test-plan.md; 49
checks red on 43b0db7, 124 of 124 green here.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
ems-agent added 1 commit 2026-11-20 22:13:22 +01:00
EV-19 review round 1: discount a battery rise only while the meter has not moved
checks / unit (pull_request) Successful in 31m32s
infra-pin / fresh (pull_request) Failing after 1s
c2bb32ec93
[Major] The rise discount applied to any rise, also one the meter
already shows, so an honest house step answered by one cycle of battery
power alarmed one cycle after base (review repro: T6 step + burst, R+6
instead of R+5). Now a reading above both earlier ones is discounted only
while the meter's house side (held - car; held alone when a car figure is
unknown) moved no more than RISE_STILL_W (50 W) since the last cycle.

Tests: the burst shapes (unit, meter in step and one cycle late;
controller, step at R+5 and R+30, 3 000 / 4 600 W) at base's second; the
"N6 unit" check tightened to the rise cycle; the RISE_STILL_W boundary;
a pin on EV-18's `_car_over_now` (mC); T10 restarts at R-1 and R (mE).
test_ev19: 144 of 144 here, 52 red on 43b0db7.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
ems-agent added 1 commit 2026-11-20 23:14:13 +01:00
EV-19 review round 2: pin the 50 W blind band and the car term of the stillness test
checks / unit (pull_request) Successful in 25m14s
infra-pin / fresh (pull_request) Failing after 1s
77684ecfad
Test-only. Two unit checks in test_ev19.py: an honest step with a burst
that moves the meter's house side +/-60 W alarms in base's cycle, and
inside the band (0 W) the car explains at most the step's own cycle;
a car step offset by a burst at the meter is not discounted. They kill
RISE_STILL_W = 500 W and a stillness test without the car term.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
admin merged commit 8150608317 into release/1.0 2026-11-20 23:42:31 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/goodwe-addon#265