Pin the conversion, plan and visualization of golden runs. Drive GENETIC0 through the optimizer registry. Move GENETIC0 into one directory with role-named modules. Prepare every run input once, run from the parameters. Fall back on bad inputs instead of cancelling the run. Simulate from frozen device dataclasses, not settings. Convert and visualize from the parameters and result only. Serve GENETIC0 from its own router, return a frozen result. Additional changes - Fix the run start of the golden runs and add a run across the DST switch. - Configure a home appliance so the conversion covers it. - Pass the warm start to the legacy preparation instead of reading the EMS. - Replace EnergyManagement.genetic0_solution() by optimizer_result(name). - Cover the warm start of the parameter preparation. - Rename Genetic0OptimizationParameters to Genetic0Request, Genetic0CommonSettings to Genetic0Settings. - Say in ADR 0007 and the skill that a move relabels baseline entries one to one. - Record the renamed OpenAPI schemas in CHANGELOG.md and the upgrade guide. - Add the observation time to the optimizer interface. - Cache the load interpolator by its backend instead of in the EMS run cache. - Add replay files that reproduce each golden result from its parameters. - Stop writing demo providers, demo devices and defaults into the configuration. - Count a NaN state of charge as invalid. - Remove the unused electricity fee check. - Record the fallbacks in CHANGELOG.md instead of the former demo providers. - Leave out a battery that is not linked to the inverter. - Count infinite forecast values as missing. - Extend a prediction.hours that leaves fewer than two hours after the start hour. - Do not charge from the grid without any known price. - Without an inverter, buy the whole load from the grid instead of planning it at no cost. - Keep the zone of the run start in the replay files. - Correct the DVhub documentation that said a missing tariff cancels the run. - Rename the request models to <Name><Thing>Request. - Move the settings' to_genetic0_*() converters into the preparation. - Remove the solution's unreachable configuration fallbacks. - Record the renamed OpenAPI schemas in CHANGELOG.md and the upgrade guide. - Add EnergyManagement.optimizer_run() and render the PDF from the run's own start. - Read the presentation series from the earlier of the run's start hours. - Render the PDF report for runs of any length, not only 48 hours. - Add the generic OptimizerProblem, rendered like EOSProblem. - Move Genetic0ParametersBaseModel into genetic0request.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Claude Code (claude-opus-5-5)
1.7 KiB
Optimizer refactoring preserves results, and GENETIC0 is frozen
An optimization result is a charge schedule for real devices, so a refactoring that silently
changes results is a defect in production, not a code-quality issue. Refactoring an optimizer,
including the migration to the architecture of ADRs
0003 to
0007, is therefore behaviour-preserving: with
a fixed seed every stored input gives the same solution as before. A change that alters a golden
result (tests/testdata/<optimizer>/optimize_result_*.json or a replay file) is a behaviour
change and goes in its own, explicitly declared pull request; a refactoring pull request never
regenerates golden data. GENETIC0 is frozen: its results never change. It gets no bug fixes and no
behaviour changes, only the structural changes needed to follow the optimizer architecture, each
proven result-identical by its golden tests.
Consequences
- Before an optimizer is refactored, its golden tests are extended with replay files: complete optimization parameters in the new parameter type plus the expected result.
- GENETIC0 is migrated first, as the pilot; the registry and the interface arrive with its first migration pull request. GENETIC follows.
- A GENETIC0 bug that matters to users is fixed in GENETIC (or a new optimizer), not in GENETIC0.
- One declared exception: GENETIC0's parameter preparation follows the "optimization parameters
are always valid" rule of the
energy-domainskill, in a behaviour-change pull request of its own. It no longer writes demo providers or devices into the configuration and no longer cancels a run; results with a complete configuration stay the same.