Skip to content

fix(mpc): close Energyplan beta publication gates - #1079

Merged
frahlg merged 2 commits into
masterfrom
fix/energyplan-beta-gates
Sep 7, 2026
Merged

fix(mpc): close Energyplan beta publication gates#1079
frahlg merged 2 commits into
masterfrom
fix/energyplan-beta-gates

Conversation

@frahlg

@frahlg frahlg commented Sep 7, 2026

Copy link
Copy Markdown
Member

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:

  • Reject an active zero PV cap at Core's plan boundary until dispatch can execute it. Energyplan 0.1.1 emits no PV curtailment, but an explicit Python planner could otherwise publish a plan that assumes it.
  • Keep Python's PV-charge bonus in every mode, matching the existing Core policy.
  • Verify bundle integrity on every host and skip worker execution where no binary exists. Beta engine selection uses the exact supported OS/architecture list.

make verify passes. 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.Canceled on the way out, and starts the pending run in finishCoreDPShadow after the cancelled worker exits.

Plan boundary: ValidatePlan now rejects plans with an active zero PV cap (PVCurtailActive and PVLimitW == 0) because dispatch cannot execute that curtailment yet.

Optimizer parity: Python’s _pv_charge_bonus_ore_kwh applies in every mode, matching Core DP (not only passive_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 and make native-solver-test are 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/dp mapped to Core on save.

Reviewed by Cursor Bugbot for commit 4c3e539. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T06:53:30.101878Z e669eb5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@frahlg
frahlg merged commit 72389f9 into master Sep 7, 2026
18 checks passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

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