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

[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
This commit is contained in:
ems-agent
2026-11-20 22:13:19 +01:00
co-authored by Claude
parent 4950a2374f
commit c2bb32ec93
4 changed files with 127 additions and 20 deletions
@@ -152,13 +152,17 @@ up to 1.8 kW; the 40 Wh floor fixes that.)
whole window and fell short; an unknown reading is no contradiction) grades
no alarm to the quarter's end; the guard's input keeps it. After a restart
or a gap the car's earlier energy is not known, so it counts as house.
- **A battery rise is house only once a second reading shows it** (EV-19, EV-15
- **A battery rise the meter has not shown is not house yet** (EV-19, EV-15
rig F-B). At the reserve inverter-b goes on following the house, so its
output rises; the reading shows it one cycle before P1 does, and the house
figure (meter + battery) counted that power as house. `_car_need_house`
latched and the alarm stood. For the house figure, a reading above both
earlier ones counts only up to the higher of them; the credit stays the lower
of the last two readings.
latched and the alarm stood. Now, while the meter's house side (held - car)
moved no more than `RISE_STILL_W` since the last cycle, a reading above both
earlier ones counts only up to the higher of them. A meter that moved shows
the rise (an honest step with a battery burst alarms at once, as before). A
rise the meter does not move with at all is graded as F-B: the one case the
readings cannot tell apart. The credit stays the lower of the last two
readings; `_car_over_now` is unchanged.
- **Our own write is ours until its mute ends** (EV-12). The mute of the tracker's
own detector opens before the write and runs 15 s from when it returns, because
the read-back reaches the cycle while the write still waits for it.