Skip to content

feat(currency): calibrate monetary planner heuristics with currency_scale - #6221

Draft
psidlo wants to merge 6 commits into
springfall2008:mainfrom
psidlo:feature/currency-scale-upstream-pr
Draft

psidlo wants to merge 6 commits into
springfall2008:mainfrom
psidlo:feature/currency-scale-upstream-pr

Conversation

@psidlo

@psidlo psidlo commented Nov 16, 2026 •

Copy link
Copy Markdown

Summary

Extends upstream currency_scale introduced by #6156 with a consistent calibration of built-in monetary heuristics across Predbat's planner, simulation, and UI. This is not an FX conversion: all input tariffs and explicitly configured or saved values remain in local minor units (e.g., haléř / haléř per kWh).

What changes

  • Calibrate hardcoded economic thresholds, price bands, improvement criteria, minimum target penalties, and monetary rounding relative to currency_scale.
  • Scale UI slider steps in addition to upstream min/max, preserving explicitly stored monetary values, including values outside existing slider limits.
  • Keep currency_scale: 1 compatible with upstream behavior; exercise scale 1, 8.5 and 29.
  • Maintain Python and C++ kernel scoring parity via an explicit kernel context currency scale. This requires ABI 13, parity 24, with all platform binaries rebuilt.
  • Add regression scenarios and documentation.

Scope

Validation

Validation on 2026-11-16: fork PR-branch workflow run #43814027820 passed: Python syntax, currency configuration/calibration, debug-plan, kernel parity, manual SoC, metric and execute tests, 6-target Zig kernel cross-build, x86_64 binary verification, and committing all rebuilt ABI 13 binaries to the PR branch. An independent manual validation run #43814051315 additionally passed the upstream quick regression suite, all targeted tests, cross-build and parity; its only failed step was a redundant binary push rejected because the first run had already updated the PR branch. The auxiliary runner has been changed to validation-only to prevent competing writes. Upstream's code-quality workflow still shows action_required, awaiting maintainer action; this PR remains draft pending upstream review/checks. It has not been deployed to Home Assistant.

See docs/currency-scale-audit.md for detailed behavior, tradeoffs and migration notes.

Related: #6156, #6155, #3683.

psidlo and others added 6 commits November 16, 2026 06:44
Extend upstream currency_scale (springfall2008#6156) with heuristic scaling, precision,
price comparisons, money-specific configuration UI steps, and Python/C++
parity. Keep incoming prices, stored values, and defaults unchanged.

Use native kernel ABI 13/parity 24 for an explicit currency scale field.
Exclude unrelated SolaX service-power changes from springfall2008#5373.

Based on upstream main 044e0ab (2026-11-15). CI rebuilds and validates
all platform kernel binaries before this PR can be considered merge-ready.

This branch has not been deployed

No deployments
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