Annual bill extrapolation misuses cross-season and partial-month data #23
Labels
No labels
bug
decision
docs
enhancement
integration
ops
security
tech-debt
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/BatteryStorageCalculator#23
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
representativeMonthValue(src/lib/simulation.js:361-375) fills each missing calendar month by: same month → same season → any complete rows → all rows. With a single-season dataset (e.g. summer-only export), missing winter months resolve to the summer average — summer rates and AC load ×12 becomes the annual bill. Separately,monthCoverage(simulation.js:377-381) treats ≥90% coverage as complete but never scales the partial energy sum, and months below the threshold are used raw when no complete month exists.Fix: (1) scale partial-month energy values by
expectedHours/hoursbefore use; (2) when a season has zero representative data, fall back to the parametric seasonal estimate for that season instead of cross-season row averages; (3) push a warning into the calculation output (warningsarray already exists) when any month was synthesized, and surface it beside annual/payback figures.calculateDataConfidenceinsrc/lib/analytics.jsalready computes the season-gap signal — consume it.Test: dataset with only June–September rows must produce winter months near the parametric winter estimate, never near the summer average; a 27-day month must scale to ~30/27 of its raw sum.
Acceptance criteria
Relations: relates to #11 (both touch simulation outputs)
(Audit finding F-02, 2026-07-16 — Severity: High, Confidence: High)