Pick the accounts that fund the retirement plan #5930
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #5930"
general
weight: 0.35
jaysbeekay
Part of #5567
Fork pre-flight: jaysbeekay/sure#1031 (same branch, same commits)
Stacked on #5755
Problem
A retirement plan can already be funded from accounts the user picks (
RetirementPlan::FundingAccount, #5610): linked accounts replace the default set of cash, investment and crypto accounts. The settings never offered a way to pick them, so the default set was the only one anyone could use. @dgilperez raised this on #5567.Resulting behaviour
The settings modal gets a "Fund the plan from" list: every cash, investment and crypto account the user counts in their finances (
RetirementPlan#eligible_funding_accounts), with the linked ones ticked. With none ticked, the plan uses all of them, as it does today.No model change: this uses the funding model #5610 already has.
Size: 46 non-test lines (controller 30, form 14, locale 2).
Validation
bin/rails testat this head7110d042f: 18749 runs, 1 failure, 8 errors. The failure isAccountsControllerTest"credit card overview shows the credit label when a credit outlives the due date", which depends on today's date and fails the same way at #5610's old head158640ad4; the 8 errors areReleaseNotesWorkflowTest, which needsnode, missing from the test image.test/controllers/retirement_plans/funding_accounts_test.rb(listing with ticks, linking, replacing, none ticked, a list not sent, ineligible ids, a refused save, a refused save keeping the ticks) and a system test that ticks an account, saves, then unticks it and saves.bin/rubocopanderb_lint: clean.Blast radius
RetirementPlansController#updateand the settings form.#save_settingsgains one step inside its existing transaction. The funding total, projection, simulation and Monte Carlo already read the links.Migration notes
No migration.
Screenshots
The bottom of the settings modal. Before:
| | Desktop | Phone |
| --- | --- | --- |
| Light |  |  |
| Dark |  |  |
After, with one account ticked:
| | Desktop | Phone |
| --- | --- | --- |
| Light |  |  |
| Dark |  |  |
<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Adds a way to pick which accounts fund a retirement plan. The settings modal now lists every eligible cash, investment, and crypto account with the linked ones ticked; ticking none uses all of them as before.
<sup>Written for commit 160439a69c5bc71f0cf1ddcd3a62232b14b0abb8. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/we-promise/sure/pull/5930?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/we-promise/sure/5930?returnTo=https%3A%2F%2Fgithub.com%2Fwe-promise%2Fsure%2Fpull%2F5930&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Retirement-plan settings now let you choose which eligible accounts fund the plan. Clearing the selection restores the default set of cash, investment, and crypto accounts.
Your selected accounts remain checked when settings are redisplayed, including after a save is refused.
Bug Fixes
* Account selections are saved only for eligible accounts, and existing selections are preserved when the account list isn’t submitted.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->