Files
goodwe-addon/goodwe_controller/DECISIONS/EV-54-refused-cut-retry.md
T
ems-agentandClaude 7613468cf9
checks / unit (pull_request) Successful in 45m48s
infra-pin / fresh (pull_request) Successful in 2s
EV-54 review r2: fails counts only refusals of the value now owed
Where a refused cut value stops being owed without a drop (the charger's return, another value written in its place), fails goes to 0; cut_fails is untouched. After a return under a capped quarter, Solar's own write gets its own 3 tries again instead of giving up after 1. New rows T40 (refused to 1430), T41 (to 1600, against the run without the away), T42 (replaced value).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-30 06:37:40 +01:00

4.1 KiB

EV-54 — Solar: a refused peak cut is tried again next quarter

EV-21 sent its cut tries through Solar's normal retry, whose third refusal set the session-wide gave_up. A cut is held at 0 A (or a partial value) under a standing cap, so neither way out of gave_up could come: after three refused tries Solar never wrote again, also once the charger took writes again (EV-21 rig, finding 1). The rules below are the PM rulings Q1-Q9, G1-G6, QA, QB and QC (brief v6); the formal check is reports/EV-54-formal-report.md.

The rule, in plain words

  • A cut try is a Solar write while a cut is due or stands, at or under its cap (the cut, its retry, a 0 A of a phase change or a way out): _cut_try.
  • At most 3 refused cut tries per quarter key (the projection's block_start), across cut values and episodes. A deeper cut does not give new tries; a press of Solar, or Off then Solar, does not either. The count is in memory only: a restart starts afresh (cut_quarter, cut_fails).
  • A refused cut try never sets gave_up. Solar's normal writes go on. The third refusal of a quarter logs one warning per episode: "The charger did not take the peak cut, so the add-on tries again next quarter: CHARGER_REFUSED." (DEBUG after; a taken cut or a mode change re-arms it). The amber row and the card's Why show it while the tries are used up and the charger shows more than the cut (cut_refused). The hold path's text is unchanged.
  • The next quarter tries again while a cut is still needed, as EV-21's cut: at once without headroom, else after the 15 s wait; a same-value retry no sooner than 60 s after the last refusal.
  • The drop. Once no cut stands (the cap lifted, or a new quarter's cut waits) a refused cut value is never sent again. Solar takes the read-back as its own: sent_a = read-back, taken, gave_up cleared, and the plan's current = read-back, timed as a new decision (_drop). The retry clock stays, so nothing non-zero reaches the charger within 60 s of its refusal. The drop waits while the reading is stuck (QA) or the read-back is unknown (QB); meanwhile Solar sends nothing but a way out's 0 A.
  • A stuck reading after the lift keeps base's fault path: its 0 A goes out three times 60 s apart with reason Solar, then gave_up with the hold path's text; the first good reading drops it and clears gave_up (QC).
  • A cut write that raises counts as a refused cut try (no Traceback, no try per cycle). The same gap outside the cut is EV-56.

Choices the rulings left open

  • Refused cut tries still count in fails (without gave_up), and outside the cut fails >= MAX_TRIES stops a write as gave_up did, but only while the refused value is still owed. So Off's way-out 0 A after refused cut tries is written exactly as before (N10). Once that value is gone (the charger came back, another value was written), nothing blocks Solar's normal writes (review round 1: a gate on fails alone froze Solar after the charger came back under a capped quarter). The gate is scoped rather than fails reset, so one rule covers every way the value goes, and the quarter's cut count (cut_fails) is never touched by it. When the cut stops standing in Solar and the value cannot be dropped yet (stuck), that value becomes Solar's own: reason Solar, a fresh fails count (QC).
  • fails counts only refusals of the value now owed (PM, review round 2). Where a refused cut value stops being owed without a drop (the charger's return, another value written in its place), fails goes to 0 (_forget_refused); cut_fails stays. Elsewhere fails is already right: a drop, a taken write or an adopt clear it; a Solar press or a change into Solar clear it; Off and the quarter roll keep the owed value, so its count stays (Off's way-out as before).
  • At a new quarter's wait the cut tick holds the read-back the writer is about to take, not the refused value, so the wait never re-sends it (G1).
  • No drop over another writer's value (a hold or a difference being watched).
  • A new cut value under the read-back is logged "peak cut", also when it lies above a refused value.