Let the planner's spending and income streams be edited
Upstream PR: we-promise/sure#5754 (same commits)
Part of jaysbeekay/sure#127
Stacked on up/retirement-plan-ui-card.
Upstream pre-flight for the planner's spending and income streams, one of five UI slices on the retirement planner model stack (jaysbeekay/sure#364, jaysbeekay/sure#365, jaysbeekay/sure#369, jaysbeekay/sure#370). The full description, validation and screenshots are on the upstream PR.
Review round, 2026-11-26 (head 1a5df189d)
- A seeded stream changed to another type becomes manual (Codex P2).
StreamsController#updatesetssource = "manual"whenkindchanges. Before, a seeded living-costs or loan stream turned into income kept its seeded source, so the simulation ignored it before retirement: a 12,000 pension starting next year added 0.0 to that year's paid-in figure. Now it adds 12,000 or more. An edit that keeps the type leaves a seeded stream seeded. - The planner says the FI number and the streams are separate (Gatekeeper review 7186365685, F1). The FI number is built from the last 12 months' spending, while the streams drive the year-by-year path, so editing the living-costs stream moves the path but not the FI number. A line above the streams table now says so, and the
simulation_inputscomment no longer calls the stream the FI figure. The model is unchanged.
Tests (test/controllers/retirement_plans/streams_controller_test.rb), red on adb3fe841 and green on 1a5df189d:
- "a seeded stream whose type is changed becomes manual, and counts before retirement": the source was
seeded_living_costsinstead ofmanual, and the paid-in delta wasExpected 0.0 to be >= 12000. - "an edit that keeps the type leaves a seeded stream seeded": the guard against flipping the source on every edit.
- "the planner explains the FI number is from recent spending, not the streams": the copy was missing (
Translation missing).
Mutations, each caught: dropping the source line; dropping it with the source assertion removed (the simulation delta alone goes red); making the flip unconditional; removing the copy.
Verification: rubocop and erb_lint clean. Full unit suite on 1a5df189d: 18,705 runs, 0 failures, 8 errors (ReleaseNotesWorkflowTest, needs node, missing from the test image), 9 skips. Full unit suite on the stack top (7893d6fbc): 18,725 runs, 0 failures, 8 errors (the same ReleaseNotesWorkflowTest ones), 9 skips.
| Light | Dark | |
|---|---|---|
| Before | ![]() | ![]() |
| After | ![]() | ![]() |



