EV-22: Solar and Manual never write over another writer; one rule of control #284

Merged
ems-agent merged 4 commits from EV-22 into release/1.0 2026-12-03 16:05:57 +01:00
Collaborator

EV-22: Car Solar mode never writes over another writer; one rule of control for the current and the phases.

What changes (goodwe_controller/app/carmode.py):

  • C7, both writers: the other-writer watch runs in every step of a phase change (zero, select, settle). The change's own 0 A and every closing current it tried count as own. While a difference or a hold stands, nothing non-zero is written over it: no settle close, no EV-28 restore, no select, no Manual undo or abandon. The 6 A raise check stays and runs first.
  • D4, Solar: the read-back phases are judged like the current, against the phases Solar itself chose (start state = first known read-back outside an own select window, or an own select seen taken), never the plan's adopted n. One mismatch count, one hold, one CHARGER_OTHER. Lift only when current and phases both match, or on a press. The window of an own select is SETTLE_S from the try's return; a take seen after it is another writer's.
  • DA1: a press that lifts a difference inside a phase change ends the change at its 0 A, in both writers; the raise check never holds over a value the press took.
  • DA2: the not-writing path no longer judges the current with the reading from before its own 0 A.

Tests: test_ev22.py (T1-T49, review row T48 (stale)), test_ev22_fuzz.py (T38, N1-N10). The one ruled edit of an existing test is test_ev20_writers T46 (a)(b)(c).

Known red on this head: test_ev60.py "T13/N7: ManualWriter's source is 2e09622's, byte for byte". It pins the SHA-256 of the whole ManualWriter source, and this ticket changes ManualWriter by ruling (C7 in Manual, Manual DA1). It was not edited: the brief says any other red existing test means stop and ask PM. New hash of ManualWriter at this head: e85758d3139b9f16c31f5488b579b1c4a11050fc710b539409235216b72dea5e.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w

EV-22: Car Solar mode never writes over another writer; one rule of control for the current and the phases. What changes (goodwe_controller/app/carmode.py): - C7, both writers: the other-writer watch runs in every step of a phase change (zero, select, settle). The change's own 0 A and every closing current it tried count as own. While a difference or a hold stands, nothing non-zero is written over it: no settle close, no EV-28 restore, no select, no Manual undo or abandon. The 6 A raise check stays and runs first. - D4, Solar: the read-back phases are judged like the current, against the phases Solar itself chose (start state = first known read-back outside an own select window, or an own select seen taken), never the plan's adopted n. One mismatch count, one hold, one CHARGER_OTHER. Lift only when current and phases both match, or on a press. The window of an own select is SETTLE_S from the try's return; a take seen after it is another writer's. - DA1: a press that lifts a difference inside a phase change ends the change at its 0 A, in both writers; the raise check never holds over a value the press took. - DA2: the not-writing path no longer judges the current with the reading from before its own 0 A. Tests: test_ev22.py (T1-T49, review row T48 (stale)), test_ev22_fuzz.py (T38, N1-N10). The one ruled edit of an existing test is test_ev20_writers T46 (a)(b)(c). Known red on this head: test_ev60.py "T13/N7: ManualWriter's source is 2e09622's, byte for byte". It pins the SHA-256 of the whole ManualWriter source, and this ticket changes ManualWriter by ruling (C7 in Manual, Manual DA1). It was not edited: the brief says any other red existing test means stop and ask PM. New hash of ManualWriter at this head: e85758d3139b9f16c31f5488b579b1c4a11050fc710b539409235216b72dea5e. 🤖 Generated with [Claude Code](https://claude.ai/code) https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
ems-agent added 1 commit 2026-12-03 04:29:51 +01:00
EV-22: Solar and Manual never write over another writer; one rule of control
checks / unit (pull_request) Failing after 57m18s
infra-pin / fresh (pull_request) Successful in 3s
c7b1b7dbd1
C7: the other-writer watch now runs in every step of a phase change (zero,
select, settle) in both writers, with the change's own 0 A and every closing
current it tried counted as own. While a difference or a hold stands, nothing
non-zero is written over it: no settle close, no EV-28 restore, no select, no
Manual undo or abandon. The 6 A raise check stays and runs first.

D4 (Solar): the read-back phases are judged like the current, against the
phases Solar itself chose (start state = first known read-back outside an own
select window, or an own select seen taken), never the plan's adopted n.
Same mismatch_since, hold and CHARGER_OTHER; lift only when current and
phases both match, or a press. The window of an own select is SETTLE_S from
the try's return; a take seen after it is another writer's.

DA1: a press that lifts a difference inside a phase change ends the change
at its 0 A (both writers); the raise check never holds over a value the
press took. DA2: the not-writing path does not judge the current with the
reading from before its own 0 A.

test_ev22.py (T1-T49, review row T48 (stale)), test_ev22_fuzz.py (T38,
N1-N10). test_ev20_writers T46 (a)(b)(c) edited as ruled (PM, v3).

Co-Authored-By: Claude <noreply@anthropic.com>
ems-agent added 1 commit 2026-12-03 05:32:49 +01:00
EV-22: retire the ManualWriter source pin in test_ev60 N7 (PM ruling)
infra-pin / fresh (pull_request) Successful in 2s
checks / unit (pull_request) Successful in 53m19s
b7c91ff746
The SHA-256 of ManualWriter's source was an EV-60 review-time pin. EV-22
changes ManualWriter by design (C7, DA1), so the pin is removed; the
behavioural Manual rows of test_ev56, test_ev59 and test_ev60 are unchanged
and green.

Co-Authored-By: Claude <noreply@anthropic.com>
ems-agent added 1 commit 2026-12-03 12:30:21 +01:00
EV-22 review round 1: press covers one reading, unknown read keeps the count, window ends on the close's clock
checks / unit (pull_request) Successful in 53m40s
infra-pin / fresh (pull_request) Successful in 2s
e0e51dac12
Major 1: the `pressed` mark of a sequence is consumed by the first `_advance`
(the first reading judged after the press); a later raise in the same zero
stage gets the raise-check hold again (Solar and Manual).
Major 2: with `cur` None `_watch` does not judge the current: the count
neither starts nor clears (phases are still judged).
Finding 4 (PM): the DA3 window uses the close's own clock and comparison
(`now - t1 < SETTLE_S`) and the one step that closes at its end is still
inside it, so a `last_done` a fraction of a second after the step's now no
longer pushes the close step outside the window.
Tests: rows A-D, R1 (Manual red under the mutant), the two fraction rows,
all red on b7c91ff. test_ev60: comment exactly as ruled, unused imports gone.

Co-Authored-By: Claude <noreply@anthropic.com>
ems-agent added 1 commit 2026-12-03 15:12:22 +01:00
EV-22 review r2: Solar row where R1 is seen (clamp falls between close tries); note on the masked Solar row
checks / unit (pull_request) Successful in 52m35s
infra-pin / fresh (pull_request) Successful in 1s
7710d45393
Test only, no implementation change. Green on e0e51da, red under R1 (seq own dropped).

Co-Authored-By: Claude <noreply@anthropic.com>
ems-agent merged commit de733f44bf into release/1.0 2026-12-03 16:05:57 +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#284