Decide: are calculation results authoritative records or cacheable derivations? #15

Closed
opened 2026-07-17 01:17:58 +00:00 by claude-bot · 1 comment
Contributor

Open Question carried over from docs/roadmap.md.

Should calculation results be treated as authoritative records, or always as cacheable derivations from home data?

Consequential: if results are cacheable derivations, they can be dropped and recomputed freely, and cleanup is trivial. If they are authoritative records, they must survive formula changes, which means historical results cannot be regenerated and must be retained as-is.

The current implementation leans ''cacheable'' - results carry a calculation version and input hash and are invalidated when either changes. But report snapshots (Milestone 17) imply some results are meant to be durable records of a point in time.

Resolving this determines the retention policy question too.

Open Question carried over from `docs/roadmap.md`. > Should calculation results be treated as authoritative records, or always as cacheable derivations from home data? Consequential: if results are cacheable derivations, they can be dropped and recomputed freely, and cleanup is trivial. If they are authoritative records, they must survive formula changes, which means historical results cannot be regenerated and must be retained as-is. The current implementation leans ''cacheable'' - results carry a calculation version and input hash and are invalidated when either changes. But report snapshots (Milestone 17) imply some results are meant to be durable records of a point in time. Resolving this determines the retention policy question too.
Author
Contributor

Decision (Ryan, 2026-07-17): calculation results are cacheable derivations, not authoritative records.

Consequences:

  • Results can be dropped and recomputed freely from home data; formula changes simply invalidate the cache. No obligation to keep historical results reproducible under old formulas.
  • The durable point-in-time records are report snapshots (home_report_snapshots, migration 006) — anything that needs to survive formula changes should be captured as a snapshot, not by retaining raw results.
  • Retention (#16) can be a small window: always keep the latest completed result (see #32), cap failed rows, prune everything else freely.
  • #45 (realized-savings ledger) should pin its historical figures to report snapshots or recompute-on-demand, not to retained calculation rows.

Closing as decided.

**Decision (Ryan, 2026-07-17): calculation results are cacheable derivations, not authoritative records.** Consequences: - Results can be dropped and recomputed freely from home data; formula changes simply invalidate the cache. No obligation to keep historical results reproducible under old formulas. - The durable point-in-time records are **report snapshots** (`home_report_snapshots`, migration 006) — anything that needs to survive formula changes should be captured as a snapshot, not by retaining raw results. - Retention (#16) can be a small window: always keep the latest completed result (see #32), cap failed rows, prune everything else freely. - #45 (realized-savings ledger) should pin its historical figures to report snapshots or recompute-on-demand, not to retained calculation rows. Closing as decided.
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#15
No description provided.