Skip to content

fix(calculations): align solver with multi-person projections & fix OAS calculations - #36

Merged
halfguru merged 1 commit into
mainfrom
fix/multivariable-savings-solver-and-oas
Aug 21, 2026
Merged

fix(calculations): align solver with multi-person projections & fix OAS calculations#36
halfguru merged 1 commit into
mainfrom
fix/multivariable-savings-solver-and-oas

Conversation

@halfguru

Copy link
Copy Markdown
Owner

This PR fixes two major calculation issues in the retirement engine:

  1. Household OAS Calculation:

    • Previously, SummaryCard calculations did not account for OAS at all, while IncomeBreakdownCard evaluated a single hardcoded OAS max of $9,024 when the household retirement age reached 65+.
    • Moved the OAS calculation into ProjectionContext. It dynamically verifies eligible seniors based on their age at the household retirement point (meaning a dual-income household where both turn 65+ during retirement gets two OAS estimates, which is correct).
    • Aligned all summary metrics and breakdown segments to draw from this single source of truth.
  2. Additional Savings Solver Synchronization:

    • Previously, the solver called the WASM calculate_additional_annual_savings method using simple parameters, which assumed continuous savings and compound growth for all accounts until retirement.
    • For multi-person households where one member retires early (e.g. at 58) and freezes their contributions, the WASM solver simulated a much higher ending balance ($3.1M instead of the actual $1.56M), resulting in incorrect $0/year additional savings recommendations when a gap actually existed.
    • Swapped the solver to use the exact mathematical sinking fund formula based directly on the actual computed projection gap, aligning the recommendations perfectly.

@halfguru
halfguru merged commit 623b09c into main Aug 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant