Let the user mark an upcoming cash flow item as already happened #387
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 478 lines diff across 5 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.369
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #387"
general
weight: 0.35
ethanteng
Why
A paycheck that is pending at the bank kept showing under "Coming up in the next month" on its expected date. The cash position starts from Plaid's reported
currentbalance, which leaves pending transactions out for checking and savings, and the ledger skips pending transactions too. So a pending item was in neither the balance nor the history, and the forecast still expected it.What changed
- moves to the first forecast day, in cash and, for a card payment, off the card. From its own date on nothing changes, so it is counted once;
- is listed above the rest under Already happened, with Undo;
- shows in the start line: "Starts from $2,402 in Personal Checking, plus $3,031 you marked as already happened."
- A regular item or recurring transfer that posts ends its own cycle, so its mark names nothing.
- Otherwise the item counts as posted when its account has a posted transaction moving about the same amount the same way (within 10%, or $1), dated from three days before the mark onward. A regular item or transfer must also come from the same payee.
- A card payment checks the card and the cash account separately, and a planned transfer checks each leg.
How items are named
A mark names what produces the item and the day it was expected: a stream id and its cycle's due date, a card's account id and payment day, or a planned event's id and occurrence date. Each upcoming item now carries this as
ref. To support it:scheduleStreamnow returns each occurrence'sdueDate, so a late paycheck the forecast expects on its first day keeps its mark.For reviewers
cash_flow_happened_marks, in20261118120000_add_cash_flow_happened_marks. It matches whatprisma migrate diffgenerates from the schema, and it must be applied to production before this ships.POST /api/cash-flow/happenedtakes{source, sourceId, date}and returns 201 when saved, 200 when already marked, 404 when the item isn't listed, and 409 at the cap.DELETE /api/cash-flow/happened/:idundoes a mark. The server labels each mark from the user's own data (happenedTarget).docs/CASH_FLOW_FORECAST.md, and a line in CLAUDE.md.Testing
cash-flow-happened.test.ts), 7 route tests, 1 Ask Linc fact test and 4 page tests.localhost:5433, and fail the same onmain.🤖 Generated with Claude Code