PRICE-02: the trading verdict skips price periods that have ended #206

Merged
admin merged 6 commits from PRICE-02 into release/1.0 2026-10-22 18:57:38 +02:00
6 Commits
Author SHA1 Message Date
glenn schrooyenandClaude Opus 5.5 6b2d0091d6 PRICE-02 review: keep an open buy over midnight in the real-year replay; say which variant the kWh figure is
checks / unit (pull_request) Successful in 47m40s
infra-pin / fresh (pull_request) Successful in 1s
The production-shaped plan sees tomorrow from 13:00, so most buys are sold
the next day or later. The ledger forgot the open buy at each midnight and
booked 46 of 51 sales as holdings: 5 trips, +1.21 EUR. Carried over, the
same decisions give 51 trips, +13.81 EUR, all clearing the threshold.
Decisions are unchanged and identical on the old and new verdict. No
assertion changed.

DECISIONS: 27.5 -> 42.6 kWh is the refresh-:00, tomorrow-known variant; give
the range of the other three.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bdqr7PiaHcBnzPituu2yTC
2026-10-22 16:48:43 +02:00
glenn schrooyenandClaude 3dd4dd89e0 PRICE-02 round 3: say that hourly and static plans change too, test plans built off the hour, exact period end and the Home page path, production-shaped real-year replay
checks / unit (pull_request) Successful in 47m47s
infra-pin / fresh (pull_request) Successful in 1s
Docs and tests only; no change under goodwe_controller/app.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bdqr7PiaHcBnzPituu2yTC
2026-10-22 14:59:13 +02:00
glenn schrooyenandClaude 891ed7bdd7 PRICE-02 round 2: require now, undo the test loosening, analyse ties
checks / unit (pull_request) Successful in 47m49s
infra-pin / fresh (pull_request) Successful in 2s
- TariffPlan.arbitrage(now=...) is required (keyword-only, no default); so are
  homeview.trade_verdict/refusal_key's now. Existing test calls pass one.
- test_arbitrage.py: no module-level decide wrapper. Fixtures that probed a
  one-day plan after its extremes now hold two days (as a site does); the
  flap day gets a unique cheapest and dearest hour; the replay breaks its
  ties without direction. The flap bound is <= 4 and the replay check is
  len(_trades) < 365 again. 228 checks pass on the old and the new code.
- test_price02.py part 6: ties (equal quarters, a real 15-minute day,
  alternating hourly prices) and the required now.
- Identity pins: the masked digest is only for the older-tree comparison;
  this tree's own digests are pinned with nothing hidden.
- DECISIONS: the tie analysis with numbers.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-22 10:37:43 +02:00
glenn schrooyenandClaude 2ff9be710c PRICE-02: correct the DECISIONS note (which sentences changed, how identity is pinned)
checks / unit (pull_request) Successful in 47m48s
infra-pin / fresh (pull_request) Successful in 1s
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-22 08:37:39 +02:00
glenn schrooyenandClaude ecd9822861 PRICE-02: pin the modes-off identity with a digest that hides only the changed words
checks / unit (pull_request) Successful in 48m44s
infra-pin / fresh (pull_request) Successful in 2s
test_price_run_fixes.py part 5 and test_modes_p3.py part 1 compare the modes-off
replay with digests printed on older trees. The trade sentence now says
"price period", and a sale quotes another "above the cheapest" figure once the
first cheap period is over. ident.trade_digest() hides exactly those two
things; re-measured on e3e4ba6, 7a00f12, 90bc901 and this tree, the digests
are the same, so every command is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-22 08:20:50 +02:00
glenn schrooyenandClaude 4297f7f3f1 PRICE-02: the trading verdict skips price periods that have ended
checks / unit (pull_request) Failing after 48m38s
infra-pin / fresh (pull_request) Successful in 1s
TariffPlan.arbitrage(now=...) drops the points whose period has ended
(end <= now), so the cheapest and dearest point can still be traded.
decide() (modes off), the modes-on allowed() gate and the Home verdict
all pass their own now. Hourly feeds and the static tariff are unchanged.
The off-peak sentence and the charge/discharge sentences say "price
period". Tests: test_price02.py; test_arbitrage.py rolls its whole-day
plans to start at now; test_modes_p3.py part 1 digests leave the trade
sentence out (commands unchanged on 7a00f12, 90bc901 and this tree).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-22 07:19:28 +02:00