Billing reconciliation aligns bill periods to calendar months, corrupting the delta #24
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#24
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?
buildBillingReconciliation(src/lib/billing.js:39-40) maps each bill toperiodEnd.slice(0,7)and compares its total against that calendar month's modeled bill. Ameren billing cycles run mid-month to mid-month, so the modeled and actual windows overlap by only ~50–60%, and at season boundaries (June, October) they straddle different rate seasons. The reconciliation delta — the feature's entire output — therefore contains a large alignment component unrelated to model accuracy.Fix: compute the modeled cost over the exact bill window. The hourly simulation already produces per-hour costs (
hourlyImpactbehind theincludeHourlyImpactoption insrc/lib/simulation.js); expose a per-day cost rollup from the monthly summary path and sum days in [periodStart, periodEnd]. If that is too heavy for the default calculation, fall back to blending adjacent calendar months by day overlap. Label any remaining approximation in the Billing tab.Acceptance criteria
Relations: relates to #14 (both concern billing-data fidelity)
(Audit finding F-03, 2026-07-16 — Severity: Medium, Confidence: High)