fix(forecast): score forecasts per pipeline, not per Core build - #1493
Merged
Merged
Conversation
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. |
frahlg
force-pushed
the
1489-calibration-cohort
branch
from
October 1, 2026 17:52
fdc3aff to
9ff5cd7
Compare
The evaluation cohort hashed the Core version together with the learning revision, the Energyplan worker and the pipeline policy. Error bands (NewCalibrator) and the previous-day and persistence baselines only use samples from the current cohort, so every update started them from nothing. Empirical bands need 48 samples over 7 days; with weekly betas the forecast margin never left its cold-start widths (35–50 % of load). The cohort now keys on the learning revision, the worker build and forecastPipelinePolicy. Bump the policy when Core changes what reaches the planner. Fixes #1489 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
frahlg
force-pushed
the
1489-calibration-cohort
branch
from
October 1, 2026 17:57
9ff5cd7 to
adef12f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Forecast error bands never leave cold start on a box that takes weekly betas.
NewCalibratoruses only errors from the current cohort, and the cohort revision includes the CoreVersion. Every update starts an empty cohort, while empirical bands need 48 samples over 7 days.The planner's forecast margin (
safety_k) then always scales the widest cold-start widths: 35–50 % of load, and PV down to the model's lower bound. On 1 Oct the live plan used exactly the cold-start load width for every night slot, which is why k = 1 was so harsh: at 11:30 it would have counted on 1.8 of 7.2 kW of forecast sun.Change
forecastPipelinePolicy. Core's build version is no longer part of it.forecastPipelinePolicystates the rule: bump it whenever Core changes what reaches the planner.docs/architecture.mdsays the same.The format change starts one new cohort when this ships. After that, bands and baselines carry over across Core updates that leave forecasting alone.
Tests
TestForecastEvaluationCohortSurvivesCoreUpdate: a new Core version keeps the cohort; a new Energyplan binary or policy changes it.make verifyclean.Fixes #1489. One of four forecast fixes found while evaluating #1482, with #1488, #1490 and #1491. Merge after #1488; #1490 bumps the policy on top of this.
🤖 Generated with Claude Code