Files
EOS/docs/adr/0008-optimizer-refactoring-preserves-results.md
T
Bobby NoelteandClaude Opus 5.5 9adf7b8be2 docs(optimization): add optimizer architecture ADRs, skill and test (#1572)
Additional changes
- Add the optimizer terms to the glossary.
- Point to the skill from AGENTS.md, docs/develop/ai.md and the energy-domain skill.
- Match module names case-exactly, also on case-insensitive file systems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Code (claude-opus-5-5)
2026-11-27 13:55:41 +01:00

1.4 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.