Skip to content

docs(contract): state Core's current Energyplan call budgets - #1967

Merged
frahlg merged 1 commit into
masterfrom
docs-energyplan-budget-sentence
Nov 5, 2026
Merged

frahlg merged 1 commit into
masterfrom
docs-energyplan-budget-sentence

Conversation

@frahlg

@frahlg frahlg commented Nov 5, 2026

Copy link
Copy Markdown
Member

Problem

The contract's budget sentence (docs/energyplan-contract.md, about line 198) is out of date. It says Core allows 500 ms for small plans and 5 s for larger ones. It leaves out three things Core does today:

  • the 1.5 s budget with an active car;
  • the call skipped when less than 500 ms of the first slot remain;
  • the 5.6 s cap on time_limit_s, and the reply margin Core keeps besides the 50 ms for validation and publication.

Planner authors size their search from this text.

Change

The paragraph now states what go/internal/mpc/energyplan.go and external_optimizer.go do at a8b696a:

Text Code
no call below 500 ms energyplanBudget returns 0 when remainingFirstSlot < energyplanSmallBudget, and Optimize returns an error before calling the worker
500 ms / 1.5 s / 5 s energyplanSmallBudget, energyplanEVBudget, energyplanFleetBudget
≥ 965 len(slots)*assets >= 193*5 with assets = 3*batteries + 2*active loadpoints
PV curtailment, demand charges, hourly caps p.PVCurtailment.MinW > 0 || len(p.DemandCharges) > 0 || hours
5.6 s TimeLimitS: o.cfg.Timeout.Seconds() * 0.8 with the 7 s timeout, then math.Min with the budget
--time-limit=5s, 7 s NewEnergyplanOptimizer
50 ms, max(5 %, 30 ms) energyplanPublishMargin, energyplanReplyMargin

Documentation only, so it needs no changeset. The Energyplan repository keeps a byte-identical copy and will sync it after this merges.

🤖 Generated with Claude Code

The budget sentence still said Core allows 500 ms or 5 s. Core also
gives 1.5 s with an active car, skips the call when less than 500 ms of
the first slot remain, caps time_limit_s at 5.6 s, and keeps a reply
margin besides the 50 ms for validation and publication. State what
go/internal/mpc/energyplan.go does today.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T05:18:29.412548Z 987c677 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.

@frahlg
frahlg merged commit 957c8c5 into master Nov 5, 2026
17 checks passed
@frahlg
frahlg deleted the docs-energyplan-budget-sentence branch November 11, 2026 09:16
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