Skip to content

fix(forecast): score forecasts per pipeline, not per Core build - #1493

Merged
frahlg merged 1 commit into
masterfrom
1489-calibration-cohort
Oct 1, 2026
Merged

frahlg merged 1 commit into
masterfrom
1489-calibration-cohort

Conversation

@frahlg

@frahlg frahlg commented Oct 1, 2026

Copy link
Copy Markdown
Member

Problem

Forecast error bands never leave cold start on a box that takes weekly betas. NewCalibrator uses only errors from the current cohort, and the cohort revision includes the Core Version. 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

  • The cohort keys on what decides the forecast: the learning revision, the Energyplan binary and forecastPipelinePolicy. Core's build version is no longer part of it.
  • A comment on forecastPipelinePolicy states the rule: bump it whenever Core changes what reaches the planner.
  • docs/architecture.md says 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 verify clean.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 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-10-01T17:25:04.098510Z fdc3aff 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.

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
frahlg force-pushed the 1489-calibration-cohort branch from 9ff5cd7 to adef12f Compare October 1, 2026 17:57
@frahlg
frahlg merged commit 68fda43 into master Oct 1, 2026
15 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.

Forecast error bands reset on every Core update

1 participant