Skip to content

Planner v1.74: flat-plan FiT scaling, unwind prior ratio, blended DP guard & UI polish - #69

Merged
RickUsingGitHub merged 1 commit into
mainfrom
fix/planner-v174
Nov 29, 2026
Merged

RickUsingGitHub merged 1 commit into
mainfrom
fix/planner-v174

Conversation

@RickUsingGitHub

Copy link
Copy Markdown
Owner

Summary

Release v1.74 wrapping up the final planner engine fixes and UI polish items:

Engine (js/planner.js)

  • Flat-plan dayFeedInScale reserve fix: Mark true flat tariffs (prices.flatTariff) in plannerBatteryPrices and honour it in simulateBattery, so halving daytime 10am–3pm feed-in (dayFeedInScale = 0.5) no longer flips isFlat to false and imposes a phantom 8% reserve haircut on flat plans.
  • Unwind neighbour diurnal prior ratio: In plannerUnwindBattery, normalize borrowed neighbours s ± k by diurnalPrior(m, s) / diurnalPrior(m, nbSlot) rather than raw * diurnalPrior(m, s) so uncovered evening-peak slots borrowing from an adjacent evening-peak slot are not double-inflated (~3.2×).
  • Exact partial-blend DP guard: Add piecewise integral helpers (vValueRange, segIntegral) and check exact realized net gain whenever a blended sell/buy segment is partially overlapped in runDayDp, preventing net-loss sliver exports/imports when eBefore barely clears load/solar.
  • Comment cleanup: Align realistic-forecast smoothing comment with the implemented 90-min bilateral moving average blended 30% with ±15 c/kWh neighbour clamp.

UI & Version (js/planner-ui.js, index.html, js/constants.js)

  • Daytime-FiT sensitivity yardstick: When baseline comparison is set to "Whatever's cheapest" (!r.compareWith), dayFeedIn(x) re-picks the cheapest allowed nothing-new plan under dayFeedInScale = 0.5 (cached as r.dayBaseBill) rather than assuming the same baseline plan stays cheapest.
  • Consistent cycles/day display: Compute cyclesPerDay in renderNumbers using delivered / (x.batteryKwh * Math.sqrt(rteVal)) / 365, matching simulateBattery (out.discharged / eta / B) and the month-by-month breakdown.
  • Version bump: 1.73 → 1.74 across index.html, js/constants.js, and tests/unit-time.js.

Tests (tests/unit-planner.js, tests/unit-time.js)

  • Added regression Tests 19–21 covering flat-plan FiT scaling, blended partial-overlap DP guard, and unwind neighbour prior normalization.
  • Updated APP_VERSION assertion to 1.74.

Verification

  • npm run lint (eslint .): 0 errors, 0 warnings
  • npm run test:unit: all 12 unit suites passed
  • npx playwright test --workers=2: 70/70 passed

@RickUsingGitHub
RickUsingGitHub merged commit 446ba0d into main Nov 29, 2026
1 check passed
@RickUsingGitHub
RickUsingGitHub deleted the fix/planner-v174 branch November 29, 2026 06:05
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