Skip to content

fix(optimizer): enforce result and mode semantics - #890

Merged
frahlg merged 1 commit into
masterfrom
agent/optimizer-mode-costs
Aug 11, 2026
Merged

frahlg merged 1 commit into
masterfrom
agent/optimizer-mode-costs

Conversation

@frahlg

@frahlg frahlg commented Aug 11, 2026

Copy link
Copy Markdown
Member

What

  • apply min_arbitrage_spread_ore_kwh only in arbitrage and passive_arbitrage
  • keep validating the setting in every mode
  • reject CVXPY USER_LIMIT results instead of treating an unverified incumbent as a valid plan
  • cover shared CVXPY, direct HiGHS, recourse, multistage and progressive paths

Why

The spread is an arbitrage hurdle. Charging every discharge with it stopped self-consumption and cheap-charge modes from serving their stated goal.

CVXPY can report USER_LIMIT without a feasible primal result. Accepting that status let the worker return plans that Core later had to reject.

Part of #885.

Tests

  • optimizer/.venv/bin/python -m pytest optimizer/tests -q — 107 passed
  • make verify
  • pre-push make verify-all, including linux/arm64, linux/amd64 and windows/amd64 builds

Risk

This is limited to optimizer policy cost terms and solver-result acceptance. Direct HiGHS already requires an optimal status. Core validation and the Go fallback stay unchanged.

@frahlg
frahlg marked this pull request as ready for review August 11, 2026 06:50
@frahlg
frahlg merged commit bfeba82 into master Aug 11, 2026
14 checks passed
@frahlg
frahlg deleted the agent/optimizer-mode-costs branch August 17, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant