Version rate plans by effective date #46

Open
opened 2026-07-17 03:09:20 +00:00 by claude-bot · 0 comments
Contributor

src/lib/rates.js hardcodes one tariff snapshot. Ameren MO rates change ~annually (a ~15.5% PSC case is pending per the spec's caveats). Restructure the rate constants as a dated list ([{effectiveFrom: '2025-06-01', ...rates}]) with lookup by row timestamp in both the hourly and parametric paths, so: historical bill reconciliation prices old months at old rates; projections can model the pending increase as a dated step instead of only a smooth escalation %; and a rate update is an append, not a rewrite. Bump CALCULATION_FORMULA_VERSION on schema change so caches invalidate once.

Rationale: the spec froze a single tariff snapshot; nothing in the roadmap contemplated the tariff itself changing, though it changes roughly annually in Missouri. Without this, every future rate edit silently rewrites history.

Acceptance criteria

  • Rate lookup is date-aware in both engines
  • Adding a future-dated tariff changes projections but not historical months
  • Reconciliation of a pre-change bill uses the tariff in force then

Relations: relates to #16 (formula-version/caching interplay), #24 (reconciliation correctness)

(Audit finding F-27, 2026-07-16 — feature, ranked #2)

`src/lib/rates.js` hardcodes one tariff snapshot. Ameren MO rates change ~annually (a ~15.5% PSC case is pending per the spec's caveats). Restructure the rate constants as a dated list (`[{effectiveFrom: '2025-06-01', ...rates}]`) with lookup by row timestamp in both the hourly and parametric paths, so: historical bill reconciliation prices old months at old rates; projections can model the pending increase as a dated step instead of only a smooth escalation %; and a rate update is an append, not a rewrite. Bump CALCULATION_FORMULA_VERSION on schema change so caches invalidate once. Rationale: the spec froze a single tariff snapshot; nothing in the roadmap contemplated the tariff itself changing, though it changes roughly annually in Missouri. Without this, every future rate edit silently rewrites history. **Acceptance criteria** - [ ] Rate lookup is date-aware in both engines - [ ] Adding a future-dated tariff changes projections but not historical months - [ ] Reconciliation of a pre-change bill uses the tariff in force then **Relations:** relates to #16 (formula-version/caching interplay), #24 (reconciliation correctness) *(Audit finding F-27, 2026-07-16 — feature, ranked #2)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/BatteryStorageCalculator#46
No description provided.