Retention prune can evict the last completed calculation result #32
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#32
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?
runAndStoreCalculationForHomeprunes to the newest 25 rows per home (calculationRunner.js:111-113), and both repository implementations (repository.pg.js:347-360,repository.memory.js:242-249) order purely bycreated_atwith no status distinction. A repeated-failure loop (invalid saved state, recurring input error) writesfailedrows until the lastcompletedresult falls out of the window — at which pointreports/current404s (reportBuilder.js:12-16) and calculation status regresses to missing/failed.Fix: exclude the most recent
completedresult from pruning unconditionally, and cap failed rows separately. Keep the window sizes configurable so issue #16's retention decision can tune them later.Acceptance criteria
Relations: relates to #16
(Audit finding F-11, 2026-07-16 — Severity: Medium, Confidence: Medium)