← Back to Pull requests

Cash flow: skip an item marked as already happened instead of counting it today #390

Closed
unknown closed this pull request without merging on Nov 22, 2026 19:22 UTC
View on GitHub
unknown unknown commented on Nov 22, 2026 18:46 UTC
Author

What changed

Marking an upcoming item as already happened on the cash position now skips it. The item is counted on no day: not its own date, not the first forecast day, and not on the card it pays.

Before this change, a mark moved the item to the first forecast day.

| Marked item | Before | Now |
|---|---|---|
| Paycheck, bill, planned income or expense | Counted on the first forecast day | Not counted |
| Planned transfer | Each leg counted on the first day (or the leg not yet posted) | Both legs skipped |
| Card payment | Left cash and came off the card on the first day (or the unposted part) | Skipped in cash and on the card |
| "Starts from" line | "…, plus $X you marked as already happened" | The reported balance, nothing added |

Savings and the cards panel are unchanged, as before. A mark changes when cash moves, never what is earned or spent.

Why

A mark means the user's live balance already has the item: a paycheck the balance includes while the bank shows it pending, a bill paid early. Counting it on the first day added it on top of a balance that already had it, so it was counted twice.

Whether a provider's reported balance includes pending transactions varies by bank. Only the user can say it does, so the forecast takes their word for it.

Removed, since skipping makes it unnecessary

  • Posted-transaction matching: the 10% / $1 amount tolerance, the 3-day lookback from the mark's date, one posted row per mark, and partly posted card payments.

  • The date a mark was made on (markedOn) and the time-zone plumbing that computed it. No schema change: the column it came from is createdAt, which stays.

  • The two Ask Linc facts that added marks to cash now: cash_flow_marked_happened_net and cash_flow_cash_now_with_marked. The pack's details now say marked items are already in the balance and counted in no projection, without naming payees.

  • The frontend fields and helper for the "Starts from" note and per-row posted status: counted, inBalance, paidFromElsewhere, happenedStartNote.
  • Reviewer notes

  • A mark skips whatever is projected for that occurrence now, even if its amount changed since. The "Already happened" list shows the amount from when it was marked.

  • A regular item or recurring transfer that posts still ends its own cycle, so its mark names nothing. A planned event or card payment day stays skipped until its date passes.

  • Marks already saved in production switch to skipping when this ships. No migration is needed.

  • docs/CASH_FLOW_FORECAST.md ("Items that already happened") and the cash flow paragraph in CLAUDE.md are rewritten to match.
  • Tests

  • Backend cash-flow unit tests pass (384). The engine tests are rewritten for skipping.

  • CashFlowPageClient tests pass (96).

  • Backend and frontend type checks are clean. The frontend's only errors are stale .next artifacts from another branch's preview page.

  • Lint shows no errors. The warnings in changed backend files are pre-existing patterns.

  • Not checked in a browser.
  • 🤖 Generated with Claude Code

    Diff: 391 lines (+293 / -98) across 4 files Reviewer: ethanteng Review duration: 35m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 391 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.357
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #390"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.1% (MEDIUM) · Higher = larger blast radius
    43.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17% · Safe to merge
    17%