Skip to content

fix(mpc): reject invalid raw grid limits - #903

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

fix(mpc): reject invalid raw grid limits#903
frahlg merged 1 commit into
masterfrom
agent/mpc-grid-limit-validation

Conversation

@frahlg

@frahlg frahlg commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

  • validate raw MPC fuse and export limits before slot clamping can mask invalid values
  • keep the latest accepted plan and skip both planners, decision ID allocation and diagnostic writes when a raw limit is invalid
  • use the same validated limit snapshot for primary and Go-fallback slot construction

Evidence

On the old base, a negative fuse and negative, NaN or infinite export limits reached planning after clamp logic turned them into disabled or fuse-only limits. The Service tests then published a new plan. The Go-DP repro also replaced the prior plan for a NaN export limit.

After this change:

  • focused regression tests pass 100 times
  • focused race tests pass 25 times
  • the full MPC suite and full MPC race suite pass
  • go vet ./internal/mpc passes
  • make verify-all passes, including 134 Python tests, all Go tests, optimizer contracts, full stack, migration checks, vet, builds and linux/arm64, linux/amd64 and windows/amd64 cross-builds
  • two independent reviews found no P0-P3 issue

Scope

This PR hardens the MPC Service boundary only. Config and dispatch still need their own finite/range checks, but open PRs currently own those files. The changeset does not claim end-to-end config or hardware enforcement.

Part of #885.

@frahlg
frahlg merged commit 5b9ec17 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