Lender-facing reporting, moved and proven row by row
The situation
A finance team sends a collateral report to its lender. The report applies the credit facility's eligibility rules and checks borrowing against the facility's limits. The same code builds the team's daily management, risk and month-end reports. If the collateral report is wrong, the lender is looking at the wrong collateral.
The whole pack ran as a scheduled task on a legacy server, and finance had little visibility into what had run and when. It needed a platform finance could see into, and no number could change on the way there.
I worked with the company's CFO on where it should go, and with the finance team day to day.
What I did
I moved the existing report code onto a new server of its own instead of rewriting the report logic. That left one question: did the numbers survive the move?
What I built:
- A database-backed job queue, with a worker that builds each report date in its own process. That cut peak memory on multi-date runs by about a quarter, and the output stayed byte-identical.
- A web app behind single sign-on. Finance can queue and cancel runs, download reports, and upload source data through an admin panel with an audit log.
- Automatic publishing to shared document storage, with a copy kept in the database and a run summary emailed to finance.
How I proved it:
- I compared the collateral report on the new platform with the old system's output, row by row. I traced the differences to three root causes. Once those were fixed, the report matched the old output 100%, within five days of starting.
- Under two weeks in, every report in the pack matched the old system on every deterministic value.
- That check came from a comparison tool I built. It joins two sets of report workbooks on their keys and lists each row that differs. I use the same tool to check later changes.
Switching over. Both systems ran side by side for months before production moved. The first production run published the full pack. The old server has since been retired.
Safeguards built in:
- Nine health checks run every five minutes. They alert finance and me only when something changes state.
- A freshness check names the stale date when an upstream feed stops updating. A second, independent source for that feed is reconciled against the first.
- The report writer flags any data that outgrows a template's formula ranges.
- Each uploaded file is processed, logged and reported on its own line.
- Backups run nightly, encrypted and off-site, and there is a written disaster-recovery runbook.
The profitability tool. The finance team had also built the first version of a monthly profitability tool. Together we reorganized it into eight modules. I added 40 unit tests, moved it onto the reporting database, and made it a tab in the web app finance already uses.
How AI helped
The report logic came over from the existing system; I didn't rewrite it for this project. From about eight weeks in, I built with frontier AI coding tools, including the first drafts of the handover documents.
I work under written rules for those tools:
- A change that would move a lender-facing number goes in only after a written ruling from finance and a before-and-after comparison on a throwaway copy of the database. Where it fits, the change ships behind a switch whose off position reproduces the old output.
- Scratch builds run only against a throwaway database, and the script refuses to start unless it's pointed at one.
- A failing test suite blocks a deploy. There is a documented emergency override.
Results
- Within five days of starting the move, the collateral report on the new platform matched the old system's output 100%.
- Under two weeks in, every report in the pack matched the old system on every deterministic value, checked row by row with a key-joined comparison tool.
- Both systems ran side by side for months. The first production run published the full pack, and the old server has since been retired.
- Peak memory on multi-date runs is down about a quarter, and the output is byte-identical.
What the team kept
An 18-document handover set. It is regenerated and published to shared document storage whenever it changes. It includes:
- a developer guide
- a configuration reference
- a data dictionary
- a report catalog
- runbooks
- emergency and disaster-recovery guides
- a security model
- a web-app guide
- a decision log of 26 records, each ending with a guardrail a future maintainer should not undo
- an ownership register
- a handover checklist
What finance can do on its own:
- upload source data through a logged admin panel
- change 16 business settings without a code change
- re-run and download reports from the web app
The profitability tool the team started is now a tested tab in that app. The handover set is written so the company's team can run and change the system without me.