fix!(portfolio-contract): SimpleRebalance rejects offers that give or want funds #12960
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.36) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 183 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.312
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #12960"
general
weight: 0.35
gibson042
refs: AGO-1678
Description
The
SimpleRebalancecontinuing invitation uses the same proposal shape as the legacyRebalanceinvitation, which acceptsgive: { Deposit }orwant: { Cash }. But its handler always starts arebalanceflow with no amount, so the planner plans a rebalance:#12955 made the legacy
Rebalancehandler reject these proposals. That handler forwards tosimpleRebalanceHandler, so this PR moves the check there. Both invitations now reject an offer that gives or wants funds, and the error points toDeposit/Withdraw. The check stays in the handler rather than the proposal shape because invitations made before an upgrade keep their old shape.Security Considerations
None.
Scaling Considerations
None.
Documentation Considerations
A
SimpleRebalanceoffer that gives or wants funds is now rejected instead of ignoring them. ymax-web always sendsSimpleRebalancewith emptygiveandwant, so it isn't affected.Testing Considerations
The contract test that
Rebalancerejects funded offers now coversSimpleRebalancetoo. An exo unit test that calledsimpleRebalanceHandlerwith a bare{}seat now uses a stub seat with an empty proposal.Upgrade Considerations
Ships with the next ymax contract upgrade.
🤖 Generated with Claude Code