Skip to content

Red flags: auto-clear returned/missed payments made good later - #12

Merged
dfrysinger merged 1 commit into
mainfrom
redflags-auto-clear-made-good
Jul 10, 2026
Merged

dfrysinger merged 1 commit into
mainfrom
redflags-auto-clear-made-good

Conversation

@dfrysinger

Copy link
Copy Markdown
Owner

Summary

Red-flag debt-payment alerts (returned payments, missed months) now auto-clear once the debt is caught back up — a returned payment re-made the same month, or later/extra payments that make an earlier arrears good. Resolved flags are downgraded from red to a new cleared state: they drop out of the red count and banner but stay visible under a Made good section for the audit trail.

How make-goods are reconciled

Reconciliation is on cumulative dollars, not posting counts. Over the audited (past-grace) months a debt owes one expected_amount payment per month; if the net dollars actually received (returns netted out) meet or beat that total, the debt has caught up, so the oldest arrears clear first and only a genuine remaining shortfall (in whole payments, ceil) stays red.

  • Summing dollars means a split payment cannot fake a surplus, and a net-negative (missed) month lowers the total instead of funding its own clearing.
  • Requires a configured payment amount. Without expected_amount_cents, missed months are left flagged rather than risk hiding an unpaid month (conservative). Returned-same-month clearing (month net goes back positive) still applies since it's unambiguous.
  • A catch-up posted in a not-yet-overdue tail month is intentionally not credited until that month is itself past grace — the safe (over-flagging) direction.

Verification

  • Full suite green (777 passed), incl. new regression tests: net-negative month can't fund its own clearing, split payment doesn't create a false make-good, genuine miss with no surplus stays red, and no auto-clear without a configured amount.
  • Live-verified on real data: the 2nd Mortgage's May payment was returned and June carried two payments — both May flags now show cleared, red count 0.

Reviewer notes

Reconciliation logic reviewed by two independent model-family reviewers to zero blocking findings. An early event-count design that could let a missed month fund its own clearing (and let split postings inflate a make-good credit) was replaced by the dollars-based model above.

A returned or missed debt payment is downgraded from a red flag to a
"made good" state when the debt caught back up: a returned payment re-made
the same month (the month nets positive again), or a later/extra payment in
another month. Extra payments beyond the one a month owed form a pool that
clears the oldest outstanding deficits first; payment amount is never
compared, matching the rest of the audit.

Made-good flags carry severity "cleared" and drop out of the red count (so
the warning banner clears) while staying visible under a "Made good" section
for the audit trail.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dfrysinger
dfrysinger merged commit 61f60e6 into main Jul 10, 2026
2 checks passed
@dfrysinger
dfrysinger deleted the redflags-auto-clear-made-good branch July 10, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant