Repository navigation
Description
Follow-ups from the final review of #1923 (head a059b6a) on 28 Oct 2026. None of them makes the PR worse than master or breaks the owner's fuse rule, so they wait until after stable.
- Fuse C4: a house drop on one phase makes a seen three-phase car's raise count as still to come
- Fuse aloneA: two mutations survive the committed tests
- Field matrix: add a house that moves on another phase, and a 10 s meter
- Offers are stamped when the next tick logs them, not when they go out
Fuse C4: a house drop on one phase makes a seen three-phase car's raise count as still to come
Seen on #1923 at a059b6a (documented under Risk, Double counting). For a three-phase order, riseAheadA takes the smallest rise across the phases and applies the remaining rise to every phase. A house load that drops on L2 while the raise travels therefore adds its drop to L1's predicted reading. Evidence: open-loop probe, 25 A fuse, 40 s charger, car seen on three phases (CarPhases 3), 6->16 A raise landing at L1 24.5 A, 8 A drop on L2 during the response time: Core cuts 11040 -> 5520 W with phases 24.5/16.5/18.0 A, every phase under the line. #1913 does not cut. Needs a drop above 0.2 x In within the response window (40 s, or 180 s for undeclared chargers) beside a landing close to the line. Test idea: closed loop with an oven element (8 A) switching off on L2 during a raise to a seen 3p car, asserting no cut while every phase is at or under In. Fix idea: use the median of the three phase rises instead of the smallest, so a move on one phase in either direction does not count. Re-baseline the C4 tests, whose L1+L2 step then reads 3 A as landed.
Fuse aloneA: two mutations survive the committed tests
Applies only if the aloneA path in riseAheadA stays after the blocking fix. On a059b6a, these mutations leave every TestEVFuse*/TestEVHardLimit* test green: (M2) count any alone rise above 0, instead of a step or more; (M4) do not reset aloneA when a new raise record starts in recordEVOffers. Test idea for M4: two raises in a row on a car not yet seen. The first lands as a one-phase rise on L1. The second meets a house step on L1 while L2 moves 1 A in the same reading. Assert that C4 still cuts when L1 plus the raise passes 1.2 x In. For M2: a 0.4 A alone drift on L1 must not count as landing.
Field matrix: add a house that moves on another phase, and a 10 s meter
The committed field matrix keeps the house still between kettle events and reads the meter every second. So it missed both regressions found in the final review of #1923: a 1p car cut to 0 W at session start, and over-cuts on 1p orders. A local probe toggled 1.2 A on L2 every 17 s with a 1 s or 10 s meter. On #1923's head this gave 18/65 failing cases against 8/17 on its base. Proposal: add one matrix variant with a small toggling load on a phase other than the car's, and a 10 s meter cadence (Swedish HAN and DSMR 4 P1). Record the known failures in testdata/sitesim_field_known.txt as today.
Offers are stamped when the next tick logs them, not when they go out
Core logs an EV offer when the next tick reads the loadpoint's command (recordEVOffers, stamped now), about 2 s after it went out. A meter reading that arrives just before that tick is then older than the logged offer. Since ab02710, rises read the meter's own rise, but a cut's cover still reads shownA, so a cut the meter already shows can count as cover for one more reading. Fix idea: stamp the offer at send time. Test: TestEVFuseRaiseShownBeforeItsOfferIsLogged shape (meter readings 7 ms before each 2 s tick), applied to a cut.
🤖 Generated with Claude Code
Activity