Skip to content

fix(mpc): reject invalid planning physics - #900

Merged
frahlg merged 1 commit into
masterfrom
agent/mpc-physics-validation
Aug 11, 2026
Merged

fix(mpc): reject invalid planning physics#900
frahlg merged 1 commit into
masterfrom
agent/mpc-physics-validation

Conversation

@frahlg

@frahlg frahlg commented Aug 11, 2026

Copy link
Copy Markdown
Member

What changed

  • Validate effective slots, fleet, storage and loadpoint physics before either planner runs.
  • Require the external and Go fallback loadpoint views to describe the same asset.
  • Use one PV uncertainty sample per replan and reject invalid values instead of masking them.
  • Keep the prior plan when inputs are invalid or when Go DP would have to invent an in-band starting SoC.

Why

Core and the Python optimizer used different defaults and clamps for malformed values. Unknown modes, non-finite values, invalid efficiencies, stale EV fallback data and out-of-band recovery could therefore reach one planner but not the other. The service now fails closed at their shared boundary.

Validation

  • make verify-all
  • focused MPC regression tests: 100 runs
  • focused MPC race tests: 25 runs
  • full go test ./internal/mpc
  • full go test -race ./internal/mpc
  • go vet ./internal/mpc
  • three independent read-only reviews with no remaining P0-P3 findings

Part of #885.

@frahlg
frahlg merged commit 60057bb into master Aug 11, 2026
14 checks passed
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