EV-54: a refused peak cut no longer stops Solar; tried again next quarter #280

Merged
ems-agent merged 4 commits from EV-54 into release/1.0 2026-11-30 09:14:12 +01:00
Collaborator

EV-54: after 3 refused peak-cut tries in a quarter, Solar no longer stops for the session.

Root cause (confirmed red at bdfd3e6): EV-21 sent its cut tries through Solar's normal retry, whose 3rd refusal set the session-wide gave_up (SolarWriter._failed). Under a standing cap neither way out of gave_up could come, so Solar never wrote again (EV-21 rig finding 1; formal C1-C5).

Fix (brief v6 rulings Q1-Q9, G1-G6, QA, QB, QC; formal drop rule):

  • A cut try = a Solar write while a cut is due or stands, at or under its cap. At most 3 refused cut tries per quarter key, across values and episodes; a refused cut try never sets gave_up. In memory only.
  • The next quarter tries again while a cut is needed. New notice: "The charger did not take the peak cut, so the add-on tries again next quarter: CHARGER_REFUSED." (one WARNING per episode; the hold path's text unchanged).
  • Drop rule: once no cut stands (lifted, or a new quarter's cut waits), a refused cut value is never sent again: sent_a = read-back, taken, gave_up cleared, plan current = read-back. Waits for a good (not stuck) and known read-back.
  • A cut write that raises counts as a refused try.
  • Files: app/carmode.py, app/ctl_car.py, app/ctl_status.py (amber row), app/homeview.py (Why), DOCS, CHANGELOG, DECISIONS/EV-54-refused-cut-retry.md; tests test_ev54.py, test_ev54_drop.py, tools/ev54_kit.py.

Dev report: reports/EV-54-dev-report.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w

EV-54: after 3 refused peak-cut tries in a quarter, Solar no longer stops for the session. **Root cause (confirmed red at bdfd3e6):** EV-21 sent its cut tries through Solar's normal retry, whose 3rd refusal set the session-wide `gave_up` (`SolarWriter._failed`). Under a standing cap neither way out of `gave_up` could come, so Solar never wrote again (EV-21 rig finding 1; formal C1-C5). **Fix (brief v6 rulings Q1-Q9, G1-G6, QA, QB, QC; formal drop rule):** - A cut try = a Solar write while a cut is due or stands, at or under its cap. At most 3 refused cut tries per quarter key, across values and episodes; a refused cut try never sets `gave_up`. In memory only. - The next quarter tries again while a cut is needed. New notice: "The charger did not take the peak cut, so the add-on tries again next quarter: CHARGER_REFUSED." (one WARNING per episode; the hold path's text unchanged). - Drop rule: once no cut stands (lifted, or a new quarter's cut waits), a refused cut value is never sent again: `sent_a` = read-back, taken, `gave_up` cleared, plan current = read-back. Waits for a good (not stuck) and known read-back. - A cut write that raises counts as a refused try. - Files: `app/carmode.py`, `app/ctl_car.py`, `app/ctl_status.py` (amber row), `app/homeview.py` (Why), DOCS, CHANGELOG, `DECISIONS/EV-54-refused-cut-retry.md`; tests `test_ev54.py`, `test_ev54_drop.py`, `tools/ev54_kit.py`. Dev report: reports/EV-54-dev-report.md. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
ems-agent added 1 commit 2026-11-30 00:25:04 +01:00
EV-54: a refused peak cut no longer stops Solar; tried again next quarter
checks / unit (pull_request) Successful in 52m35s
infra-pin / fresh (pull_request) Successful in 1s
a698211318
Refused cut tries are capped at 3 per quarter key and never set the session-wide gave_up. The next quarter tries again while a cut is needed. Once no cut stands, a refused cut value is dropped (sent_a and the plan current = the read-back, taken), never re-sent; the drop waits for a good, known read-back. A cut write that raises counts as a refused try. New notice text (Q3); the hold path's text is unchanged. Tests: test_ev54.py, test_ev54_drop.py (T1-T35); test_ev52 N8 knows the new text.

Co-Authored-By: Claude <noreply@anthropic.com>
ems-agent added 1 commit 2026-11-30 01:47:42 +01:00
EV-54 tests: T26 asserts the first write after the lift is the step-up; T8 checks named T8
checks / unit (pull_request) Successful in 50m12s
infra-pin / fresh (pull_request) Successful in 1s
cf07f6f99b
Mutant M18 (the drop leaves taken False) re-sent the standing read-back at the lift and T26 missed it; the T8 checks were filed under T2/T5 by name. Test-only.

Co-Authored-By: Claude <noreply@anthropic.com>
ems-agent added 1 commit 2026-11-30 04:51:57 +01:00
EV-54 review r1: no stale fails block after the charger returns; peak cut reason
checks / unit (pull_request) Successful in 45m27s
infra-pin / fresh (pull_request) Successful in 2s
095f773921
The fails >= MAX_TRIES block on non-cut writes applies only while the refused cut value is still owed, so Solar resumes after the charger came back under a capped quarter (it froze before). The quarter's cut count is untouched and D2's 0 A stays held while capped. A new cut value under the read-back above a refused one logs 'peak cut'. New rows T36 (away while capped, 0 A and 6 A), T37 (F6), T38 (Off after 3 tries), T39 (reason replay).

Co-Authored-By: Claude <noreply@anthropic.com>
ems-agent added 1 commit 2026-11-30 06:37:44 +01:00
EV-54 review r2: fails counts only refusals of the value now owed
checks / unit (pull_request) Successful in 45m48s
infra-pin / fresh (pull_request) Successful in 2s
7613468cf9
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>
ems-agent merged commit 344c974f90 into release/1.0 2026-11-30 09:14:12 +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#280