EV-20 SPIKE-06 re-check: a stuck verdict does not hold Solar while no own current may stand (C14)
infra-pin / fresh (pull_request) Successful in 2s
checks / unit (pull_request) Failing after 1h12m24s

The exemption now applies whenever Solar is not live (also just after Solar
is chosen under a verdict Manual's refusals left), so Solar writes its 0 A
over the other current first and then the start rule runs. EV-13
T14 [8 A], T17 and T18 now assert that the energy meter does not flag the
frozen figure (PM accepted the trade-off); T14 [6 A] that it flags at +57 s.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
This commit is contained in:
Claude
2026-11-23 17:49:04 +01:00
parent 82dc77df62
commit b99f8c7e52
4 changed files with 54 additions and 12 deletions
+28
View File
@@ -378,6 +378,34 @@ check(f"C12 bound: a frozen charger after Solar's own 0 A: at most 3 starts "
and [a for t, a, _ in w if t0 <= t < 1200][-1:] == [0.0])
nevers(r, "C12 bound")
# C14: Manual's refused writes leave a stuck verdict on a paused, live car,
# then the user presses Solar. No current of Solar's own may stand, so the
# verdict does not hold Solar: its 0 A first (over Manual's 6 A), then the
# start rule with spare sun; the start moves the reading, the verdict clears.
for name, win, t_s in (("Manual's 12 A refused 3 times, Solar at 400 s",
(99.5, 250.0), 400),):
sim = TSim(setpoint_a=0, windows=[(win[0], win[1], "ignore")])
sim.car_full()
seen = {}
r = S.drive(const(500.0), const(2900.0), dur=1200, first="car",
socs={"a": 100.0, "b": 100.0}, sim=sim, mode="manual",
events={100: act("car_current", 12),
t_s - 1: lambda p, c: seen.update(
armed=c.car.armed_at, stuck=c.car.stuck_now),
t_s: act("car_mode", "solar")})
w = cur_writes(r)
nz = [(t, a) for t, a, _ in w if a > 0.0]
check(f"C14 [{name}]: the check armed by Manual's refusal before the "
f"press ({seen})", seen.get("armed") is not None)
check(f"C14 [{name}]: Solar writes 0 A first, then a start within the "
f"start rule, and the verdict clears ({w[:4]}, stuck now "
f"{r['c'].car.stuck_now})",
present(nth(w, 0)) and nth(w, 0)[1] == 0.0
and nth(w, 0)[0] <= t_s + 2 and present(nth(nz, 0))
and nth(nz, 0)[0] <= t_s + 125 and not r["c"].car.stuck_now
and r["trace"][-1]["fault"] is None)
nevers(r, f"C14 [{name}]")
# C13: a car that draws less than allowed (an on-board limit of 1380 W, or a
# taper). Tracker level: a raise 6 -> 10 A, the post-write reading filed
# during the wait (race) or not: never stuck.