feat: investment contribution as a transfer switch is added #6029
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.48) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 559 lines diff across 6 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.379
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #6029"
general
weight: 0.35
imcvampire
Problem
A transfer into an investment or crypto account becomes an investment contribution by default: it counts as spending in budgets and reports. Since #4177, users can switch a single transfer to a plain transfer, for example when a brokerage or crypto account only converts money into another currency. Users whose investment transfers are mostly currency conversions have to flip that switch on every transfer.
The existing Count investing as spending preference doesn't cover this. It's all-or-nothing: it stops every contribution from counting as spending and leaves no way to opt individual transfers back in.
What changes
A new admin-only preference under Settings → Preferences → Budget: Mark new investment transfers as contributions. It is on by default, so nothing changes for existing families.
When it's off, a new confirmed transfer into an investment or crypto account from a non-investment account starts as a plain transfer:
funds_movement, notinvestment_contributionThis is the same state
Transfer#update_investment_contribution!(false)produces when a user flips the switch, so users can still turn individual transfers back into contributions.Behaviour
Transfer::InvestmentKindReconcilerand provider re-syncs throughAccount::ProviderImportAdapterkeep it too.Transfer::Creator(transfer form and trades), and inTransfer#confirm!, which covers manual matches, auto-match confirmations, rules (SetAsTransferOrPayment), the assistant's match and review tools, and Sharesight.Family::DataImporterdoesn't call either path, so imported transfers keep the kinds and choices they were exported with.<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Adds an admin-only preference for marking new investment transfers as contributions, so users who mostly convert currency in brokerage or crypto accounts don't have to flip the switch on every transfer.
funds_movement, no investment contributions category.one_time) are replaced by the default.<sup>Written for commit 1ce63da77d73fa9e6175cfb8aaf51e444ff1e4b3. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/we-promise/sure/pull/6029?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>
<!-- 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
Administrators can choose whether new transfers into brokerage or crypto accounts count as spending. By default, they do; when disabled, these transfers are treated as funds movements.
This preference is available only to administrators and applies to new transfers. Existing transfers retain their current classification and can still be changed individually.
Transfer previews show the applicable classification for investment-account transfers, including when a transfer’s classification has been locked.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->