A small, dependency-free, fully-tested demonstration of the correctness-critical core a mortgage servicing copilot has to get right — built to show the discipline in code, not just describe it.
Three things in mortgage servicing are not "UI bugs." A mistake in any of them is a financial or compliance event:
- Money math that can't silently lose cents. Per-diem interest (Actual/365-Fixed),
payoff/discharge statements, LTV — integer cents, UTC day-count, half-up rounding
applied once per period. →
money.mjs - An immutable, tamper-evident audit trail. Every copilot action is appended to a
hash-chained log; mutating or reordering any past entry is detected by
verify(). →audit.mjs - Role-scoped access to borrower PII, no cross-deal leakage. servicer / broker / admin
roles, field-level redaction (a broker never sees SSN or phone), hard denial across
deals — and every denial is itself audited. →
access.mjs
copilot.mjs ties them together: a payoff action that is access-checked, computed
correctly, and written to the audit trail in a single call.
node --test
4 tests, zero dependencies — money correctness, PII redaction, cross-deal denial, and audit tamper-detection.
This is the same "is the number / the access / the record exactly right?" discipline I used to find and fix silent wrong-results bugs in five production databases this month (see silentdrop). Mortgage servicing is the same problem with regulatory stakes.