EV-10b: grade the alarm on the house alone, no 0 W clip #259

Merged
admin merged 2 commits from EV-10b into release/1.0 2026-11-17 00:20:56 +01:00
Owner

Rig F-1 again: car_exclude clipped the period without the car at 0 W, so batteries covering the car (house 3 kW, car 11 kW, batteries 8.1 kW, aim 6 kW) were charged to the house, latched the house need early in the quarter, and the floor alarm fired at the reserve.

New car_exclude_alarm (alarm grading only): rest of the period held - car_w keeps its sign; done part max(0, done - car so far). car_exclude (cover-off guard input) unchanged, proved bit-identical by test.

Tests: new test_ev10b.py (rig shape over a whole quarter, N=2 variant, house overload, counterfactual unit, cover-off identity); red on b86c015, green here. Mutant (restore clip) red. test_ev10/04/03 unchanged and green. tools/ev04_peak.py gained optional n, plant_cls, dev_w (defaults as before) and CarPlantN.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Bdqr7PiaHcBnzPituu2yTC

Rig F-1 again: `car_exclude` clipped the period without the car at 0 W, so batteries covering the car (house 3 kW, car 11 kW, batteries 8.1 kW, aim 6 kW) were charged to the house, latched the house need early in the quarter, and the floor alarm fired at the reserve. New `car_exclude_alarm` (alarm grading only): rest of the period `held - car_w` keeps its sign; done part `max(0, done - car so far)`. `car_exclude` (cover-off guard input) unchanged, proved bit-identical by test. Tests: new `test_ev10b.py` (rig shape over a whole quarter, N=2 variant, house overload, counterfactual unit, cover-off identity); red on b86c015, green here. Mutant (restore clip) red. test_ev10/04/03 unchanged and green. `tools/ev04_peak.py` gained optional `n`, `plant_cls`, `dev_w` (defaults as before) and `CarPlantN`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Bdqr7PiaHcBnzPituu2yTC
admin added 1 commit 2026-11-16 22:16:31 +01:00
EV-10b: grade the alarm on the house alone without the 0 W clip
checks / unit (pull_request) Successful in 22m5s
infra-pin / fresh (pull_request) Successful in 2s
b12776c705
The period without the car was clipped at 0 W, so batteries covering the car
were charged to the house and the floor alarm fired (rig F-1). New
car_exclude_alarm keeps the sign of the rest of the period; car_exclude (the
cover-off guard input) is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
admin added 1 commit 2026-11-16 23:58:15 +01:00
EV-10b review: pin the done-part clip and the car's power now in test_ev10b
checks / unit (pull_request) Successful in 22m9s
infra-pin / fresh (pull_request) Successful in 1s
ff2eebe28b
Two checks a mutant survived: crediting the car-made export in the done part,
and taking off the car's quarter average instead of its power now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

EV-10b review (full tier): approve, merging. Head reviewed b12776c, plus one reviewer commit ff2eebe (tests only).

Findings

  • Low (fixed, ff2eebe) goodwe_controller/test_ev10b.py section 3: two safety terms of car_exclude_alarm were not pinned. Mutant A (app/ctl_car.py:275, drop the done-part max(0, ...) so the car-made export is credited) and mutant B (app/ctl_car.py:272, take off the car's quarter average instead of its power now) both left test_ev10b and test_ev10 green. Added two unit checks: rig shape for 400 s then house 12 kW at the reserve must still miss the aim; a car turned down from 11 kW to 1.4 kW with a 7 kW house must still miss the aim. Red on A and B, green on head.
  • Info app/ctl_car.py:256-276: the done part is clipped as one sum, not per moment. Alternating periods (house above, then under the batteries) can under-count the house alone. It is never lower than EV-10's car_exclude done part, the latch is sticky, so no regression. No action.
  • Info app/ctl_car.py:272: held - w signed means a trusted car figure that lags a stop under-counts the house by up to w for that cycle (EV-10 bounded it at held). Bounded by car_w_trusted (fresh, charging, corroborated). No action.

Checks

  • Formula: rest held - car_w keeps its sign, so misses_aim / load_too_high add the batteries back to exactly the house. Done part never below EV-10's. w None: the period as it is.

  • car_exclude (cover off) source unchanged; bit-identical test green.

  • Rig shape (N=2, both at reserve; and one first) silent with one car-over notice; house 7 kW alarms.

  • Repros on head: clip probe (rig rows now False, house row True), probe_branches OK, break_twin 3075/3100/3200 and break_house 6000/7800: car_explains False throughout, alarm fires in both modes.

  • Tests in goodwe-addon-checks:1 (--network none): test_ev10b, test_ev10, test_ev04, test_ev03, safety81/87/126/126b, test_named_absence, test_bytecode, test_docs green.

  • tools/ev04_peak.py: new args default to the old behaviour; existing callers green.

  • DECISIONS section short and plain; CHANGELOG wording still true.

  • 50 W floor / 10 s on-count: unchanged by this PR (judged in EV-10 review).

  • CI: checks / unit (pull_request) run 1720 success on ff2eebe.

**EV-10b review (full tier): approve, merging.** Head reviewed b12776c, plus one reviewer commit ff2eebe (tests only). **Findings** - **Low (fixed, ff2eebe)** `goodwe_controller/test_ev10b.py` section 3: two safety terms of `car_exclude_alarm` were not pinned. Mutant A (`app/ctl_car.py:275`, drop the done-part `max(0, ...)` so the car-made export is credited) and mutant B (`app/ctl_car.py:272`, take off the car's quarter average instead of its power now) both left test_ev10b and test_ev10 green. Added two unit checks: rig shape for 400 s then house 12 kW at the reserve must still miss the aim; a car turned down from 11 kW to 1.4 kW with a 7 kW house must still miss the aim. Red on A and B, green on head. - **Info** `app/ctl_car.py:256-276`: the done part is clipped as one sum, not per moment. Alternating periods (house above, then under the batteries) can under-count the house alone. It is never lower than EV-10's `car_exclude` done part, the latch is sticky, so no regression. No action. - **Info** `app/ctl_car.py:272`: `held - w` signed means a trusted car figure that lags a stop under-counts the house by up to `w` for that cycle (EV-10 bounded it at `held`). Bounded by `car_w_trusted` (fresh, charging, corroborated). No action. **Checks** - Formula: rest `held - car_w` keeps its sign, so `misses_aim` / `load_too_high` add the batteries back to exactly the house. Done part never below EV-10's. `w` None: the period as it is. - `car_exclude` (cover off) source unchanged; bit-identical test green. - Rig shape (N=2, both at reserve; and one first) silent with one car-over notice; house 7 kW alarms. - Repros on head: clip probe (rig rows now False, house row True), probe_branches OK, break_twin 3075/3100/3200 and break_house 6000/7800: `car_explains` False throughout, alarm fires in both modes. - Tests in `goodwe-addon-checks:1` (`--network none`): test_ev10b, test_ev10, test_ev04, test_ev03, safety81/87/126/126b, test_named_absence, test_bytecode, test_docs green. - `tools/ev04_peak.py`: new args default to the old behaviour; existing callers green. - DECISIONS section short and plain; CHANGELOG wording still true. - 50 W floor / 10 s on-count: unchanged by this PR (judged in EV-10 review). - CI: `checks / unit (pull_request)` run 1720 success on ff2eebe.
admin merged commit 628bde8013 into release/1.0 2026-11-17 00:20:56 +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#259