A refused phase-change close ended its sequence with one `_failed`, so the
same value got 5 tries (3 closes, then 2 on the normal path). Manual now
counts the not-taken closes of the value owed since the last user change
(`_close_k`); at the capped close end `fails` = that count, so `gave_up` and
CHARGER_REFUSED come at the 3rd refused close, and a value changed during the
retries still gets 3 tries. SolarWriter overrides the end hook and is
unchanged (EV-60).
Tests: new test_ev59.py; test_ev56 T5, T5b and the T20 T5 [R] golden,
test_ev28 T15 and the test_ev13 T13 text per the brief rulings.
Co-Authored-By: Claude <noreply@anthropic.com>
ManualWriter._write catches an Exception from drv.write_current (not CancelledError) and returns False, so every caller in Manual and Solar counts it as a refused try: RETRY_S spacing, MAX_TRIES, CHARGER_REFUSED. The tracker is not told (Q2). One ERROR record per raised value, armed again by another value, a taken write, a user change or the charger's return (Q1, G2). Shutdown writes (abandon, release) pass strict and keep base's behaviour (F3, H1, G3); the peak cut path keeps EV-54's (G1). test_ev13 T13: fails is 1 now (Q2). New test_ev56.py.
Co-Authored-By: Claude <noreply@anthropic.com>