fix(mpc): close Energyplan beta publication gates - #1079
Conversation
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Stale comment
Left a non-blocking comment and did not approve: APPROVAL_POLICY.md does not authorise auto-approval, so this stays with the existing human review process. Cursor Bugbot completed with no findings. No reviewers were assigned because no CODEOWNERS path matches the changed files.
Sent by Cursor Approval Agent: Pull Request Router and Approver
There was a problem hiding this comment.
Left a non-blocking comment and did not approve: APPROVAL_POLICY.md does not authorise auto-approval, so this stays with the existing human review process. Cursor Bugbot completed with no findings. No reviewers were assigned because no CODEOWNERS path matches the changed files.
Sent by Cursor Approval Agent: Pull Request Router and Approver


A replan could cancel the Core DP shadow, store that cancellation as a rejection, and skip the new comparison while the old solve stopped. Keep only the newest pending comparison and start it after the cancelled solve exits. Cancellation leaves the old result intact; a real failure still reports an unavailable comparison.
This closes the other review findings from #1077 before beta installation:
make verifypasses. Race tests cover cancellation and replacement of a pending comparison. Tests cover rejection of a zero PV cap, the Python bonus rule and unsupported-host integrity checks. No rendered UI changed.The v2.15.0-beta.1 workflow was cancelled before its GitHub prerelease or channel aliases published. Its tag remains immutable. The next candidate will use the next Changesets version from a new final merge commit.
Note
Medium Risk
Touches MPC publication/shadow timing and plan validation at the dispatch boundary, plus beta default engine selection—important for correct plans but guarded by new race/cancellation tests.
Overview
Tightens Energyplan beta behavior around Core DP shadow comparisons, plan validation, and host support before wider rollout.
Core DP shadow: When a replan cancels an in-flight shadow solve, the service no longer records that cancellation as a rejected comparison or drops a newer request. It keeps a single pending comparison (the latest champion), ignores
context.Canceledon the way out, and starts the pending run infinishCoreDPShadowafter the cancelled worker exits.Plan boundary:
ValidatePlannow rejects plans with an active zero PV cap (PVCurtailActiveandPVLimitW == 0) because dispatch cannot execute that curtailment yet.Optimizer parity: Python’s
_pv_charge_bonus_ore_kwhapplies in every mode, matching Core DP (not onlypassive_arbitrage).Beta engine & native worker: Default beta Energyplan selection uses an explicit OS/arch allowlist (
energyplanSupported) instead of “not Windows”. Bundle verification still runs on all hosts; handshake/execution andmake native-solver-testare skipped when no bundled worker exists for the host.Settings UI: Planner engine control is a dedicated select: Automatic (release default), Energyplan, Core DP, and Python, with legacy
go/dpmapped to Core on save.Reviewed by Cursor Bugbot for commit 4c3e539. Bugbot is set up for automated code reviews on this repo. Configure here.